A GPU-based Automatic Retrieval and Generation Method and System for Legal Knowledge

Through automatic retrieval and generation of legal knowledge based on GPU, task sorting and resource allocation are dynamically optimized, and the problems of fixed resource allocation and inflexible task processing in the existing technology are solved, and efficient and stable legal knowledge output is achieved.

CN119938811BActive Publication Date: 2025-08-01BEIJING MAHA PULSE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing technology lacks a dynamic priority adjustment mechanism, resulting in fixed resource allocation, 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 needs, and video memory allocation does not fully consider multi-task concurrency needs, which may lead to memory overflow or resource idleness, query results and generation processes are separated, and output results are lacking targeted and comprehensive.

Method used

Automatic retrieval and generation of legal knowledge based on GPU is adopted to optimize task sorting through task urgency, memory usage and calculation complexity, dynamic allocation of resources, merge similar tasks, filter time range, plan GPU resource call order, analyze task completion status, and integrate output results.

Benefits of technology

It realizes reasonable allocation of resources, improves task processing efficiency, reduces resource waste, avoids overflow or insufficient video memory, improves equipment utilization and processing stability, and improves the accuracy and comprehensiveness of search and generation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938811B_ABST
    Figure CN119938811B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of information retrieval, and specifically to a method and system for automatic retrieval and generation of legal knowledge based on GPU, including the following steps: Extract the task urgency value based on the task type information, task urgency parameter, and video memory occupancy parameter, assign a priority number in numerical order, and at the same time compare the video memory occupancy with the computational complexity value. In the present invention, by dynamically allocating task priorities, optimizing task sorting according to urgency, video memory occupancy, and computational complexity, classifying and merging tasks based on demand values, screening the time range, improving the efficiency of batch task processing, reducing resource waste, combining video memory demand analysis with dynamic programming of remaining resources to call, avoiding problems of video memory overflow or insufficiency, parsing the task completion status and accurately marking unfinished tasks, integrating and outputting content by comparing task data with query results, improving the accuracy and comprehensiveness of the retrieval and generation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information retrieval, and particularly to a method and system for automatically retrieving and generating legal knowledge based on GPU. Background Art

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

[0003] Among them, the method for automatically retrieving and generating legal knowledge refers to using information retrieval technology and related algorithms to automatically extract content related to the user's query requirements from massive legal data such as legal documents and case databases, and constructing meaningful legal knowledge outputs 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 prior art lacks a dynamic priority adjustment mechanism, resulting in fixed resource allocation and important tasks unable to be responded to in a timely manner. Task classification and merging rely on fixed rules and cannot flexibly adapt to multi-task requirements, leading to uneven resource allocation or redundant task processing. Video memory allocation does not fully consider the concurrent requirements of multi-tasks, and may cause video memory overflow or resource idleness due to improper planning, affecting efficiency and hardware performance. Uncompleted tasks lack a status marking and management mechanism, and cannot effectively identify the reasons for failure or optimize subsequent paths, resulting in task delay processing or omission. The query result is separated from the generation process, and the output result lacks 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 disadvantages existing in the prior art, and to propose a method and system for automatically retrieving and generating legal knowledge based on GPU.

[0006] To achieve the above purpose, the present invention adopts the following technical solutions: A method for automatically retrieving and generating legal knowledge based on GPU, 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 a priority number in numerical order, and at the same time compare the video memory occupancy with the computational complexity value, and adjust the priority number in turn to construct a task priority number table;

[0008] S2: Based on the task priority number table and task calculation requirement parameters, merge similar tasks according to the task calculation requirement parameters, screen tasks by comparing the values within the entry time range, classify resource requirements and generate a batch task instruction, and generate a batch task call list;

[0009] S3: Based on the batch task call list, combined with task feature parameters, calculate the total video memory requirement of the batch tasks. At the same time, compare the remaining video memory and the video memory occupancy ratio, plan the GPU call order according to the task characteristics, and call the GPU resources batch by batch to complete task processing, generating a batch task output data set;

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

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

