Data processing system, data writing method and data query method and device

By constructing a data structure combining multi-level arrays and linked lists in the memory area and using atomic instructions for data writing and reading, the problem of memory and performance imbalance in existing technologies is solved, and high-performance data processing is achieved.

CN121412971APending Publication Date: 2026-01-27ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511262029.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2026-01-27

AI Technical Summary

Technical Problem

In scenarios involving single/multi-threaded writes and high-concurrency reads on massive IP-application mapping relationships, existing technologies cannot achieve a good balance between memory and performance, resulting in insufficient data write and read performance on the client side.

Method used

A data structure combining multi-level arrays and linked lists is used. Multi-level arrays are constructed in the memory area, and data is written and read through atomic instructions. The linked list node data includes check codes to achieve lock-free insertion and reading, ensuring data integrity and consistency.

Benefits of technology

It effectively balances memory usage and data read/write performance, improves network request processing performance, avoids memory waste and data incompleteness, and achieves high-performance insertion and high-concurrency fast query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121412971A_ABST
    Figure CN121412971A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing system and a related method, device and equipment. On one hand, the data processing system performs cross-process reading and writing through a shared memory, only one copy of data is needed globally, and the memory is greatly saved; on the other hand, the multi-stage group cache and the last-stage array cache are linked lists, so that the storage conflict of massive IP addresses is solved, and the situation that more memories are consumed due to the fact that all the IP addresses are the array caches is avoided; and on the other hand, the data of the linked list node comprises the check code, and the linked list node is read and written through the atomic instruction, so that lock-free insertion and reading are realized in the linked list, the corresponding relationship between the application identifier and the IP address can be read at one time, incomplete data is prevented from being read, the completeness and consistency of reading and writing the data at the same time are ensured, and the user experience is improved. Concurrent reading and writing are not blocked, and high-performance insertion and high-concurrency rapid query are achieved; therefore, the memory occupation of the data and the read-write performance of the data can be effectively and excellently balanced, so that the network request processing performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to data processing systems, data writing methods and apparatus, data querying methods and apparatus, and electronic devices. Background Technology

[0002] A typical network request handling method involves application A, as the network request recipient, determining whether application B, as the network request sender, has permission to access application A based on the IP address of application B. To implement this method, it's necessary not only to configure access permissions between applications but also to store the mapping between applications and their IP addresses. In practice, applications often work in clusters, meaning one application may correspond to multiple IP addresses; therefore, what's actually stored is the mapping between one application and multiple IP addresses.

[0003] One application scenario for the aforementioned network request processing is as follows: the network request processing system includes a server and a client. The server can detect changes in the mapping relationship between applications and IP addresses. The client retrieves the mapping data from the server and stores it locally. The client runs multiple applications simultaneously. When application A receives a network request from another application, it determines the application B corresponding to the source IP address of the network request by querying the mapping relationship between applications and IP addresses. Based on application access permissions, it determines whether application B has the right to access application A. In other words, the server sends the mapping relationship between applications and IP addresses to the client, the client stores this mapping relationship, and multiple applications running on the client concurrently read this mapping relationship to implement network access restrictions between applications based on this mapping relationship.

[0004] In scenarios involving single / multi-threaded writes and high-concurrency reads of massive IP-application mapping relationships, how to improve the performance of writing the mapping relationship between applications and IP addresses to the client's local storage, and how to improve the performance of a large number of applications running simultaneously on the client's local storage to read the mapping relationship at high concurrency, achieving a good balance between memory and performance, has become a hot research topic for those skilled in the art. Summary of the Invention

[0005] This application provides a data processing system to address the problem in existing technologies that fail to achieve a good balance between memory and performance. This application also provides a data writing method and apparatus, a data querying method and apparatus, and an electronic device.

[0006] This application provides a data processing system, including:

[0007] At least one data writing device and at least one application server;

[0008] The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the target application identifier and the target IP address; and perform the following processing level by level from the first level array downwards: taking the modulus between the target IP address and the length of the current level array to obtain a first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current level array, then the lower level array is used as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained; a first check code is generated according to the target IP address, the target application identifier, and the linked list node pointer; and the linked list node pointer, the target IP address, the target application identifier, and the first check code are written as linked list node data into the first target linked list through atomic instructions.

[0009] The application server is used to receive network requests and obtain the source IP address from the network request. It then performs the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the source IP address is read from the second target linked list using atomic instructions; a second checksum is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second checksum is the same as the first checksum in the linked list node data, then the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.

[0010] Optionally, the data writing device is further configured to write the correspondence into the current array element if the current array is not the last array and the current array element corresponding to the first modulus is an unoccupied element;

[0011] The application server is further configured to obtain the application identifier corresponding to the source IP address from the current array element if the current array is not the last array and the source IP address is the same as the IP address in the current array element.

[0012] Optionally, the multi-level array includes a three-level array.

[0013] Optionally, the lengths of different levels of arrays can be different prime numbers.

[0014] Optionally, the data writing device is further configured to select a fixed-length memory block from the memory pool as a linked list node.

[0015] Optionally, the data writing device is also used to compress the IP address.

[0016] Optionally, a data providing device is used to provide the data writing device with a set of correspondences between application identifiers and IP addresses, and to provide the data writing device with updated data of the correspondences;

[0017] The data writing device is also used to update the memory area data according to the updated data.

[0018] Optionally, the updated data includes newly added correspondences;

[0019] The data writing device is also used to write the newly added correspondence into the memory area.

[0020] Optionally, the updated data includes deleting the corresponding relationship;

[0021] The data writing device is also used to delete the deletion correspondence from the memory area.

[0022] Optionally, the updated data includes the correspondence before modification and the correspondence after modification;

[0023] The data writing device is also used to delete the original correspondence from the memory area and write the modified correspondence into the memory area.

[0024] Optionally, the data providing device is further configured to merge the updated data into the corresponding relationship set and provide the merged corresponding relationship set to the new data writing device.

[0025] Optionally, the data providing device is further configured to generate a third verification code based on the corresponding relationship set; generate a fourth verification code based on the updated data; and provide the third verification code and the fourth verification code to the data writing device.

[0026] The data writing device is further configured to verify whether the received correspondence set is accurate based on the third verification code; and to verify whether the received updated data is accurate based on the fourth verification code.

[0027] Optionally, the data writing device and the application server are deployed in the same operating environment.

[0028] This application provides a data processing system, including:

[0029] At least one data writing device and at least one data querying device;

[0030] The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the first data and the second data; and perform the following processing level by level from the first level array downwards: taking the modulus between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained; a first check code is generated according to the first data, the second data, and the linked list node pointer; and the linked list node pointer, the first data, the second data, and the first check code are written as linked list node data into the first target linked list through atomic instructions.

[0031] The data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the target first data is read from the second target linked list through atomic instructions; a second check code is generated based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data is taken as the target second data.

[0032] Optionally, the data writing device is further configured to write the correspondence into the current array element if the current array is not the last array and the current array element corresponding to the first modulus is an unoccupied element;

[0033] The data query device is further configured to, if the current level array is not the last level array and the target first data is the same as the first data in the current level array element, then obtain the second data corresponding to the target first data from the current level array element.

[0034] This application provides a data processing system, including:

[0035] At least one data writing device and at least one data querying device;

[0036] The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the first data and the second data; and perform the following processing level by level from the first level array downwards: take the modulo between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained, and the linked list node pointer and the correspondence are written as linked list node data into the first target linked list;

[0037] The data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained, and the second data corresponding to the target first data is read from the second target linked list.

[0038] This application provides a data writing method, including:

[0039] Construct multi-level arrays in the memory area;

[0040] Obtain the mapping between the target application identifier and the target IP address;

[0041] The following processing is performed level by level from the first-level array downwards: the target IP address is moduloed by the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then the lower-level array is taken as the current-level array, and the above correspondence writing process is performed;

