GPU-based legal knowledge automatic retrieval and generation method and system

By building a task priority numbering table and batch task instructions on the GPU, and planning the GPU call order, the problems of fixed resource allocation and uneven video memory allocation in the existing technology are solved, efficient legal knowledge retrieval and generation are achieved, and task processing efficiency and accuracy of results are improved.

CN119938811AActive Publication Date: 2025-05-06BEIJING MAHA PULSE TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411988860.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-05-06
Estimated Expiration
2045-02-17

AI Technical Summary

Technical Problem

The lack of a dynamic priority adjustment mechanism in the existing technology has led to the fixed resource allocation, the inability to respond to important tasks in a timely manner, task classification and merging rely on fixed rules, video memory allocation does not fully consider the concurrency requirements of multi-tasks, resulting in uneven resource allocation or redundant task processing, the query results are separated from the generation process, and the output results are not targeted and comprehensive.

Method used

The automatic retrieval and generation method of legal knowledge based on GPU is adopted. By extracting the urgency value of the task, the memory usage parameters and calculation complexity, a task priority number table is constructed, and similar tasks are merged according to the task needs, batch task instructions are generated, GPU calls order, GPU resources are called batch by batch to complete task processing, the output data is integrated, the task re-planning status table is generated, and the legal knowledge retrieval and generation result data are finally generated.

Benefits of technology

Dynamic task priority adjustment, optimize resource allocation, improve task processing efficiency, avoid memory overflow or insufficient problems, improve equipment utilization and processing stability, improve the accuracy and comprehensiveness of search and generation results, and meet the needs of efficient legal knowledge output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938811A_ABST
    Figure CN119938811A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information retrieval, in particular to an automatic legal knowledge retrieval and generation method and system based on a GPU (Graphics Processing Unit), which comprises the following steps of: extracting task emergency degree numerical values based on task type information, task emergency degree parameters and video memory occupancy parameters, and distributing priority numbers according to a numerical value sequence, and comparing the video memory occupancy with the calculation complexity value. According to the method, the task priority is dynamically allocated, the task sorting is optimized according to the emergency degree, the video memory occupation amount and the calculation complexity, the tasks are classified and combined according to the demand value, the time range is screened, the task batch processing efficiency is improved, the resource waste is reduced, the video memory demand analysis is combined with the allowance to dynamically plan the resource calling, and the task scheduling efficiency is improved. The problem of video memory overflow or insufficiency is avoided, the task completion state is analyzed, the uncompleted task is accurately marked, the output content is integrated by comparing the task data with the query result, and the accuracy and comprehensiveness of the retrieval generation result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information retrieval technology, and in particular to a GPU-based legal knowledge automatic retrieval and generation method and system. Background Art

[0002] The field of information retrieval technology is an important branch of computer science, which mainly studies how to extract relevant information from large amounts of unstructured or semi-structured data. Its core goal is to index, store and retrieve data through effective algorithms and models to meet users' information needs. Information retrieval is widely used in search engines, recommendation systems, electronic document management and knowledge base systems, etc., which can help users quickly find content related to the query and improve the efficiency of information acquisition.

[0003] Among them, the automatic retrieval and generation method of legal knowledge refers to the use of information retrieval technology and related algorithms to automatically extract content related to user query needs from massive legal data such as legal documents and case libraries, and construct meaningful legal knowledge output through knowledge generation technology. The purpose of this method is to help legal practitioners, researchers and ordinary users quickly obtain accurate legal information, simplify the legal analysis and decision-making process, and thus improve work efficiency and the accuracy of knowledge acquisition.

[0004] The existing technology lacks a dynamic priority adjustment mechanism, resulting in fixed resource allocation and the inability to respond to important tasks in a timely manner. Task classification and merging rely on fixed rules and cannot flexibly adapt to multi-task requirements, resulting in uneven resource allocation or redundant task processing. Video memory allocation does not fully consider the concurrent needs of multiple tasks, which may lead to video memory overflow or idle resources due to improper planning, affecting efficiency and hardware performance. There is a lack of status marking and management mechanism for unfinished tasks, which cannot effectively identify the cause of failure or optimize subsequent paths, resulting in delayed processing or omission of tasks. The query results are separated from the generation process, and the output results lack pertinence and comprehensiveness, which is not conducive to the efficient acquisition and application of legal information. Summary of the invention