[0012] As a further solution of the present invention, the steps for obtaining the task priority number table are specifically as follows:

[0013] S111: Based on the task type information, task urgency parameter and video memory occupancy parameter, extract the task urgency value, screen according to the task type information, and conduct a preliminary classification of the tasks according to the description of the urgency parameter and task type, generating a preliminary classification result of task urgency;

[0014] S112: Using the preliminary classification result of task urgency, perform priority sorting for each task, arrange them in descending order according to the urgency value, and calculate according to the video memory occupancy parameter and complexity parameter of each task. Using the formula:

[0015] ;

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

[0017] Among them, represents the task priority number, represents the task urgency, represents the estimated task completion time, represents the calculation complexity, represents the video memory occupancy.

[0018] As a further solution of the present invention, the step of obtaining the batch task call list is specifically as follows:

[0019] S211: According to the task priority number table, retrieve the task calculation requirement parameters of each task. According to the range and characteristics of the task calculation requirement parameters, classify and integrate the tasks with the same type of requirement parameters to generate a preliminary task grouping result;

[0020] S212: Based on the preliminary task grouping result, analyze the entry time range values of each group of tasks, and use the formula:

[0021] ;

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

[0023] Among them, represents the adjusted average time of the task group, is the entry time of a single task, is the adjustment coefficient, is the number of tasks in the task group;

[0024] S213: Based on the time screening task list, classify the resource requirements of the screened tasks, and integrate and generate batch task instructions according to the resource usage and calculation requirements of multiple tasks, and establish and complete the batch task call list.

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

[0026] S311: According to the batch task call list, retrieve the task feature parameters, extract the video memory requirement parameter values of each batch task, and calculate the total cumulative video memory requirement by combining the relevance calculation of the video memory requirements between tasks, and generate the total batch task video memory requirement result;

[0027] S312: Based on the total batch task video memory requirement result, compare the remaining video memory of the current GPU with the video memory occupancy ratio, and calculate the weight relationship between the occupancy ratio and the remaining amount by using the formula:

[0028] ;

[0029] Calculate the video memory priority planning parameter of the task, and generate the video memory priority planning parameter result;

[0030] Among them, represents the video memory priority planning parameter, which is used for the priority call order of task video memory, represents the remaining video memory of the GPU, Indicates the total video memory requirement of the current batch task, Indicates the total video memory capacity of the GPU, and respectively represent the weight parameters of the remaining video memory and the video memory occupancy ratio;

[0031] S313: Utilize the result of the video memory priority planning parameter, analyze the task characteristic parameters according to the calculated priority, and sequentially call the GPU resources in combination with the video memory priority planning order to complete the task processing in batches and generate a batch task output data set.

[0032] As a further solution of the present invention, the obtaining step of the task re-planning status table is specifically as follows:

[0033] S411: Analyze the task completion status values in the batch task output data set, identify the unfinished or pending tasks through parsing and classification, and generate a status classification result according to the resource requirements and status;

[0034] S412: Extract the resource allocation values of each pending task from the status classification result, recalculate the resource priorities of multiple tasks, and use the formula:

[0035] ;

[0036] Calculate the adjusted resource allocation and generate a resource allocation priority;

[0037] wherein, represents the resource allocation priority, represents the current resource allocation value of the th task, represents the average value of all task resource allocations, represents the maximum resource allocation value, represents the th task priority, represents the number of tasks participating in the calculation;

[0038] S413: Use the resource allocation priority to re-plan the task queue, optimize the resource call order, integrate the output data, and generate a task re-planning status table.

[0039] As a further solution of the present invention, the obtaining step of the legal knowledge retrieval and generation result data is specifically as follows:

[0040] S511: Based on the task re-planning status table, retrieve the task completion status values and the query results of the associated legal knowledge base for each task, identify the unfinished tasks associated with legal clauses, and generate a preliminary legal association task list;

[0041] S512: Based on the preliminary legal association task list, classify and label each task according to the complexity of its legal relevance and completion status, using the formula:

[0042] ;