[0042] If the current-level array is the last-level array, then obtain the first target linked list pointed to by the linked list pointer in the current-level array element corresponding to the first modulus; generate the first checksum based on the target IP address, target application identifier, and linked list node pointer; and write the linked list node pointer, target IP address, target application identifier, and first checksum as linked list node data into the first target linked list through atomic instructions.

[0043] This application provides a data writing method, including:

[0044] Construct multi-level arrays in the memory area;

[0045] Obtain the correspondence between the first data and the second data;

[0046] Starting from the first-level array, perform the following processing level by level: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the lower-level array as the current-level array and perform the above correspondence writing process.

[0047] If the current-level array is the last-level array, then obtain the first target linked list pointed to by the linked list pointer in the current-level array element corresponding to the first modulus; generate the first check code based on the first data, the second data, and the linked list node pointer; and write the linked list node pointer, the first data, the second data, and the first check code as linked list node data into the first target linked list through atomic instructions.

[0048] This application provides a data writing method, including:

[0049] Construct multi-level arrays in the memory area;

[0050] Obtain the correspondence between the first data and the second data;

[0051] Starting from the first-level array, perform the following processing level by level: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the lower-level array as the current-level array and perform the above correspondence writing process.

[0052] If the current level array is the last level array, then obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus, and write the linked list node pointer and the corresponding relationship as linked list node data into the first target linked list.

[0053] This application provides a data query method, including:

[0054] Receive a network request and obtain the source IP address from the network request;

[0055] Starting from the first-level array, perform the following processing level by level: take the modulo between the source IP address and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0056] If the current-level array is the last-level array, then obtain the second target linked list pointed to by the linked list pointer within the current-level array element; read the linked list node data corresponding to the source IP address from the second target linked list using atomic instructions; generate a second checksum based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second checksum is the same as the first checksum in the linked list node data, then obtain the processing method for the network request based on the application access permissions and the application identifier corresponding to the source IP address.

[0057] This application provides a data query method, including:

[0058] Obtain the target's first data;

[0059] Starting from the first-level array in the memory area, perform the following processing level by level: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0060] If the current-level array is the last-level array, then obtain the second target linked list pointed to by the linked list pointer within the current-level array element; read the linked list node data corresponding to the target first data from the second target linked list using atomic instructions; generate a second check code based on the target first data, second data, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then use the second data corresponding to the target first data as the target second data.

[0061] This application provides a data query method, including:

[0062] Obtain the target's first data;

[0063] Starting from the first-level array in the memory area, perform the following processing level by level: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0064] If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element, and read the second data corresponding to the target first data from the second target linked list.

[0065] This application provides a data writing device, comprising:

[0066] Memory building blocks are used to construct multi-level arrays in memory areas.

[0067] The data acquisition unit is used to acquire the correspondence between the target application identifier and the target IP address;

[0068] The array processing unit is used to perform the following processing level by level from the first level array downwards: take the modulo between the target IP address and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed;

[0069] The linked list processing unit is configured to, if the current-level array is the last-level array, obtain the first target linked list pointed to by the linked list pointer in the current-level array element corresponding to the first modulus; generate a first checksum based on the target IP address, the target application identifier, and the linked list node pointer; and write the linked list node pointer, the target IP address, the target application identifier, and the first checksum as linked list node data into the first target linked list through atomic instructions.

[0070] This application provides a data writing device, comprising:

[0071] Memory building blocks are used to construct multi-level arrays in memory areas.

[0072] The data acquisition unit is used to acquire the correspondence between the first data and the second data;

[0073] The array processing unit is used to perform the following processing level by level from the first level array downwards: take the first data modulo the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed;

[0074] The linked list processing unit is configured to, if the current-level array is the last-level array, obtain the first target linked list pointed to by the linked list pointer in the current-level array element corresponding to the first modulus; generate a first check code based on the first data, the second data, and the linked list node pointer; and write the linked list node pointer, the first data, the second data, and the first check code as linked list node data into the first target linked list through atomic instructions.

[0075] This application provides a data writing device, comprising:

[0076] Memory building blocks are used to construct multi-level arrays in memory areas.

[0077] The data acquisition unit is used to acquire the correspondence between the first data and the second data;

[0078] The array processing unit is used to perform the following processing level by level from the first level array downwards: take the first data modulo the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed;

[0079] The linked list processing unit is configured to, if the current level array is the last level array, obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus, and write the linked list node pointer and the corresponding relationship as linked list node data into the first target linked list.

[0080] This application provides a data query device, including:

[0081] A data acquisition unit is used to receive network requests and obtain the source IP address from the network requests;

[0082] The array processing unit is used to perform the following processing level by level from the first level array downwards: take the modulo between the source IP address and the length of the current level array to obtain the second modulus; obtain the current level array element corresponding to the second modulus; if the current level array is not the last level array and the source IP address is different from the IP address in the current level array element, then take the lower level array element as the current level array and perform the above correspondence query processing.

[0083] The linked list processing unit is configured to: if the current-level array is the last-level array, obtain the second target linked list pointed to by the linked list pointer within the current-level array element; read the linked list node data corresponding to the source IP address from the second target linked list using atomic instructions; generate a second checksum based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second checksum is the same as the first checksum in the linked list node data, use the application identifier corresponding to the source IP address as the target application identifier;

[0084] The request processing method acquisition unit is used to acquire the processing method for the network request based on the application access permissions and the target application identifier.

[0085] This application provides a data query device, including:

[0086] The data acquisition unit is used to acquire the target's first data;

[0087] The array processing unit is used to perform the following processing level by level from the first-level array in the memory area: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0088] The linked list processing unit is configured to: if the current-level array is the last-level array, obtain the second target linked list pointed to by the linked list pointer within the current-level array element; read the linked list node data corresponding to the target first data from the second target linked list through atomic instructions; generate a second check code based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then use the second data corresponding to the target first data as the target second data.

[0089] This application provides a data query device, including:

[0090] The data acquisition unit is used to acquire the target's first data;

[0091] The array processing unit is used to perform the following processing level by level from the first-level array in the memory area: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0092] This application provides an electronic device, including:

[0093] Processor; and

[0094] A memory for storing a program for implementing the method described in any of the preceding methods, wherein the device is powered on and the program of the method is executed by the processor.

[0095] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the various methods described above.

[0096] This application also provides a computer program product including instructions that, when run on a computer, cause the computer to perform the various methods described above.

[0097] Compared with the prior art, this application has the following advantages:

[0098] The data processing system provided in this application includes at least one data writing device and at least one application server. The data writing device is used to construct a multi-level array in memory; obtain the correspondence between a target application identifier and a target IP address; and perform the following processing level by level from the first-level array downwards: taking the modulo between the target IP address and the length of the current-level array to obtain a first modulus; if the current-level array is not the last level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus is obtained; a first checksum is generated based on the target IP address, the target application identifier, and the linked list node pointer; and the linked list node pointer, the target IP address, the target application identifier, and the first checksum are written as linked list node data into the first target linked list using atomic instructions. Correspondingly, the application server is used to receive network requests and obtain the source IP address from the network request; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the source IP address is read from the second target linked list through atomic instructions; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.This approach achieves several advantages. First, it uses shared memory for cross-process read / write, requiring only one copy of the data globally, significantly saving memory. Second, it resolves storage conflicts for massive IP addresses by using multi-level array caching and a linked list for the last level, avoiding excessive memory consumption from array caching. Third, by including the first checksum in the linked list node data and using atomic instructions to read and write linked list nodes, it enables lock-free insertion and reading within the linked list. This ensures that the mapping between application identifiers and IP addresses read multiple times (e.g., two or three times) is complete, while reading the mapping in one go prevents incomplete data from being read while data is being written, guaranteeing the integrity and consistency of simultaneous read and write operations. It does not block concurrent read and write operations, achieving high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance, thereby improving network request processing performance.

