A data processing method and apparatus

By processing data processing instructions in parallel within a key-value database and leveraging the multi-core performance of HetuKV, Jedis's performance bottleneck in high-concurrency environments was resolved, achieving efficient data processing and resource optimization, and improving the performance and user experience of Java applications.

CN118733654BActive Publication Date: 2025-11-28SHENZHEN PENGLAI SMART NUMBER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410829374.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-11-28
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing Jedis clients suffer from performance bottlenecks and blocking issues in high-concurrency environments, and lack built-in connection pools, leading to increased development complexity and failing to meet the needs of Java developers for efficient connection and operation in high-concurrency environments.

Method used

A data processing method and apparatus are provided, which receives data processing instructions from the client and processes key-value pair data in parallel. By utilizing the multi-core performance of the HetuKV key-value database, efficient parallel data processing is achieved, improving application performance and reducing operation latency.

Benefits of technology

It enables clients to connect to key-value databases efficiently, improving data processing efficiency, reducing operation latency, enhancing user experience, and optimizing resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733654B_ABST
    Figure CN118733654B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method, which can perform parallel data processing on key-value pair data in a key-value database according to at least one data processing instruction, obtain data processing results respectively corresponding to the at least one data processing instruction, and feed back the data processing results respectively corresponding to the at least one data processing instruction to the client, so that the client can be efficiently connected to the key-value database by using preset data processing instructions, and the parallel data processing can be performed on the key-value pair data in the key-value database, efficient parallel data processing is realized, the performance of an application program is improved, the performance of the client is improved, operation delay is reduced, the efficiency of data processing is improved, data processing cost is reduced, and user experience of data processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a data processing method and device. BACKGROUND

[0002] NoSQL databases are a type of database that emerged alongside relational databases, aiming to address challenges such as large-scale data storage and high-concurrency access that traditional relational databases struggle with. Key-value databases are a major type of NoSQL databases, which store data in the form of key-value pairs, suitable for simple data models and fast read-write operations. In particular, Redis, as an in-memory key-value database, is widely used due to its fast read-write operations and rich features such as publish / subscribe, transactions, pipelines, etc.

[0003] In the field of Java development, with the rapid development of Internet applications, there is an increasing demand for high performance, scalability, and flexibility. Traditional relational databases may face performance bottlenecks when handling large amounts of data and high concurrency requests, so developers have begun to seek alternative solutions. The emergence of key-value databases fills this gap and provides Java developers with more choices. Java is a widely used programming language applied in enterprise, web, mobile, and embedded systems. Many enterprise-level applications and microservice architectures are based on the Java technology stack. Developing Java interfaces for key-value databases allows these applications to easily access and manipulate key-value databases, meeting the needs of application scenarios.

[0004] Key-value databases typically have high performance and scalability characteristics, as they are based on a simple key-value pair data model that allows fast read-write operations. Through Java interfaces, developers can leverage the performance advantages of key-value databases for application scenarios that require caching, session management, real-time data processing, etc. Developing Java interfaces for key-value databases can simplify the development process by abstracting and encapsulating database operations. Developers can interact with key-value databases using familiar Java APIs without needing to delve into the underlying implementation of the database. This simplification helps improve development efficiency and reduce the probability of errors.

[0005] In the prior art, Jedis is a Java client library for Redis, providing comprehensive support and direct mapping of Redis commands. Jedis provides encapsulation of Redis commands, including strings, hashes, lists, sets, sorted sets, transactions, publish / subscribe, etc. It also provides APIs that allow developers to interact with Redis using native commands.

[0006] Jedis is synchronous, which means that Jedis blocks while waiting for a response from Redis. This can lead to performance bottlenecks, especially in high-concurrency environments. Since Jedis is synchronous, it is not suitable for scenarios that require non-blocking and asynchronous operations. Jedis does not come with a connection pool, and an additional configuration of the connection pool is required to manage connections. This can lead to increased development complexity. Therefore, there is an urgent need for a method that can be applied to high-concurrency environments and enable Java clients to efficiently connect to key-value databases. SUMMARY

[0007] The present application provides a data processing method and device, which can enable clients to efficiently connect to key-value databases using pre-set data processing instructions and perform parallel data processing on key-value pair data in key-value databases, achieving efficient parallel data processing and improving the performance of application programs, improving the performance of clients, reducing operation delay, and thus improving the efficiency of data processing and reducing the cost of data processing, thereby improving the user experience of data processing.

[0008] In a first aspect, the present application provides a data processing method, which is applied to a solid state disk corresponding to a key-value database, and the method comprises:

[0009] receiving at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and target set operation type;

[0010] performing parallel data processing on the at least one data processing instruction to obtain data processing results corresponding to each of the at least one data processing instruction respectively; wherein, for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction;

[0011] feeding the data processing results corresponding to each of the at least one data processing instruction respectively to the client.

[0012] In a second aspect, the present application provides a data processing device, which is applied to a solid state disk corresponding to a key-value database, and the device comprises:

[0013] a first unit for receiving at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and target set operation type;

[0014] a second unit, configured to perform parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction respectively; wherein for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; and the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction;

[0015] a third unit, configured to feed back the data processing result corresponding to each of the at least one data processing instruction to the client.

[0016] In a third aspect, the present application provides a readable medium comprising execution instructions, when a processor of an electronic device executes the execution instructions, the electronic device executes the method according to any one of the first aspect.

[0017] In a fourth aspect, the present application provides an electronic device comprising a processor and a memory storing execution instructions, when the processor executes the execution instructions stored in the memory, the processor executes the method according to any one of the first aspect.

