Data operation request processing method and device, equipment and storage medium
By obtaining and parsing the load indicators of data operation requests in the big data analysis and processing system, and directly sending the requests to the target data nodes, the performance bottleneck problem caused by the high load of the coordination node is solved and the data processing efficiency is improved.
Patent Information
- Application Number
- CN202410664305.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-10
AI Technical Summary
In big data analysis and processing systems, when the system load is high, the coordination node is in a high-load state, resulting in performance bottlenecks and reduced data processing efficiency.
By obtaining the data operation request and the current load indicator of the coordination node, syntax analysis is performed to determine the request type, and when a certain threshold is reached, the request is directly sent to the target data node through hash processing to avoid processing by the coordination node.
It reduces the performance burden of the coordination node, improves data processing efficiency, and achieves reasonable offload processing and accurate positioning of data operation requests.
Smart Images

Figure CN118626252A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method, apparatus, device and storage medium for processing a data operation request. Background Art
[0002] At present, in big data analysis and processing systems, a large-scale parallel processing architecture is generally used, in which the architecture includes a coordination node and multiple data nodes. Each data node can carry multiple data instances and is mainly responsible for data storage and computing. The coordination node is responsible for managing the entire system, including processing data operation requests, such as data change requests and data query requests, as well as related load balancing and query optimization.
[0003] However, when the system load is high, all data operation requests require the coordination node to call the optimizer and scheduler for routing and scheduling, which may cause the coordination node to be in a high-load state, resulting in performance bottlenecks and reduced data processing efficiency, which needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a data operation request processing method, apparatus, device and storage medium to solve the problem that the coordination node is in a high load state due to a high system load, resulting in performance bottlenecks and reduced data processing efficiency. It realizes the diversion processing of data operation requests with reasonable reference to the load state of the coordination node, accurately locates the target data node corresponding to the data operation request, and completes the sending of the data operation request without processing by the coordination node, thereby reducing the performance burden of the coordination node and improving data processing efficiency.
[0005] In a first aspect, an embodiment of the present application provides a method for processing a data operation request, the method comprising:
[0006] Get data operation requests and current load indicators of the coordination node;
[0007] Parsing the data operation request to determine whether the data operation request contains a complex data operation;
[0008] When the current load indicator reaches a first load threshold and the data operation request does not include a complex data operation, performing hash processing on the data operation request to determine a corresponding target data node;
[0009] The data operation request is sent to the target data node, so that the target data node processes the data operation request and feeds back a data processing result.
[0010] In a second aspect, an embodiment of the present application further provides a data operation request processing device, including:
[0011] A request information acquisition module configured to obtain data operation requests and current load indicators of the coordination node;
[0012] A data request parsing module, configured to perform syntax analysis on the data operation request to determine whether the data operation request contains a complex data operation;
[0013] a data node determination module, configured to, when the current load indicator reaches a first load threshold and the data operation request does not include a complex data operation, perform hash processing on the data operation request to determine a corresponding target data node;
[0014] The data request sending module is configured to send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0015] In a third aspect, an embodiment of the present application further provides a data operation request processing device, the device comprising:
[0016] one or more processors;
[0017] a storage device configured to store one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the data operation request processing method described in the embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the data operation request processing method described in the embodiment of the present application.
[0020] In the embodiment of the present application, by obtaining the data operation request and the current load index of the coordination node; parsing the data operation request to determine whether the data operation request contains complex data operations; when the current load index reaches the first load threshold and the data operation request does not contain complex data operations, hashing the data operation request to determine the corresponding target data node; sending the data operation request to the target data node for the target data node to process the data operation request and feedback the data processing result. In the above scheme, by parsing the data operation request to effectively filter out data operation requests that do not require complex data operations, reasonably determine the data operation requests that can skip the coordination node processing, and by combining the threshold comparison result of the current load index of the coordination node, the load state of the coordination node can be reasonably referred to for the data operation request diversion processing, and by sending the data operation request directly to the target data node corresponding to its hash calculation result, the corresponding target data node can be accurately located, and the sending of the data operation request can be completed without the need for processing by the coordination node, thereby reducing the performance burden of the coordination node and improving the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a method for processing a data operation request provided in an embodiment of the present application;
[0022] Figure 2 A flowchart of a data operation request processing method including sending a target data operation request to a coordination node provided in an embodiment of the present application;
[0023] Figure 3 A flowchart of a data operation request processing method including a process of determining a target data node through hash processing provided by an embodiment of the present application;
[0024] Figure 4 A flowchart of a data operation request processing method including a process of updating a node mapping table provided in an embodiment of the present application;
[0025] Figure 5 A flowchart of a data operation request processing method including a process of generating warning information of a target data node provided by an embodiment of the present application;
[0026] Figure 6 A flowchart of another method for processing a data operation request including a process for generating warning information of a target data node provided by an embodiment of the present application;
[0027] Figure 7 A structural block diagram of a data operation request processing device provided in an embodiment of the present application;
[0028] Figure 8A schematic diagram of the structure of a data operation request processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0031] The data operation request processing method provided in the embodiment of the present application is used to make distribution decisions of data operation requests according to the load status of the coordination node in the data warehouse system and the specific request content of the data operation request, so as to determine whether to send it to the coordination node or directly to the data node. The data operation request processing method can be applied to the client, the intermediate agent, etc. Related data warehouse systems include: Greenplum, Apache Spark, and Redshift, etc. The several data warehouse systems listed above are only exemplary and explanatory. In practical applications, the data operation request processing method can also be used in request processing in other scenarios, and the embodiment of the present application does not limit this. The present application aims to provide a data operation request processing method, device, equipment, and storage medium to solve the problem that the coordination node is in a high load state due to the high system load, the performance bottleneck occurs, and the data processing efficiency is reduced.
[0032] In the data operation request processing method provided in the embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.
[0033] Figure 1The flowchart of a data operation request processing method provided in an embodiment of the present application can be implemented with a data operation request processing device as the execution subject. Figure 1 As shown, the data operation request processing method specifically includes the following steps:
[0034] Step S101: Obtain a data operation request and a current load indicator of a coordination node.
[0035] Among them, the data operation request can be a data change request, a data query request, etc., which is used to request the data node to store or calculate data. The coordination node can be responsible for managing the configuration information of the entire cluster in the data warehouse system, maintaining the information of the relevant data nodes, such as the status of the node, IP address, port number, etc., and coordinating the allocation and scheduling of resources, determining the tasks or workloads performed by the data nodes, and correspondingly distributing data operation requests to ensure the rational use of resources and load balancing. The current load index can be a measure of the current performance and resource utilization of the server, which is used to evaluate and balance the load of the coordination node. Optionally, the current load index can be the number of concurrently connected clients of the coordination node, the average number of processes in the coordination node in an operational state and an uninterruptible state, or the length of the task queue in the coordination node, the request response time, etc., which are not limited in this application. In one embodiment, the current load index can be at least one or more of the number of concurrent connections, the average number of processes, the length of the task queue, and the request response time.
[0036] Step S102: parse the data operation request to determine whether the data operation request contains complex data operations.
[0037] Among them, the syntax parsing can be to first perform lexical analysis on the data operation request to determine the tokens or morphemes in the request, then receive the relevant sequence of tokens or morphemes, and combine them into an abstract syntax tree or similar data structure that conforms to the language syntax, determine all components and the relationship between them, and finally determine whether the data operation request contains complex data operations. The complex data operation can be a process involving statistical calculations, cross-table operations, sorting, and grouping of multiple data. Correspondingly, simple data operations can be the writing and query of single-point data, which is used for precise query operations for a specific value or condition. In one embodiment, complex data operations can include one or more of aggregate calculations, multi-table joins, and sorted queries. The aggregate calculation can be a sum calculation, a maximum value calculation, etc. The multi-table join can perform cross-table data queries based on the association relationship between two or more tables. The sorted query can be used to arrange the multiple data obtained by the query in ascending or descending order according to the specified field. In one embodiment, the data operation request may include SQL (Structured Query Language) related operation statements, and after lexical analysis, keywords such as SELECT, FROM, identifiers such as table names, column names, operators, and other lexical units may be obtained, and the obtained lexical units are combined into an abstract syntax tree or similar data structure that conforms to the language syntax, so as to determine whether the data operation request includes connections between multiple tables, conditional logic judgments, sorting queries, and aggregate calculations such as summation and averaging. Of course, the above is only an exemplary description. In actual application scenarios, different database operations and query languages are used, and the data operation statements in the data operation request are also different. For example, they can also include Xquery statements, SPL statements, etc., which are not limited in this application.
[0038] Step S103: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, hash processing is performed on the data operation request to determine the corresponding target data node.
[0039] Among them, different load indicators can set the corresponding first load threshold, for example, for the number of concurrent connections, a corresponding connection number threshold can be set, for the average number of processes, a corresponding process number threshold can be set, for the task queue length, a corresponding task number threshold can be set, and for the request response time, a corresponding duration threshold can be set. The developer can be adaptively set according to the load indicators used in the actual application scenario, and this application is not limited here. If the current load indicator reaches the first load threshold, it can be regarded as the current load of the coordination node is too high or there is a performance bottleneck, and new data operation requests cannot be processed. Hash processing can be a hash calculation of the key identifier in the data operation request, such as a shard identifier, a user identifier, user address information, etc. Among them, hash processing can map the key identifier to a storage location in a mapping table, and then the storage location is allocated to the data node. When a data operation request is received, the hash value of the key identifier can be calculated by a hash function, and then the corresponding data node is searched on the mapping table to process the request.
[0040] Step S104: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0041] In the above, by obtaining the data operation request and the current load index of the coordination node; parsing the data operation request to determine whether the data operation request contains complex data operations; when the current load index reaches the first load threshold and the data operation request does not contain complex data operations, hashing the data operation request to determine the corresponding target data node; sending the data operation request to the target data node for the target data node to process the data operation request and feedback the data processing result. In the above scheme, by parsing the data operation request to effectively screen out the data operation request that does not require complex data operations, reasonably determine the data operation request that can skip the coordination node processing, by combining the threshold comparison result of the current load index of the coordination node, the load status of the coordination node can be reasonably referred to for the data operation request diversion processing, by sending the data operation request directly to the target data node corresponding to its hash calculation result, the corresponding target data node can be accurately located, and the sending of the data operation request can be completed without the need for processing by the coordination node, reducing the performance burden of the coordination node and improving the data processing efficiency.
[0042] Figure 2 A flowchart of a data operation request processing method including sending a target data operation request to a coordination node is provided in an embodiment of the present application. Figure 2 As shown, the specific steps include:
[0043] Step S201: Obtain a data operation request and a current load indicator of a coordination node.
[0044] Step S202: Parse the data operation request to determine whether the data operation request contains complex data operations.
[0045] Step S203: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, hash processing is performed on the data operation request to determine the corresponding target data node.
[0046] Step S204: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0047] Step S205: When the current load indicator does not reach the first load threshold but reaches the second load threshold, and the data operation request does not include a complex data operation, a preset identifier is added to the data operation request to obtain a target data operation request, wherein the preset identifier is used to instruct the coordination node to skip the processing flow of the optimizer and scheduler corresponding to the target data operation request, and the second load threshold is less than the first load threshold.
[0048] Among them, if the current load index does not reach the first load threshold and reaches the second load threshold, it can be regarded that the current load of the coordination node has reached a relatively saturated state, but has not reached a performance bottleneck. The specific first load threshold and the second load threshold can be set by the developer according to the corresponding relationship between the load status and performance status of the coordination node in the actual application scenario. Adaptive setting, this application does not limit it. The preset identifier is used to indicate that the coordination node skips the processing flow of the optimizer and scheduler corresponding to the target data operation request. The optimizer can be responsible for receiving the query statement or query tree and generating a query plan. For a query, there may be multiple possible equivalent query plans, but the execution performance may vary greatly. The optimizer can find the query plan with the best performance, which usually involves parsing, rewriting, optimizing and other operations on the query statement to ensure that the generated query plan can be executed efficiently and accurately. The scheduler can be a comprehensive operation status of each data node and schedule tasks to the appropriate node according to demand, such as the reference node's computing power, storage capacity, network bandwidth, etc., as well as the priority and dependency of the task, to make the best scheduling decision. Therefore, using the optimizer and scheduler to make data operation requests will increase the performance burden of the coordination node. When the current load of the coordination node has reached a relatively saturated state, the optimizer and scheduler can be skipped by filtering out data operation requests that do not contain complex data operations, thereby reducing the performance burden of the coordination node.
[0049] Step S206: Send the target data operation request to the coordination node, so that the coordination node forwards the target data operation request to the data node corresponding to the data operation request.
[0050] As described above, by judging that the current load index of the coordination node has not reached the first load threshold but has reached the second load threshold, it is determined that the current load of the coordination node is in a relatively saturated state, and data operation requests that do not contain complex data operations can be screened out to skip the processing decisions of the optimizer and scheduler, reasonably optimize the resource allocation of the coordination node, reduce the resource occupancy of coordinating simple data operation requests, and reduce the performance burden of the coordination node.
[0051] Figure 3 A flowchart of a data operation request processing method including a process of determining a target data node through hash processing is provided in an embodiment of the present application. Figure 3 As shown, the specific steps include:
[0052] Step S301: Obtain a data operation request and a current load indicator of a coordination node.
[0053] Step S302: Parse the data operation request to determine whether the data operation request contains complex data operations.
[0054] Step S303: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, a hash calculation is performed on the shard identifier in the data operation request to obtain a hash result value.
[0055] The shard identifier may be used to locate a data node storing relevant data in the data operation request.
[0056] Step S304: query the target data node corresponding to the hash result value from the set node mapping table.
[0057] Among them, the node mapping table may store the correspondence between different hash result values and data nodes, and the target data node corresponding to the data operation request can be located through the hash result value of the shard identifier.
[0058] Step S305: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0059] As described above, by determining the target data node based on the hash calculation result of the shard identifier in the data operation request, the uniqueness of the hash calculation result can be effectively utilized to accurately locate the target data node that can process the data operation request, and reliably realize the direct distribution of the data operation request.
[0060] Figure 4A flowchart of a data operation request processing method including a process of updating a node mapping table is provided in an embodiment of the present application. Figure 4 As shown, the specific steps include:
[0061] Step S401: Obtain a data operation request and a current load indicator of a coordination node.
[0062] Step S402: parse the data operation request to determine whether the data operation request contains complex data operations.
[0063] Step S403: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, a hash calculation is performed on the shard identifier in the data operation request to obtain a hash result value.
[0064] Step S404: query the target data node corresponding to the hash result value from the set node mapping table.
[0065] Step S405: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0066] Step S406: When it is detected that the number or position of the data nodes has changed, the state change information of the data nodes is obtained.
[0067] Among them, with the development of business and the growth of data volume, it may be necessary to increase the number of data nodes to expand the capacity and performance of the database cluster, or, due to hardware failure, maintenance requirements or cost considerations, it is necessary to remove data nodes from the cluster, or, due to hardware upgrades, data center migration or other reasons, it is necessary to move existing data nodes from one physical location to another, and due to data skew or changes in query load, it is necessary to redistribute data to balance the load between data nodes. The above situations may cause the number or location of data nodes to change, so it is necessary to obtain the status change information of the data nodes and update the node mapping table to ensure that subsequent data operation requests can be correctly distributed to the corresponding target data nodes. In one embodiment, the status change information automatically reported by the data node can be obtained. In one embodiment, the status of the data node can be detected through an intermediate service, and the status change information provided by the intermediate service can be obtained.
[0068] Step S407: Update the node mapping table based on the state change information.
[0069] Among them, the node mapping table can be updated by performing operations such as reallocation, addition and deletion of hash result values and data nodes based on the state change information.
[0070] As described above, by obtaining the status change information of the data node and updating and adjusting the node mapping table in time, the accuracy and timeliness of the node mapping table can be guaranteed, the normal distribution of data operation requests can be guaranteed, and the risk of business abnormalities can be reduced.
[0071] Figure 5 A flowchart of a data operation request processing method including a process of generating warning information of a target data node provided by an embodiment of the present application. Figure 5 As shown, the specific steps include:
[0072] Step S501: Obtain a data operation request and a current load indicator of a coordination node.
[0073] Step S502: Parse the data operation request to determine whether the data operation request contains complex data operations.
[0074] Step S503: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, hash processing is performed on the data operation request to determine the corresponding target data node.
[0075] Step S504: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0076] Step S505: Update the recorded number of requests processed by the target data node within a preset time.
[0077] Among them, by statistically recording the number of requests processed by the target data node within a preset time, the load status of the target data node after the data operation request is distributed can be determined.
[0078] Step S506: When the number of request processing reaches a preset number threshold, generate first warning information corresponding to the target data node.
[0079] Among them, if the number of request processing reaches the preset number threshold, it can be regarded as the target data node may have a centralized distribution of requests, and a load warning of the target data node is required to remind the developer to make relevant adjustments to the load balancing of the data node in a timely manner. The preset number threshold can be adaptively adjusted by the developer according to the load statistics of the data node in the actual application scenario, and this application does not limit it here.
[0080] Step S507: Send the first warning information to the system background.
[0081] The first warning information may include the node identification of the target data node and statistical information on the number of request processing, which may be used to remind relevant developers of the system background to promptly check for load anomalies on the data node.
[0082] As mentioned above, by monitoring the cumulative number of request processing of the target data node within the preset time, it is possible to effectively determine whether the data operation requests are concentratedly distributed to the same target data node, and when it is judged through the threshold that the target data node may be overloaded, early warning information is output in time to remind relevant personnel to conduct investigations and adjustments to ensure the normal operation of the business.
[0083] Figure 6 A flowchart of another data operation request processing method including a process of generating warning information of a target data node provided by an embodiment of the present application. Figure 6 As shown, the specific steps include:
[0084] Step S601: Obtain a data operation request and a current load indicator of a coordination node.
[0085] Step S602: Parse the data operation request to determine whether the data operation request contains complex data operations.
[0086] Step S603: When the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation, hash processing is performed on the data operation request to determine the corresponding target data node.
[0087] Step S604: Send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0088] Step S605: When the data processing result is received, the request processing duration is determined according to the current timestamp and the sending timestamp of the data operation request.
[0089] Among them, since sending the data operation request directly to the target data node involves the request transmission process and the request processing process of the data node, the request processing time can be the sum of the transmission time of the data operation request and the data processing time of the target data node.
[0090] Step S606: When the request processing time exceeds a preset time threshold, generate second warning information corresponding to the target data node.
[0091] Among them, if the request processing time exceeds the preset time threshold, it can be regarded as the network connection with the target data node may be abnormal, or the current load of the target data node is high, resulting in low processing efficiency. It is necessary to carry out a load warning for the target data node to remind the developer to promptly conduct network anomaly inspection or load balancing related adjustments of the data node. The preset time threshold can be adaptively adjusted by the developer according to the average result feedback time of the data node in the actual application scenario, and this application does not limit it.
[0092] Step S607: Send the second warning information to the system background.
[0093] Among them, the second warning information may include the node identification of the target data node and statistical information of the request processing time, which can be used to remind relevant developers of the system background to conduct network anomaly troubleshooting or load anomaly troubleshooting of the data node in a timely manner.
[0094] As mentioned above, by monitoring the processing result feedback time of the target data node, it is possible to effectively determine whether the target data node may have a network connection abnormality or excessive load. When it is determined through the threshold that the target data node may have a network connection abnormality or excessive load, early warning information is output in time to remind relevant personnel to conduct investigations and adjustments to ensure normal business operation.
[0095] Figure 7 This is a structural block diagram of a data operation request processing device provided in an embodiment of the present application. The device is configured to execute the data operation request processing method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 7 As shown, the device specifically includes:
[0096] The request information acquisition module 101 is configured to obtain the data operation request and the current load indicator of the coordination node;
[0097] The data request parsing module 102 is configured to perform syntax analysis on the data operation request to determine whether the data operation request contains a complex data operation;
[0098] The data node determination module 103 is configured to perform hash processing on the data operation request to determine the corresponding target data node when the current load indicator reaches the first load threshold and the data operation request does not include a complex data operation;
[0099] The data request sending module 104 is configured to send a data operation request to a target data node, so that the target data node processes the data operation request and feeds back a data processing result.
[0100] In the above, by obtaining the data operation request and the current load index of the coordination node; parsing the data operation request to determine whether the data operation request contains complex data operations; when the current load index reaches the first load threshold and the data operation request does not contain complex data operations, hashing the data operation request to determine the corresponding target data node; sending the data operation request to the target data node for the target data node to process the data operation request and feedback the data processing result. In the above scheme, by parsing the data operation request to effectively screen out the data operation request that does not require complex data operations, reasonably determine the data operation request that can skip the coordination node processing, by combining the threshold comparison result of the current load index of the coordination node, the load status of the coordination node can be reasonably referred to for the data operation request diversion processing, by sending the data operation request directly to the target data node corresponding to its hash calculation result, the corresponding target data node can be accurately located, and the sending of the data operation request can be completed without the need for processing by the coordination node, reducing the performance burden of the coordination node and improving the data processing efficiency.
[0101] In a possible embodiment, it further includes a request processing and sending module configured as follows:
[0102] When the current load indicator does not reach the first load threshold but reaches the second load threshold, and the data operation request does not include a complex data operation, a preset identifier is added to the data operation request to obtain a target data operation request, where the preset identifier is used to instruct the coordination node to skip the processing flow of the optimizer and scheduler corresponding to the target data operation request, and the second load threshold is less than the first load threshold;
[0103] The target data operation request is sent to the coordination node, so that the coordination node forwards the target data operation request to the data node corresponding to the data operation request.
[0104] In a possible embodiment, the data node determination module 103 is further configured to:
[0105] Perform hash calculation on the shard identifier in the data operation request to obtain a hash result value;
[0106] Query the target data node corresponding to the hash result value from the set node mapping table.
[0107] In a possible embodiment, a mapping table updating module is further included, configured to:
[0108] When a change in the number or location of data nodes is detected, the status change information of the data nodes is obtained;
[0109] The node mapping table is updated based on the status change information.
[0110] In a possible embodiment, it further includes a first node early warning module configured to:
[0111] Update the number of requests processed by the target data node within the preset time;
[0112] When the number of request processing reaches a preset number threshold, generating first warning information corresponding to the target data node;
[0113] Send the first warning information to the system background.
[0114] In a possible embodiment, a second node early warning module is further included, configured to:
[0115] When the data processing result is received, the request processing duration is determined according to the current timestamp and the sending timestamp of the data operation request;
[0116] When the request processing time exceeds a preset time threshold, generating second warning information corresponding to the target data node;
[0117] Send the second warning information to the system background.
[0118] In a possible embodiment, the complex data operation includes one or more of: aggregate calculation, multi-table join, and sort query.
[0119] Figure 8 A structural diagram of a data operation request processing device provided in an embodiment of the present application, such as Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 8 The example of connecting through a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the data operation request processing method in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned data operation request processing method. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0120] The data operation request processing device provided above can be used to execute the data operation request processing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0121] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are configured to execute a data operation request processing method described in the above embodiment, which includes: obtaining a data operation request and a current load indicator of a coordination node; performing syntax parsing on the data operation request to determine whether the data operation request contains a complex data operation; when the current load indicator reaches a first load threshold and the data operation request does not contain a complex data operation, performing hash processing on the data operation request to determine the corresponding target data node; sending the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
[0122] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0123] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above data operation request processing method, can also execute related operations in the data operation request processing method provided in any embodiment of the present application.
[0124] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text when describing is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (fl ash RAM). The memory is an example of a computer-readable medium.
[0125] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0126] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for processing a data operation request, characterized in that: include: Get data operation requests and current load indicators of the coordination node; Parsing the data operation request to determine whether the data operation request contains a complex data operation; When the current load indicator reaches a first load threshold and the data operation request does not include a complex data operation, performing hash processing on the data operation request to determine a corresponding target data node; The data operation request is sent to the target data node, so that the target data node processes the data operation request and feeds back a data processing result.
2. The data operation request processing method according to claim 1, characterized in that: Also includes: When the current load indicator does not reach the first load threshold but reaches the second load threshold, and the data operation request does not include a complex data operation, a preset identifier is added to the data operation request to obtain a target data operation request, wherein the preset identifier is used to instruct the coordinating node to skip a processing flow of an optimizer and a scheduler corresponding to the target data operation request, and the second load threshold is less than the first load threshold; The target data operation request is sent to the coordination node, so that the coordination node forwards the target data operation request to the data node corresponding to the data operation request.
3. The data operation request processing method according to claim 1, characterized in that: The performing hash processing on the data operation request to determine the corresponding target data node includes: Performing a hash calculation on the shard identifier in the data operation request to obtain a hash result value; The target data node corresponding to the hash result value is queried from the set node mapping table.
4. The data operation request processing method according to claim 3, characterized in that: Also includes: When detecting a change in the number or position of a data node, obtaining status change information of the data node; The node mapping table is updated based on the state change information.
5. The data operation request processing method according to claim 1, characterized in that: After sending the data operation request to the target data node, the method further includes: Update the recorded number of requests processed by the target data node within a preset time; When the number of request processing reaches a preset number threshold, generating first warning information corresponding to the target data node; The first warning information is sent to the system background.
6. The data operation request processing method according to claim 1, characterized in that: After sending the data operation request to the target data node, the method further includes: When receiving the data processing result, determining the request processing duration according to the current timestamp and the sending timestamp of the data operation request; When the request processing time exceeds a preset time threshold, generating second warning information corresponding to the target data node; The second warning information is sent to the system background.
7. The method for processing a data operation request according to any one of claims 1 to 6, characterized in that: The complex data operations include: one or more of aggregate calculations, multi-table joins, and sorting queries.
8. A data operation request processing device, characterized in that: include: A request information acquisition module configured to obtain data operation requests and current load indicators of the coordination node; A data request parsing module, configured to perform syntax analysis on the data operation request to determine whether the data operation request contains a complex data operation; a data node determination module, configured to, when the current load indicator reaches a first load threshold and the data operation request does not include a complex data operation, perform hash processing on the data operation request to determine a corresponding target data node; The data request sending module is configured to send the data operation request to the target data node, so that the target data node processes the data operation request and feeds back the data processing result.
9. A data operation request processing device, the device comprising: one or more processors; A storage device configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the data operation request processing method described in any one of claims 1 to 7.
10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the data operation request processing method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Cited By
Distributed storage data self-adaptive load balancing method and system
CN119201003A