[0043] Calculate the legal relevance degree marking result;

[0044] Wherein, represents the legal relevance degree marking, represents the completion status value of the th task, represents the legal query result value of the th task, represents the adjustment coefficient, which is enhanced with reference to the weight of the legal query result, represents the total number of tasks participating in the calculation;

[0045] S513: Utilize the legal relevance degree marking result, integrate the marking value and the query result, and perform a re-query matching of the task requirements on the legal knowledge base to generate legal knowledge retrieval and generation result data.

[0046] 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 above-mentioned GPU-based legal knowledge automatic retrieval and generation method, and the system includes:

[0047] A task priority planning module, based on task type information, task urgency parameters, and video memory occupancy parameters, extracts the task urgency value, assigns priority numbers in numerical order, and at the same time compares the video memory occupancy with the calculation complexity value, and adjusts the priority numbers in turn to construct a task priority number table;

[0048] A batch task generation module, based on the task priority number table and task calculation requirement parameters, combines similar tasks according to the task calculation requirement parameters, screens tasks by comparing the entry time range value, classifies resource requirements and generates batch task instructions, and generates a batch task call list;

[0049] A GPU resource scheduling module, based on the batch task call list, combines task feature parameters, calculates the total video memory requirement of the batch task, and at the same time compares the remaining video memory with the video memory occupancy ratio, plans the GPU call order according to the task characteristics, and calls GPU resources batch by batch to complete task processing, generating a batch task output data set;

[0050] The result integration and knowledge generation module, based on the batch task output data set and the task queue status parameters, parses the task completion status value, extracts the pending task resource allocation value and re-plans the resource call order, integrates the output data, generates a task re-planning status table, and based on the task re-planning status table and the legal knowledge base query result, compares the task completion status with the query result value, classifies and marks the step-by-step values of the unfinished tasks, and integrates the marked values and the query result to generate legal knowledge retrieval and generation result data.

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

[0052] In the present invention, by dynamically allocating task priorities, optimizing task sorting according to the urgency, video memory occupancy, and computational complexity, reasonable resource allocation is achieved, reducing the possibility of high-priority tasks being delayed due to resource conflicts. Classifying and merging tasks based on demand parameters, and screening the time range, improving the efficiency of batch task processing and reducing resource waste. Combining video memory demand analysis with the remaining capacity for dynamic resource planning to avoid video memory overflow or shortage problems, and improving device utilization and processing stability. Parsing the task completion status and accurately marking the unfinished tasks, by comparing task data with query results and integrating output content, improving the accuracy and comprehensiveness of the retrieval and generation results, and meeting the demand for efficient legal knowledge output. Description of the Drawings

[0053] Figure 1 It is a schematic diagram of the work flow of the present invention;

[0054] Figure 2 It is a flow chart of the steps for obtaining the task priority number table of the present invention;

[0055] Figure 3 It is a flow chart of the steps for obtaining the batch task call list of the present invention;

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

[0057] Figure 5 It is a flow chart of the steps for obtaining the task re-planning status table of the present invention;

[0058] Figure 6 It is a flow chart of the steps for obtaining the legal knowledge retrieval and generation result data of the present invention. Detailed Embodiments

[0059] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to 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 used to limit the present invention.

[0060] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is 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 should not be construed as a limitation to the present invention. In addition, in the description of the present invention, the meaning of "a plurality" is two or more, unless otherwise specifically defined.

[0061] Embodiment 1: Please refer to Figure 1 , the present invention provides a technical solution: a method for automatically retrieving and generating legal knowledge based on GPU, including the following steps:

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

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

[0064] S3: Based on the batch task call list, combined with the task characteristic parameters, calculate the total video memory requirement of the batch task, and at the same time compare the remaining video memory with the video memory occupancy ratio, plan the GPU call order according to the task characteristics, and call the GPU resources batch by batch to complete the task processing, and generate a batch task output data set;

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

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

[0067] Please refer to Figure 2 , the specific steps for obtaining the task priority number table are as follows:

[0068] S111: Based on the task type information, task urgency parameter, and video memory occupancy parameter, extract the task urgency value, screen according to the task type information, and conduct a preliminary classification of the tasks based on the urgency parameter and the description of the task type to generate the preliminary classification result of task urgency;

[0069] The screening based on the task type information, the urgency parameter and the specific description of the task type are used to conduct a preliminary classification of the tasks. By collecting the urgency data of each task type and comparing these data with the preset urgency threshold, the tasks that require special attention are screened out. This process not only depends on the accurate input of data, but also needs to comprehensively consider the actual situation of the tasks and the true value of the urgency to perform the classification. This classification helps to optimize the task processing flow, ensure that resources are reasonably allocated to the tasks that most need them, and thus improve the response efficiency and processing capacity.

[0070] S112: Using the preliminary classification result of task urgency, conduct a priority ranking for each task, arrange them in descending order according to the urgency value, and calculate according to the video memory occupancy parameter and complexity parameter of each task. Use the formula:

[0071] ;

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

[0073] Where, represents the task priority number, represents the task urgency, represents the estimated task completion time, represents the calculation complexity, represents the video memory occupancy;

[0074] Formula:

[0075] ;

[0076] The advantage of the formula is that by comprehensively considering the urgency and required time of the task, and dividing by the square root of the sum of the squares of the calculation complexity and video memory occupancy, it can more fairly allocate system resources to give priority to processing tasks that are both urgent and have high resource requirements. This helps to optimize system performance and reduce the delay of task processing.

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

[0078] Suppose there is a task, whose urgency is 5 (indicating very urgent), the estimated completion time is 2 hours, and the calculation complexity is 3 (medium complexity), and the video memory occupancy is 4GB; the calculation process is as follows:

[0079] ;

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

[0081] Please refer to Figure 3 , and the specific steps for obtaining the batch task call list are as follows:

[0082] S211: According to the task priority number table, retrieve the calculation requirement parameters of each task. According to the range and characteristics of the task calculation requirement parameters, classify and integrate the tasks with the same type of requirement parameters to generate a preliminary task grouping result;

[0083] Extract the calculation requirement parameters according to the task priority number table, perform preliminary task grouping processing, identify and integrate tasks with similar requirements according to the calculation requirement values of each task, classify the tasks according to the value range and specific characteristics of the requirement parameters. 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, generating a preliminary task grouping result, which provides a basis for subsequent task scheduling and resource allocation.

[0084] S212: Based on the preliminary task grouping result, analyze the entry time range values for each group of tasks, and use the formula:

[0085] ;

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

[0087] Among them, represents the adjusted average time of the task group, is the entry time of a single task, is the corresponding calculation complexity, is the adjustment coefficient, is the number of tasks in the task group;

[0088] Formula:

[0089] ;

[0090] The benefit of the formula is that by combining the entry time of the task with its calculation complexity and adjusting with In exponential form, the adjustment of task priorities is made more in line with the actual complexity, thus achieving effective time management and resource allocation in the system.

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

[0092] Suppose there are three tasks, and the entry time of each task is 3, 5, 8 unit time, and the computational complexity is 1, 2, 4 respectively, and the adjustment coefficient is set to 0.5, and the number of tasks . Then:

[0093] ;

[0094] ;

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

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

[0097] Use the time to filter the task list for resource requirement classification. According to the resource usage and computational requirements of the filtered task group, refine the task resource configuration process. This process involves a detailed matching analysis of the total amount of resources actually used by each task and the computational requirements of each task. Through this refined resource classification and integration, the utilization efficiency of resources can be effectively improved, resource waste can be avoided, and at the same time, the execution speed of tasks is also accelerated, making the operation of the entire system more efficient and stable. Generate batch task instructions and establish a completed batch task call list, providing a solid foundation for the further operation of the system.

[0098] Please refer to Figure 4 , and the specific steps for obtaining the batch task output data set are as follows:

[0099] S311: According to the batch task call list, retrieve the task characteristic parameters, extract the video memory requirement parameter values of each batch task, and calculate the total cumulative video memory requirement by combining the relevance calculation of the video memory requirements between tasks, and generate the result of the total batch task video memory requirement;