[0018] It can be seen from the technical scheme that the method provided by the application can be applied to a solid state disk corresponding to a key-value database, and the method comprises the following steps: receiving at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and a target set operation type; performing parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each data processing instruction respectively; wherein for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises one key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; performing data processing corresponding to the target set operation type on the target key-value pair data to obtain a data processing result corresponding to the data processing instruction; and feeding back the data processing result corresponding to each data processing instruction to the client. In the application, parallel data processing can be performed on key-value pair data in the key-value database according to at least one data processing instruction to obtain a data processing result corresponding to each data processing instruction respectively, and the data processing result corresponding to each data processing instruction is fed back to the client, so that the client can be connected to the key-value database efficiently by using a preset data processing instruction, and parallel data processing can be performed on key-value pair data in the key-value database, efficient parallel data processing is realized, the performance of an application program is improved, the performance of the client is improved, operation delay is reduced, the efficiency of data processing is improved, data processing cost is reduced, and the user experience of data processing is improved.

[0019] Further effects of the above-described non-conventional preferred modes will be explained in the following in connection with the detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments described in the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative labor.

[0021] Figure 1 A flowchart of a data processing method provided by an embodiment of the present application;

[0022] Figure 2 A flowchart of a data processing method provided by an embodiment of the present application;

[0023] Figure 3This is a flowchart illustrating a data processing method according to an embodiment of the present invention.

[0024] Figure 4 This is a flowchart illustrating a data processing method according to an embodiment of the present invention.

[0025] Figure 5 This is a flowchart illustrating a data processing method according to an embodiment of the present invention.

[0026] Figure 6 This is a flowchart illustrating a data processing method according to an embodiment of the present invention.

[0027] Figure 7 This is a schematic diagram of the structure of a data processing device according to an embodiment of the present invention;

[0028] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0030] Various non-limiting embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0031] See Figure 1 This paper illustrates a data processing method according to an embodiment of the present invention. The method can be applied to a solid-state drive corresponding to a key-value database. In this embodiment, the method may include, for example, the following steps:

[0032] Step 1: Receive at least one data processing instruction sent by the client.

[0033] In this embodiment, when a client needs to process key-value pairs in a key-value database via a solid-state drive (SSD), the client can send at least one data processing instruction to the SSD corresponding to the key-value database. In one implementation, the client can be a Java client, and the key-value database can be a combined key-value database (i.e., a HetuKV key-value database).

[0034] Each data processing instruction can include target set type data and target set operation type. The target set type data can be understood as the relevant information of the data set and / or the elements in the data set that need to be processed, such as the key and / or value of the key-value pair to be processed. It should be noted that each key-value pair data in the key-value database includes a key and at least one value, each value includes at least one data set, and each data set includes at least one element. The target set operation type can be understood as the operation mode that needs to be processed on the key-value pair to be processed, such as data set / element query, element deletion, element addition, etc.

[0035] It should be noted that the key-value pair data in the key-value database can be related data in the fields of artificial intelligence, content recommendation, image rendering, financial risk control, Internet of Things, game development, big data analysis, etc. For example, in the field of artificial intelligence, the scheme provided by the present application can be used to train and deploy machine learning and deep learning models, and the application mode is: used to read and process a large amount of training data, quickly perform data preprocessing, cache intermediate results, and store the trained model in the cache for real-time inference and prediction; in the field of content recommendation system, the content recommendation system usually needs to quickly access and process a large amount of user and content data to generate personalized recommendations, and the scheme provided by the present application can be used to cache user preferences, recommendation history, popular content, etc. to reduce the read pressure of the database and improve the real-time performance and accuracy of the recommendation system; in the field of image rendering and processing, fast access and caching of intermediate results are crucial to performance, and the scheme provided by the present application can be used to store and cache intermediate data generated during the rendering process, such as textures, image slices, rendering results, etc. to help speed up the rendering process and reduce the computational load; financial institutions need to quickly process and analyze a large amount of transaction and user data to detect fraudulent behavior and manage risks, and the scheme provided by the present application can be used to cache and quickly access transaction records, account information, risk assessment results, etc. to improve the real-time response capability and data processing performance of the risk control system; in the field of Internet of Things (IoT), Internet of Things devices generate a large amount of data, and fast processing and analysis of these data are crucial to system stability and performance, and the scheme provided by the present application can be used to store and cache sensor data, device status, real-time events, etc. to help the Internet of Things system quickly respond to events and instructions and ensure the real-time performance of the system; game development needs to process a large amount of real-time data, including game state, player information and game events, and the scheme provided by the present application can be used to cache game state, player data, rankings, etc. to improve the response speed and performance of the game; big data analysis needs to quickly process and analyze a large amount of data to obtain valuable insights, and the scheme provided by the present application can be used as a data processing transfer station to help realize fast import, processing and caching of data, thereby improving the performance of the analysis system.

[0036] Step 2: performing parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction respectively.

[0037] In this embodiment, if multiple data processing instructions are received simultaneously, parallel data processing can be performed on the multiple data processing instructions to obtain a data processing result corresponding to each of the at least one data processing instruction respectively. For example, when the client is a Java client and the key-value database is a HetuKV key-value database, the multi-core performance advantage of the HetuKV key-value database can be utilized to achieve efficient parallel data processing, thereby improving the performance of the application program. The HetuKV key-value database is multi-core parallel, and the Java client supports and can implement multi-threading, so the multiple cores of the CPU can be enabled, and each core processes a data processing instruction separately. For example, when storing a large String file in a multi-core environment, the file can be split into multiple parts, and each core stores a part of the data separately, and can perform simultaneously without interference. This multi-core parallel processing method can greatly improve the performance of data processing.

[0038] Specifically, for each data processing instruction, the target key-value pair data in the key-value database can be determined according to the target set type data, that is, the target key-value pair data corresponding to the target set type data is queried from the key-value database according to the target set type data. Each key-value pair data in the key-value database includes a key and at least one value, and each value includes at least one data set, and each data set includes at least one element. It can be understood that in this embodiment, the value corresponding to the key in each key-value pair data is at least one data set (i.e., set), which can be a hashset (hash data set), that is, a hashset (hash data set) is stored using key-value storage, which can be understood as storing a data set (i.e., set). The key is the unique identifier of the data set, and the value is the data set (i.e., set). The data set (i.e., set) has multiple elements. Simply put, the key is the name of a data set, and the value corresponding to the key is the element (member) in the data set.

