A data processing method and device, electronic equipment and storage medium
By allocating multiple data groups to the data structure of electronic devices, with each group corresponding to a different lock, the problem of sequential operation of multiple data processing is solved, achieving concurrent processing and efficiency improvement.
Patent Information
- Application Number
- CN202111591942.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2041-12-23
AI Technical Summary
In the prior art, when electronic devices process multiple data sets, they share a single lock, which requires the operations to be performed sequentially, thus reducing data processing efficiency.
By dividing the data structure into multiple data groups, each corresponding to a different lock, electronic devices can concurrently process requests from different data groups, acquire the target lock, and perform corresponding operations.
It enables concurrent processing of multiple data processing requests, improving data processing efficiency and accuracy while reducing memory usage and management overhead.
Smart Images

Figure CN114416384B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data processing method and device, electronic equipment and storage medium. BACKGROUND
[0002] At present, when data needs to be processed or operated, a lock needs to be acquired, and the data can be operated in the case that the lock is acquired.
[0003] However, in the above method, the number of locks can be only one, that is, all data processing processes share one lock. Therefore, when the electronic equipment needs to operate multiple data, it needs to operate one by one. For example, after the operation of the first data is completed, the lock is released (which can also be understood as being unlocked), and then the related operation of the second data can be completed, which causes multiple data to be unable to be processed in time and reduces the efficiency of data processing. SUMMARY
[0004] The present disclosure provides a data processing method and device, electronic equipment and storage medium, which solves the technical problem that when the electronic equipment needs to process multiple data, it needs to operate one by one, multiple data cannot be processed in time, and the efficiency of data processing is reduced.
[0005] The technical scheme of the embodiment of the present disclosure is as follows:
[0006] According to a first aspect of the embodiment of the present disclosure, a data processing method is provided. The method can include: in response to a first processing request, the first processing request including first keyword information corresponding to a first to-be-processed element, the first processing request being used to request a preset operation on the first keyword information; acquiring a target lock according to the first to-be-processed element, the first to-be-processed element being one of at least one element in a first data structure, the target lock being a lock corresponding to a target data group, and the target data group being a data group to which the first data structure belongs; and executing the first processing request based on the target lock.
[0007] Optionally, the acquiring the target lock according to the first to-be-processed element specifically includes: determining the first data structure according to the first to-be-processed element; performing a hash transformation on the name of the first data structure to obtain a target hash value; and determining the target data group according to the target hash value and acquiring the lock corresponding to the target data group.
[0008] Optionally, the executing the first processing request based on the target lock specifically includes: performing a copy processing on the first data structure to obtain a second data structure; and performing the preset operation on the first to-be-processed element based on the target lock and the second data structure.
[0009] Optionally, the preset operation is an insertion operation, and the copying of the first data structure to obtain the second data structure specifically includes: determining a position of the first to-be-processed element in the first data structure; determining a to-be-processed path according to the position of the first to-be-processed element in the first data structure and a position of a root node in the first data structure, the to-be-processed path being a path in which a start position is the position of the root node and an end position is a position of a to-be-processed node, the path being a path included in the first data structure, and the to-be-processed node being a node corresponding to the first to-be-processed element; copying at least one node included in the to-be-processed path and merging other nodes to obtain the second data structure, the other nodes being nodes other than the at least one node in a plurality of nodes, and the plurality of nodes being nodes included in the first data structure.
[0010] Optionally, the data processing method further includes: determining a reference count of each node in a plurality of nodes included in the first data structure; and releasing the first data structure when the reference count of the each node is 0.
[0011] Optionally, the preset operation is an insertion operation, and the data processing method further includes: determining a current data size corresponding to a to-be-processed node, the current data size corresponding to the to-be-processed node being a sum of data size of at least one element currently stored in the to-be-processed node, and the to-be-processed node being a node corresponding to the first to-be-processed element; and inserting the first to-be-processed element into the to-be-processed node when a sum of the data size of the first to-be-processed element and the current data size corresponding to the to-be-processed node is less than or equal to a data size threshold.
[0012] Optionally, the data processing method further includes: in response to the first processing request, responding to at least one second processing request, each second processing request including second keyword information corresponding to a second to-be-processed element, the second to-be-processed element being one of at least one element in a second data structure; determining whether a data group to which the second data structure belongs is the target data group; and concurrently processing the first processing request and the at least one second processing request when the data group to which the second data structure belongs is not the target data group.
[0013] Optionally, the preset operation corresponding to the first processing request is an insertion operation, and the target second processing request is one of the at least one second processing request. The data processing method further includes: when the data group to which the second data structure belongs is the target data group, determining whether a preset operation corresponding to the target second processing request is a query operation; and concurrently processing the first processing request and the target second processing request when the preset operation corresponding to the target second processing request is the query operation.
[0014] According to a second aspect of the embodiments of the present disclosure, a data processing apparatus is provided. The apparatus can include a response module, an obtaining module and a processing module. The response module is configured to respond to a first processing request, the first processing request including first keyword information corresponding to a first to-be-processed element, the first processing request being used to request a preset operation on the first keyword information. The obtaining module is configured to obtain the first to-be-processed element according to the first to-be-processed element, the first to-be-processed element being one of at least one element in a first data structure, the target lock being a lock corresponding to a target data group, and the target data group being a data group to which the first data structure belongs. The processing module is configured to perform the first processing request based on the target lock.
[0015] Optionally, the data processing apparatus further includes a determining module. The determining module is configured to determine the first data structure according to the first to-be-processed element. The processing module is further configured to perform a hash transformation on a name of the first data structure to obtain a target hash value. The determining module is further configured to determine the target data group according to the target hash value. The obtaining module is specifically configured to obtain the lock corresponding to the target data group.
[0016] Optionally, the processing module is specifically configured to perform a copy processing on the first data structure to obtain a second data structure. The processing module is specifically further configured to perform the preset operation on the first to-be-processed element based on the target lock and the second data structure.
[0017] Optionally, the preset operation is an insertion operation. The determining module is configured to determine a position of the first to-be-processed element in the first data structure. The determining module is further configured to determine a to-be-processed path according to the position of the first to-be-processed element in the first data structure and a position of a root node in the first data structure, the to-be-processed path being a path in which a start position is the position of the root node and an end position is a position of a to-be-processed node, the path being a path included in the first data structure, and the to-be-processed node being a node corresponding to the first to-be-processed element. The processing module is specifically further configured to copy at least one node included in the to-be-processed path and merge other nodes to obtain the second data structure, the other nodes being nodes other than the at least one node in a plurality of nodes, and the plurality of nodes being nodes included in the first data structure.
[0018] Optionally, the determining module is configured to determine a reference count of each node in a plurality of nodes included in the first data structure. The processing module is further configured to release the first data structure when the reference count of the each node is 0.
[0019] Optionally, the preset operation is an insertion operation; the determining module is configured to determine a current data size corresponding to a to-be-processed node, the current data size corresponding to the to-be-processed node being a sum of data sizes of at least one element currently stored in the to-be-processed node, the to-be-processed node being a node corresponding to the first to-be-processed element; and the processing module is further configured to insert the first to-be-processed element into the to-be-processed node when a sum of the data size of the first to-be-processed element and the current data size corresponding to the to-be-processed node is less than or equal to the data size threshold.
[0020] Optionally, the response module is further configured to, while responding to the first processing request, also respond to at least one second processing request, each second processing request including second keyword information corresponding to a second to-be-processed element, the second to-be-processed element being one of at least one element in a second data structure; the determining module is configured to determine whether a data group to which the second data structure belongs is the target data group; and the processing module is further configured to, when the data group to which the second data structure belongs is not the target data group, concurrently process the first processing request and the at least one second processing request.
[0021] Optionally, the preset operation corresponding to the first processing request is an insertion operation, and a target second processing request is one of the at least one second processing request; the determining module is further configured to, when the data group to which the second data structure belongs is the target data group, determine whether a preset operation corresponding to the target second processing request is a query operation; and the processing module is further configured to, when the preset operation corresponding to the target second processing request is the query operation, concurrently process the first processing request and the target second processing request.
[0022] According to a third aspect of embodiments of the present disclosure, an electronic device can include a processor and a memory configured to store processor-executable instructions; and wherein the processor is configured to execute the instructions to implement any of the optional data processing methods of the first aspect.
[0023] According to a fourth aspect of embodiments of the present disclosure, a computer-readable storage medium is provided, and the computer-readable storage medium stores instructions, and when the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to perform any of the optional data processing methods of the first aspect.
[0024] According to a fifth aspect of embodiments of the present disclosure, a computer program product is provided, and the computer program product includes computer instructions, and when the computer instructions are run on an electronic device, the electronic device performs any of the optional data processing methods of the first aspect.
[0025] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0026] Based on any of the above aspects, in the present disclosure, the electronic device can respond to the first processing request, and acquire a target lock according to the first to-be-processed element; and then the electronic device executes the first processing request based on the target lock. In the embodiments of the present disclosure, since each data group in the plurality of data groups can correspond to a different lock, and the target lock is the lock corresponding to the target data group (which can be understood as one data group in the plurality of data groups), when the electronic device needs to process different processing requests (specifically, process the keyword information or elements corresponding to different data groups), the electronic device can acquire the locks corresponding to the different data groups respectively, without affecting each other, and can concurrently process the different processing requests, thereby improving the efficiency of data processing.
[0027] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure, and do not constitute an improper limitation on the present disclosure.
[0029] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure is shown;
[0030] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0031] Figure 3 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0032] Figure 4 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0033] Figure 5 A schematic diagram of a copy operation on a first data structure provided by an embodiment of the present disclosure is shown;
[0034] Figure 6 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0035] Figure 7 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0036] Figure 8 A schematic diagram of inserting an element into a node provided by an embodiment of the present disclosure is shown;
[0037] Figure 9 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0038] Figure 10 A flowchart of another data processing method provided by an embodiment of the present disclosure is shown;
[0039] Figure 11 A structural diagram of a data processing apparatus provided by an embodiment of the present disclosure is shown;
[0040] Figure 12 A structural diagram of another data processing apparatus provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0041] In order to make the ordinary person in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below in conjunction with the drawings.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0043] It should also be understood that the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or components.
[0044] The data involved in the present disclosure can be data authorized by the user or sufficiently authorized by all parties.
[0045] As described in the background, since the number of locks in the prior art is only 1. When the electronic device needs to perform processing operations on multiple data, it needs to be operated one by one, and the multiple data cannot be processed in time, reducing the efficiency of data processing. Based on this, the embodiment of the present disclosure provides a data processing method, since each data group in the multiple data groups can correspond to a different lock, and the target lock is the lock corresponding to the target data group (which can be understood as one of the multiple data groups), when the electronic device needs to process different processing requests (specifically, process the keyword information or elements corresponding to different data groups), the lock corresponding to each of the different data groups can be obtained respectively, without affecting each other, and the different processing requests can be processed concurrently, improving the efficiency of data processing.
[0046] The data processing method, apparatus, electronic device and storage medium provided by the embodiment of the present disclosure are applied to the scene of operating and storing data. When the electronic device responds to a first processing request, the first processing request can be executed based on a target lock according to the method provided by the embodiment of the present disclosure.
[0047] The data processing method provided by the embodiment of the present disclosure is exemplarily described below in combination with the drawings:
[0048] As shown in Figure 1 The data processing method provided by the embodiment of the present disclosure can include S101-S103.
[0049] S101, the electronic device responds to a first processing request.
[0050] The first processing request includes first keyword information, the first keyword information corresponds to a first to-be-processed element, and the first processing request is used to request a preset operation on the first keyword information.
[0051] It should be understood that one element (for example, the first to-be-processed element) can correspond to one keyword information (key) and one value (value), that is, one element corresponds to one key-value pair.
[0052] In an implementation manner of the embodiment of the present disclosure, the preset operation can be a query operation, an insertion operation, an update operation or a deletion operation, etc. The query operation is used to query the value corresponding to a certain keyword information, the insertion operation is used to insert (or add) a certain keyword information (or an element corresponding to the keyword information) in a certain data structure, the update operation is used to update the value corresponding to a certain keyword, and the deletion operation is used to delete a certain keyword (or an element corresponding to the keyword).
[0053] S102, the electronic device acquires a target lock according to the first to-be-processed element.
[0054] The first to-be-processed element is one of at least one element in the first data structure, the target lock is a lock corresponding to a target data group, and the target data group is a data group to which the first data structure belongs.
[0055] It can be understood that one data structure (for example, the first data structure) can include at least one element. When a certain element (for example, the first to-be-processed element) is an element in the first data structure, the electronic device can acquire a lock corresponding to a target data group to which the first data structure belongs.
[0056] In the embodiments of the present disclosure, the electronic device can divide all data structures into a plurality of data groups, and each data group in the plurality of data groups can include at least one data structure. When the electronic device responds to a first processing request, the electronic device can determine a first to-be-processed element corresponding to first keyword information included in the first processing request, and then determine a data structure (that is, the first data structure) to which the first to-be-processed element belongs. Then, the electronic device can determine a data group (that is, the target data group) to which the first data structure belongs (or corresponds). In this way, the electronic device can acquire the target lock, specifically, a lock corresponding to the target data group.
[0057] S103, the electronic device performs the first processing request based on the target lock.
[0058] It should be understood that the electronic device performing the first processing request is to perform a preset operation on the above-mentioned first keyword information (or a first to-be-processed element corresponding to the first keyword).
[0059] In an implementation manner of the embodiments of the present disclosure, each data group in the above-mentioned plurality of data groups can correspond to two locks, one write lock and one value lock. When the above-mentioned preset operation is a query operation, the target lock acquired by the electronic device is a value lock corresponding to the target data group. After acquiring the value lock corresponding to the target data group, the electronic device can perform a query operation on the first to-be-processed element (or first keyword information corresponding to the first to-be-processed element) based on the value lock corresponding to the target data group. When the preset operation is an insertion operation, the target lock acquired by the electronic device is a write lock corresponding to the target data group. After acquiring the write lock corresponding to the target data group, the electronic device can perform an insertion operation on the first to-be-processed element (or the first keyword information) based on the write lock corresponding to the target data group.
[0060] It should be understood that since each data group can correspond to two locks, when the electronic device needs to perform two different preset operations (for example, a query operation and an insertion operation) on a to-be-processed element (or a keyword information) at the same time, the two different preset operations can be performed concurrently without affecting each other, which can improve the efficiency of data processing.
[0061] The technical solutions provided by the above embodiments can bring at least the following beneficial effects: as can be known from S101-S103, the electronic device can respond to the first processing request and acquire a target lock according to a first to-be-processed element; and then the electronic device executes the first processing request based on the target lock. In the embodiments of the present disclosure, each data group in the plurality of data groups can correspond to a different lock, and the target lock is the lock corresponding to a target data group (which can be understood as one data group in the plurality of data groups). When the electronic device needs to process different processing requests (specifically, process keyword information or elements corresponding to different data groups), the electronic device can acquire the locks corresponding to the different data groups respectively, without affecting each other, and can concurrently process the different processing requests, thereby improving the efficiency of data processing.
[0062] In combination Figure 1 As Figure 2 shown, in an implementation manner of the embodiments of the present disclosure, acquiring the target lock according to the first to-be-processed element specifically includes S1021-S1023.
[0063] S1021, the electronic device determines a first data structure according to the first to-be-processed element.
[0064] Specifically, the electronic device can store a plurality of data structures and a corresponding relationship of elements corresponding to the plurality of data structures. After the electronic device acquires the first keyword information, the electronic device can determine a first to-be-processed element corresponding to the first keyword information, and determine a data structure corresponding to the first to-be-processed element from the plurality of data structures based on the corresponding relationship, that is, the first data structure.
[0065] S1022, the electronic device performs hash transformation on the name of the first data structure to obtain a target hash value.
[0066] It should be understood that the target hash value is a hash value corresponding to the first data structure, and the electronic device can perform hash transformation on the names of the plurality of data structures to obtain hash values corresponding to the plurality of data structures respectively, and then distribute the plurality of data structures into a plurality of data groups.
[0067] In the embodiments of the present disclosure, one data structure can be understood as one ImmutZipMap. The electronic device distributes the plurality of data structures into the plurality of data groups, which can also be understood as distributing a plurality of slots to the plurality of ImmutZipMaps, specifically, distributing each ImmutZipMap in the plurality of ImmutZipMaps into a slot corresponding to the ImmutZipMap.
[0068] S1023, the electronic device determines a target data group according to the target hash value, and acquires a lock corresponding to the target data group.
[0069] In one implementation of this disclosure, the electronic device can determine the target data group by taking the modulo of the target hash value and the number of the plurality of data groups. Then, the electronic device can acquire the lock corresponding to the target data group, i.e., obtain the target lock.
[0070] At this point, the electronic device can determine the hash value corresponding to each of the multiple data structures and access the data group corresponding to each data structure. Furthermore, when the electronic device obtains the key corresponding to a certain element, it can determine the data structure corresponding to that key and the data group corresponding to that data structure; then, it can acquire the lock corresponding to that data group.
[0071] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S1021-S1023, the electronic device can determine a first data structure based on the first element to be processed, and perform a hash transformation on the name of the first data structure to obtain a target hash value (i.e., the hash value corresponding to the first data structure). Then, based on the target hash value, it can determine a target data group and acquire the lock corresponding to the target data group. In this embodiment of the present disclosure, the electronic device can determine the hash value corresponding to each data structure in multiple data structures, thereby determining the data group corresponding to each data structure and acquiring the lock corresponding to the relevant data group. It can accurately determine the lock used to perform preset operations on keyword information (or element to be processed), thereby improving the accuracy of data processing.
[0072] Combination Figure 1 ,like Figure 3 As shown, in one implementation of this disclosure, the first processing request is executed based on the target lock, including S1031-S1032.
[0073] S1031. The electronic device copies the first data structure to obtain the second data structure.
[0074] In one implementation of this disclosure, the electronic device can completely copy the first data structure, that is, the resulting second data structure is the same as the first data structure.
[0075] In another implementation of the embodiments of this disclosure, the electronic device may also copy a portion of the first data structure, thereby obtaining a second data structure that is different from the first data structure.
[0076] S1032. The electronic device performs a preset operation on the first element to be processed based on the target lock and the second data structure.
[0077] It should be understood that the electronic device performs a preset operation on the first element to be processed based on the target lock and the second data structure, that is, it performs a preset operation on the second data structure based on the target lock. Specifically, it performs the preset operation on the first element to be processed in the second data structure. The electronic device's preset operation on the first element to be processed can also be understood as performing a preset operation on the aforementioned first keyword information.
[0078] It is understandable that during the preset operation of the first element to be processed (or the first keyword information), the electronic device does not need to perform related processing operations in the original data structure (i.e., the first data structure). Instead, it can directly perform related processing operations in the data structure obtained after copying (i.e., the second data structure). This allows the generation of a new data structure to process the corresponding element (or keyword information) while ensuring that the original data structure remains unchanged.
[0079] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S1031-S1032, the electronic device can copy the first data structure to obtain a second data structure; and based on the target lock and the second data structure, a preset operation is performed on the first element to be processed. In this embodiment of the present disclosure, since the second data structure is obtained by copying the first data structure, the processing (i.e., preset operation) of the first element to be processed can be completed based on the newly generated data structure while ensuring that the original data structure does not change, thereby improving the effectiveness of data processing.
[0080] Combination Figure 3 ,like Figure 4 As shown, in one implementation of this disclosure, the preset operation is an insertion operation, and the copying of the first data structure to obtain the second data structure includes S1031a-S1031c.
[0081] S1031a, The electronic device determines the position of the first element to be processed in the first data structure.
[0082] Based on the description of the above embodiments, it should be understood that the first data structure may include at least one element. The electronic device can determine the position of the first element to be processed in the first data structure based on the first keyword information corresponding to the first element to be processed and the keyword information corresponding to each element in the at least one element.
[0083] Specifically, if the keyword information corresponding to the first element to be processed is less than the keyword information corresponding to a certain element, then the first element to be processed should be placed to the lower left of that element; if the keyword information corresponding to the first element to be processed is greater than the keyword information corresponding to that element, then the first element to be processed should be placed to the lower right of that element.
[0084] S1031b, the electronic device determines a to-be-processed path according to the position of the first to-be-processed element in the first data structure and the position of the root node in the first data structure.
[0085] The to-be-processed path is a path whose start position is the position of the root node and whose end position is the position of the to-be-processed node in a plurality of paths, the plurality of paths are paths included in the first data structure, and the to-be-processed node is a node corresponding to the first to-be-processed element.
[0086] It can be understood that the electronic device can determine the to-be-processed path from the plurality of paths according to the position of the first to-be-processed element in the first data structure and the position of the root node in the first data structure.
[0087] It should be understood that the position of the first to-be-processed element in the first data structure is the position of the to-be-processed node in the first data structure. In an optional implementation, one node can correspond to (or include) one element.
[0088] S1031c, the electronic device copies at least one node included in the to-be-processed path and merges other nodes to obtain a second data structure.
[0089] The other nodes are nodes other than the at least one node in a plurality of nodes, and the plurality of nodes are nodes included in the first data structure.
[0090] It should be understood that the electronic device can only copy the nodes included in the to-be-processed path and combine the other nodes to generate the second data structure.
[0091] It can be understood that when the electronic device copies the nodes included in the to-be-processed path (i.e., the at least one node), it also copies the links included in the to-be-processed path.
[0092] For example, the to-be-processed path includes a node A and a node B, and the node A and the node B are connected by a link A-B. When the electronic device copies the node A and the node B, it also copies the link A-B. Figure 5As shown, the first data structure includes 8 nodes (i.e., node 101, node 102, node 103, node 104, node 105, node 106, node 107, and node 108), and the key information of the elements corresponding to the 8 nodes is 6, 4, 7, 1, 5, 9, 3, and 8 respectively. Assuming that the key corresponding to the first to-be-processed element is 2, the electronic device determines that the position of the first to-be-processed element (or to-be-processed node) in the first data structure is the lower left of node 103 (i.e., the key information is 4). Since the root node in the first data structure is node 101 (i.e., the key information is 6), the electronic device determines that the to-be-processed path includes node 101, node 103, and the to-be-processed node (i.e., the key information is 2), the electronic device copies node 101, node 102, and the to-be-processed node to obtain node 201, node 202, and node 203 respectively, and then merges node 103, node 104, node 105, node 106, node 107, and node 108, that is, the second data structure can be obtained.
[0093] The technical solutions provided by the above embodiments can bring at least the following beneficial effects: as can be seen from S1031a-S1031c, the electronic device can determine the position of the first to-be-processed element in the first data structure, and determine the to-be-processed path according to the position of the first to-be-processed element in the first data structure and the position of the root node in the first data structure; then the electronic device copies at least one node included in the to-be-processed path and merges other nodes to obtain the second data structure. In the embodiments of the present disclosure, since the at least one node included in the to-be-processed path is a node that needs to be copied and will affect the to-be-processed node (i.e., the node corresponding to the first to-be-processed element), only the at least one node needs to be copied, and the second data structure can be obtained by combining other nodes (i.e., the remaining nodes in the original first data structure). The newly generated data structure can be reasonably and effectively obtained, and the effectiveness of data processing can be improved.
[0094] In an implementation manner of the embodiments of the present disclosure, the preset operation is a query operation, and the copying processing of the first data structure to obtain the second data structure includes S1031e.
[0095] S1031e, the electronic device copies each node in the plurality of nodes to obtain the second data structure.
[0096] The plurality of nodes are nodes included in the first data structure.
[0097] It should be understood that the electronic device also copies each edge included in the first data structure in the process of obtaining the second data structure, that is, the second data structure is the same as the first data structure.
[0098] In combination withFigure 1 As shown in Figure 6 The data processing method provided by the embodiments of the present disclosure further includes S104-S105.
[0099] S104, the electronic device determines the reference count of each node in the plurality of nodes included in the first data structure.
[0100] It should be understood that the reference count of a node represents the number of times the node is being used. For example, when the reference count of a node is 2, it means that the node is being used 2 times, for example, the node can be used for query operation and update operation at the same time.
[0101] S105, when the reference count of each node in the plurality of nodes is 0, the electronic device releases the first data structure.
[0102] It can be understood that when the reference count of a node in the plurality of nodes is 0, it means that the node is not currently used, and the electronic device can release the node (which can also be understood as deleting the node) to improve the memory of the electronic device. When the reference count of each node in the plurality of nodes is 0, it means that the plurality of nodes are not currently used, and the electronic device can release the plurality of nodes, that is, release the first data structure (which can also be understood as deleting the first data structure), to improve the memory of the electronic device.
[0103] The technical solutions provided by the above embodiments can at least bring the following beneficial effects: as can be seen from S104-S105, the electronic device can determine the reference count of each node in the plurality of nodes included in the first data structure; since the reference count of a node represents the number of times the node is being used; when the reference count of each node in the plurality of nodes is 0, it means that the plurality of nodes are not currently used. Therefore, the electronic device can release the first data structure, which can improve the memory of the electronic device and improve the processing performance.
[0104] In combination with Figure 1 As shown in Figure 7 In one implementation provided by the embodiments of the present disclosure, the above-mentioned preset operation is an insertion operation, and the data processing method provided by the embodiments of the present disclosure further includes S106-S107.
[0105] S106, the electronic device determines the data size currently corresponding to the to-be-processed node.
[0106] The data size currently corresponding to the to-be-processed node is the sum of the data size of at least one element currently stored in the to-be-processed node, and the to-be-processed node is the node corresponding to the first to-be-processed element.
[0107] It should be understood that the data size corresponding to the to-be-processed node currently represents the data size currently used by the to-be-processed node. When the currently used data size is small, the electronic device can insert (or add) other elements in the to-be-processed node; when the currently used data size is large, the electronic device can insert other elements in other nodes.
[0108] In S107, when the sum of the data size of the first to-be-processed element and the data size corresponding to the to-be-processed node is less than or equal to the data size threshold, the electronic device inserts the first to-be-processed element into the to-be-processed node.
[0109] It can be understood that when the sum of the data size of the first to-be-processed element and the data size corresponding to the to-be-processed node is less than or equal to the data size threshold, it means that the data size corresponding to the to-be-processed node is small, and the sum of the data size of the first to-be-processed element and the data size corresponding to the to-be-processed node will not exceed the maximum data size of a node (i.e., the data size threshold). Therefore, the electronic device can insert the first to-be-processed element into the to-be-processed node to reduce the storage space of the first data structure.
[0110] Optionally, the data size threshold can be 1024B (bytes) or 2048B.
[0111] For example, as shown in FIG. 3, the first data structure includes 7 nodes (each node corresponds to one element), including node 301, node 302, node 303, node 304, node 305, node 306, and node 307. The key information corresponding to the elements of the 7 nodes is 10, 3, 14, 5, 11, 19, and 18 respectively. If the first to-be-processed element is one of the 7 keys, the electronic device can obtain a target data structure as shown in FIG. 4. Figure 8 Figure 8 Specifically, the target data structure includes 3 nodes, i.e., node 401, node 402, and node 403. Node 401 includes 2 elements: “10” and “11”; node 402 includes 2 elements: “3” and “5”; and node 403 includes 3 elements: “14”, “18”, and “19”. The data size currently corresponding to each of the 3 nodes is less than the data size threshold.
[0112] It should be noted that for a data structure including 7 nodes (for example, the first data structure shown in FIG. 3), the data size corresponding to each node is less than the data size threshold. Figure 8 From the user's perspective, the data size of the first data structure (in the example above) is 7 * 4 B = 28 B. In reality, for each node, the space consumed includes the data size occupied by two pointers (2 * 8 B), the data size of the reference count (8 B), the node height (8 B), and the stored integer (4 B). Thus, the actual space occupied by the first data structure is magnified by 900%, resulting in significant management overhead. In this embodiment of the disclosure, the electronic device adds at least one element to a node (e.g., Figure 8 The target data structure in the system can reduce management overhead, reduce memory usage, and improve the processing performance of electronic devices.
[0113] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S106-S107, the electronic device can determine the current data size corresponding to the node to be processed. When the sum of the data size of the first element to be processed and the data size corresponding to the node to be processed is less than or equal to the data size threshold, it indicates that the current data size corresponding to the node to be processed is small, and inserting the first element to be processed into the node to be processed will not exceed the maximum data size of a node. In this way, the electronic device can insert the first element to be processed into the node to be processed, which can reduce the management overhead of the data structure, reduce the memory of the electronic device, and improve the data processing efficiency.
[0114] Combination Figure 1 ,like Figure 9 As shown, the data processing method provided in this embodiment of the disclosure further includes S108-S110.
[0115] S108. While responding to the first processing request, the electronic device responds to at least one second processing request.
[0116] Each second processing request includes second keyword information, which corresponds to a second element to be processed, which is one of at least one element in a second data structure.
[0117] It should be understood that each second processing request is used to request a preset operation on each second keyword information (or each second element to be processed). The electronic device responds to the first processing request while simultaneously responding to the at least one second processing request, that is, it receives the first processing request and the at least one second processing request at the same time (or at the same moment).
[0118] S109. The electronic device determines whether the data group to which the second data structure belongs is the target data group.
[0119] It should be noted that the method by which the electronic device determines the data group to which the second data structure belongs is the same as or similar to the description in the above description of the electronic device determining the data group to which the first data structure belongs, and will not be repeated here.
[0120] S110. When the data group to which the second data structure belongs is not the target data group, the electronic device concurrently processes the first processing request and at least one second processing request.
[0121] It should be understood that when the data group to which the second data structure belongs is not the target data group, it means that the second data structure and the first data structure belong to different data groups. In this case, the electronic device can acquire the locks corresponding to each of the different data groups. The locks corresponding to the different data groups do not conflict with each other, so the electronic device can concurrently process the first processing request and the at least one second processing request.
[0122] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S108-S110, the electronic device can respond to at least one second processing request while responding to the first processing request; then it determines whether the data group to which the second data structure belongs is the target data group; when the data group to which the second data structure belongs is not the target data group, it means that the second data structure and the first data structure belong to different data groups. At this time, the electronic device can acquire the locks corresponding to each of the different data groups, and the locks corresponding to the different data groups do not conflict with each other. In this way, the electronic device can concurrently process the first processing request and the at least one second processing request, and can concurrently process multiple processing requests received by the electronic device, thereby improving the effectiveness of data processing.
[0123] Combination Figure 9 ,like Figure 10 As shown, in one implementation of this disclosure, the preset operation corresponding to the first processing request is an insertion operation, and the target second processing request is one of the at least one second processing request. The data processing method provided in this disclosure further includes steps S111-S112.
[0124] S111 When the data group to which the second data structure belongs is the target data group, the electronic device determines whether the preset operation corresponding to the target second processing request is a query operation.
[0125] It should be understood that when the data group to which the second data structure belongs is the target data group, it is indicated that the second data structure and the first data structure belong to the same data group (i.e., both belong to the target data group). At this time, the electronic device can determine whether the preset operation corresponding to the first processing request and the preset operation corresponding to the target second processing request are the same. Specifically, when the preset operation corresponding to the first processing request is an insertion operation, the electronic device can determine whether the preset operation corresponding to the target second processing request is a query operation.
[0126] In S112, when the preset operation corresponding to the target second processing request is a query operation, the electronic device concurrently processes the first processing request and the target second processing request.
[0127] In combination with the above description of the embodiments, it should be understood that each data group (e.g., the target data group) in the above-mentioned multiple data groups can correspond to two locks, one write lock and one value lock. When the preset operation corresponding to the first processing request is an insertion operation, the electronic device needs to obtain the corresponding write lock; when the preset operation corresponding to the target second processing request is a query operation, the electronic device needs to obtain the value lock. The two locks do not conflict, so the electronic device can concurrently process the first processing request and the target second processing request.
[0128] In an implementation manner of the embodiments of the present disclosure, when the preset operation corresponding to the target second processing request is not a query operation (e.g., is also an insertion operation), the electronic device can process the first processing request and the target second processing request respectively.
[0129] In another implementation manner of the embodiments of the present disclosure, the preset operation corresponding to the first processing request can also be a query operation. In this way, when the data group of the second data structure is the target data group, the electronic device can determine whether the preset operation corresponding to the target second processing request is an insertion operation, and when the preset operation corresponding to the target second processing request is an insertion operation, concurrently process the first processing request and the target second processing request.
[0130] The technical solutions provided by the above embodiments can bring at least the following beneficial effects: as can be known from S111-S112, the preset operation corresponding to the first processing request can be an insertion operation; when the data group to which the second data structure belongs is the target data group, it indicates that the second data structure and the first data structure belong to the same data group (that is, both belong to the target data group). At this time, the electronic device can determine whether the preset operation corresponding to the target second processing request is a query operation. When the preset operation corresponding to the target second processing request is a query operation, it indicates that the locks used when processing the first processing request and the target second processing request do not conflict with each other, so that the electronic device can concurrently process the first processing request and the at least one second processing request, can concurrently process multiple processing requests received by the electronic device, and improves the effectiveness of data processing.
[0131] It can be understood that, in actual implementation, the electronic device described in the embodiments of the present disclosure can include one or more hardware structures and / or software modules for implementing the foregoing corresponding data processing method, and these execution hardware structures and / or software modules can constitute an electronic device. Those skilled in the art should easily realize that, in combination with the algorithm steps of the examples described in the embodiments disclosed herein, the present disclosure can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.
[0132] Based on such understanding, the embodiments of the present disclosure also correspondingly provide a data processing apparatus, Figure 11 The structure schematic diagram of the data processing apparatus provided by the embodiments of the present disclosure is shown. As Figure 11 The data processing apparatus 50 can include a response module 501, an acquisition module 502, and a processing module 503.
[0133] The response module 501 is configured to respond to a first processing request, the first processing request including first keyword information corresponding to a first to-be-processed element, the first processing request being used to request a preset operation on the first keyword information.
[0134] The acquisition module 502 is configured to acquire, according to the first to-be-processed element, the first to-be-processed element being one of at least one element in a first data structure, the target lock being a lock corresponding to a target data group, and the target data group being a data group to which the first data structure belongs.
[0135] The processing module 503 is configured to execute the first processing request based on the target lock.
[0136] Optionally, the data processing apparatus further comprises a determining module 504.
[0137] The determining module 504 is configured to determine the first data structure according to the first to-be-processed element; and the processing module is further configured to perform a hash transformation on a name of the first data structure to obtain a target hash value.
[0138] The determining module 504 is further configured to determine the target data group according to the target hash value.
[0139] The obtaining module 502 is specifically configured to obtain a lock corresponding to the target data group.
[0140] Optionally, the processing module 503 is specifically configured to perform a copy processing on the first data structure to obtain a second data structure.
[0141] The processing module 503 is further configured to perform the preset operation on the first to-be-processed element based on the target lock and the second data structure.
[0142] Optionally, the preset operation is an insertion operation.
[0143] The determining module 504 is configured to determine a position of the first to-be-processed element in the first data structure.
[0144] The determining module 504 is further configured to determine a to-be-processed path according to the position of the first to-be-processed element in the first data structure and a position of a root node in the first data structure, the to-be-processed path being a path in which a start position is the position of the root node and an end position is a position of a to-be-processed node, the path being a path included in the first data structure, and the to-be-processed node being a node corresponding to the first to-be-processed element.
[0145] The processing module 503 is further configured to copy at least one node included in the to-be-processed path and merge other nodes to obtain the second data structure, the other nodes being nodes other than the at least one node in a plurality of nodes, and the plurality of nodes being nodes included in the first data structure.
[0146] Optionally, the determining module 504 is configured to determine a reference count of each node in a plurality of nodes included in the first data structure.
[0147] The processing module 503 is further configured to release the first data structure when the reference count of the each node is 0.
[0148] Optionally, the preset operation is an insertion operation.
[0149] The determining module 504 is configured to determine a current data size corresponding to a to-be-processed node, the current data size corresponding to the to-be-processed node being a sum of data sizes of at least one element currently stored in the to-be-processed node, the to-be-processed node being a node corresponding to the first to-be-processed element.
[0150] The processing module 503 is further configured to insert the first to-be-processed element into the to-be-processed node when the sum of the data size of the first to-be-processed element and the current data size corresponding to the to-be-processed node is less than or equal to the data size threshold.
[0151] Optionally, the responding module 501 is further configured to, in response to the first processing request, respond to at least one second processing request, each second processing request including second keyword information corresponding to a second to-be-processed element, the second to-be-processed element being one of at least one element in a second data structure.
[0152] The determining module 504 is configured to determine whether a data group to which the second data structure belongs is the target data group.
[0153] The processing module 503 is further configured to, when the data group to which the second data structure belongs is not the target data group, concurrently process the first processing request and the at least one second processing request.
[0154] Optionally, the first processing request corresponds to an insertion operation, and the target second processing request is one of the at least one second processing request.
[0155] The determining module 504 is further configured to, when the data group to which the second data structure belongs is the target data group, determine whether a preset operation corresponding to the target second processing request is a query operation.
[0156] The processing module 503 is further configured to, when the preset operation corresponding to the target second processing request is the query operation, concurrently process the first processing request and the target second processing request.
[0157] As described above, the embodiments of the present disclosure can divide the functional modules of the data processing apparatus according to the above method examples. The integrated modules described above can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiments of the present disclosure is illustrative, and is only a logical functional division. Actual implementation can have another division manner. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.
[0158] As to the data processing apparatus in the above-mentioned embodiments, the specific manner in which each module performs operations and the beneficial effects possessed have been described in detail in the foregoing method embodiments, and will not be described here again.
[0159] Figure 12 is a structural schematic diagram of another data processing apparatus provided by the present disclosure. As Figure 12 The data processing apparatus 60 can include at least one processor 601 and a memory 603 for storing processor-executable instructions. The processor 601 is configured to execute the instructions in the memory 603 to implement the data processing method in the above-mentioned embodiments.
[0160] In addition, the data processing apparatus 60 can further include a communication bus 602 and at least one communication interface 604.
[0161] The processor 601 can be a central processing unit (CPU), a micro-processing unit, an ASIC, or one or more integrated circuits for controlling program execution of the present disclosure scheme.
[0162] The communication bus 602 can include a channel for transmitting information between the above-mentioned components.
[0163] The communication interface 604 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0164] The memory 603 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory may exist independently and be connected to the processing unit via a bus. The memory may also be integrated with the processing unit.
[0165] The memory 603 stores instructions for executing the present invention, and the processor 601 controls the execution of these instructions. The processor 601 executes the instructions stored in the memory 603 to implement the functions of the method disclosed herein.
[0166] In a specific implementation, as one embodiment, the processor 601 may include one or more CPUs, for example... Figure 12 CPU0 and CPU1 in the CPU.
[0167] In a specific implementation, as one example, the data processing device 60 may include multiple processors, such as... Figure 12 Processors 601 and 607 are described herein. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0168] In a particular implementation, as an example, the data processing apparatus 60 can further include an output device 605 and an input device 606. The output device 605 is in communication with the processor 601 and can display information in a variety of ways. For example, the output device 605 can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, a projector, or the like. The input device 606 is in communication with the processor 601 and can accept user input in a variety of ways. For example, the input device 606 can be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
[0169] Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the data processing apparatus 60, and the data processing apparatus 60 can include more or fewer components than shown, or combine certain components, or adopt a different arrangement of components. Figure 12 Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the data processing apparatus 60, and the data processing apparatus 60 can include more or fewer components than shown, or combine certain components, or adopt a different arrangement of components.
[0170] In addition, the present disclosure also provides a computer readable storage medium, comprising instructions, when the instructions are executed by an electronic device, the electronic device executes the data processing method provided by the above embodiments.
[0171] In addition, the present disclosure also provides a computer program product, comprising instructions, when the instructions are executed by an electronic device, the electronic device executes the data processing method provided by the above embodiments.
[0172] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the aspects disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following, in general, the principles of the present disclosure and including such features that are evident to those skilled in the art or are known in the art and can be used in combination with the present disclosure. The specification and examples are to be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
Claims
1. A data processing method, characterized by, The method comprises: in response to a first processing request, the first processing request comprising first keyword information corresponding to a first to-be-processed element, the first processing request being used to request a preset operation on the first keyword information, the preset operation being an insertion operation; acquiring a target lock according to the first to-be-processed element, the first to-be-processed element being one of at least one element in a first data structure, the target lock being a lock corresponding to a target data group, the target data group being a data group to which the first data structure belongs, and one data structure being one ImmutZipMap; determining a position of the first to-be-processed element in the first data structure; determining a to-be-processed path according to the position of the first to-be-processed element in the first data structure and a position of a root node in the first data structure, the to-be-processed path being a path in which a start position is the position of the root node and an end position is a position of a to-be-processed node, the paths being paths included in the first data structure, and the to-be-processed node being a node corresponding to the first to-be-processed element; copying at least one node included in the to-be-processed path and merging other nodes to obtain a second data structure, the other nodes being nodes other than the at least one node in a plurality of nodes, and the plurality of nodes being nodes included in the first data structure; performing the preset operation on the first to-be-processed element based on the target lock and the second data structure.
2. The data processing method according to claim 1, characterized in that, The acquiring of the target lock according to the first to-be-processed element comprises: determining the first data structure according to the first to-be-processed element; performing a hash transformation on a name of the first data structure to obtain a target hash value; determining the target data group according to the target hash value and acquiring a lock corresponding to the target data group.
3. The data processing method of claim 1, wherein, The method further comprises: determining a reference count of each node in a plurality of nodes included in the first data structure; when the reference count of each node is 0, releasing the first data structure.
4. The data processing method according to any one of claims 1-3, characterized in that, The preset operation is an insertion operation, and the method further comprises: determining a current data size corresponding to a to-be-processed node, the current data size corresponding to the to-be-processed node being a sum of data sizes of at least one element currently stored in the to-be-processed node, and the to-be-processed node being a node corresponding to the first to-be-processed element; when a sum of a data size of the first to-be-processed element and the current data size corresponding to the to-be-processed node is less than or equal to a data size threshold, inserting the first to-be-processed element into the to-be-processed node.
5. The data processing method according to any one of claims 1-3, characterized in that, The method further comprises: in response to the first processing request, in response to at least one second processing request, each second processing request comprising second keyword information corresponding to a second to-be-processed element, the second to-be-processed element being one of at least one element in a second data structure; determining whether a data group to which the second data structure belongs is the target data group; Concurrently process the first processing request and the at least one second processing request when the data group to which the second data structure belongs is not the target data group.
6. The data processing method according to claim 5, characterized in that, The first processing request corresponds to a preset operation of an insertion operation, and the target second processing request is one of the at least one second processing request, and the method further comprises: When the data group to which the second data structure belongs is the target data group, determining whether a preset operation corresponding to the target second processing request is a query operation; Concurrently process the first processing request and the target second processing request when the preset operation corresponding to the target second processing request is the query operation.
7. A data processing apparatus, characterized by Comprise: A response module, an acquisition module, and a processing module; The response module is configured to respond to a first processing request, the first processing request comprising first keyword information corresponding to a first to-be-processed element, the first processing request being used to request a preset operation on the first keyword information, the preset operation being an insertion operation; The acquisition module is configured to acquire a target lock according to the first to-be-processed element, the first to-be-processed element being one of at least one element in a first data structure, the target lock being a lock corresponding to a target data group, the target data group being a data group to which the first data structure belongs, and one data structure being one ImmutZipMap; The processing module is configured to determine a position of the first to-be-processed element in the first data structure; The processing module is further configured to determine a to-be-processed path according to the position of the first to-be-processed element in the first data structure and a position of a root node in the first data structure, the to-be-processed path being a path in which a start position is the position of the root node and an end position is a position of a to-be-processed node, the path being one of a plurality of paths included in the first data structure, and the to-be-processed node being a node corresponding to the first to-be-processed element; The processing module is further configured to copy at least one node included in the to-be-processed path and merge other nodes to obtain a second data structure, the other nodes being nodes other than the at least one node in a plurality of nodes, and the plurality of nodes being nodes included in the first data structure; The processing module is further configured to perform the preset operation on the first to-be-processed element based on the target lock and the second data structure.
8. The data processing apparatus according to claim 7, characterized in that, The data processing apparatus further comprises a determination module; The determination module is configured to determine the first data structure according to the first to-be-processed element; The processing module is further configured to perform a hash transformation on a name of the first data structure to obtain a target hash value; The determination module is further configured to determine the target data group according to the target hash value; The acquisition module is specifically configured to acquire the lock corresponding to the target data group.
9. The data processing apparatus according to claim 7, characterized by The data processing apparatus further comprises a determination module; The determination module is configured to determine a reference count of each node in a plurality of nodes included in the first data structure; The processing module is further configured to release the first data structure when the reference count of each node is 0.
10. The data processing apparatus according to any one of claims 7-9, characterized in that, The preset operation is an insertion operation, and the data processing apparatus further comprises a determining module; The determining module is configured to determine a current data size corresponding to a to-be-processed node, the current data size corresponding to the to-be-processed node being a sum of data sizes of at least one element currently stored by the to-be-processed node, the to-be-processed node being a node corresponding to the first to-be-processed element; The processing module is further configured to insert the first to-be-processed element into the to-be-processed node when a sum of the data size of the first to-be-processed element and the current data size corresponding to the to-be-processed node is less than or equal to a data size threshold.
11. The data processing apparatus according to any one of claims 7-9, characterized in that, The data processing apparatus further comprises a determining module; The response module is further configured to, while responding to the first processing request, respond to at least one second processing request, each second processing request comprising second keyword information corresponding to a second to-be-processed element, the second to-be-processed element being one of at least one element in a second data structure; The determining module is configured to determine whether a data group to which the second data structure belongs is the target data group; The processing module is further configured to, when the data group to which the second data structure belongs is not the target data group, concurrently process the first processing request and the at least one second processing request.
12. The data processing apparatus according to claim 11, characterized by The preset operation corresponding to the first processing request is an insertion operation, and a target second processing request is one of the at least one second processing request; The determining module is further configured to, when the data group to which the second data structure belongs is the target data group, determine whether a preset operation corresponding to the target second processing request is a query operation; The processing module is further configured to, when the preset operation corresponding to the target second processing request is a query operation, concurrently process the first processing request and the target second processing request.
13. An electronic device, comprising: The electronic device comprises: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data processing method of any one of claims 1-6.
14. A computer-readable storage medium having stored thereon instructions, the computer-readable storage medium comprising: When the instructions in the computer-readable storage medium are executed by the electronic device, the electronic device is enabled to perform the data processing method of any one of claims 1-6.
15. A computer program product, characterised in that, The computer program product comprises computer instructions, which, when executed on an electronic device, enable the electronic device to perform the data processing method of any one of claims 1-6.
Citation Information
Patent Citations
Data processing method and device, server and storage medium
CN110765143A
Data processing method and device, electronic equipment and computer readable medium
CN111858607A