[0100] Extract the video memory requirement parameters for each batch task. These parameters reflect the video memory usage of different tasks during execution. By calculating the total video memory requirement for each task and combining it with the characteristic parameters of the task, such as task type, task priority, and estimated execution time of the task, the total video memory requirement can be estimated. This process involves the accumulation of video memory requirement parameters and weight distribution. The weights are set based on the urgency and resource consumption of the task, generating the total result of the video memory requirement for batch tasks, providing a basis for the subsequent GPU resource scheduling.

[0101] S312: Based on the total result of the video memory requirement for batch tasks, compare the remaining video memory of the current GPU with the video memory occupancy ratio. By calculating the weight relationship between the occupancy ratio and the remaining amount, use the formula:

[0102] ;

[0103] Calculate the video memory priority planning parameters for the task, generating the result of the video memory priority planning parameters;

[0104] Among them, represents the video memory priority planning parameter, used for the priority call order of task video memory, represents the remaining video memory of the GPU, represents the total video memory requirement of the current batch task, represents the total video memory capacity of the GPU, 、 respectively represent the weight parameters of the remaining video memory and the video memory occupancy ratio;

[0105] Formula:

[0106] ;

[0107] The advantage of the formula is that it combines the square root processing of the difference between the remaining video memory and the total video memory demand and the video memory occupancy ratio, thereby dynamically adjusting the weight parameters to achieve the effective utilization of video memory resources. Through this method, the GPU resources can be flexibly scheduled according to the actual video memory situation, optimizing the task execution order.

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

[0109] Set MB as the remaining video memory of the GPU, MB as the total video memory requirement of the current batch task, MB as the total video memory capacity of the GPU, and the weights and are set to 1.5 and 0.5 according to the historical data of the urgency and resource consumption of past task executions. The calculation process is as follows:

[0110] 1. Calculate the video memory difference and its square root processing: ;

[0111] 2. Calculate the video memory occupancy ratio: ;

[0112] 3. Apply the formula to calculate : ;

[0113] This result shows that considering the current video memory margin and total demand, the video memory priority planning parameter is 27.49. This parameter will guide the decision-making of GPU call order to ensure efficient resource allocation.

[0114] S313: Utilize the result of the video memory priority planning parameter, analyze the task feature parameters according to the calculated priority, and sequentially call GPU resources in combination with the video memory priority planning order to batch complete the task processing and generate a batch task output dataset.

[0115] In this process, the video memory requirements of each batch of tasks are compared with the remaining video memory to ensure the smooth execution of each batch of tasks without exceeding the maximum capacity of the GPU. According to the video memory occupancy priority, tasks are processed in batches to generate a batch task output result. This output result details the execution status and required time of each batch of tasks, providing a detailed task processing record and resource utilization report for the system.

[0116] Please refer to Figure 5 , and the specific steps for obtaining the task replanning status table are as follows:

[0117] S411: Analyze the task completion status values in the batch task output dataset, identify uncompleted or pending tasks through parsing and classification, and generate a status classification result according to resource requirements and status;

[0118] This step is very crucial because it directly affects the subsequent resource reallocation and task priority adjustment. After the task status is classified as pending or uncompleted, 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 the task management system to achieve resource optimization and task scheduling. Through this processing step, the system can more precisely perform optimization operations for specific tasks to ensure the maximization of resource utilization and the improvement of task processing efficiency.

[0119] S412: Extract the resource allocation values of each pending task from the status classification result, recalculate the resource priorities of multiple tasks, using the formula:

[0120] ;

[0121] Calculate the adjusted resource allocation and generate the resource allocation priority.

[0122] Among them, represents the resource allocation priority, represents the th current resource allocation value of the task, represents the average of all task resource allocations, represents the maximum resource allocation value, represents the th priority of the task, represents the number of tasks participating in the calculation;

[0123] Formula:

[0124] ;