[0039] Then, the target key-value pair data can be subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction. That is, the target key-value pair data is processed according to a data processing mode corresponding to the target set operation type, and a processed data processing result is obtained. For example, the target set operation type is a set operation for performing a key-value operation, including sadd, scard, sismember, srem, etc., so that fast and efficient key-value data storage and retrieval can be ensured.

[0040] Step 3: feeding back the data processing result corresponding to each of the at least one data processing instruction to the client.

[0041] After obtaining the data processing result corresponding to each of the at least one data processing instruction, the data processing result corresponding to each of the at least one data processing instruction can be fed back to the client.

[0042] As can be seen from the above technical solution, the method provided by the application can be applied to a solid state disk corresponding to a key-value database, and the method comprises: receiving at least one data processing instruction sent by a client; wherein each data processing instruction comprises: target set type data and a target set operation type; performing parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction; wherein for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction; and the data processing result corresponding to each of the at least one data processing instruction is fed back to the client. In the present application, the key-value pair data in the key-value database can be subjected to parallel data processing according to at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction, and the data processing result corresponding to each of the at least one data processing instruction is fed back to the client, so that the client can be efficiently connected to the key-value database by using a preset data processing instruction, and the key-value pair data in the key-value database can be subjected to parallel data processing, efficient parallel data processing is achieved, the performance of the application program is improved, the performance of the client is improved, the operation delay is reduced, the efficiency of data processing is improved, the cost of data processing is reduced, and the user experience of data processing is improved.

[0043] Next, embodiments of different target set type data and target set operation type cases are introduced respectively.

[0044] In an implementation manner, the target set type data includes a key of a to-be-processed key-value pair, and the target set operation type is an element addition operation.

[0045] In this embodiment, a specific implementation manner of determining target key-value pair data in the key-value database according to the target set type data can be as follows:

[0046] If the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair and the target element.

[0047] It is determined whether the key-value database includes key-value pair data corresponding to the key-value pair class, wherein a key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0048] If the key-value database includes the key-value pair data corresponding to the key-value pair class, the key-value pair data corresponding to the key-value pair class is taken as target key-value pair data.

[0049] Correspondingly, the data processing on the target key-value pair data according to the target set operation type to obtain a data processing result corresponding to the data processing instruction includes:

[0050] The value in the target key-value pair data is converted into a data set.

[0051] For each target element, it is determined whether the data set includes the target element; if the data set does not include the target element, the target element is inserted into the data set to obtain an updated data set.

[0052] After processing all target elements, the updated data set is converted into the value in the target key-value pair data.

[0053] It is determined that the data processing result corresponding to the data processing instruction is element addition success, and a number of target elements added successfully is taken as the data processing result corresponding to the data processing instruction.

[0054] Next, embodiments of different target set type data and target set operation type cases are introduced respectively. Figure 2 are introduced. For example, Figure 2As shown, the target set type data includes a key key of a key-value pair to be processed, target elements members; the target set operation type is an element addition operation sadd, that is, one or more elements are added to the data set, and the elements already existing in the data set are ignored. Specifically, the following steps are included:

[0055] S101: receiving a data processing instruction.

[0056] For step 101, at least two parameters such as key and members are accepted, wherein key represents a key to be inserted, and members represent members to be inserted. That is, the target set type data includes a key key of a key-value pair to be processed, target elements members; the target set operation type is an element addition operation sadd.

[0057] S102: judging whether the parameters are legal

[0058] For step 102, it is judged whether the parameters meet the type, wherein both key and members need to meet the data of String type (that is, the preset string type is String type), and the size of key cannot exceed the maximum value defined by kye, for example, the data size in key does not exceed 64 kb. If yes, S103 is executed, otherwise S114 is executed.

[0059] S103: initializing a HetuItem (that is, a key-value pair class) using the parameters.

[0060] For step 103, the legal parameters will be passed here to initialize a HetuItem object. That is, a key-value pair class is generated using the key of the key-value pair to be processed and the target elements.

[0061] S104: querying whether the value of HetuKVItem is successful.

[0062] For step 104, HetuKVItem is used to query the key-value pair corresponding to the key in HetuKV, and it is judged whether the query is successful, if yes, S105 is executed, otherwise S109 is executed. That is, it is judged whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the key-value pair to be processed.

[0063] S105: decoding value to obtain hashset and traversing member parameters.

[0064] For step 105, after S104 is successfully queried, the corresponding value is extracted, the obtained value is converted to hashset type, and traversal is started. That is, the value in the target key-value pair data is converted to a data set.

[0065] S106: Determine if the traversal is finished.

[0066] For step 106, determine if the traversal is finished, if yes, execute S109, otherwise execute S107.

[0067] S107: Determine if the member exists in the hashset.

[0068] For step 107, determine if the current member exists in the hashset, if yes, execute S106, otherwise execute S108.

[0069] S108: Insert the member into the hashset.

[0070] For step 108, the member that does not exist will be inserted into the hashset, and continue to traverse the next member. That is, for each target element, determine if the data set includes the target element; if the data set does not include the target element, insert the target element into the data set to obtain an updated data set.

[0071] S109: Encode the hashset.

[0072] For step 109, after the traversal is finished, the entire hashset is converted into a byteStream type. That is, after all target elements are processed, the updated data set is converted into the value in the target key-value pair data.

[0073] S110: Update the value of HetuKVItem.

[0074] For step 110, the converted byteStream hashset is updated to the value of HetuKVItem.

[0075] S111: Update HetuKV object using HetuKVItem.

[0076] For step 111, HetuKV is updated using HetuKVItem.

[0077] S112: Determine if the update is successful.

[0078] For step 112, determine if the update is successful, if yes, execute 113, if not, execute 114.

[0079] S113: Return the number of successfully inserted members.

[0080] For step 113, the number of successfully inserted members is returned.

[0081] S114: return error code

[0082] For step 114, S102 and S112 are entered when the operation fails, indicating that the operation is wrong and cannot be performed. At this time, the corresponding error code is returned and the operation is ended.