[0099] The data processing system provided in this application includes at least one data writing device and at least one data querying device. The data writing device is used to construct a multi-level array in a memory area; obtain the correspondence between first data and second data; and perform the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data within the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last-level array, then the first target linked list pointed to by the linked list pointer within the element of the current-level array corresponding to the first modulus is obtained; a first checksum is generated based on the first data, the second data, and the linked list node pointer; and the linked list node pointer, the first data, the second data, and the first checksum are written as linked list node data into the first target linked list using atomic instructions. Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulus between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the target first data is read from the second target linked list through atomic instructions; a second check code is generated based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data is taken as the target second data. This approach achieves several advantages. First, it enables cross-process read / write operations via shared memory, requiring only one copy of the data globally, thus significantly saving memory. Second, it resolves data storage conflicts for massive amounts of data by using multi-level array caching and a linked list for the last level, avoiding excessive memory consumption from array caching alone. Third, by including the first checksum in the linked list node data and using atomic instructions to read and write linked list nodes, it enables lock-free insertion and reading within the linked list. This allows for a one-time retrieval of the correspondence between the first and second data, preventing the reading of incomplete data and ensuring the integrity and consistency of simultaneous read and write operations. It does not block concurrent read and write operations, achieving high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance.

[0100] The data processing system provided in this application includes at least one data writing device and at least one data querying device. The data writing device is used to construct a multi-level array in a memory area; obtain the correspondence between first data and second data; and perform the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data within the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last-level array, then the first target linked list pointed to by the linked list pointer within the element of the current-level array corresponding to the first modulus is obtained, and the linked list node pointer and the correspondence are written as linked list node data into the first target linked list. Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained, and the second data corresponding to the target first data is read from the second target linked list. This approach achieves several advantages. First, it enables cross-process read / write operations via shared memory, requiring only one copy of the data globally, thus significantly saving memory. Second, it resolves data storage conflicts for massive amounts of data by using multi-level array caching and a linked list for the last level array cache, avoiding excessive memory consumption from array caching alone. Third, it enables lock-free insertion and retrieval of linked list nodes through atomic instructions, allowing for simultaneous reading of the correspondence between the first and second data items, preventing incomplete data reads, ensuring the integrity and consistency of concurrent read / write operations, and avoiding blocking concurrent read / write operations. This results in high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance. Attached Figure Description

[0101] Figure 1 This application provides a schematic diagram of the structure of an embodiment of the data processing system;

[0102] Figure 2 This application provides a schematic diagram of a three-level cache for an embodiment of the data processing system.

[0103] Figure 3 This application provides a schematic diagram of a hot update method for an embodiment of the data processing system. Detailed Implementation

[0104] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0105] This application provides a data processing system, a data writing method and apparatus, a data query method and apparatus, a network request processing system, and an electronic device. The various solutions are described in detail below in each embodiment.

[0106] First Embodiment

[0107] Please refer to Figure 1 This is a schematic diagram of the data processing system of this application. In this embodiment, the system may include at least one data writing device and at least one application server. The data writing device and the application server may be deployed in the same operating environment or different operating environments. The operating environment may be a virtual operating environment (such as a virtual machine or container) or a physical host (such as a server). The data writing device is used to write the correspondence between application identifiers and IP addresses into the memory area, and the application server is used to query the application identifier corresponding to the IP address from the memory area.

[0108] In this embodiment, the data writing device is specifically used to construct a multi-level array in the memory area; obtain the correspondence between the target application identifier and the target IP address; and perform the following processing level by level from the first level array downwards: take the modulo between the target IP address and the length of the current level array to obtain a first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current level array, then the lower level array is used as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained; a first check code is generated according to the target IP address, the target application identifier, and the linked list node pointer; and the linked list node pointer, the target IP address, the target application identifier, and the first check code are written as linked list node data into the first target linked list through atomic instructions.

[0109] Accordingly, the application server is specifically used to receive network requests and obtain the source IP address from the network request; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the source IP address is read from the second target linked list through atomic instructions; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.

[0110] The data writing device constructs multi-level arrays in the memory area, such as two-level, three-level, or more-level arrays, such as... Figure 1 The cache array consists of 1 to N levels, where N can be an integer greater than or equal to 2. In the multi-level array, the elements of the first to N-1 levels represent the mapping between application identifiers and IP addresses, and the elements of the Nth (last) level array are linked lists.

[0111] An array is a collection of elements of the same data type stored in a contiguous block of memory. Arrays allocate a fixed amount of memory, with each block being the same size. Arrays offer the advantage of random access, using indices to access array elements.

[0112] A linked list is a non-contiguous, non-sequential storage structure in terms of physical storage units. The logical order of data elements is achieved through the linking order of pointers within the linked list. A linked list consists of a series of nodes (each element in the linked list is called a node), and nodes can be dynamically generated at runtime. Linked lists allow insertion and removal of nodes at any position in the list. The characteristic of the linked storage representation of a linear list is that it uses a set of arbitrary storage units to store the data elements of the linear list.

[0113] The data writing device generates a first checksum based on the target IP address, target application identifier, and linked list node pointer. Using atomic instructions (such as `__sync_val_compare_and_swap`, `__sync_lock_test_and_set`, etc.), it writes the linked list node pointer, target IP address, target application identifier, and first checksum as linked list node data in multiple steps to the first target linked list. Each atomic instruction writes 8 bytes into a linked list node; when the linked list node is 16 bytes, the data is written in two steps; when the linked list node is 24 bytes, the data is written in three steps. Correspondingly, the application server uses atomic instructions (such as the atomic load instruction `__atomic_load_n`, etc.) to read the linked list node data corresponding to the source IP address from the second target linked list in multiple steps. Each atomic instruction reads 8 bytes from a linked list node; when the linked list node is 16 bytes, the data is read in two steps; when the linked list node is 24 bytes, the data is read in three steps. After reading the linked list node data, the application server generates a second checksum based on the source IP address, application identifier, and linked list node pointer included in the linked list node data. If the second checksum is the same as the first checksum in the linked list node data, then the application identifier in the linked list node data corresponds to the application identifier of the source IP address. An atomic operation is an indivisible operation in a multi-threaded environment that cannot be interrupted during execution. An atomic read operation means that the reading process is not interfered with by other threads and does not require locking. Using this approach, by including the first checksum in the linked list node data and using atomic instructions to read and write the linked list node data, lock-free insertion and reading are achieved in the linked list. This ensures that the correspondence between the application identifier and IP address read multiple times (e.g., two, three times, etc.) is complete data, while reading the correspondence between the application identifier and IP address in one go prevents incomplete data from being read when data is only partially written, ensuring the integrity and consistency of simultaneous data reading and writing, and avoiding blocking concurrent read and write operations. This achieves high-performance insertion and high-concurrency fast querying.

[0114] Application access permissions refer to the access permissions between applications. For example, which applications are allowed to access application A, or which applications are allowed to access service 1 provided by application A, which applications are allowed to access service 2 provided by application A, and so on. When application A, as the recipient of a network request, receives a network request from application B, as the sender of the network request, it determines application B's access permissions for application A based on the source IP address carried in the network request. If application B has permission to access application A, application A responds to the network request from application B; if application B does not have permission to access application A, application A refuses to process the network request from application B.

[0115] In one example, the data writing device is also used to select fixed-size memory blocks from the memory pool as linked list nodes. This approach allows for the pre-allocation of a memory pool with a fixed node size (e.g., 16 bytes) for linked list node allocation via shared memory. Linked list nodes obtain fixed-size memory blocks from the pre-allocated memory pool and are then linked together in the list. This multi-level cache-based shared memory pool effectively reduces memory consumption and eliminates the need for dynamic memory allocation using malloc, avoiding memory fragmentation caused by variable-size memory requests.

[0116] In one example, the lengths of different levels of arrays can be different prime numbers. This approach allows for better dispersion of IP data through multi-level caching and prime number lengths, while significantly improving query speed.

[0117] An IP (Internet Protocol) address is a computer communication identification address. An IPv4 address consists of 32 bits, with a maximum of approximately 4.3 billion (2^32) possible addresses; an IPv4 address consists of 128 bits, with a maximum of approximately 3.4 * 10^38 (2^128) possible addresses. Therefore, a massive number of IP addresses will occupy a significant amount of memory.