[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a GPU-based legal knowledge automatic retrieval and generation method and system.

[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solution: a GPU-based legal knowledge automatic retrieval and generation method, comprising the following steps:

[0007] S1: Based on the task type information, task urgency parameter and video memory occupancy parameter, extract the task urgency value, assign priority numbers in numerical order, compare the video memory occupancy with the computational complexity value, adjust the priority numbers in sequence, and construct a task priority number table;

[0008] S2: Based on the task priority number table and the small task calculation requirement parameters, extract the small task calculation requirement values, merge similar tasks according to the requirement values, filter tasks by comparing the values ​​of the time range, classify resource requirements and generate batch task instructions, and generate a batch task call list;

[0009] S3: Based on the batch task call list and in combination with the task characteristic parameters, the total amount of video memory required for the batch tasks is calculated, and the video memory margin and the video memory occupancy ratio are compared. The GPU call sequence is planned according to the task characteristics, and GPU resources are called batch by batch to complete task processing, thereby generating a batch task output data set.

[0010] S4: Based on the batch task output data set and the task queue status parameters, the task completion status value is parsed, the resource allocation value of the suspended task is extracted and the resource calling sequence is re-planned, the output data is integrated, and a task re-planning status table is generated;

[0011] S5: Based on the task re-planning status table and the legal knowledge base query results, compare the task completion status with the query result value, classify and mark the unfinished tasks by step value, and integrate the marked value with the query results to generate legal knowledge retrieval and generation result data.

[0012] The task priority number table specifically includes the task urgency value, priority number, and video memory occupancy parameters; the batch task call list includes the small task computing requirement value, the merging status of similar tasks, the entry time range value, and the resource requirement classification; the batch task output data set includes the total video memory requirement, video memory remaining, video memory occupancy ratio, GPU call sequence, and task processing completion status; the task replanning status table includes the task completion status value, suspended task resource allocation value, resource call replanning sequence, and output data integration status; the legal knowledge retrieval and generation result data includes the step-by-step numerical classification of unfinished tasks, the legal knowledge base query result value, and the mark value integration.

[0013] As a further solution of the present invention, the step of obtaining the task priority number table is specifically as follows:

[0014] S111: extracting task urgency values ​​based on task type information, task urgency parameters and video memory usage parameters, screening tasks according to task type information, preliminarily classifying tasks according to urgency parameters and task type descriptions, and generating preliminary task urgency classification results;

[0015] S112: Using the preliminary classification results of the task urgency, prioritize each task, arranging them from high to low according to the urgency value, and calculating the video memory usage parameter and complexity parameter of each task using the formula:

[0016]

[0017] Calculate the priority number of each task, generate the task priority adjustment result, and establish the task priority number table;

[0018] Among them, P i Represents the task priority number, E i Represents the urgency of the task, T i represents the estimated task completion time, C i Represents the computational complexity, M i Represents the amount of video memory used.

[0019] As a further solution of the present invention, the steps of obtaining the batch task call list are specifically as follows:

[0020] S211: According to the task priority number table, the calculation requirement parameters of each small task are retrieved, the calculation requirement values ​​of multiple small tasks are extracted, and tasks with similar requirement values ​​are classified and integrated according to the range and characteristics of the requirement values ​​to generate a preliminary task grouping result;

[0021] S212: Based on the preliminary task grouping result, the entry time range value of each group of tasks is analyzed using the formula:

[0022]

[0023] Calculate the average deviation entry time of each group of tasks, use this time as the screening basis, screen the task groups that meet the target time window, and generate a time screening task list;

[0024] Among them, τ group represents the average time of the adjusted task group, T i is the entry time of a single task, C i is the corresponding computational complexity, α is the adjustment coefficient, and n is the number of tasks in the task group;

[0025] S213: Filter the task list based on the time, classify the resource requirements of the filtered tasks, integrate and generate batch task instructions according to the resource usage and computing requirements of multiple tasks, and establish and complete the batch task call list.

[0026] As a further solution of the present invention, the step of obtaining the batch task output data set is specifically:

[0027] S311: According to the batch task call list, retrieve the task characteristic parameters, extract the video memory requirement parameter value of each batch task, calculate the correlation between the video memory requirements of the tasks, accumulate the total video memory requirements, and generate the total video memory requirement result of the batch tasks;

[0028] S312: Based on the total amount of video memory demand of the batch tasks, compare the video memory margin and the video memory occupancy ratio of the current GPU, and calculate the weight relationship between the occupancy ratio and the margin using the formula:

[0029]

[0030] Calculate the memory priority planning parameters of the task and generate the memory priority planning parameter results;

[0031] Where η represents the memory priority planning parameter, which is used for the task memory priority calling sequence, V r Indicates the remaining video memory of the GPU, V t Indicates the total amount of video memory required by the current batch task, V max Indicates the total memory capacity of the GPU, W1 and W2 represent the weight parameters of the memory margin and memory occupancy ratio respectively;

[0032] S313: Analyze the task characteristic parameters according to the calculated priority using the memory priority planning parameter result, call GPU resources in sequence according to the memory priority planning sequence, complete task processing in batches, and generate batch task output data sets.

[0033] As a further solution of the present invention, the steps of obtaining the task replanning state table are specifically as follows:

[0034] S411: analyzing the task completion status values ​​in the batch task output data set, identifying unfinished or suspended tasks through parsing and classification, and generating status classification results according to resource requirements and status;

[0035] S412: extracting the resource allocation value of each suspended task from the state classification result, and recalculating the resource priority of multiple tasks using the formula:

[0036]

[0037] Calculate the adjusted resource allocation and generate resource allocation priorities;

[0038] Among them, R new Indicates the resource allocation priority, R i represents the current resource allocation value of the i-th task, represents the average value of resource allocation for all tasks, R max represents the maximum resource allocation value, P i represents the priority of the i-th task, and n represents the number of tasks involved in the calculation;

[0039] S413: using the resource allocation priority, re-planning the task queue, optimizing the resource calling sequence, integrating the output data, and generating a task re-planning status table.

[0040] As a further solution of the present invention, the steps of obtaining the legal knowledge retrieval and generation result data are specifically as follows:

[0041] S511: Based on the task re-planning status table, the completion status value of each task and the query result of the associated legal knowledge base are retrieved, unfinished tasks associated with legal clauses are identified, and a preliminary legally associated task list is generated;

[0042] S512: Based on the preliminary legally relevant task list, the step values ​​of the unfinished tasks are subdivided, and each task is categorized and marked based on its legal relevance and the complexity of the completion status, using the formula:

[0043]

[0044] Calculate and obtain the legal relevance marking result;

[0045] Among them, L tag Indicates the legal relevance mark, C i Indicates the completion status value of the i-th task, S i represents the value of the legal query result of the i-th task, λ represents the adjustment coefficient, which refers to the weight enhancement of the legal query result, and n represents the total number of tasks involved in the calculation;

[0046] S513: Utilizing the legal relevance marking result, integrating the marking value and the query result, re-querying the legal knowledge base to match the task requirements, and generating legal knowledge retrieval and generation result data.

[0047] A GPU-based legal knowledge automatic retrieval and generation system, the GPU-based legal knowledge automatic retrieval and generation system is used to execute the GPU-based legal knowledge automatic retrieval and generation method, the system includes:

[0048] The task priority planning module extracts and sorts the task urgency values ​​based on task type information, task urgency parameters and video memory occupancy parameters, compares the video memory occupancy and calculates the complexity to adjust the priority order, numbers the task priorities, and constructs a priority number list;

[0049] The batch task generation module extracts the small task calculation requirement parameters based on the task priority number table, calculates the requirement values ​​and classifies them, filters the tasks that enter the time range, integrates the calculation requirement classification to generate batch task instructions, and constructs a batch task call list;

[0050] The GPU resource scheduling module calculates the total amount of video memory demand based on the batch task call list and the task characteristic parameters, plans the call sequence by comparing the video memory margin and the video memory occupancy ratio, allocates GPU resources to complete task processing, generates task calculation data, and integrates them into a batch task output data set;

[0051] The result integration and knowledge generation module analyzes the task completion status and adjusts the GPU call order based on the batch task output data set, reallocates suspended tasks to GPU processing, compares the task completion status and value with the query results, integrates the marking status and query data, and generates legal knowledge retrieval generation result data.

[0052] Compared with the prior art, the advantages and positive effects of the present invention are:

[0053] In the present invention, by dynamically allocating task priorities, task sorting is optimized according to urgency, video memory usage, and computational complexity, so as to achieve reasonable resource allocation and reduce the possibility of delays in high-priority tasks due to resource conflicts. Tasks are classified and merged based on demand values, and time ranges are screened to improve the efficiency of batch processing of tasks and reduce resource waste. Video memory demand analysis is combined with the remaining dynamic planning resource call to avoid video memory overflow or insufficient problems, improve equipment utilization and processing stability. Task completion status analysis and accurate marking of unfinished tasks, by comparing task data with query results, integrate output content, improve the accuracy and comprehensiveness of retrieval generation results, and meet the needs of efficient legal knowledge output. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a schematic diagram of the workflow of the present invention;

[0055] Figure 2 A flowchart of the steps for obtaining the task priority number table of the present invention;

[0056] Figure 3 A flowchart of the steps for obtaining a batch task call list of the present invention;

[0057] Figure 4 A flow chart of the steps for obtaining a batch task output data set of the present invention;

[0058] Figure 5 A flowchart of the steps for obtaining the task replanning state table of the present invention;

[0059] Figure 6 This is a flow chart of the steps for obtaining legal knowledge retrieval and generating result data of the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0061] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the 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 orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.

[0062] Embodiment 1

[0063] See also Figure 1 The present invention provides a technical solution: a GPU-based automatic retrieval and generation method for legal knowledge, comprising the following steps:

[0064] S1: Based on the task type information, task urgency parameter and video memory occupancy parameter, extract the task urgency value, assign priority numbers in numerical order, compare the video memory occupancy with the computational complexity value, adjust the priority numbers in sequence, and construct a task priority number table;

[0065] S2: Based on the task priority number table and small task calculation requirement parameters, extract the small task calculation requirement values, merge similar tasks according to the requirement values, filter tasks by comparing the values ​​of the time range, classify resource requirements and generate batch task instructions, and generate a batch task call list;

[0066] S3: Based on the batch task call list and task characteristic parameters, the total amount of video memory required for the batch tasks is calculated. At the same time, the video memory margin and the video memory occupancy ratio are compared. The GPU call sequence is planned according to the task characteristics. GPU resources are called batch by batch to complete task processing and generate batch task output data sets.

[0067] S4: Based on the batch task output data set and task queue status parameters, parse the task completion status value, extract the suspended task resource allocation value and re-plan the resource call sequence, integrate the output data, and generate the task re-planning status table;

[0068] S5: Based on the task re-planning status table and the legal knowledge base query results, compare the task completion status with the query result value, classify and mark the unfinished tasks by step value, and integrate the marked value with the query results to generate legal knowledge retrieval and generation result data.

[0069] The task priority number table specifically includes the task urgency value, priority number, and video memory occupancy parameters. The batch task call list includes the small task computing requirement value, the merging status of similar tasks, the entry time range value, and the resource requirement classification. The batch task output data set includes the total video memory requirement, video memory remaining, video memory occupancy ratio, GPU call sequence, and task processing completion status. The task replanning status table includes the task completion status value, suspended task resource allocation value, resource call replanning sequence, and output data integration status. The legal knowledge retrieval and generation result data includes the step-by-step numerical classification of unfinished tasks, the legal knowledge base query result value, and the tag value integration.

[0070] See also Figure 2 , the specific steps for obtaining the task priority number table are:

[0071] S111: extracting task urgency values ​​based on task type information, task urgency parameters and video memory usage parameters, screening tasks according to task type information, preliminarily classifying tasks according to urgency parameters and task type descriptions, and generating preliminary task urgency classification results;

[0072] Based on the screening of task type information, the urgency parameters and the specific description of the task type are used to preliminarily classify the tasks. By collecting the urgency data of each task type and comparing these data with the preset urgency threshold, the tasks that need special attention are screened out. This process not only relies on the accurate input of data, but also requires a comprehensive classification based on the actual situation of the task and the true value of the urgency. This classification helps optimize the task processing flow and ensures that resources are reasonably allocated to the most needed tasks, thereby improving response efficiency and processing capabilities.

[0073] S112: Using the preliminary classification results of task urgency, prioritize each task, arranging them from high to low according to the urgency value, and calculating the video memory usage parameter and complexity parameter of each task using the formula:

[0074]

[0075] Calculate the priority number of each task, generate the task priority adjustment result, and establish the task priority number table;

[0076] Among them, P i Represents the task priority number, E iRepresents the urgency of the task, T i represents the estimated task completion time, C i Represents the computational complexity, M i Represents the amount of video memory used;

[0077] formula:

[0078]

[0079] The benefit of the formula is that by comprehensively considering the urgency and time required for the task and dividing it by the square root of the sum of the squares of the computational complexity and the amount of memory usage, the system resources can be allocated more fairly to give priority to tasks that are both urgent and have higher resource requirements, which helps to optimize system performance and reduce delays in task processing.

[0080] Detailed explanation of the formula and the process of formula calculation and derivation:

[0081] Suppose there is a task with an urgency level of E. i 5 (very urgent), estimated completion time T i 2 hours, computational complexity C i 3 (medium complexity), video memory usage M i is 4GB; the calculation process is as follows:

[0082]

[0083] This result shows that the task has a priority number of 2, which means that the task has medium priority among all pending tasks, ensuring that more urgent or resource-demanding tasks can be processed first.

[0084] See also Figure 3 , the specific steps for obtaining the batch task call list are:

[0085] S211: According to the task priority number table, the calculation requirement parameters of each small task are retrieved, the calculation requirement values ​​of multiple small tasks are extracted, and tasks with similar requirement values ​​are classified and integrated according to the range and characteristics of the requirement values ​​to generate a preliminary task grouping result;

[0086] The computing requirement parameters are extracted according to the task priority number table, and preliminary task grouping is carried out. According to the computing requirement values ​​of each small task, tasks with similar requirements are identified and integrated, and tasks are classified according to the numerical range and specific characteristics of the requirement values. Through this process, resources can be managed more effectively and the task processing flow can be optimized. This classification and integration method not only improves the efficiency of task processing, but also optimizes the allocation and use of resources, and generates preliminary task grouping results. This result provides a basis for subsequent task scheduling and resource allocation.

[0087] S212: Based on the preliminary task grouping results, analyze the entry time range values ​​of each group of tasks using the formula:

[0088]

[0089] Calculate the average deviation entry time of each group of tasks, use this time as the screening basis, screen the task groups that meet the target time window, and generate a time screening task list;

[0090] Among them, τ group represents the average time of the adjusted task group, T i is the entry time of a single task, C i is the corresponding computational complexity, α is the adjustment coefficient, and n is the number of tasks in the task group;

[0091] formula:

[0092]

[0093] The benefit of the formula is that by combining the entry time of the task with its computational complexity and adjusting it in the form of an α exponent, the adjustment of the task priority is more in line with the actual complexity, thereby achieving effective time management and resource allocation in the system.

[0094] Detailed explanation of the formula and the process of formula calculation and derivation:

[0095] Assume that there are three tasks, the entry time T of each task is 3, 5, and 8 time units, the computational complexity C is 1, 2, and 4 respectively, the adjustment coefficient α is set to 0.5, and the number of tasks n = 3. Then:

[0096]

[0097] This result shows that: the τ calculated in this way group The value reflects the weighted average of the time complexity of each task, which more fairly evaluates the overall performance of the task group.

[0098] S213: Filter the task list based on time, classify the resource requirements of the filtered tasks, integrate and generate batch task instructions according to the resource usage and computing requirements of multiple tasks, and establish and complete the batch task call list.

[0099] Use time to filter the task list to classify resource requirements, and refine the task resource allocation process based on the resource usage and computing requirements of the filtered task groups. This process involves a detailed matching analysis of the total amount of resources actually used by each task and the computing requirements of each task. Through this refined resource classification and integration, the resource utilization efficiency can be effectively improved and resource waste can be avoided. At the same time, the execution speed of tasks is also accelerated, making the operation of the entire system more efficient and stable, generating batch task instructions and establishing a completed batch task call list, providing a solid foundation for the further operation of the system.

[0100] See also Figure 4 , the specific steps for obtaining the batch task output data set are:

[0101] S311: According to the batch task call list, retrieve the task characteristic parameters, extract the video memory requirement parameter value of each batch task, calculate the correlation between the video memory requirements of the tasks, accumulate the total video memory requirements, and generate the total video memory requirement result of the batch tasks;

[0102] Extract the video memory requirement parameters of each batch task. These parameters reflect the video memory usage of different tasks during execution. By calculating the total video memory requirement of each task and combining the characteristic parameters of the task, such as task type, task priority and expected time of task execution, the total video memory requirement can be estimated. This process involves the accumulation and weight allocation of video memory requirement parameters. The weight setting is based on the urgency of the task and the resource consumption. The total video memory requirement result of the batch task is generated to provide a basis for the subsequent GPU resource scheduling.

[0103] S312: Based on the total amount of video memory demand of the batch tasks, compare the current GPU video memory margin and the video memory occupancy ratio, and calculate the weight relationship between the occupancy ratio and the margin using the formula:

[0104]

[0105] Calculate the memory priority planning parameters of the task and generate the memory priority planning parameter results;

[0106] Where η represents the memory priority planning parameter, which is used for the task memory priority calling sequence, V r Indicates the remaining video memory of the GPU, V t Indicates the total amount of video memory required by the current batch task, V max Indicates the total memory capacity of the GPU, W1 and W2 represent the weight parameters of the memory margin and memory occupancy ratio respectively;

[0107] formula:

[0108]

[0109] The benefit of the formula is that it combines the square root of the difference between the remaining video memory and the total video memory requirement as well as the video memory occupancy ratio to dynamically adjust the weight parameters and achieve effective utilization of video memory resources. This method can flexibly schedule GPU resources according to the actual video memory situation and optimize the order of task execution.

[0110] Detailed explanation of the formula and the process of formula calculation and derivation:

[0111] Set V r = 2000MB as the remaining GPU memory, V t =5000MB is the total memory requirement of the current batch task, V max = 8000MB is the total memory capacity of the GPU. The weights W1 and W2 are set to 1.5 and 0.5 according to the urgency of past task execution and historical data of resource consumption. The calculation process is as follows:

[0112] 1. Calculate the memory difference and its square root processing:

[0113] 2. Calculate the video memory usage ratio:

[0114] 3. Apply the formula to calculate η:

[0115] The result shows that, considering the current memory margin and total demand, the memory priority planning parameter is 27.49, which will guide the decision of GPU call order and ensure efficient allocation of resources.

[0116] S313: Analyze the task characteristic parameters according to the calculated priority using the memory priority planning parameter results, call GPU resources in sequence according to the memory priority planning sequence, complete task processing in batches, and generate batch task output data sets.

[0117] The process involves comparing the video memory requirements of each batch of tasks with the remaining video memory to ensure the smooth execution of each batch of tasks and not exceeding the maximum capacity of the GPU. Tasks are processed in batches according to the priority of video memory occupancy, and batch task output results are generated. This output result records in detail the execution status and required time of each batch of tasks, providing the system with detailed task processing records and resource utilization reports.

[0118] See also Figure 5 , the specific steps for obtaining the task replanning status table are:

[0119] S411: Analyze the task completion status values ​​in the batch task output data set, identify unfinished or suspended tasks through parsing and classification, and generate status classification results according to resource requirements and status;

[0120] This step is very critical because it directly affects the subsequent reallocation of resources and the adjustment of task priorities. After the task status is classified as suspended or unfinished, a status classification result is generated for each task. The status classification result will be used as an input parameter for the resource reallocation strategy. This is a key step in achieving resource optimization and task scheduling in the task management system. Through this processing step, the system can more accurately perform optimization operations on specific tasks to ensure maximum resource utilization and improved task processing efficiency.

[0121] S412: Extract the resource allocation value of each suspended task from the status classification result, and recalculate the resource priority of multiple tasks using the formula:

[0122]

[0123] Calculate the adjusted resource allocation and generate resource allocation priorities;

[0124] Among them, R new Indicates the resource allocation priority, R i represents the current resource allocation value of the i-th task, R represents the average resource allocation of all tasks, and R max represents the maximum resource allocation value, P i represents the priority of the i-th task, and n represents the number of tasks involved in the calculation;

[0125] formula:

[0126]

[0127] The benefit of the formula is that it rebalances resources based on the resource allocation bias and priority weights of each task, which helps optimize the overall performance and response time of the system.

[0128] Detailed explanation of the formula and the process of formula calculation and derivation:

[0129] Assume that the current resource allocation values ​​of three tasks are R1=100, R2=150, and R3=200, and the average resource allocation is Maximum resource allocation value R max =300, the priorities of each task are P1=1, P2=2, P3=3. Calculate the ratio of the resource allocation deviation of each task to the maximum value and multiply it by its priority weight:

[0130]

[0131] Then find the weighted average of the weight parameters:

[0132] R new =(0.1667+0+0.5)÷(1+2+3)=0.1111;

[0133] This result shows that according to the current resource allocation deviation and task priority, the new resource allocation value R new A value of 0.1111 will direct the system to reallocate resources to support all pending tasks more fairly and efficiently.

[0134] S413: Use resource allocation priorities to re-plan the task queue, optimize the resource calling sequence, integrate the output data, and generate a task re-planning status table.

[0135] The key to this step is that it directly determines the efficiency of task processing and the utilization of system resources. Through this fine resource priority adjustment, the system can more reasonably allocate its resources to those tasks that need it most, thereby ensuring that tasks can be processed efficiently in order of priority. The generated task replanning status table not only reflects the current task execution status, but also provides a basis for future scheduling strategies, which is crucial to maintaining the stability of system operation and improving the response speed of task processing.

[0136] See also Figure 6 ,The specific steps for obtaining legal knowledge retrieval and generation result data are as follows:

[0137] S511: Based on the task re-planning status table, the completion status value of each task and the query result of the associated legal knowledge base are retrieved, the unfinished tasks associated with the legal terms are identified, and a preliminary legally associated task list is generated;

[0138] Based on the task re-planning status table, the task completion status value and the query results of the relevant legal knowledge base, through analysis and identification, it is found that many instances in the unfinished tasks have a high degree of legal relevance, which requires not only considering the physical completion status of the task, but also a more detailed analysis based on the legal impact of the task. By combining the specific legal issues of each task, a more accurate task priority and resource allocation strategy can be formulated. Such a strategy not only optimizes resource allocation, but also ensures the minimization of legal risks. This is particularly important when dealing with issues involving contract breach, regulatory compliance, etc. The goal is to improve the efficiency and legal security of task processing through this method.

[0139] S512: Based on the preliminary legally relevant task list, subdivide the step values ​​of the unfinished tasks, and classify and label each task based on its legal relevance and the complexity of the completion status, using the formula:

[0140]

[0141] Calculate and obtain the legal relevance marking result;

[0142] Among them, L tagIndicates the legal relevance mark, C i Indicates the completion status value of the i-th task, S i represents the value of the legal query result of the i-th task, λ represents the adjustment coefficient, which refers to the weight enhancement of the legal query result, and n represents the total number of tasks involved in the calculation;

[0143] formula:

[0144]

[0145] The benefit of the formula is that by introducing square root operations and adjustment coefficients for legal query results, the sensitivity of legal-related task markers is enhanced, making them more reflective of the urgency and legal importance of the task.

[0146] Detailed explanation of the formula and the process of formula calculation and derivation:

[0147] Assume there are three tasks, where the completion status value C i The legal query result value is 20, 30, and 40 respectively. i are 200, 300, and 500 respectively, and the adjustment coefficient λ is 5. get:

[0148]

[0149] Calculate each

[0150] 20·14.14+5=287.8;

[0151] 30·17.32+5=524.6;

[0152] 40·22.36+5=899.4;

[0153] Total: 287.8+524.6+899.4=1711.8;

[0154] Total S i Sum: 200+300+500=1000;

[0155] L tag The calculation is:

[0156]

[0157] The results show that the legal relevance is marked as 1.7118, indicating that the task completion status and the importance of the legal query results are weighted to obtain the relevance score of each task in the legal knowledge base. This score can be used to prioritize tasks with high legal relevance.

[0158] S513: Using the legal relevance marking results, integrating the marking values ​​and the query results, re-querying the legal knowledge base to match the task requirements, and generating legal knowledge retrieval and generation result data.

[0159] By using the task list re-planned through legal relevance marking, the legal knowledge base can be queried in a targeted manner, which not only speeds up the retrieval of legal information, but also ensures the relevance and accuracy of the acquired information. Throughout the process, attention is paid to matching the specific legal requirements of each task with the corresponding information in the knowledge base. This matching process takes into account the urgency of the task, the legal complexity and the possible legal consequences, thereby generating highly targeted legal knowledge retrieval results. These results will directly support subsequent legal decisions and risk management measures. The resulting legal knowledge retrieval and generation result data provide the project team with the necessary legal support, ensuring the smooth progress of the project and reducing potential legal risks.

[0160] A GPU-based legal knowledge automatic retrieval and generation system, which is used to execute the GPU-based legal knowledge automatic retrieval and generation method, and includes:

[0161] The task priority planning module extracts and sorts the task urgency values ​​based on task type information, task urgency parameters and video memory occupancy parameters, compares the video memory occupancy and calculates the complexity to adjust the priority order, numbers the task priorities, and constructs a priority number list;

[0162] The batch task generation module extracts the small task calculation requirement parameters based on the task priority number table, calculates the requirement values ​​and classifies them, filters the tasks that enter the time range, integrates the calculation requirement classification to generate batch task instructions, and constructs a batch task call list;

[0163] The GPU resource scheduling module calculates the total amount of video memory demand based on the batch task call list and the task characteristic parameters, plans the call sequence by comparing the video memory margin and the video memory occupancy ratio, allocates GPU resources to complete task processing, generates task calculation data, and integrates them into a batch task output data set;

[0164] The result integration and knowledge generation module analyzes the task completion status and adjusts the GPU call order based on the batch task output data set, reallocates suspended tasks to GPU processing, compares the task completion status and value with the query results, integrates the marking status and query data, and generates legal knowledge retrieval generation result data.

[0165] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A GPU-based method for automatically retrieving and generating legal knowledge, characterized in that: The following steps are involved: Based on the task type information, task urgency parameters and video memory occupancy parameters, the task urgency value is extracted, and priority numbers are assigned in numerical order. At the same time, the video memory occupancy and computational complexity values ​​are compared, and the priority numbers are adjusted in sequence to construct a task priority number table. Based on the task priority number table and small task calculation requirement parameters, extract small task calculation requirement values, merge similar tasks according to the requirement values, filter tasks by comparing the time range values, classify resource requirements and generate batch task instructions, and generate a batch task call list; Based on the batch task call list and in combination with the task characteristic parameters, the total amount of video memory required for the batch tasks is calculated, and at the same time, the video memory margin and the video memory occupancy ratio are compared, the GPU call sequence is planned according to the task characteristics, and the GPU resources are called batch by batch to complete the task processing, and the batch task output data set is generated; Based on the batch task output data set and task queue status parameters, the task completion status value is parsed, the suspended task resource allocation value is extracted and the resource calling sequence is re-planned, the output data is integrated, and a task re-planning status table is generated; Based on the task re-planning status table and the legal knowledge base query results, the task completion status is compared with the query result value, the unfinished tasks are classified and marked by step-by-step numerical values, and the marked values ​​are integrated with the query results to generate legal knowledge retrieval and generation result data.

2. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 1 is characterized in that: The task priority number table specifically includes the task urgency value, priority number, and video memory occupancy parameters; the batch task call list includes the small task computing requirement value, the merging status of similar tasks, the entry time range value, and the resource requirement classification; the batch task output data set includes the total video memory requirement, video memory remaining, video memory occupancy ratio, GPU call sequence, and task processing completion status; the task replanning status table includes the task completion status value, suspended task resource allocation value, resource call replanning sequence, and output data integration status; the legal knowledge retrieval and generation result data includes the step-by-step numerical classification of unfinished tasks, the legal knowledge base query result value, and the mark value integration.

3. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 2 is characterized in that: The steps for obtaining the task priority number table are specifically as follows: Based on the task type information, task urgency parameters and video memory usage parameters, the task urgency values ​​are extracted, the tasks are screened according to the task type information, the tasks are preliminarily classified according to the urgency parameters and the description of the task type, and the preliminary classification results of the task urgency are generated; Using the preliminary classification results of the task urgency, prioritize each task, arranging them from high to low according to the urgency value, and calculate according to the video memory occupancy parameter and complexity parameter of each task, using the formula: Calculate the priority number of each task, generate the task priority adjustment result, and establish the task priority number table; Among them, P i Represents the task priority number, E i Represents the urgency of the task, T i represents the estimated task completion time, C i Represents the computational complexity, M i Represents the amount of video memory used.

4. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 3 is characterized in that: The steps for obtaining the batch task call list are specifically as follows: According to the task priority number table, the calculation requirement parameters of each small task are retrieved, the calculation requirement values ​​of multiple small tasks are extracted, and tasks with similar requirement values ​​are classified and integrated according to the range and characteristics of the requirement values ​​to generate a preliminary task grouping result; Based on the preliminary task grouping results, the entry time range values ​​of each group of tasks are analyzed using the formula: Calculate the average deviation entry time of each group of tasks, use this time as the screening basis, screen the task groups that meet the target time window, and generate a time screening task list; Among them, τ group represents the average time of the adjusted task group, T i is the entry time of a single task, C i is the corresponding computational complexity, α is the adjustment coefficient, and n is the number of tasks in the task group; Based on the time, the task list is screened, resource requirements are classified for the screened tasks, batch task instructions are integrated and generated according to resource usage and computing requirements of multiple tasks, and a batch task call list is established and completed.

5. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 4 is characterized in that: The steps for obtaining the batch task output data set are specifically as follows: According to the batch task call list, task characteristic parameters are retrieved, the video memory requirement parameter value of each batch task is extracted, and the total video memory requirement is accumulated in combination with the correlation calculation between the video memory requirements of the tasks to generate the total video memory requirement result of the batch tasks; Based on the total amount of video memory demand of the batch tasks, the video memory margin and the video memory occupancy ratio of the current GPU are compared, and the weight relationship between the occupancy ratio and the margin is calculated using the formula: Calculate the memory priority planning parameters of the task and generate the memory priority planning parameter results; Where η represents the memory priority planning parameter, which is used for the task memory priority calling sequence, V r Indicates the remaining video memory of the GPU, V t Indicates the total amount of video memory required by the current batch task, V max Indicates the total memory capacity of the GPU, W1 and W2 represent the weight parameters of the memory margin and memory occupancy ratio respectively; The memory priority planning parameter result is used to analyze the task characteristic parameters according to the calculated priority, and the GPU resources are called in sequence in combination with the memory priority planning order to complete the task processing in batches and generate a batch task output data set.

6. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 5 is characterized in that: The steps for obtaining the task replanning status table are specifically as follows: Analyze the task completion status values ​​in the batch task output data set, identify unfinished or suspended tasks through parsing and classification, and generate status classification results based on resource requirements and status; The resource allocation value of each suspended task is extracted from the state classification result, and the resource priority of the multiple tasks is recalculated using the formula: Calculate the adjusted resource allocation and generate resource allocation priorities; Among them, R new Indicates the resource allocation priority, R i represents the current resource allocation value of the i-th task, R represents the average resource allocation of all tasks, and R max represents the maximum resource allocation value, P i represents the priority of the i-th task, and n represents the number of tasks involved in the calculation; The resource allocation priority is utilized to re-plan the task queue, optimize the resource calling sequence, integrate the output data, and generate a task re-planning status table.

7. The GPU-based automatic retrieval and generation method of legal knowledge according to claim 6 is characterized in that: The steps for obtaining the legal knowledge retrieval and generation result data are specifically as follows: Based on the task re-planning status table, the completion status value of each task and the query result of the associated legal knowledge base are retrieved, the unfinished tasks associated with the legal terms are identified, and a preliminary legally associated task list is generated; Based on the preliminary legal relevance task list, the step values ​​of the unfinished tasks are broken down, and each task is categorized and labeled based on its legal relevance and the complexity of the completion status, using the formula: Calculate and obtain the legal relevance marking result; Among them, L tag Indicates the legal relevance mark, C i Indicates the completion status value of the i-th task, S i represents the value of the legal query result of the i-th task, λ represents the adjustment coefficient, which refers to the weight enhancement of the legal query result, and n represents the total number of tasks involved in the calculation; By utilizing the legal relevance marking results, the marking values ​​and the query results are integrated, and the legal knowledge base is queried again to match the task requirements, thereby generating legal knowledge retrieval and generation result data.

8. A GPU-based legal knowledge automatic retrieval and generation system, characterized by: According to the GPU-based automatic retrieval and generation method of legal knowledge according to any one of claims 1 to 7, the system comprises: The task priority planning module extracts and sorts the task urgency values ​​based on task type information, task urgency parameters and video memory occupancy parameters, compares the video memory occupancy and calculates the complexity to adjust the priority order, numbers the task priorities, and constructs a priority number list; The batch task generation module extracts the small task calculation requirement parameters based on the task priority number table, calculates the requirement values ​​and classifies them, filters the tasks that enter the time range, integrates the calculation requirement classification to generate batch task instructions, and constructs a batch task call list; The GPU resource scheduling module calculates the total amount of video memory demand based on the batch task call list and the task characteristic parameters, plans the call sequence by comparing the video memory margin and the video memory occupancy ratio, allocates GPU resources to complete task processing, generates task calculation data, and integrates them into a batch task output data set; The result integration and knowledge generation module analyzes the task completion status and adjusts the GPU call order based on the batch task output data set, reallocates suspended tasks to GPU processing, compares the task completion status and value with the query results, integrates the marking status and query data, and generates legal knowledge retrieval generation result data.

Citation Information

Patent Citations

  • Task scheduling method and device based on CPU-GPU cooperative computing

    CN112596902A

  • Task allocation system based on big data analysis

    CN118193172A

  • GPU cluster service management system and scheduling method

    CN118312324A

  • Marine emergency scheduling method and system based on interaction

    CN118446501A

  • GPU server cluster system and GPU scheduling method

    CN119248460A