[0083] In an implementation mode, the target set type data includes a key of a to-be-processed key-value pair, and the target set operation type is a first query operation.

[0084] In this embodiment, the specific implementation mode of determining the target key-value pair data in the key-value database according to the target set type data can be:

[0085] If the key of the to-be-processed key-value pair conforms to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair.

[0086] It is judged whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0087] If the key-value pair data corresponding to the key-value pair class exists in the key-value database, the key-value pair data corresponding to the key-value pair class is taken as the target key-value pair data.

[0088] Correspondingly, the data processing on the target key-value pair data according to the data processing instruction corresponding to the target set operation type includes:

[0089] It is judged whether the value in the target key-value pair data is a null value.

[0090] If the value in the target key-value pair data is not a null value, the value in the target key-value pair data is converted into a data set.

[0091] The number of elements in the data set is determined.

[0092] The number of elements in the data set is taken as the data processing result corresponding to the data processing instruction.

[0093] Next, combined with Figure 3 illustration. As Figure 3 shown, the target set type data includes a key key of a to-be-processed key-value pair, and the target set operation type is a first query operation scard, that is, the number of elements of a set. Specifically, the following steps are included:

[0094] S201: receive a data processing instruction.

[0095] For step 201, a parameter key is accepted, indicating the key to be queried for aggregation. The target collection type data includes the key of the key-value pair to be processed, and the target collection operation type is the first query operation.

[0096] S202: determine whether the parameter is legal.

[0097] For step 202, it is determined whether the parameter is legal, wherein the key needs to satisfy the String type data (i.e., the preset string type is the String type), and the size of the key cannot exceed the maximum value defined by the key. If yes, S203 is executed, otherwise S210 is executed.

[0098] S203: initialize a HetuItem using the parameter.

[0099] For step 203, the legal parameter is passed here to initialize a HetuItem object. That is, the key-value pair class is generated using the key of the key-value pair to be processed.

[0100] S204: determine whether the key query is successful.

[0101] For step 204, the HetuItem is used to query the key-value pair corresponding to the key, and it is determined whether the query is successful. If yes, S205 is executed, otherwise S210 is executed.

[0102] S205: query the value of HetuKVItem.

[0103] For step 205, the value is extracted after the query is successful.

[0104] S206: determine whether the value is empty.

[0105] For step 206, it is determined whether the value is empty. If yes, S209 is executed, otherwise S207 is executed. It is determined whether the value in the target key-value pair data is empty.

[0106] S207: convert the value to a Set type.

[0107] For step 207, the non-empty value is converted to a set type. That is, if the value in the target key-value pair data is not empty, the value in the target key-value pair data is converted to a data set.

[0108] S208: return the number of Members.

[0109] For step 208, the number of elements in the set collection in the value is queried, and the value is returned after the operation is ended. That is, the number of elements in the data collection is determined; the number of elements in the data collection is taken as the data processing result corresponding to the data processing instruction.

[0110] S209: return "0".

[0111] For step 209, "0" is returned when the value is empty.

[0112] S210: return an error code.

[0113] For step 210, S202 and S206 are entered when the execution fails, indicating that the operation is wrong and cannot be performed. At this time, the corresponding error code is returned and the operation is ended.

[0114] In an implementation mode, the target collection type data includes a key of a to-be-processed key-value pair, and the target element, and the target collection operation type is a second query operation.

[0115] In this embodiment, the target key-value pair data in the key-value database is determined according to the target collection type data, including:

[0116] If the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair and the target element.

[0117] It is judged whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0118] If the key-value pair data corresponding to the key-value pair class exists in the key-value database, the key-value pair data corresponding to the key-value pair class is taken as the target key-value pair data.

[0119] Correspondingly, the target key-value pair data is subjected to the data processing corresponding to the target collection operation type, and the data processing result corresponding to the data processing instruction is obtained, including:

[0120] The value in the target key-value pair data is converted into a data collection.

[0121] It is judged whether the data collection includes the target element.

[0122] If the data collection includes the target element, the result that the data collection includes the target element is taken as the data processing result corresponding to the data processing instruction.

[0123] If the data set does not include the target element, the result that the data set does not include the target element is taken as the data processing result corresponding to the data processing instruction.

[0124] Next, an example is given to illustrate the present application. Figure 4 As shown in the figure, the target set type data includes the key key of the key-value pair to be processed and the target element member, and the target set operation type is the second query operation sismember, i.e., judging whether the element is stored in the data set corresponding to the key. Specifically, the following S is included: Figure 4

[0125] S301: Receiving parameters.

[0126] For step 301, two parameters key and member are received. Key is the key of the target set, and member is the element to be judged.

[0127] S302: Judging whether the parameters are legal.

[0128] For step 302, it is judged whether the parameters are legal. Key and member are both String type data, and the size of key should not exceed the maximum value defined by key. If yes, S303 is executed, otherwise S310 is executed.

[0129] S303: Initializing a HetuItem using the parameters.

[0130] For step 303, the legal parameters are passed here to initialize a HetuItem object.

[0131] S304: Judging whether HetuKVItem exists.

[0132] For step 304, it is judged whether the key-value pair corresponding to key exists in HetuKV using HetuKVItem. If yes, S305 is executed, otherwise S310 is executed.

[0133] S305: Querying the value of HetuKVItem.

[0134] For step 305, the value corresponding to key is extracted.

[0135] S306: Converting value to Set type.

[0136] For step 306, value is converted to Set type. That is, the value in the target key-value pair data is converted to a data set.

[0137] S307: Judging whether Member is included. ​

[0138] For step 307, it is judged whether there is an element member in Se. If yes, S308 is executed, otherwise S309 is executed.

[0139] S308: returns True.

[0140] For step 308, True is returned to end the operation, indicating that the member exists.

[0141] S309: returns False.

[0142] For step 309, False is returned to end the operation, indicating that the member does not exist.

[0143] S310: returns an error code.

[0144] For step 310, S302 and S304 are entered when the execution fails, indicating that the operation is wrong and cannot be performed. At this time, the corresponding error code is returned and the operation is ended.