[0125] The benefit of the formula is that it rebalances resources according to the resource allocation deviation and priority weight of each task, which helps to optimize the overall performance and response time of the system.

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

[0127] Suppose the current resource allocation values of three tasks are , , , the average resource allocation is , the maximum resource allocation value , and the priorities of each task are , , . Calculate the ratio of the resource allocation deviation of each task to the maximum value and multiply it by its priority weight:

[0128] ;

[0129] ;

[0130] ;

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

[0132] ;

[0133] The result shows that according to the current resource allocation deviation and task priority, the new resource allocation value is 0.1111, which will guide the system to reallocate resources to support all pending tasks more fairly and efficiently.

[0134] S413: Re-plan the task queue using resource allocation priorities, optimize the resource call order, integrate the output data, and generate a task re-planning status table.

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

[0136] Please refer to Figure 6 , and the specific steps for obtaining the legal knowledge retrieval and generated result data are as follows:

[0137] S511: Based on the task re-planning status table, retrieve the completion status values of each task and the query results of the associated legal knowledge base, identify the unfinished tasks associated with legal provisions, and generate a preliminary legal association task list;

[0138] Based on the task re-planning status table, the task completion status values, 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. This requires not only considering the physical completion status of the tasks but also conducting more detailed analysis based on the legal implications of the tasks. By combining the specific legal issues of each task, a more precise 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, which is particularly important when dealing with issues such as contract breaches and regulatory compliance. The goal is to improve the efficiency and legal security of task processing through this method.

[0139] S512: Based on the preliminary legal association task list, classify and mark each task according to the complexity of its legal relevance and completion status, using the formula:

[0140] ;

[0141] Calculate the legal association degree marking result;

[0142] Among them, represents the legal association degree marking, represents the completion status value of the th task, represents the legal query result value of the th task, represents the adjustment coefficient, enhancing the weight with reference to the legal query result, represents the total number of tasks participating in the calculation;

[0143] Formula:

[0144] ;

[0145] The advantage of the formula is that by introducing the square root operation and adjustment coefficient of the legal query result, the sensitivity of the legal-related task marking is improved, making it more capable of reflecting the urgency of the task and the legal importance.

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

[0147] Suppose there are three tasks, and the task completion status values are 20, 30, and 40 respectively, and the legal query result values are 200, 300, and 500 respectively, and the adjustment coefficient is 5. Calculate each item of to get:

[0148] ;

[0149] Calculate each item of :

[0150] ;

[0151] ;

[0152] ;

[0153] Sum: ;

[0154] Total Sum: ;

[0155] The calculation of is:

[0156] ;

[0157] The result shows that the legal relevance marking is 1.7118, indicating that it is weighted according to the importance of the task completion status and the legal query result, obtaining the relevance score of each task in the legal knowledge base, and this score can be used to prioritize tasks with high legal relevance.

[0158] S513: Utilize the legal relevance marking result, integrate the marked value and the query result, and perform a re-query and match of the task requirements on the legal knowledge base to generate legal knowledge retrieval and generation result data.

[0159] Using the task list re-planned by legal relevance marking, the legal knowledge base can be queried specifically. This not only speeds up the retrieval of legal information but also ensures the relevance and accuracy of the information obtained. Throughout the process, attention is paid to corresponding the specific legal requirements of each task with the corresponding information in the knowledge base. This correspondence process takes into account the urgency of the task, legal complexity, and possible legal consequences, thus enabling the generation of highly targeted legal knowledge retrieval results. These results will directly support the subsequent legal decision-making and risk management measures. The legal knowledge retrieval and generation result data formed provides the necessary legal support for the project team, ensuring the smooth progress of the project and reducing potential legal risks.

[0160] 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 above-mentioned GPU-based legal knowledge automatic retrieval and generation method. The system includes:

[0161] A task priority planning module, which extracts the task urgency value based on the task type information, task urgency parameter, and video memory occupancy parameter, assigns a priority number in numerical order, and at the same time compares the video memory occupancy with the calculation complexity value, and adjusts the priority number in turn to construct a task priority number table;

