Process query method and system based on digital relocation
By decomposing query tasks and dynamically allocating tasks, the problem of insufficient resource utilization in the existing system is solved, more efficient resource utilization and system reliability are achieved, and query processing speed and throughput are improved.
Patent Information
- Application Number
- CN202311156734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-09-08
AI Technical Summary
The existing process query system based on digital relocation is difficult to fully utilize the computing resources of each node, resulting in excessively high resource occupancy of a single node and prone to resource bottlenecks.
By decomposing the query task into multiple subtasks, the subtasks are assigned to different nodes for processing using a random algorithm, and the faulty tasks are dynamically transferred to the edge nodes under the monitoring mechanism. The asynchronous query module is combined to merge the results and deduplicate the results.
It improves the system's processing speed and throughput, reduces the resource occupancy rate of a single node, avoids resource bottlenecks, enhances the system's scalability and reliability, and reduces task transmission delays.
Smart Images

Figure CN117112650B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information query technology, and in particular to a process query method and system based on digital relocation. Background Art
[0002] A digital relocation-based process query system uses mathematical models and computer technology to digitize, standardize, and formalize a company or organization's business processes, business data, and personnel behaviors. This enables full-process monitoring, query, and analysis of business processes and their associated data. This system enables companies or organizations to better understand and optimize digital relocation business processes, reduce process costs, and promptly respond to and adapt to changes in the external environment. Digital relocation business processes and data can be queried and analyzed using various query tools, such as data warehouses, OLAP, and data mining, and presented to users through various visualization methods. This provides users with a more intuitive understanding of the status of business processes and data, further supporting decision-making and business management.
[0003] However, the existing digital relocation process query technology is prone to one node handling multiple query tasks when processing query tasks, which can easily lead to congestion of a single node. Node congestion will affect a large number of query processes, and query results are difficult to return to the client in a very short time. At the same time, it is difficult to fully utilize the computing resources of each node. The resource occupancy rate of a single node is too high, and resource bottlenecks are prone to occur. Summary of the Invention
[0004] The purpose of the present invention is to provide a process query method and system based on digital relocation to solve the following technical problems:
[0005] The existing process query based on digital relocation is difficult to fully utilize the computing resources of each node. The resource occupancy rate of a single node is too high, which easily leads to resource bottlenecks.
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] The process query method and system based on digital relocation include:
[0008] S1: When a user initiates a query request, a query task is created based on the user's query conditions and added to the query queue for processing;
[0009] S2: Decompose the query task into multiple subtasks using a distributed framework, and assign the subtasks to different nodes for processing using a random algorithm.
[0010] S3: Establish a monitoring mechanism to monitor the operating status of each node. When a node fails, the subtasks of the failed node are transferred to the nearest edge node for processing.
[0011] S4: The node that completes the subtask processing transmits the processing results to the asynchronous query module, which merges the processing results of each node and sorts and removes duplicates.
[0012] S5: The sorted and deduplicated results returned by each node form a result set; the result set is optimized to form a query result, and the optimized query result is fed back to the corresponding client.
[0013] As a further solution of the present invention, subtasks are assigned to different nodes for processing by a random algorithm, including the following steps:
[0014] According to the type of subtask obtained and the processing requirements of the subtask, perform the corresponding operation;
[0015] Determine whether the data required by the subtask comes from the edge node. If the subtask needs to obtain data from the edge node, directly transfer the subtask to the edge node for processing;
[0016] If there is no need to obtain data from the edge node, the data is searched from the local storage. If there is no data to be queried in the local storage, a query request is sent to other nodes.
[0017] The node processes the subtask, and after the task processing is completed, it needs to return the processing result of the subtask to the requesting node.
[0018] As a further solution of the present invention, the asynchronous query module sorts and removes duplicates of the merged results, including the following steps:
[0019] Every time a new processing result is returned, the query results are sorted using an incremental sorting algorithm;
[0020] For duplicate elements in the processing results returned by the node, the red-black tree algorithm is used to remove duplicate elements in the processing results.
[0021] As a further solution of the present invention, duplicate elements in the processing result are deduplicated using a red-black tree algorithm, including the following steps:
[0022] Create an empty red-black tree and import the returned processing results into the red-black tree;
[0023] Read the data in the red-black tree one by one, and check whether the same data already exists in the red-black tree.
[0024] If it does not exist, the processing result is inserted into the red-black tree and marked as a black node; if it already exists, the processing result is skipped.
[0025] Continue to read the next returned processing result and repeat steps 2-3.
[0026] When all the processing results are completed, the data of all black nodes in the red-black tree are the results after deduplication.
[0027] As a further solution of the present invention: when step S5 is not completed and the query result has not been fed back to the corresponding client, after the user issues a request to suspend the query process, the following steps are performed:
[0028] The asynchronous query module persists the query process information;
[0029] If the user issues a request to continue the query process, the asynchronous query module will continue to operate the query task by controlling the thread;
[0030] If the user re-initiates a query request, the asynchronous query module will check whether there is a corresponding query result in the temporary cache, reload it, and continue the query from the pause point.
[0031] As a further solution of the present invention: query process information persistence, including the following steps:
[0032] At the edge node, a temporary cache is created;
[0033] The query process is paused and the query results are stored in a temporary buffer.
[0034] The process query system based on digital relocation includes:
[0035] User management module: used to manage user login information, registration information and permissions;
[0036] Database management module: used for storage, backup and recovery of various data related to digital relocation planning;
[0037] Asynchronous query module: used to respond to query requests and return query results, and transmit the query results to the data feedback module;
[0038] Data feedback module: used to process uploaded, imported or generated data, optimize query results, and feed back the optimized query results to the corresponding client.
[0039] As a further solution of the present invention: the asynchronous query module includes:
[0040] The request receiving unit is used to receive query requests sent by various clients, abstract the query requests into file descriptions to form a file description set, create a query task based on the file description set, and add the task to the query queue;
[0041] The query queue is used to store the query tasks sent by the request receiving module and sort and number the query tasks;
[0042] Request processing unit: used to cyclically process query tasks in the query queue, obtain query results, and feed the query results back to the data feedback module;
[0043] Data deletion module: used to delete the query tasks and corresponding numbers that have been processed in the query queue.
[0044] As a further solution of the present invention: the asynchronous query module is also used to create a temporary cache area at the edge node when a query request is interrupted, and store the unfinished query process and query results in the temporary cache area; when the user initiates a query request again, the asynchronous query module will check whether there is a corresponding query result in the temporary cache area and reload it.
[0045] As a further solution of the present invention, the request processing unit of the asynchronous query module decomposes the query task in the query queue into multiple subtasks using a distributed framework. The request processing unit assigns the subtasks to different nodes for processing using a random algorithm. A monitoring mechanism is also established to monitor the operating status of each node. When a node is found to be faulty, the subtasks of the faulty node are transferred to the nearest edge node for processing.
[0046] Beneficial effects of the present invention:
[0047] The present invention decomposes the query task into multiple subtasks, and assigns the subtasks to different nodes for processing through a random algorithm. When a node is found to have a fault, the subtasks of the faulty node are transferred to the nearest edge node for processing. The task is decomposed into multiple subtasks and processed in parallel by multiple nodes at the same time, which is conducive to fully utilizing the computing resources of each node, improving the processing speed and throughput of the system, reducing the resource occupancy rate of a single node, thereby avoiding the occurrence of resource bottlenecks and further improving the scalability of the system.
[0048] By distributing tasks to different nodes, the present invention ensures that even if some nodes fail, other nodes can continue to process tasks, effectively improving the reliability and availability of the system. Furthermore, by transferring subtasks from failed nodes to the nearest edge node for processing, task transmission delays can be minimized, thereby improving the system's response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The present invention will be further described below with reference to the accompanying drawings.
[0050] Figure 1 is a flow chart of the method of the present invention;
[0051] Figure 2 It is a structural diagram of the system of the present invention. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0053] Example 1
[0054] See also Figure 1-2 As shown, the present invention is a process query method and system based on digital relocation, including:
[0055] S1: When a user initiates a query request, a query task is created based on the user's query conditions and added to the query queue for processing;
[0056] S2: Decompose the query task into multiple subtasks using a distributed framework, and assign the subtasks to different nodes for processing using a random algorithm.
[0057] S3: Establish a monitoring mechanism to monitor the operating status of each node. When a node fails, the subtasks of the failed node are transferred to the nearest edge node for processing.
[0058] S4: The node that completes the subtask processing transmits the processing results to the asynchronous query module, which merges the processing results of each node and sorts and removes duplicates.
[0059] S5: The sorted and deduplicated results returned by each node form a result set; the result set is optimized to form a query result, and the optimized query result is fed back to the corresponding client.
[0060] Specifically, by decomposing the task, the query task is decomposed into multiple subtasks, and the subtasks are assigned to different nodes for processing through a random algorithm; when a node is found to be faulty, the subtasks of the faulty node are transferred to the nearest edge node for processing; decomposing the task into multiple subtasks and processing them in parallel by multiple nodes at the same time is conducive to making full use of the computing resources of each node, improving the processing speed and throughput of the system; reducing the resource occupancy rate of a single node, thereby avoiding the emergence of resource bottlenecks and further improving the scalability of the system.
[0061] By distributing tasks to different nodes, even if some nodes fail, other nodes can still continue to process tasks, thereby effectively improving the reliability and availability of the system.
[0062] At the same time, by transferring the subtasks of the failed node to the nearest edge node for processing, the delay of task transmission can be reduced as much as possible, thereby improving the response speed of the system.
[0063] In one embodiment of the present invention, subtasks are assigned to different nodes for processing by a random algorithm, including the following steps:
[0064] According to the type of subtask obtained and the processing requirements of the subtask, perform the corresponding operation;
[0065] Determine whether the data required by the subtask comes from the edge node. If the subtask needs to obtain data from the edge node, directly transfer the subtask to the edge node for processing;
[0066] If there is no need to obtain data from the edge node, the data is searched from the local storage. If there is no data to be queried in the local storage, a query request is sent to other nodes.
[0067] The node processes the subtask, and after the task processing is completed, it needs to return the processing result of the subtask to the requesting node.
[0068] Specifically, when a subtask needs to obtain data from an edge node, it is directly transferred to the edge node for processing, which helps the subtask to be processed quickly. At the same time, the amount of data calls to the edge node is reduced, ensuring the efficient operation of the edge node. When there is no need to obtain data from the edge node, the data is searched from the local storage. If the local storage does not contain the data to be queried, a query request is sent to other nodes. By querying and calling information between nodes other than the edge node, the subtask can be processed quickly, speeding up the processing efficiency of the subtask, effectively reducing the large number of data calls to the edge node, and ensuring the security of the edge node data.
[0069] In one embodiment of the present invention, the asynchronous query module sorts and removes duplicates of the merged results, including the following steps:
[0070] Every time a new processing result is returned, the query results are sorted using an incremental sorting algorithm;
[0071] Sorting query results through incremental sorting algorithm does not require sorting all elements, which can reduce the time complexity of sorting.
[0072] For duplicate elements in the processing results returned by the node, the red-black tree algorithm is used to remove duplicate elements in the processing results.
[0073] In one embodiment of the present invention, duplicate elements in the processing result are deduplicated using a red-black tree algorithm, including the following steps:
[0074] Create an empty red-black tree and import the returned processing results into the red-black tree;
[0075] Read the data in the red-black tree one by one, and check whether the same data already exists in the red-black tree.
[0076] If it does not exist, the processing result is inserted into the red-black tree and marked as a black node; if it already exists, the processing result is skipped.
[0077] Continue to read the next returned processing result and repeat steps 2-3.
[0078] When all the processing results are completed, the data of all black nodes in the red-black tree are the results after deduplication.
[0079] Specifically, during the insertion process, the data in the red-black tree is read one by one, and the red-black tree is searched to see if the same data already exists. If not, the processing result is inserted into the red-black tree and marked as a black node to ensure the balance of the red-black tree. The specific operation needs to be judged and adjusted according to the current state of the inserted node and its parent node, grandparent node, etc. Deduplication of duplicate elements in the processing results through the red-black tree algorithm can avoid repeated processing, thereby saving computing resources and time and reducing unnecessary communication overhead. Deduplication can ensure that each element is processed only once, avoiding data inconsistency and calculation errors caused by repeated processing. Through deduplication, program design can be simpler, and the processing results can be stored directly in the red-black tree, avoiding the repeated storage process and being more efficient.
[0080] In one embodiment of the present invention, when step S5 is not completed and the query result has not been fed back to the corresponding client, after the user issues a request to suspend the query process, the following steps are performed:
[0081] The asynchronous query module persists the query process information;
[0082] If the user issues a request to continue the query process, the asynchronous query module will continue to operate the query task by controlling the thread;
[0083] If the user re-initiates a query request, the asynchronous query module will check whether there is a corresponding query result in the temporary cache, reload it, and continue the query from the pause point.
[0084] Specifically, after a user issues a request to pause a query, they may continue their query for the same question by requesting to resume the query or re-initiating a query. When resuming a paused query, the asynchronous query module prioritizes critical data by controlling threads, improving query efficiency. The request to resume the query will continue where it was previously paused, allowing users to easily track the query progress and obtain more accurate results. When a user re-initiates a query, the asynchronous query module checks the temporary cache for corresponding query results and reloads them. If the query results were obtained during the previous query but not yet fed back to the client, repeated queries can be avoided, saving time and resources and preventing high server load.
[0085] In one embodiment of the present invention, querying process information for persistence includes the following steps:
[0086] At the edge node, a temporary cache is created;
[0087] The query process is paused and the query results are stored in a temporary buffer.
[0088] Specifically, moving query processing to edge nodes can reduce data transmission and processing time, thereby improving query efficiency. It also reduces data loss and inconsistencies during network transmission, thereby improving the accuracy of query results. Moving query processing to edge nodes reduces reliance on central servers, thereby improving system scalability and effectively avoiding problems such as server overload.
[0089] Example 2
[0090] For the progress query system based on digital relocation, please refer to Figure 1-2 Shown, including:
[0091] User management module: used to manage user login information, registration information and permissions;
[0092] Database management module: used for storage, backup and recovery of various data related to digital relocation planning;
[0093] Asynchronous query module: used to respond to query requests and return query results, and transmit the query results to the data feedback module;
[0094] Data feedback module: used to process uploaded, imported or generated data, optimize query results, and feed back the optimized query results to the corresponding client.
[0095] In one embodiment of the present invention, the asynchronous query module includes:
[0096] The request receiving unit is used to receive query requests sent by various clients, abstract the query requests into file descriptions to form a file description set, create a query task based on the file description set, and add the task to the query queue;
[0097] The query queue is used to store the query tasks sent by the request receiving module and sort and number the query tasks;
[0098] Request processing unit: used to cyclically process query tasks in the query queue, obtain query results, and feed the query results back to the data feedback module;
[0099] Data deletion module: used to delete the query tasks and corresponding numbers that have been processed in the query queue.
[0100] In one embodiment of the present invention, the asynchronous query module is also used to create a temporary cache area at the edge node when a query request is interrupted, and store the unfinished query process and query results in the temporary cache area; when the user initiates a query request again, the asynchronous query module will check whether there is a corresponding query result in the temporary cache area and reload it.
[0101] Specifically, when a subtask needs to obtain data from an edge node, it is directly transferred to the edge node for processing, which helps the subtask to be processed quickly. At the same time, the amount of data calls to the edge node is reduced, ensuring the efficient operation of the edge node. When there is no need to obtain data from the edge node, the data is searched from the local storage. If the local storage does not contain the data to be queried, a query request is sent to other nodes. By querying and calling information between nodes other than the edge node, the subtask can be processed quickly, speeding up the processing efficiency of the subtask, effectively reducing the large number of data calls to the edge node, and ensuring the security of the edge node data.
[0102] In one embodiment of the present invention, when the request processing unit of the asynchronous query module processes a query task in a query queue, it decomposes the query task being processed and decomposes the query task into multiple subtasks through a distributed framework; the request processing unit assigns the subtasks to different nodes for processing through a random algorithm; and establishes a monitoring mechanism to monitor the operating status of each node through the monitoring mechanism; when a node is found to have a fault, the subtasks of the faulty node are transferred to the nearest edge node for processing.
[0103] Specifically, by decomposing the task, the query task is decomposed into multiple subtasks, and the subtasks are assigned to different nodes for processing through a random algorithm; when a node is found to be faulty, the subtasks of the faulty node are transferred to the nearest edge node for processing; decomposing the task into multiple subtasks and processing them in parallel by multiple nodes at the same time is conducive to making full use of the computing resources of each node, improving the processing speed and throughput of the system; reducing the resource occupancy rate of a single node, thereby avoiding the emergence of resource bottlenecks and further improving the scalability of the system.
[0104] In the description of the present invention, it should be understood that the terms "upper", "lower", "left", "right" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, and a specific direction structure and operation, and therefore, cannot be understood as limiting the present invention. In addition, "first" and "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0105] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0106] The above is a detailed description of an embodiment of the present invention. However, the content described is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.
Claims
1. The process query method based on digital relocation is characterized by: include: S1: When a user initiates a query request, a query task is created based on the user's query conditions and added to the query queue for processing; S2: Decompose the query task into multiple subtasks using a distributed framework, and assign the subtasks to different nodes for processing using a random algorithm. S3: Establish a monitoring mechanism to monitor the operating status of each node; When a node is found to be faulty, the subtasks of the faulty node are transferred to the nearest edge node for processing; S4: The node that completes the subtask processing transmits the processing results to the asynchronous query module, which merges the processing results of each node and sorts and removes duplicates. S5: The sorted and deduplicated results returned by each node form a result set. The result set is optimized to form a query result, and the optimized query result is fed back to the corresponding client. The subtasks are assigned to different nodes for processing through a random algorithm, including the following steps: According to the type of subtask obtained and the processing requirements of the subtask, perform the corresponding operation; Determine whether the data required by the subtask comes from the edge node. If the subtask needs to obtain data from the edge node, directly transfer the subtask to the edge node for processing; If there is no need to obtain data from the edge node, the data is searched from the local storage. If there is no data to be queried in the local storage, a query request is sent to other nodes. The node processes the subtask. After the task processing is completed, the processing result of the subtask needs to be returned to the requesting node; The asynchronous query module sorts and removes duplicates from the merged results, including the following steps: Every time a new processing result is returned, the query results are sorted using an incremental sorting algorithm; For duplicate elements in the processing results returned by the node, the red-black tree algorithm is used to remove duplicate elements in the processing results; The red-black tree algorithm is used to remove duplicate elements in the processing results, including the following steps: P1: Create an empty red-black tree and import the returned processing results into the red-black tree; P2: Read the data in the red-black tree one by one, and check whether the same data already exists in the red-black tree; P3: If it does not exist, insert the processing result into the red-black tree and mark it as a black node; if it already exists, skip the processing result; Continue to read the next returned processing result and repeat steps P2 P3; When all the processing results are completed, the data of all black nodes in the red-black tree are the results after deduplication.
2. The process query method based on digital relocation according to claim 1 is characterized in that: When step S5 is not completed, the query result has not been fed back to the corresponding client. After the user issues a request to suspend the query process, the following steps are performed: The asynchronous query module persists the query process information; If the user issues a request to continue the query process, the asynchronous query module will continue to operate the query task by controlling the thread; If the user re-initiates a query request, the asynchronous query module will check whether there is a corresponding query result in the temporary cache, reload it, and continue the query from the pause point.
3. The process query method based on digital relocation according to claim 2 is characterized in that: Query process information persistence, including the following steps: At the edge node, a temporary cache is created; The query process is paused and the query results are stored in a temporary buffer.
4. The process query system based on digital relocation is characterized by: The process query method based on digital relocation as described in claims 2-3 is adopted, comprising: User management module: used to manage user login information, registration information and permissions; Database management module: used for storage, backup and recovery of various data related to digital relocation planning; Asynchronous query module: used to respond to query requests and return query results, and transmit the query results to the data feedback module; Data feedback module: used to process uploaded, imported or generated data, optimize query results, and feed back the optimized query results to the corresponding client.
5. The process query system based on digital relocation according to claim 4 is characterized in that: The asynchronous query module includes: The request receiving unit is used to receive query requests sent by various clients, abstract the query requests into file descriptions to form a file description set, create a query task based on the file description set, and add the task to the query queue; The query queue is used to store the query tasks sent by the request receiving module and sort and number the query tasks; Request processing unit: used to cyclically process query tasks in the query queue, obtain query results, and feed the query results back to the data feedback module; Data deletion module: used to delete the query tasks and corresponding numbers that have been processed in the query queue.
6. The process query system based on digital relocation according to claim 4 is characterized in that: The asynchronous query module is also used to create a temporary cache area at the edge node when a query request is interrupted, and store the unfinished query process and query results in the temporary cache area; when the user initiates a query request again, the asynchronous query module will check whether there is a corresponding query result in the temporary cache area and reload it.
7. The process query system based on digital relocation according to claim 5 is characterized in that: When processing query tasks in the query queue, the request processing unit of the asynchronous query module decomposes the query task being processed into multiple subtasks through a distributed framework; the request processing unit assigns the subtasks to different nodes for processing through a random algorithm; And establish a monitoring mechanism to monitor the operating status of each node; When a node is found to be faulty, the subtasks of the faulty node are transferred to the nearest edge node for processing.
Citation Information
Patent Citations
System and method for task processing
CN103942098A
Method and device for establishing and inquiring index file
CN110019985A
Node switching method and device, computer equipment and storage medium
CN111294845A
Data query method and device, electronic equipment and storage medium
CN115495478A