[0145] In an implementation mode, the target set type data includes a key of a to-be-processed key-value pair, and the target element, and the target set operation type is a deletion operation.

[0146] In this embodiment, the target key-value pair data in the key-value database is determined according to the target set type data, including:

[0147] If the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair and the target element.

[0148] It is judged whether there is key-value pair data corresponding to the key-value pair class in the key-value database; wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0149] If there is key-value pair data corresponding to the key-value pair class in the key-value database, the key-value pair data corresponding to the key-value pair class is taken as the target key-value pair data.

[0150] Correspondingly, the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction, including:

[0151] The value in the target key-value pair data is converted into a data set.

[0152] For each target element, determine whether the data set includes the target element; if the data set includes the target element, delete the target element from the data set to obtain an updated data set;

[0153] After processing all target elements, convert the updated data set into the value in the target key-value pair data;

[0154] Determine that the data processing instruction corresponds to a data processing result of element deletion success, and the number of target elements deleted successfully as the data processing result corresponding to the data processing instruction.

[0155] Next, combined with Figure 5 Examples are given. As Figure 5 shown, the target set type data includes the key of the key-value pair to be processed, the target element, and the target set operation type is the delete operation srem, that is, deleting the specified element from the data set stored at key.

[0156] Specifically, the following steps are included:

[0157] S401: receiving parameters

[0158] For step 401, at least two parameters, key, members, are accepted. Key represents the key of the element set to be deleted, and member represents the element to be deleted.

[0159] S402: determining whether the parameters are legal

[0160] For step 402, determine whether the parameters are legal. Key and member are both String type data, and the size of key must not exceed the maximum value defined by key. If yes, execute S403, otherwise execute S413.

[0161] S403: initializing a HetuKVItem using parameters

[0162] For step 403, legal parameters will be passed here to initialize a HetuItem object.

[0163] S404: setting the key of HetuKVItem

[0164] For step 404, set the key of the HetuItem object to the input parameter.

[0165] S405: successfully querying the value corresponding to the key

[0166] For step 405, it is determined whether the key is in HetuKV through HetuItem. If yes, S406 is executed, otherwise S413 is executed.

[0167] S406: convert Value to Set type, count = 0

[0168] For step 406, the queried value is converted to set type, and the count is set to 0.

[0169] S407: traverse all Members

[0170] For step 407, it is determined whether all members are traversed. If yes, S410 is executed, otherwise S408 is executed.

[0171] S408: if the input Member is contained in the Set

[0172] For step 408, it is determined whether the input member is contained in the Set. If yes, S409 is executed, otherwise S407 is executed.

[0173] S409: delete the member, count + 1

[0174] For step 409, the member is deleted, and the count is set to +1.

[0175] S410: set the new Value value of HetuKVItem

[0176] For step 410, after the changed set is converted to value, the new value of HetuKVItem is set.

[0177] S411: update to the database through HetuKVItem

[0178] For step 411, HetuKVItem is updated to HetuKV.

[0179] S412: return the count

[0180] For step 412, the number of successfully deleted members is returned.

[0181] S413: return error code

[0182] For step 413, S402 and S405 are executed when the operation fails, indicating that the operation is wrong and cannot be performed. At this time, the corresponding error code is returned and the operation is ended.

[0183] In an implementation mode, the target set type data includes a key of a key-value pair to be processed, and the target set operation type is a third query operation.

[0184] In this embodiment, determining the target key-value pair data in the key-value database based on the target set type data includes:

[0185] If the key of the key-value pair to be processed conforms to a preset string type, and the key of the key-value pair to be processed meets a preset threshold condition, a key-value pair class is generated using the key of the key-value pair to be processed;

[0186] Determine whether key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the key-value pair to be processed;

[0187] If the key-value pair data corresponding to the key-value pair class exists in the key-value database, the key-value pair data corresponding to the key-value pair class is used as the target key-value pair data.

[0188] Accordingly, the step of performing data processing on the target key-value pair data corresponding to the target set operation type to obtain the data processing result corresponding to the data processing instruction includes:

[0189] Convert the values ​​in the target key-value pair data into a data set;

[0190] All elements in the data set are used as the data processing result corresponding to the data processing instruction.

[0191] Next, combine Figure 6 Provide examples. For instance... Figure 6 As shown, the target set type data includes the key of the key-value pair to be processed, and the target set operation type is the third query operation smembers, which counts all elements stored in the data set corresponding to the key.

[0192] Specifically, it includes the following steps:

[0193] S501: Receive parameters.

[0194] For step 501, the `key` parameter is accepted. It represents the key corresponding to the set to be queried.

[0195] S502: Determine if the parameter is valid.

[0196] For step 502, determine if the parameter is valid. The key must be of type String, and the size of the key cannot exceed the maximum value specified by kye. If valid, proceed to step S503; otherwise, proceed to step S509.

[0197] S503: Initialize a HetuKVItem using parameters.

[0198] For step 503, the legal parameter will be passed here to initialize a HetuItem object.

[0199] S504: Set the key of HetuKVItem.

[0200] For step 504, the key of HetuItem object is set as the input parameter.

[0201] S505: Judge whether HetuKVItem exists.

[0202] For step 505, it will be checked through HetuItem whether the key is in HetuKV. If yes, execute S506, otherwise execute S509.

[0203] S506: Query the value of HetuKVItem.

[0204] For step 506, the value corresponding to the key is extracted.

[0205] S507: Convert the value to Set type.

[0206] For step 507, the queried value is converted to set type.

[0207] S508: Return Set.

[0208] For step 508, Set is returned, indicating that the operation is successfully executed.

[0209] S509: Return error code.

[0210] For step 509, it is entered when S502 and S505 fail to execute, indicating that the operation is failed to perform. At this time, the corresponding error code will be returned and the operation will be ended.