[0118] In one example, the data writing device is also used to compress the IP address and write the compressed IP address into the memory area. For example, array elements use 8 bytes (4 bytes for the IPv4 address + 4 bytes for the application identifier), and linked list nodes use 16 bytes (4 bytes for the IPv4 address + 4 bytes for the application identifier + 4 bytes for the node pointer + 4 bytes for the first checksum). This processing method uses shared memory and compresses the IP address data structure, thus effectively saving memory. Figure 2 As shown, taking a 16-byte memory block as an example, the memory overhead of the same data in a linked list node is reduced from 48 bytes (Malloc itself requires 32 bytes + 16 bytes for the node) to 16 bytes.

[0119] In one example, the data writing device specifically uses the XOR value of the application identifier, the IP address, and the node pointer as the first checksum. This approach effectively improves the efficiency of generating the first checksum. In practice, other checksum generation methods can also be used to generate the first checksum based on the application identifier, the IP address, and the node pointer.

[0120] In one example, the data writing device is further configured to write the correspondence into the current-level array element if the current-level array is not the last-level array and the current-level array element corresponding to the first modulus is an unoccupied element. Correspondingly, the application server can also be configured to obtain the application identifier corresponding to the source IP address from the current-level array element if the current-level array is not the last-level array and the source IP address is the same as the IP address within the current-level array element.

[0121] In one example, the data writing device is further configured to modify the application identifier in the current level array element to the target application identifier if the current level array is not the last level array, the current level array element corresponding to the first modulus is an occupied element, and the target IP address is the same as the IP address in the current level array element.

[0122] like Figure 2 As shown, the multi-level array consists of three levels of data. The data writing device constructs a three-level cache structure, with each level using an array structure. The first and second level cache arrays store corresponding relationships, while the third level cache array stores linked list pointers, with each linked list storing corresponding relationships. The length of the first level cache array is a first prime number, the length of the second level cache array is a second prime number, and the length of the third level cache array is a third prime number. Correspondingly, the data writing device inserts the mapping data between the target application identifier and the target IP address into the local shared memory in the following manner: The target IP address is moduloed by the length of the first-level array to obtain a first modulus; if the first-level array element corresponding to the first modulus is an occupied element and the target IP address is different from the IP address in the first-level array element, the target IP address is moduloed by the length of the second-level array to obtain a second modulus; if the second-level array element corresponding to the second modulus is an occupied element and the target IP address is different from the IP address in the second-level array element, the first target IP address is moduloed by the length of the third-level array to obtain a third modulus; the first target linked list pointed to by the linked list pointer in the third-level array element corresponding to the third modulus is obtained, and the mapping relationship between the target IP address and the application identifier is inserted into the first target linked list. This approach enables the shared memory to employ a three-level cache structure. The process involves taking the modulo between the IP address and the length of the first-level cache array (a prime number), prioritizing insertion into the first-level cache array. If the first-level cache array slot is occupied and the IP address is inconsistent, the IP address is inserted into the second-level cache array. Similarly, taking the modulo between the IP address and the length of the first-level cache array (a prime number), the process prioritizes insertion into the second-level cache array. If the second-level cache array slot is occupied and the IP address is inconsistent, the IP address is inserted into a linked list. Finally, taking the modulo between the IP address and the length of the third-level cache array (a prime number), the corresponding target linked list is found, and the IP address is inserted into the target linked list.

[0123] based on Figure 2 The three-level cache structure shown can be implemented as follows: The application server retrieves the application identifier corresponding to the source IP address from local shared memory using the following method: Take the modulo between the source IP address and the length of the first-level array to obtain the fourth modulo; retrieve the IP address within the first-level array element corresponding to the fourth modulo; if the source IP address differs from the IP address within the first-level array element, take the modulo between the source IP address and the length of the second-level array to obtain the fifth modulo; retrieve the IP address within the second-level array element corresponding to the fifth modulo; if the source IP address differs from the IP address within the second-level array element, take the modulo between the source IP address and the length of the third-level array to obtain the sixth modulo; retrieve the second target linked list pointed to by the linked list pointer within the third-level array element corresponding to the sixth modulo; and retrieve the application identifier corresponding to the source IP address from the second target linked list. This processing method involves taking the modulo between the source IP address to be queried and the length of the first-level cache array (a first prime number), querying the first-level cache array, and if the IP address of the corresponding slot in the first-level cache array matches the source IP address to be queried, then the IP address of the corresponding slot in the first-level cache array is returned; otherwise, the query continues. The modulo is then taken between the source IP address to be queried and the length of the second-level cache array (a second prime number), and the second-level cache array is queried. If the IP address of the corresponding slot in the second-level cache array matches the source IP address to be queried, then the IP address of the corresponding slot in the second-level cache array is returned; otherwise, the query continues. Finally, the modulo is taken between the source IP address to be queried and the length of the third-level cache array (a third prime number), and the corresponding target linked list is found. The target linked list is traversed to search for the source IP address to be queried. If the corresponding IP address is found, the corresponding application identifier is returned; otherwise, it is returned that no IP address was found.

[0124] Experiments have shown that storing the mapping between 1 million random IP addresses and application identifiers using a three-level array and linked lists requires only 14MB of memory; while existing methods require over 35MB of memory for this mapping (application identifier + IP address, 8 bytes in total). This significantly reduces the memory usage of the IP address-application identifier mapping. Furthermore, by utilizing a multi-level caching mechanism and atomic instruction operations, the write and query speeds of the mapping are greatly improved. Storing 1 million random IP data results in a single-threaded insertion time of approximately 0.0003 microseconds and a single-threaded query time of approximately 0.0001 microseconds, effectively meeting the requirements of high-concurrency queries.

[0125] In one example, the system provided in this application embodiment may further include: a data providing device, which provides the data writing device with a set of correspondences between application identifiers and IP addresses; the data providing device also provides the data writing device with updated data of the correspondences; and the data writing device is further configured to update the data in the memory area, i.e., update the data in the multi-level array, according to the updated data of the correspondences. This processing method enables hot updates of massive amounts of correspondence data between IP addresses and application identifiers. Through incremental updates by the data providing device deployed on the server and the data writing device deployed on the client, bandwidth and computational pressure can be effectively reduced.

[0126] In specific implementation, the updated data of the correspondence may include newly added correspondences; the data writing device is further configured to write the newly added correspondences into the memory area. The updated data of the correspondence may include deleted correspondences; the data writing device is further configured to delete the deleted correspondences from the memory area. The updated data of the correspondence may include the correspondence before modification and the correspondence after modification; the data writing device is further configured to delete the correspondence before modification from the memory area and write the modified correspondence into the memory area.

[0127] In one example, the data providing device can also be used to merge the updated data of the correspondence into the correspondence set, and provide the merged correspondence set to the new data writing device. This processing method allows the correspondence set to be the base version of the correspondence data, and the updated data of the correspondence to be merged into the correspondence set, thus providing a new base version of the correspondence set to the new data writing device; therefore, it can effectively improve data processing efficiency.

[0128] In practice, the most recent day's updated relationship data can be merged into the current base version's relationship set at a fixed time each day to form a new base version. This approach ensures the server refreshes the base version daily and resets the updated version. Alternatively, after accumulating a certain amount of updated relationship data, the updated data can be merged into the current base version's relationship set to form a new base version.

[0129] In one example, the data providing device is further configured to generate a third verification code based on the correspondence set; generate a fourth verification code based on the updated data; and provide the third and fourth verification codes to the data writing device. The data writing device is further configured to verify whether the received correspondence set is accurate based on the third verification code; and verify whether the received updated data is accurate based on the fourth verification code. In specific implementations, the verification code can be a hash verification code, etc. This processing method allows the data writing device deployed on the client to perform local merging based on the incrementally pulled updated version data, while simultaneously performing data verification (such as hash verification) to check data consistency, thereby ensuring data consistency between the server and the client.