[0162] A batch task generation module, which merges similar tasks according to the task calculation requirement parameter based on the task priority number table and task calculation requirement parameter, screens tasks by comparing the entry time range value, classifies resource requirements, generates a batch task instruction, and generates a batch task call list;

[0163] A GPU resource scheduling module, which calculates the total video memory requirement of the batch task based on the batch task call list and combines the task feature parameters. At the same time, it compares the remaining video memory with the video memory occupancy ratio, plans the GPU call order according to the task characteristics, and calls the GPU resources batch by batch to complete the task processing, generating a batch task output data set;

[0164] A result integration and knowledge generation module, which analyzes the task completion status value based on the batch task output data set and task queue status parameter, extracts the resource allocation value of the suspended task and re-plans the resource call order, integrates the output data, generates a task re-planning status table, and based on the task re-planning status table and the legal knowledge base query result, compares the task completion status with the query result value, classifies and marks the step-by-step values of the unfinished tasks, and integrates the marked values with the query result to generate legal knowledge retrieval and generation result data.

[0165] The above are only the preferred embodiments of the present invention, and do not impose other forms of limitations on the present invention. Any person skilled in the relevant art may use the technical content disclosed above to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical solution content of the present invention, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.

Claims

1. A method for automatically retrieving and generating legal knowledge based on GPU, characterized in that, It includes the following steps: 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, and at the same time compare the video memory occupancy with the computational complexity value to adjust the priority numbers in sequence, and construct a task priority number table; Based on the task priority number table and task calculation requirement parameters, merge similar tasks according to the task calculation requirement parameters, screen tasks by comparing the entry 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, combined with task characteristic parameters, calculate the total video memory requirement of batch tasks, and at the same time compare the remaining video memory with the video memory occupancy ratio, plan the GPU call order according to task characteristics, and batch call GPU resources to complete task processing, generating a batch task output data set; Based on the batch task output data set and task queue status parameters, analyze the task completion status value, extract the suspended task resource allocation value and re-plan the resource call order, integrate the output data, and generate a task re-planning status table; Based on the task re-planning status table and the legal knowledge base query result, compare the task completion status with the query result value, classify and mark the step values of unfinished tasks, and integrate the marked value and the query result to generate legal knowledge retrieval and generation result data; The specific steps for obtaining the legal knowledge retrieval and generation result data are as follows: Based on the task re-planning status table, retrieve the completion status value of each task and the query result of the associated legal knowledge base, identify unfinished tasks associated with legal clauses, and generate a preliminary legal association task list; Based on the preliminary legal association task list, classify and mark the complexity of each task based on its legal relevance and completion status, using the formula: ; Calculate the legal association degree marking result; Among them, represents the legal relevance mark, represents the completion status value of the th task, represents the legal query result value of the th task, represents the adjustment coefficient, which is enhanced according to the weight of the legal query result, represents the total number of tasks participating in the calculation; Using the legal association degree marking result, integrate the marked value and the query result, and perform a second query on the legal knowledge base to match the task requirements, generating legal knowledge retrieval and generation result data.

2. The method for automatically retrieving and generating legal knowledge based on GPU according to claim 1, wherein The specific steps for obtaining the task priority number table are as follows: Based on the task type information, task urgency parameter, and video memory occupancy parameter, extract the task urgency value, screen according to the task type information, and conduct a preliminary classification of tasks according to the description of the urgency parameter and task type, generating a preliminary task urgency classification result; Using the preliminary task urgency classification result, perform priority sorting for each task, arrange them in descending order of 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 i, generate a task priority adjustment result, and establish a task priority number table; Among them, represents the task priority number, represents the task urgency, represents the estimated task completion time, represents the computational complexity, represents the video memory occupancy.