[0211] As an example, when calling the HetuKV key-value database using a java client, a certain solid state disk is specified and locked, and after the call is completed, the memory occupied by the solid state disk is released, that is, the garbage collection mechanism of the HetuKV key-value database is used to release the memory occupied by the solid state disk in a timely manner. During the process of locking the solid state disk, other processes cannot use the solid state disk. In the embodiment, the data calculation is downgraded to the solid state disk, which can reduce the dependence on memory, and the garbage collection mechanism is used to optimize resource utilization, and the solid state disk is locked to ensure the safety and reliability of data, so that resource optimization and safety protection can be realized, that is, through the advantages of HetuKV, the resource utilization is optimized, the safety and reliability of data are ensured, the memory dependence is reduced, the hardware resource utilization is optimized, the memory consumption is reduced, the system is more flexible, in addition, the safety and control right are enhanced, the complete control right is provided, and the data safety is enhanced, and the data safety of enterprise-level application is ensured.

[0212] So far, the embodiment has realized the processing process of the data processing method in combination with a specific application scenario. Of course, it should be considered that the above-mentioned scenario is only an exemplary scenario and does not limit the method provided by the application. The method provided by the application can be applied in other data processing method processing processes of the same principle.

[0213] As shown in Figure 7 , it is a specific embodiment of the data processing apparatus described in the application. The apparatus described in the embodiment, that is, the entity apparatus for executing the method described in the above-mentioned embodiment. The technical scheme of the embodiment is essentially consistent with the above-mentioned embodiment, and the corresponding description in the above-mentioned embodiment is also applicable to the embodiment. In the embodiment, the apparatus is applied to the solid state disk corresponding to the key-value database. The apparatus comprises:

[0214] The first unit 701 is configured to receive at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and target set operation type;

[0215] The second unit 702 is configured to perform parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction respectively; wherein for each data processing instruction, the target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction;

[0216] The third unit 703 is configured to feed back the data processing result corresponding to each data processing instruction to the client.

[0217] Optionally, the target set type data includes a key of a to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation.

[0218] Optionally, the second unit 702 is specifically configured to:

[0219] If the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair and the target element.

[0220] It is determined whether the key-value database includes key-value pair data corresponding to the key-value pair class, wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0221] If the key-value database includes the key-value pair data corresponding to the key-value pair class, the key-value pair data corresponding to the key-value pair class is taken as target key-value pair data.

[0222] Optionally, the second unit 702 is specifically configured to:

[0223] The value in the target key-value pair data is converted into a data set.

[0224] For each target element, it is determined whether the data set includes the target element; if the data set does not include the target element, the target element is inserted into the data set to obtain an updated data set.

[0225] After processing all target elements, the updated data set is converted into the value in the target key-value pair data.

[0226] It is determined that the data processing result corresponding to the data processing instruction is element addition success, and the number of target elements added successfully is taken as the data processing result corresponding to the data processing instruction.

[0227] Optionally, the target set type data includes a key of a to-be-processed key-value pair, and the target set operation type is a first query operation.

[0228] Optionally, the second unit 702 is specifically configured to:

[0229] If the key of the to-be-processed key-value pair conforms to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair.

[0230] determining whether the key-value pair data corresponding to the key-value pair class exists in the key-value database, wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair;

[0231] if the key-value pair data corresponding to the key-value pair class exists in the key-value database, taking the key-value pair data corresponding to the key-value pair class as target key-value pair data.

[0232] Optionally, the second unit 702 is specifically configured to:

[0233] determining whether the value in the target key-value pair data is a null value;

[0234] if the value in the target key-value pair data is not a null value, converting the value in the target key-value pair data into a data set;

[0235] determining the number of elements in the data set;

[0236] taking the number of elements in the data set as the data processing result corresponding to the data processing instruction.

[0237] Optionally, the target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is a second query operation.

[0238] Optionally, the second unit 702 is specifically configured to:

[0239] if the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, generating a key-value pair class by using the key of the to-be-processed key-value pair and the target element;

[0240] determining whether the key-value pair data corresponding to the key-value pair class exists in the key-value database, wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair;

[0241] if the key-value pair data corresponding to the key-value pair class exists in the key-value database, taking the key-value pair data corresponding to the key-value pair class as target key-value pair data.

[0242] Optionally, the second unit 702 is specifically configured to:

[0243] convert the value in the target key-value pair data into a data set;

[0244] determining whether the data set includes the target element;

[0245] if the data set includes the target element, taking the result that the data set includes the target element as the data processing result corresponding to the data processing instruction;

[0246] If the data set does not include the target element, a result that the data set does not include the target element is taken as a data processing result corresponding to the data processing instruction.

[0247] Optionally, the target set type data includes a key of a to-be-processed key-value pair and a target element, and the target set operation type is a deletion operation.

[0248] Optionally, the second unit 702 is specifically configured to:

[0249] If the key of the to-be-processed key-value pair and the target element conform to a preset string type, and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair and the target element.

[0250] It is determined whether the key-value database includes key-value pair data corresponding to the key-value pair class, wherein a key in the key-value pair data is the same as the key of the to-be-processed key-value pair.

[0251] If the key-value database includes the key-value pair data corresponding to the key-value pair class, the key-value pair data corresponding to the key-value pair class is taken as target key-value pair data.

[0252] Optionally, the second unit 702 is specifically configured to:

[0253] The value in the target key-value pair data is converted into a data set.

[0254] For each target element, it is determined whether the data set includes the target element; if the data set includes the target element, the target element is deleted from the data set to obtain an updated data set.

[0255] After processing of all target elements is completed, the updated data set is converted into the value in the target key-value pair data.

[0256] It is determined that a data processing result corresponding to the data processing instruction is that an element is successfully deleted, and a number of target elements that are successfully deleted is taken as the data processing result corresponding to the data processing instruction.

[0257] Optionally, the target set type data includes a key of a to-be-processed key-value pair, and the target set operation type is a third query operation.

[0258] Optionally, the second unit 702 is specifically configured to:

[0259] If the key of the to-be-processed key-value pair conforms to a preset string type and the key of the to-be-processed key-value pair conforms to a preset threshold condition, a key-value pair class is generated by using the key of the to-be-processed key-value pair.