[0130] like Figure 3 As shown, at time 0, the server with the data providing device saves the base version A and the updated version a0; correspondingly, at time 0', the data writing device on the client obtains the base version A and the updated version a0, and writes the correspondence between the base version A and the updated version a0 into memory. At time 1, the server saves the base version A and the updated version a1; correspondingly, at time 1', the data writing device obtains the updated version a1, calculates the checksum of the updated version a1, and if the locally calculated checksum is the same as the received checksum of the updated version a1, then the correspondence of the updated version a1 is written into memory. At time 2, the server saves the base version A and the updated version a2. At time 3, the server periodically merges the base version A, updated versions a0, a1, and a2 to obtain the base version B and the updated version b0; correspondingly, at time 3', the data writing device obtains the updated version b0, calculates the checksum of the updated version b0, and if the locally calculated checksum is the same as the received checksum of the updated version b0, then the correspondence of the updated version b0 is written into memory. At time 4, the server saves the base version B and the updated version b1. At time N, the server saves the base version N and the updated version n. Correspondingly, at time N', the data writing device obtains the updated version n, calculates the checksum of the updated version n, and if the locally calculated checksum is the same as the received checksum of the updated version n, then the correspondence of the updated version n is written into memory.

[0131] As can be seen from the above embodiments, the data processing system provided in this application includes at least one data writing device and at least one application server. The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the target application identifier and the target IP address; and perform the following processing level by level from the first-level array downwards: taking the modulus between the target IP address and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last-level array, then the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus is obtained; a first checksum is generated based on the target IP address, the target application identifier, and the linked list node pointer; and the linked list node pointer, the target IP address, the target application identifier, and the first checksum are written as linked list node data into the first target linked list using atomic instructions. Correspondingly, the application server is used to receive network requests and obtain the source IP address from the network request; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the source IP address is read from the second target linked list through atomic instructions; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.This approach achieves several advantages. First, it uses shared memory for cross-process read / write, requiring only one copy of the data globally, significantly saving memory. Second, it resolves storage conflicts for massive IP addresses by using multi-level array caching and a linked list for the last level, avoiding excessive memory consumption from array caching. Third, by including the first checksum in the linked list node data and using atomic instructions to read and write linked list nodes, it enables lock-free insertion and reading within the linked list. This ensures that the mapping between application identifiers and IP addresses read multiple times (e.g., two or three times) is complete, while reading the mapping in one go prevents incomplete data from being read while data is being written, guaranteeing the integrity and consistency of simultaneous read and write operations. It does not block concurrent read and write operations, achieving high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance, thereby improving network request processing performance.

[0132] Second Embodiment

[0133] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data writing method, which can be used in the above-described data writing device. This method corresponds to the embodiments of the system described above. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0134] This application also provides a data writing method, including the following steps: Step S401: Construct a multi-level array in the memory area.

[0135] Step S401: Construct a multi-level array in the memory area.

[0136] Step S403: Obtain the correspondence between the first data and the second data.

[0137] Step S405: Perform the following processing from the first level array downwards: Take the first data modulo the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then take the lower level array as the current level array and perform the above correspondence writing processing.

[0138] Step S407: If the current level array is the last level array, obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus; generate the first check code according to the first data, the second data and the linked list node pointer; and write the linked list node pointer, the first data, the second data and the first check code as linked list node data into the first target linked list through atomic instructions.

[0139] The multi-level arrays include, but are not limited to, three-level arrays. The lengths of the different levels of arrays are different prime numbers.

[0140] In one example, the method may further include the following steps: if the current level array is not the last level array and the current level array element corresponding to the first modulus is an unoccupied element, then the correspondence is written into the current level array element.

[0141] In one example, the method may further include the following step: selecting a fixed-length memory block from the memory pool as a linked list node.

[0142] In one example, the method may further include the step of compressing the IP address.

[0143] In one example, the method may further include the following steps: receiving a set of correspondences between application identifiers and IP addresses, and updated data of the correspondences; and updating memory area data according to the updated data.

[0144] The updated data includes newly added correspondences; updating the memory area data according to the updated data may include the following sub-steps: writing the newly added correspondences into the memory area.

[0145] The updated data includes the deletion of corresponding relationships; the step of updating the memory area data according to the updated data may include the following sub-step: deleting the deleted corresponding relationships from the memory area.

[0146] The updated data includes the correspondence before modification and the correspondence after modification; updating the memory area data according to the updated data may include the following sub-steps: deleting the correspondence before modification from the memory area and writing the correspondence after modification into the memory area.

[0147] In one example, the method may further include the following steps: merging the updated data into the corresponding relationship set, and providing the merged corresponding relationship set to the new data writing device.

[0148] In one example, the method may further include the following steps: receiving a third verification code generated based on the correspondence set and a fourth verification code generated based on the updated data; verifying whether the received correspondence set is accurate based on the third verification code; and verifying whether the received updated data is accurate based on the fourth verification code.

[0149] Third Embodiment

[0150] In the above embodiments, a data writing method is provided. Correspondingly, this application also provides a data writing apparatus. This apparatus corresponds to the embodiments of the method described above. Since the apparatus embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The apparatus embodiments described below are merely illustrative.

[0151] This application also provides a data writing device, including: a memory construction unit, a data acquisition unit, an array processing unit, and a linked list processing unit.

[0152] The system includes a memory construction unit for constructing multi-level arrays in memory; a data acquisition unit for acquiring the correspondence between target application identifiers and target IP addresses; an array processing unit for performing the following processing level by level from the first-level array downwards: taking the modulo between the target IP address and the length of the current-level array to obtain a first modulus; if the current-level array is not the last level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; and a linked list processing unit for acquiring the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus if the current-level array is the last level array; generating a first checksum based on the target IP address, target application identifier, and linked list node pointer; and writing the linked list node pointer, target IP address, target application identifier, and first checksum as linked list node data into the first target linked list through atomic instructions.

[0153] Fourth embodiment

[0154] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data query method. This method corresponds to the embodiments of the above system. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0155] This application also provides a data reading method, including the following steps: Step S501: Receive a network request and obtain the source IP address from the network request.

[0156] Step S501: Receive a network request and obtain the source IP address from the network request.

[0157] Step S503: Perform the following processing level by level from the first-level array downwards: Take the modulo between the source IP address and the length of the current-level array to obtain the second modulus; obtain the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then take the lower-level array element as the current-level array and perform the above-mentioned correspondence query processing step S501:

[0158] Step S505: If the current-level array is the last-level array, then obtain the second target linked list pointed to by the linked list pointer in the current-level array element; read the linked list node data corresponding to the source IP address from the second target linked list through atomic instructions; generate a second check code based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then obtain the processing method for the network request based on the application access permissions and the application identifier corresponding to the source IP address.

[0159] Application access permissions refer to the access permissions between applications. For example, which applications are allowed to access application A, or which applications are allowed to access service 1 provided by application A, which applications are allowed to access service 2 provided by application A, and so on. When application A, as the recipient of a network request, receives a network request from application B, as the sender of the network request, it determines application B's access permissions for application A based on the source IP address carried in the network request. If application B has permission to access application A, application A responds to the network request from application B; if application B does not have permission to access application A, application A refuses to process the network request from application B.

[0160] Fifth Embodiment

[0161] In the above embodiments, a data query method is provided. Correspondingly, this application also provides a data query device. This device corresponds to the embodiments of the above method. Since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The device embodiments described below are merely illustrative.

[0162] This application also provides a data query device, including: a data acquisition unit, an array processing unit, a linked list processing unit, and a request processing method acquisition unit.

[0163] A data acquisition unit is used to receive network requests and obtain the source IP address from the network requests. An array processing unit is used to perform the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above-mentioned correspondence query processing is performed. A linked list processing unit is used to obtain the second target linked list pointed to by the linked list pointer in the current-level array element if the current-level array is the last-level array; read the linked list node data corresponding to the source IP address from the second target linked list through atomic instructions; generate a second check code based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the application identifier corresponding to the source IP address is used as the target application identifier. A request processing method acquisition unit is used to obtain the processing method for the network request based on the application access permissions and the target application identifier.