3. The method for automatically retrieving and generating legal knowledge based on GPU according to claim 2, wherein The specific steps for obtaining the batch task call list are as follows: According to the task priority number table, retrieve each task calculation requirement parameter, classify and integrate tasks with the same type of requirement parameters according to the range and characteristics of the task calculation requirement parameters, generating a preliminary task grouping result; Based on the preliminary task grouping result, analyze the entry time range value of each group of tasks, using the formula: ; Calculate the average deviation entry time for each group of tasks, and use this time as the screening criterion to screen the task groups that meet the target time window, and generate a time-screened task list; Among them, represents the adjusted average time of the task group, is the entry time of a single task, is the adjustment coefficient, is the number of tasks within the task group; Based on the time-screened task list, classify the resource requirements of the screened tasks, and integrate and generate batch task instructions according to the resource usage and calculation requirements of multiple tasks, and establish and complete a batch task call list.

4. The method for automatically retrieving and generating legal knowledge based on GPU according to claim 3, characterized in that, The specific steps for obtaining the batch task output dataset are as follows: According to the batch task call list, retrieve the task feature parameters, extract the video memory requirement parameter values of each batch task, and calculate the total cumulative video memory requirement by combining the relevance calculation of the video memory requirements between tasks, and generate the total batch task video memory requirement result; Based on the total batch task video memory requirement result, compare the remaining video memory of the current GPU with the video memory occupancy ratio, and calculate the weight relationship between the occupancy ratio and the remaining amount by using the formula: ; Calculate the video memory priority planning parameter of the task, and generate the video memory priority planning parameter result; Among them, represents the video memory priority planning parameter, which is used for the priority call order of task video memory, represents the remaining video memory of the GPU, represents the total video memory requirement of the current batch task, represents the total video memory capacity of the GPU, and respectively represent the weight parameters of the video memory margin and the video memory occupancy ratio; Utilize the video memory priority planning parameter result, analyze the task feature parameters according to the calculated priority, and call the GPU resources in turn according to the video memory priority planning order, and complete the task processing in batches to generate a batch task output dataset.

5. The method for automatically retrieving and generating legal knowledge based on GPU according to claim 4, characterized in that, The specific steps for obtaining the task replanning status table are as follows: Analyze the task completion status values in the batch task output dataset, identify the unfinished or pending tasks through parsing and classification, and generate a status classification result according to the resource requirements and status; Extract the resource allocation values of each pending task from the status classification result, recalculate the resource priority of multiple tasks, and use the formula: ; Calculate the adjusted resource allocation and generate the resource allocation priority; Among them, represents the resource allocation priority, represents the current resource allocation value of the th task, represents the average value of all tasks' resource allocations, represents the maximum resource allocation value, represents the priority of the th task, represents the number of tasks participating in the calculation; Utilize the resource allocation priority to replan the task queue, optimize the resource call order, and integrate the output data to generate a task replanning status table.

6. A GPU-based legal knowledge automatic retrieval and generation system, characterized in that, According to the GPU-based automatic legal knowledge retrieval and generation method according to any one of claims 1-5, the system includes: A task priority planning module, which extracts the task urgency value based on the task type information, task urgency parameter, and video memory occupancy parameter, assigns a priority number in numerical order, and at the same time compares the video memory occupancy with the calculation complexity value, and adjusts the priority number in turn to construct a task priority number table; A batch task generation module, which combines similar tasks according to the task calculation requirement parameters based on the task priority number table and task calculation requirement parameters, screens tasks by comparing the entry time range values, classifies resource requirements and generates batch task instructions, and generates a batch task call list; A GPU resource scheduling module, which calculates the total batch task video memory requirement based on the batch task call list and combines the task feature parameters, and at the same time compares the remaining video memory with the video memory occupancy ratio, plans the GPU call order according to the task characteristics, and calls the GPU resources batch by batch to complete the task processing, and generates a batch task output dataset; The result integration and knowledge generation module, based on the batch task output data set and the task queue status parameters, parses the task completion status value, extracts the pending task resource allocation value and re-plans the resource invocation order, integrates the output data, generates a task re-planning status table, and based on the task re-planning status table and the legal knowledge base query result, compares the task completion status with the query result value, classifies and marks the step-by-step values of the unfinished tasks, and integrates the marked values with the query result to generate legal knowledge retrieval and 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