[0260] determining whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair;

[0261] if the key-value pair data corresponding to the key-value pair class exists in the key-value database, taking the key-value pair data corresponding to the key-value pair class as target key-value pair data.

[0262] Optionally, the second unit 702 is specifically configured to:

[0263] convert the value in the target key-value pair data into a data set;

[0264] take all elements in the data set as a data processing result corresponding to the data processing instruction.

[0265] Optionally, the client is a Java client, and the key-value database is a HetuKV key-value database.

[0266] Optionally, the apparatus further comprises a fourth unit configured to, before the step of receiving at least one data processing instruction sent by the client, perform the following steps:

[0267] receive a calling instruction sent by the client; wherein the calling instruction comprises a target solid state disk identifier;

[0268] call a solid state disk corresponding to the target solid state disk identifier according to the target solid state disk identifier, and take the solid state disk corresponding to the target solid state disk identifier as a solid state disk corresponding to the key-value database, and adjust the state of the solid state disk corresponding to the key-value database to a locked state.

[0269] The fourth unit is further configured to, after the step of feeding back the data processing result corresponding to each of the at least one data processing instruction to the client respectively, perform the following steps:

[0270] release the memory of the solid state disk corresponding to the key-value database, and adjust the state of the solid state disk corresponding to the key-value database to an idle state.

[0271] Figure 8is a structural schematic diagram of an electronic device provided by an embodiment of the present application. At the hardware level, the electronic device comprises a processor, and optionally further comprises an internal bus, a network interface, and a memory. The memory can contain a memory, such as a high-speed random-access memory (RAM), and can further comprise a non-volatile memory, such as at least one disk memory. Of course, the electronic device can further comprise other hardware required by a business.

[0272] The processor, the network interface, and the memory can be connected to each other through the internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 8 Only one bidirectional arrow is used to represent the internal bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0273] The memory is used to store execution instructions. Specifically, the execution instructions are computer programs that can be executed. The memory can comprise a memory and a non-volatile memory, and provide the processor with execution instructions and data.

[0274] In a possible implementation manner, the processor reads corresponding execution instructions from the non-volatile memory into the memory and then runs, and can also obtain corresponding execution instructions from other devices to form a data processing apparatus at the logical level. The processor executes the execution instructions stored in the memory to implement the data processing method provided in any embodiment of the present application through the executed execution instructions.

[0275] The above-mentioned data processing apparatus as the present application Figure 1The method executed by the data processing apparatus provided by the embodiment shown can be applied to a processor or implemented by the processor. The processor can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits in the hardware of the processor or instructions in the form of software. The processor mentioned above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor.

[0276] The steps of the method disclosed in the embodiment of the present application can be directly embodied as hardware decoding processor execution completion, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.

[0277] The embodiment of the present application further proposes a readable medium, which stores execution instructions. When the stored execution instructions are executed by the processor of an electronic device, the electronic device can execute the data processing method provided in any embodiment of the present application, and is specifically used to execute the method for data query.

[0278] The electronic device mentioned in each of the foregoing embodiments can be a computer.

[0279] Those skilled in the art should understand that the embodiments of the present application can be provided as a method or a computer program product. Therefore, the present application can adopt a complete hardware embodiment, a complete software embodiment, or a combination of software and hardware.

[0280] The various embodiments in the present application are described in a progressive manner, and the same or similar parts among the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.

[0281] It should also be noted that the terms "comprising", "comprising", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements not only includes those elements, but also includes other elements not explicitly listed, or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0282] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A data processing method, characterized by, The method is applied to a solid state disk corresponding to a coexistence key-value database, and the method comprises: receiving at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and a target set operation type; the client is a Java client; performing parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each of the at least one data processing instruction respectively; wherein for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; data processing corresponding to the target set operation type is performed on the target key-value pair data to obtain a data processing result corresponding to the data processing instruction; feeding back the data processing result corresponding to each of the at least one data processing instruction to the client respectively; wherein the key-value database is multi-core parallel, can enable multiple cores of a CPU, and each core processes a data processing instruction individually; the target set type data comprises a key of a key-value pair to be processed and a target element, and the target set operation type is a second query operation; the determination of the target key-value pair data in the key-value database according to the target set type data comprises: if the key of the key-value pair to be processed and the target element conform to a preset string type, and the key of the key-value pair to be processed conforms to a preset threshold condition, generating a key-value pair class by using the key of the key-value pair to be processed and the target element; judging whether there is key-value pair data corresponding to the key-value pair class in the key-value database; wherein the key in the key-value pair data is the same as the key of the key-value pair to be processed; if there is key-value pair data corresponding to the key-value pair class in the key-value database, taking the key-value pair data corresponding to the key-value pair class as the target key-value pair data; wherein the data processing corresponding to the target set operation type is performed on the target key-value pair data to obtain a data processing result corresponding to the data processing instruction, comprising: converting the value in the target key-value pair data into a data set; judging whether the data set comprises the target element; if the data set comprises the target element, taking a result that the data set comprises the target element as the data processing result corresponding to the data processing instruction; if the data set does not comprise the target element, taking a result that the data set does not comprise the target element as the data processing result corresponding to the data processing instruction; the target set type data comprises a key of a key-value pair to be processed, and the target set operation type is a third query operation; the determination of the target key-value pair data in the key-value database according to the target set type data comprises: if the key of the key-value pair to be processed conforms to a preset string type, and the key of the key-value pair to be processed conforms to a preset threshold condition, generating a key-value pair class by using the key of the key-value pair to be processed; determining whether the key-value pair data corresponding to the key-value pair class exists in the key-value database, wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair; if the key-value pair data corresponding to the key-value pair class exists in the key-value database, taking the key-value pair data corresponding to the key-value pair class as target key-value pair data; the data processing corresponding to the target set operation type is performed on the target key-value pair data to obtain a data processing result corresponding to the data processing instruction, including: converting the value in the target key-value pair data into a data set; taking all elements in the data set as the data processing result corresponding to the data processing instruction.