[0164] Sixth Embodiment

[0165] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data processing system. This system corresponds to Embodiment 1 of the above system. Since this system embodiment is basically similar to System Embodiment 1, it is described simply, and relevant parts can be referred to in the description of System Embodiment 1. The system embodiments described below are merely illustrative.

[0166] This application also provides a data processing system, including: at least one data writing device and at least one data querying device.

[0167] The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the first data and the second data; and perform the following processing level by level from the first level array downwards: taking the modulus between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained; a first check code is generated according to the first data, the second data, and the linked list node pointer; and the linked list node pointer, the first data, the second data, and the first check code are written as linked list node data into the first target linked list through atomic instructions.

[0168] Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulus between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the target first data is read from the second target linked list through atomic instructions; a second check code is generated based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data is taken as the target second data.

[0169] In one example, the data writing device is further configured to write the correspondence into the current-level array element if the current-level array is not the last-level array and the current-level array element corresponding to the first modulus is an unoccupied element; the data query device is further configured to obtain the second data corresponding to the target first data from the current-level array element if the current-level array is not the last-level array and the target first data is the same as the first data in the current-level array element.

[0170] The data processing system provided in this embodiment does not limit its application scenario. It can be used for any application scenario that requires "writing data to memory and reading data from memory concurrently in multiple threads". The data processing object is "the correspondence between the first data and the second data", the data to be queried is "the target first data", and the data query result is "the second data corresponding to the target first data".

[0171] As can be seen from the above embodiments, the data processing system provided in this application includes at least one data writing device and at least one data querying device. The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between first data and second data; and perform the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data within the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last-level array, then the first target linked list pointed to by the linked list pointer within the element of the current-level array corresponding to the first modulus is obtained; a first checksum is generated based on the first data, the second data, and the linked list node pointer; and the linked list node pointer, the first data, the second data, and the first checksum are written as linked list node data into the first target linked list using atomic instructions. Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulus between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; the linked list node data corresponding to the target first data is read from the second target linked list through atomic instructions; a second check code is generated based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data is taken as the target second data. This approach achieves several advantages. First, it enables cross-process read / write operations via shared memory, requiring only one copy of the data globally, thus significantly saving memory. Second, it resolves data storage conflicts for massive amounts of data by using multi-level array caching and a linked list for the last level, avoiding excessive memory consumption from array caching alone. Third, by including the first checksum in the linked list node data and using atomic instructions to read and write linked list nodes, it enables lock-free insertion and reading within the linked list. This allows for a one-time retrieval of the correspondence between the first and second data, preventing the reading of incomplete data and ensuring the integrity and consistency of simultaneous read and write operations. It does not block concurrent read and write operations, achieving high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance.

[0172] Seventh Embodiment

[0173] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data writing method. This method corresponds to the embodiments of the above system. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0174] This application also provides a data writing method, including the following steps:

[0175] Step S701: Construct a multi-level array in the memory area.

[0176] Step S703: Obtain the correspondence between the first data and the second data.

[0177] Step S705: Perform the following processing from the first level array downwards: Take the modulo between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then take the lower level array as the current level array and perform the above correspondence writing processing.

[0178] Step S707: If the current level array is the last level array, obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus; generate the first check code according to the first data, the second data and the linked list node pointer; and write the linked list node pointer, the first data, the second data and the first check code as linked list node data into the first target linked list through atomic instructions.

[0179] Eighth embodiment

[0180] In the above embodiments, a data writing method is provided. Correspondingly, this application also provides a data writing apparatus. This apparatus corresponds to the embodiments of the method described above. Since the apparatus embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The apparatus embodiments described below are merely illustrative.

[0181] This application also provides a data writing device, including: a memory construction unit, a data acquisition unit, an array processing unit, and a linked list processing unit.

[0182] The system includes a memory construction unit for constructing multi-level arrays in memory; a data acquisition unit for acquiring the correspondence between first data and second data; an array processing unit for performing the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; and a linked list processing unit for acquiring the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus if the current-level array is the last-level array; generating a first checksum based on the first data, the second data, and the linked list node pointer; and writing the linked list node pointer, the first data, the second data, and the first checksum as linked list node data into the first target linked list through atomic instructions.

[0183] Ninth Embodiment

[0184] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data query method. This method corresponds to the embodiments of the above system. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0185] This application also provides a data query method, including the following steps:

[0186] Step S901: Obtain the target first data.

[0187] Step S903: Starting from the first-level array in the memory area, perform the following processing level by level: take the modulo between the target first data and the length of the current-level array to obtain the second modulus; obtain the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0188] Step S905: If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element; read the linked list node data corresponding to the target first data from the second target linked list through atomic instructions; generate a second check code based on the target first data, second data and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then take the second data corresponding to the target first data as the target second data.

[0189] Tenth Embodiment

[0190] In the above embodiments, a data query method is provided. Correspondingly, this application also provides a data query device. This device corresponds to the embodiments of the above method. Since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The device embodiments described below are merely illustrative.

[0191] This application also provides a data query device, including: a data acquisition unit, an array processing unit, and a linked list processing unit.

[0192] The data acquisition unit is used to acquire target first data; the array processing unit is used to perform the following processing level by level from the first-level array in the memory area: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; acquiring the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; the linked list processing unit is used to acquire the second target linked list pointed to by the linked list pointer in the current-level array element if the current-level array is the last-level array; read the linked list node data corresponding to the target first data from the second target linked list through atomic instructions; generate a second check code based on the target first data, the second data, and the linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data is taken as the target second data.

[0193] Eleventh Embodiment

[0194] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data processing system. This system corresponds to Embodiment 1 of the above system. Since this system embodiment is basically similar to System Embodiment 1, it is described simply, and relevant parts can be referred to in the description of System Embodiment 1. The system embodiments described below are merely illustrative.

[0195] This application also provides a data processing system, including: at least one data writing device and at least one data querying device.

[0196] The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between the first data and the second data; and perform the following processing level by level from the first level array downwards: take the modulus between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; if the current level array is the last level array, then the first target linked list pointed to by the linked list pointer in the element of the current level array corresponding to the first modulus is obtained, and the linked list node pointer and the correspondence are written as linked list node data into the first target linked list.

[0197] In this embodiment, the complete correspondence of the linked list node data can be written with only one atomic instruction; the complete correspondence can be read with only one atomic instruction; therefore, the linked list node data does not include a checksum.

[0198] Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained, and the second data corresponding to the target first data is read from the second target linked list.

[0199] In one example, the data writing device is further configured to write the correspondence into the current-level array element if the current-level array is not the last-level array and the current-level array element corresponding to the first modulus is an unoccupied element; the data query device is further configured to obtain the second data corresponding to the target first data from the current-level array element if the current-level array is not the last-level array and the target first data is the same as the first data in the current-level array element.

[0200] The data processing system provided in this embodiment is not limited to any particular application scenario. It can be used for any application scenario that requires writing data to memory and reading data from memory concurrently using multiple threads. The data processing object is the correspondence between "first data" and "second data". The data to be queried is "target first data", and the data query result is "second data corresponding to the target first data". The first data can be any data, and the second data corresponds to the first data.

[0201] As can be seen from the above embodiments, the data processing system provided in this application includes at least one data writing device and at least one data querying device. The data writing device is used to construct a multi-level array in the memory area; obtain the correspondence between first data and second data; and perform the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain a first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data within the element of the current-level array, then the lower-level array is used as the current-level array, and the above correspondence writing processing is performed; if the current-level array is the last-level array, then the first target linked list pointed to by the linked list pointer within the element of the current-level array corresponding to the first modulus is obtained, and the linked list node pointer and the correspondence are written as linked list node data into the first target linked list. Accordingly, the data query device is used to obtain target first data; and to perform the following processing level by level from the first-level array downwards: taking the modulo between the target first data and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained, and the second data corresponding to the target first data is read from the second target linked list. This approach achieves several advantages. First, it enables cross-process read / write operations via shared memory, requiring only one copy of the data globally, thus significantly saving memory. Second, it resolves data storage conflicts for massive amounts of data by using multi-level array caching and a linked list for the last level array cache, avoiding excessive memory consumption from array caching alone. Third, it enables lock-free insertion and retrieval of linked list nodes through atomic instructions, allowing for simultaneous reading of the correspondence between the first and second data items, preventing incomplete data reads, ensuring the integrity and consistency of concurrent read / write operations, and avoiding blocking concurrent read / write operations. This results in high-performance insertion and high-concurrency fast querying. Therefore, it effectively achieves a good balance between data memory usage and data read / write performance.