2. The method of claim 1, wherein, The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation.

3. The method of claim 2, wherein, The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation.

4. The method of claim 3, wherein, The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation.

5. The method of claim 1, wherein, The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation.

6. The method of claim 5, wherein, The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element, and the target set operation type is an element addition operation. The target set type data includes the key of the to-be-processed key-value pair and a target element 7. The method of claim 6, wherein, The data processing corresponding to the target set operation type is performed on the target key-value pair data, and a data processing result corresponding to the data processing instruction is obtained, including: determining whether the value in the target key-value pair data is a null value; if the value in the target key-value pair data is not a null value, converting the value in the target key-value pair data into a data set; determining the number of elements in the data set; the number of elements in the data set is used as the data processing result corresponding to the data processing instruction.

8. The method of claim 1, wherein, The target set type data includes the key of the key-value pair to be processed, and the target element, and the target set operation type is a deletion operation.

9. The method of claim 8, wherein, The target key-value pair data in the key-value database is determined according to the target set type data, including: if the key of the key-value pair to be processed and the target element meet the preset string type, and the key of the key-value pair to be processed meets the preset threshold condition, a key-value pair class is generated using the key of the key-value pair to be processed and the target element; determining whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the key-value pair to be processed; if the key-value pair data corresponding to the key-value pair class exists in the key-value database, the key-value pair data corresponding to the key-value pair class is used as the target key-value pair data.

10. The method of claim 9, wherein, The data processing corresponding to the target set operation type is performed on the target key-value pair data, and a data processing result corresponding to the data processing instruction is obtained, including: the value in the target key-value pair data is converted into a data set; for each target element, it is determined whether the data set includes the target element; if the data set includes the target element, the target element is deleted from the data set to obtain an updated data set; after processing all target elements, the updated data set is converted into the value in the target key-value pair data; the data processing result corresponding to the data processing instruction is determined to be an element deletion success, and the number of target elements that are successfully deleted is used as the data processing result corresponding to the data processing instruction.

11. The method of any one of claims 1-10, wherein, Before the step of receiving at least one data processing instruction sent by the client, the method further includes: receiving a calling instruction sent by the client; wherein the calling instruction includes a target solid state disk identifier; calling a solid state disk corresponding to the target solid state disk identifier according to the target solid state disk identifier, and using the solid state disk corresponding to the target solid state disk identifier as the solid state disk corresponding to the key-value database, and adjusting the state of the solid state disk corresponding to the key-value database to a locked state.

12. The method of claim 11, wherein, After the step of feeding back the data processing result corresponding to each of the at least one data processing instruction to the client, the method further includes: releasing the memory of the solid state disk corresponding to the key-value database, and adjusting the state of the solid state disk corresponding to the key-value database to an idle state.

13. A data processing apparatus, characterized by: The device is applied to a solid state disk corresponding to a key-value database, and the key-value database is multi-core parallel, and can enable multiple cores of a CPU, each core processes a data processing instruction individually, and the device comprises: A first unit configured to receive at least one data processing instruction sent by a client; wherein each data processing instruction comprises target set type data and target set operation type; the client is a Java client; A second unit configured to perform parallel data processing on the at least one data processing instruction to obtain a data processing result corresponding to each data processing instruction respectively; wherein for each data processing instruction, target key-value pair data in the key-value database is determined according to the target set type data, wherein each key-value pair data in the key-value database comprises a key and at least one value, each value comprises at least one data set, and each data set comprises at least one element; the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction; the target set type data comprises a key of a key-value pair to be processed and a target element, and the target set operation type is a second query operation; the target key-value pair data in the key-value database is determined according to the target set type data, comprising: if the key of the key-value pair to be processed and the target element meet a preset string type, and the key of the key-value pair to be processed meets a preset threshold condition, a key-value pair class is generated by using the key of the key-value pair to be processed and the target element; it is judged whether the key-value pair data corresponding to the key-value pair class exists in the key-value database; wherein the key in the key-value pair data is the same as the key of the key-value pair to be processed; if the key-value pair data corresponding to the key-value pair class exists in the key-value database, the key-value pair data corresponding to the key-value pair class is taken as the target key-value pair data; wherein the target key-value pair data is subjected to data processing corresponding to the target set operation type to obtain a data processing result corresponding to the data processing instruction, comprising: converting the value in the target key-value pair data into a data set; It is judged whether the data set comprises the target element; if the data set comprises the target element, a result that the data set comprises the target element is taken as the data processing result corresponding to the data processing instruction; if the data set does not comprise the target element, a result that the data set does not comprise the target element is taken as the data processing result corresponding to the data processing instruction; The target set type data comprises a key of a key-value pair to be processed, and the target set operation type is a third query operation; The determining the target key-value pair data in the key-value database according to the target set type data comprises: if the key of the to-be-processed key-value pair conforms to a preset string type and the key of the to-be-processed key-value pair conforms to a preset threshold condition, generating a key-value pair class by using the key of the to-be-processed key-value pair; determining whether the key-value database contains key-value pair data corresponding to the key-value pair class; wherein the key in the key-value pair data is the same as the key of the to-be-processed key-value pair; if the key-value database contains the key-value pair data corresponding to the key-value pair class, taking the key-value pair data corresponding to the key-value pair class as the target key-value pair data; the data processing corresponding to the target set operation type on the target key-value pair data to obtain the data processing result corresponding to the data processing instruction comprises: converting the value in the target key-value pair data into a data set; and taking all elements in the data set as the data processing result corresponding to the data processing instruction. The third unit is configured to feed back the data processing result corresponding to each of the at least one data processing instruction to the client. 14.A readable medium comprising an execution instruction, when a processor of an electronic device executes the execution instruction, the electronic device performs the method according to any one of claims 1 to 12. 15.An electronic device comprising a processor and a memory storing an execution instruction, when the processor executes the execution instruction stored in the memory, the processor performs the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • KV database data management method and device, computing equipment and storage medium

    CN114328453A

  • Data query method and related device

    CN116955421A