[0202] Twelfth Embodiment

[0203] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data writing method. This method corresponds to the embodiments of the above system. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0204] This application also provides a data writing method, including the following steps:

[0205] Step S1201: Construct a multi-level array in the memory area.

[0206] Step S1203: Obtain the correspondence between the first data and the second data.

[0207] Step S1205: Perform the following processing from the first level array downwards: Take the modulo between the first data and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then take the lower level array as the current level array and perform the above correspondence writing processing.

[0208] Step S1207: If the current level array is the last level array, then obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus, and write the linked list node pointer and the corresponding relationship as linked list node data into the first target linked list.

[0209] Thirteenth Embodiment

[0210] In the above embodiments, a data writing method is provided. Correspondingly, this application also provides a data writing apparatus. This apparatus corresponds to the embodiments of the method described above. Since the apparatus embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The apparatus embodiments described below are merely illustrative.

[0211] This application also provides a data writing device, including: a memory construction unit, a data acquisition unit, an array processing unit, and a linked list processing unit.

[0212] The system includes a memory construction unit for constructing multi-level arrays in memory; a data acquisition unit for acquiring the correspondence between first data and second data; an array processing unit for performing the following processing level by level from the first-level array downwards: taking the modulus between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then the lower-level array is taken as the current-level array, and the above correspondence writing processing is performed; and a linked list processing unit for acquiring the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus if the current-level array is the last-level array, and writing the linked list node pointer and the correspondence as linked list node data into the first target linked list.

[0213] Fourteenth Embodiment

[0214] In the above embodiments, a data processing system is provided. Correspondingly, this application also provides a data query method. This method corresponds to the embodiments of the above system. Since the method embodiments are basically similar to the system embodiments, they are described simply, and relevant details can be found in the descriptions of the system embodiments. The method embodiments described below are merely illustrative.

[0215] This application also provides a data query method, including the following steps:

[0216] Step S1401: Obtain the target first data.

[0217] Step S1403: Starting from the first-level array in the memory area, perform the following processing level by level: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing.

[0218] Step S1405: If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element, and read the second data corresponding to the target first data from the second target linked list.

[0219] Fifteenth Embodiment

[0220] In the above embodiments, a data query method is provided. Correspondingly, this application also provides a data query device. This device corresponds to the embodiments of the above method. Since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. The device embodiments described below are merely illustrative.

[0221] This application also provides a data query device, including: a data acquisition unit, an array processing unit, and a linked list processing unit.

[0222] The data acquisition unit is used to acquire the target first data; the array processing unit is used to perform the following processing level by level from the first-level array in the memory area: take the modulo between the target first data and the length of the current-level array to obtain the second modulus; acquire the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing; the linked list processing unit is used to acquire the second target linked list pointed to by the linked list pointer in the current-level array element if the current-level array is the last-level array, and read the second data corresponding to the target first data from the second target linked list.

[0223] Sixteenth Embodiment

[0224] In the above embodiments, a data processing method is provided. Correspondingly, this application also provides an electronic device. This device corresponds to the embodiments of the above method. Since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and relevant details can be found in the description of the method embodiments. The device embodiments described below are merely illustrative.

[0225] The electronic device of this embodiment includes: a memory and a processor; the memory is used to store a program that implements the above-described data writing method or data query method, and the device is powered on and runs the program of the above-described data writing method or data query method through the processor.

[0226] Memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0227] In specific implementations, the electronic device may also include one or more of the following components: a power supply component, an input / output (I / O) interface, and a communication component. The power supply component provides power to various components of the electronic device. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device. The I / O interface provides an interface between the processor 503 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. The communication component is configured to facilitate wired or wireless communication between the electronic device and user devices (such as smartphones, tablets, etc.).

[0228] Seventeenth Embodiment

[0229] This application also provides a computer-readable storage medium. Since the embodiments of the computer-readable storage medium are substantially similar to the method embodiments, the description is relatively simple; relevant details can be found in the description of the method embodiments. The computer-readable storage medium embodiments described below are merely illustrative.

[0230] In this embodiment, a non-transitory computer-readable storage medium including instructions is provided, such as a memory including instructions. These instructions can be executed by a processor of an electronic device to complete the data writing method or data query method provided in this disclosure. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0231] It should be noted that the embodiments of this application may involve the use of user data. In practical applications, user-specific personal data may be used in the scheme described herein within the scope permitted by applicable laws and regulations, provided that it complies with the applicable laws and regulations of the country (e.g., with the user's explicit consent, with the user being properly notified, etc.).

[0232] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

[0233] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0234] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0235] 1. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.

[0236] 2. Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Claims

1. A data processing system, characterized in that, include: At least one data writing device and at least one application server; The data writing device is used to construct a multi-level array in the memory area; Obtain the correspondence between the target application identifier and the target IP address; proceed through the following steps from the first-level array downwards: take the modulo between the target IP address and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then use the next-level array as the current-level array and perform the above correspondence writing process; if the current-level array is the last-level array, obtain the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus; Generate the first checksum based on the target IP address, target application identifier, and linked list node pointers; Using atomic instructions, the linked list node pointer, target IP address, target application identifier, and first checksum are written into the first target linked list as linked list node data; The application server is used to receive network requests and obtain the source IP address from the network requests; it performs the following processing level by level from the first-level array downwards: taking the modulo between the source IP address and the length of the current-level array to obtain a second modulus; obtaining the current-level array element corresponding to the second modulus; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then the lower-level array element is used as the current-level array, and the above correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; Using atomic instructions, the linked list node data corresponding to the source IP address is read from the second target linked list; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.

2. A data processing system, characterized in that, include: At least one data writing device and at least one data querying device; The data writing device is used to construct a multi-level array in the memory area; Obtain the correspondence between the first data and the second data; proceed through the following steps from the first-level array downwards: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the next-level array as the current-level array and perform the above correspondence writing process; if the current-level array is the last-level array, obtain the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus; generate the first checksum based on the first data, the second data, and the linked list node pointers; Using atomic instructions, the linked list node pointer, the first data, the second data, and the first check code are written into the first target linked list as linked list node data; The data query device is used to obtain target first data; and to perform the following processing level by level from the first level array downwards: take the modulo between the target first data and the length of the current level array to obtain a second modulo; and obtain the current level array element corresponding to the second modulo. If the current-level array is not the last-level array and the target first data is different from the first data in the current-level array element, then the lower-level array element is taken as the current-level array, and the above-mentioned correspondence query processing is performed; if the current-level array is the last-level array, then the second target linked list pointed to by the linked list pointer in the current-level array element is obtained; through atomic instructions, the linked list node data corresponding to the target first data is read from the second target linked list; based on the target first data, second data, and linked list node pointer included in the linked list node data, a second check code is generated; If the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data will be used as the target second data.

3. A data processing system, characterized in that, include: At least one data writing device and at least one data querying device; The data writing device is used to construct a multi-level array in the memory area; Obtain the correspondence between the first data and the second data; proceed through the following steps from the first-level array downwards: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the next-level array as the current-level array and perform the above correspondence writing process; if the current-level array is the last-level array, obtain the first target linked list pointed to by the linked list pointer in the element of the current-level array corresponding to the first modulus, and write the linked list node pointer and the correspondence as linked list node data into the first target linked list; The data query device is used to obtain target first data; and to perform the following processing level by level from the first level array downwards: take the modulo between the target first data and the length of the current level array to obtain a second modulo; and obtain the current level array element corresponding to the second modulo. If the current level array is not the last level array and the target first data is different from the first data in the current level array element, then the lower level array element is taken as the current level array, and the above correspondence query processing is performed; if the current level array is the last level array, then the second target linked list pointed to by the linked list pointer in the current level array element is obtained, and the second data corresponding to the target first data is read from the second target linked list.

4. A data writing method, characterized in that, include: Construct multi-level arrays in the memory area; Obtain the mapping between the target application identifier and the target IP address; The following processing is performed level by level from the first-level array downwards: the target IP address is moduloed by the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current-level array, then the lower-level array is taken as the current-level array, and the above correspondence writing process is performed; If the current level array is the last level array, then obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus; Generate the first checksum based on the target IP address, target application identifier, and linked list node pointers; Using atomic instructions, the linked list node pointer, target IP address, target application identifier, and first checksum are written into the first target linked list as linked list node data.

5. A data writing method, characterized in that, include: Construct multi-level arrays in the memory area; Obtain the correspondence between the first data and the second data; Starting from the first-level array, perform the following processing level by level: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the lower-level array as the current-level array and perform the above correspondence writing process. If the current level array is the last level array, then obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus; generate the first check code based on the first data, the second data and the linked list node pointers; Using atomic instructions, the linked list node pointer, first data, second data, and first checksum are written as linked list node data into the first target linked list.

6. A data writing method, characterized in that, include: Construct multi-level arrays in the memory area; Obtain the correspondence between the first data and the second data; Starting from the first-level array, perform the following processing level by level: take the modulo between the first data and the length of the current-level array to obtain the first modulus; if the current-level array is not the last-level array, and the element of the current-level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current-level array, then take the lower-level array as the current-level array and perform the above correspondence writing process. If the current level array is the last level array, then obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus, and write the linked list node pointer and the corresponding relationship as linked list node data into the first target linked list.

7. A data query method, characterized in that, include: Receive a network request and obtain the source IP address from the network request; Starting from the first-level array, perform the following processing level by level: take the modulo between the source IP address and the length of the current-level array to obtain the second modulo; obtain the current-level array element corresponding to the second modulo; if the current-level array is not the last-level array and the source IP address is different from the IP address in the current-level array element, then take the lower-level array element as the current-level array and perform the above correspondence query processing. If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element; Using atomic instructions, the linked list node data corresponding to the source IP address is read from the second target linked list; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, the processing method for the network request is obtained based on the application access permissions and the application identifier corresponding to the source IP address.

8. A data query method, characterized in that, include: Obtain the target's first data; Starting from the first-level array in the memory area, perform the following processing level by level: Take the modulo between the target first data and the length of the current-level array to obtain the second modulo; retrieve the current-level array element corresponding to the second modulo. If the current level array is not the last level array, and the target first data is different from the first data in the current level array element, then the lower level array element is taken as the current level array, and the above correspondence query processing is performed; If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element; Using atomic instructions, read the linked list node data corresponding to the target first data from the second target linked list; generate a second check code based on the target first data, second data, and linked list node pointers included in the linked list node data; If the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data will be used as the target second data.

9. A data query method, characterized in that, include: Obtain the target's first data; Starting from the first-level array in the memory area, perform the following processing level by level: Take the modulo between the target first data and the length of the current-level array to obtain the second modulo; retrieve the current-level array element corresponding to the second modulo. If the current level array is not the last level array, and the target first data is different from the first data in the current level array element, then the lower level array element is taken as the current level array, and the above correspondence query processing is performed; If the current level array is the last level array, then obtain the second target linked list pointed to by the linked list pointer in the current level array element, and read the second data corresponding to the target first data from the second target linked list.

10. A data writing device, characterized in that, include: Memory building blocks are used to construct multi-level arrays in memory areas; The data acquisition unit is used to acquire the correspondence between the target application identifier and the target IP address; The array processing unit is used to perform the following processing level by level from the first level array downwards: take the modulo between the target IP address and the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the target IP address is different from the IP address in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; A linked list processing unit is used to obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus if the current level array is the last level array. Generate the first checksum based on the target IP address, target application identifier, and linked list node pointers; Using atomic instructions, the linked list node pointer, target IP address, target application identifier, and first checksum are written into the first target linked list as linked list node data.

11. A data writing device, characterized in that, include: Memory building blocks are used to construct multi-level arrays in memory areas; The data acquisition unit is used to acquire the correspondence between the first data and the second data; The array processing unit is used to perform the following processing level by level from the first level array downwards: take the first data modulo the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; The linked list processing unit is configured to, if the current level array is the last level array, obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus; and generate a first check code based on the first data, the second data, and the linked list node pointers. Using atomic instructions, the linked list node pointer, first data, second data, and first checksum are written as linked list node data into the first target linked list.

12. A data writing device, characterized in that, include: Memory building blocks are used to construct multi-level arrays in memory areas; The data acquisition unit is used to acquire the correspondence between the first data and the second data; The array processing unit is used to perform the following processing level by level from the first level array downwards: take the first data modulo the length of the current level array to obtain the first modulus; if the current level array is not the last level array, and the element of the current level array corresponding to the first modulus is an occupied element, and the first data is different from the first data in the element of the current level array, then the lower level array is taken as the current level array, and the above correspondence writing processing is performed; The linked list processing unit is configured to, if the current level array is the last level array, obtain the first target linked list pointed to by the linked list pointer in the current level array element corresponding to the first modulus, and write the linked list node pointer and the corresponding relationship as linked list node data into the first target linked list.

13. A data query device, characterized in that, include: A data acquisition unit is used to receive network requests and obtain the source IP address from the network requests; The array processing unit is used to perform the following processing level by level from the first level array downwards: take the modulo between the source IP address and the length of the current level array to obtain the second modulus; obtain the current level array element corresponding to the second modulus; if the current level array is not the last level array and the source IP address is different from the IP address in the current level array element, then take the lower level array element as the current level array and perform the above correspondence query processing. A linked list processing unit is used to obtain the second target linked list pointed to by the linked list pointer in the element of the current level array if the current level array is the last level array; Using atomic instructions, the linked list node data corresponding to the source IP address is read from the second target linked list; a second check code is generated based on the source IP address, application identifier, and linked list node pointer included in the linked list node data; if the second check code is the same as the first check code in the linked list node data, the application identifier corresponding to the source IP address is used as the target application identifier. The request processing method acquisition unit is used to acquire the processing method for the network request based on the application access permissions and the target application identifier.

14. A data query device, characterized in that, include: The data acquisition unit is used to acquire the target's first data; The array processing unit is used to perform the following processing level by level from the first-level array in the memory area: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; and retrieve the current-level array element corresponding to the second modulo. If the current level array is not the last level array, and the target first data is different from the first data in the current level array element, then the lower level array element is taken as the current level array, and the above correspondence query processing is performed; A linked list processing unit is used to obtain the second target linked list pointed to by the linked list pointer in the element of the current level array if the current level array is the last level array; Using atomic instructions, read the linked list node data corresponding to the target first data from the second target linked list; generate a second check code based on the target first data, second data, and linked list node pointers included in the linked list node data; If the second check code is the same as the first check code in the linked list node data, then the second data corresponding to the target first data will be used as the target second data.

15. A data query device, characterized in that, include: The data acquisition unit is used to acquire the target's first data; The array processing unit is used to perform the following processing level by level from the first-level array in the memory area: take the modulo between the target first data and the length of the current-level array to obtain the second modulo; and retrieve the current-level array element corresponding to the second modulo. If the current level array is not the last level array, and the target first data is different from the first data in the current level array element, then the lower level array element is taken as the current level array, and the above correspondence query processing is performed; The linked list processing unit is used to obtain the second target linked list pointed to by the linked list pointer in the current level array if the current level array is the last level array, and read the second data corresponding to the target first data from the second target linked list.

16. An electronic device, characterized in that, include: processor; as well as A memory for storing a program for implementing the method according to any one of claims 4 to 9, wherein the device is powered on and the program for running the method is executed by the processor.