Document tracking method and device based on intelligent condition filtering and medium
By constructing conditional filtering expressions for document relationships and a multi-level caching mechanism, the query path is optimized, solving the problems of increased query time and resource consumption in traditional document tracking technology, and achieving efficient document tracking.
Patent Information
- Application Number
- CN202511138662.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Traditional document tracking technology suffers from exponentially increasing query time in many-to-one document relationship scenarios, resulting in low efficiency and difficulty in quickly adapting to business process adjustments, leading to system performance bottlenecks.
Construct conditional filtering expressions for document relationships to filter invalid document relationships, optimize query path order, and reduce query scope and time by combining multi-level caching mechanisms and dynamic condition evaluation.
It significantly improved the query response speed and efficiency of document tracking, optimized the query path for complex business processes, reduced resource consumption, and improved system performance.
Smart Images

Figure CN120973841A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of document tracking, and particularly relates to a document tracking method and device based on intelligent condition filtering and a medium. BACKGROUND
[0002] With the deepening of enterprise digital transformation, business processes are becoming increasingly complex, and the association between documents presents the characteristics of many-to-many and multi-level. In order to ensure the traceability of business and improve operational efficiency, accurate tracking of documents becomes crucial.
[0003] However, in the many-to-one document relationship scenario, the traditional document tracking technology needs to traverse all possible document relationships. For example, a sales delivery order may be generated from a normal sales order, a promotional order or a transfer order. The traditional method needs to query all types of upstream documents, resulting in exponential growth of query time and low efficiency. The above invalid query operation also occupies a large amount of database connections and computing resources, and easily causes system performance bottlenecks during peak periods. Existing solutions usually rely on hard-coded methods to handle specific business rules and association logic, which is difficult to quickly adapt to frequent adjustments of business processes or new business scenarios. SUMMARY
[0004] To solve the above problems, the present application provides a document tracking method based on intelligent condition filtering, comprising:
[0005] For the document association relationship between each business document, a condition filtering expression corresponding to the document association relationship is constructed;
[0006] A target document to be tracked is determined, and according to the condition filtering expression, invalid document relationships corresponding to the target document are filtered to obtain a filtered target query path;
[0007] According to the target query path, a corresponding query request is generated, and the execution cost corresponding to the target query path is determined, so as to determine the query order corresponding to the target query path according to the execution cost;
[0008] According to the query order, the target document is tracked through the target query path to obtain a corresponding query result.
[0009] In an implementation manner of the present application, according to the condition filtering expression, the invalid document relationships corresponding to the target document are filtered to obtain the filtered target query path, specifically comprising:
[0010] The basic attribute information corresponding to the target document is obtained, and it is determined whether the basic attribute information matches the condition filtering expression;
[0011] If no, it is determined that the document association relationship corresponding to the condition filtering expression is an invalid document relationship, and the query path corresponding to the invalid document relationship is filtered out.
[0012] In an implementation manner of the present application, for the document association relationship between each business document, a condition filtering expression corresponding to the document association relationship is constructed, specifically including:
[0013] According to the upstream and downstream relationship between each business document, the document association relationship between the business documents is determined;
[0014] The condition filtering expression corresponding to the document association relationship is constructed; wherein the condition filtering expression includes field reference, operator, function call and logical combination.
[0015] In an implementation manner of the present application, the execution cost corresponding to the target query path is determined, and according to the execution cost, the query order corresponding to the target query path is determined, specifically including:
[0016] According to the preset cost index, the cost of the target query path is evaluated to determine the corresponding basic cost index value;
[0017] According to the weight corresponding to each cost index and the basic cost index value, the basic cost of the target query path is calculated;
[0018] The current database load is obtained, and the basic cost is corrected according to the current database load to obtain the execution cost corresponding to the target query path;
[0019] The target query path is arranged in ascending order of the execution cost to determine the query order corresponding to the target query path.
[0020] In an implementation manner of the present application, the target document is tracked through the target query path, specifically including:
[0021] Based on the preset multi-level cache mechanism, it is tried to obtain the query result corresponding to the target document from the historical query result stored in the three-level query result cache, to determine whether there is a query result in the historical query result;
[0022] If no, the query condition of the target document is optimized according to the multi-level cache mechanism.
[0023] In an implementation manner of the present application, the query condition of the target document is optimized according to the multi-level cache mechanism, specifically including:
[0024] It is determined whether the condition filtering expression corresponding to the target document exists in the first-level configuration cache;
[0025] If yes, determine whether there is a condition evaluation result corresponding to the target document in the secondary evaluation result cache;
[0026] If yes, filter the invalid document relationship corresponding to the target document according to the condition evaluation result.
[0027] In an implementation form of the present application, after the condition filtering expression corresponding to the document association relationship is constructed, the method further comprises:
[0028] calculating the constant expression in the condition filtering expression to obtain a corresponding constant value;
[0029] replacing the constant value with the constant expression to obtain a replaced condition filtering expression;
[0030] compiling the replaced condition filtering expression to convert the replaced condition filtering expression into executable code.
[0031] In an implementation form of the present application, filtering the invalid document relationship corresponding to the target document specifically comprises:
[0032] filtering the invalid document relationship corresponding to the target document;
[0033] In the case where the invalid document relationship exists a subordinate document relationship, skipping the filtering calculation of the subordinate document relationship.
[0034] The embodiments of the present application provide a document tracking device based on intelligent condition filtering, and the device comprises:
[0035] at least one processor;
[0036] and a memory in communication connection with the at least one processor;
[0037] wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the document tracking method based on intelligent condition filtering according to any one of the above.
[0038] The embodiments of the present application provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:
[0039] the document tracking method based on intelligent condition filtering according to any one of the above.
[0040] The document tracking method based on intelligent condition filtering provided by the present application can bring the following beneficial effects:
[0041] By constructing a conditional filter expression of the document association relationship, the invalid document relationship is accurately filtered, the query range and time are significantly reduced, the query path order is optimized by combining dynamic condition evaluation and execution cost analysis, the query response speed is improved, and efficient tracking of complex business processes is realized. BRIEF DESCRIPTION OF DRAWINGS
[0042] The accompanying drawings, which are included to provide a further understanding of the application, illustrate embodiments of the application and together with the description explain the application. The illustrations presented are not intended to be an undue limitation on the scope of the application and it is intended that the application be construed as including all embodiments falling within the scope of the application. In the drawings:
[0043] Figure 1 A flowchart of a document tracking method based on intelligent conditional filtering provided by an embodiment of the application;
[0044] Figure 2 A structural diagram of a document tracking device based on intelligent conditional filtering provided by an embodiment of the application. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions and advantages of the application clearer, the technical solutions of the application will be described below in conjunction with specific embodiments of the application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the application.
[0046] The technical solutions provided by the embodiments of the application will be described in detail below with reference to the drawings.
[0047] As shown in Figure 1 The document tracking method based on intelligent conditional filtering provided by an embodiment of the application includes:
[0048] S101: For the document association relationship between each business document, a conditional filter expression corresponding to the document association relationship is constructed.
[0049] In enterprise business processes, there are logical relationships between different business documents. For example, an overseas warehouse entry document can be derived from four different types of upstream documents, including a regular purchase order, an emergency purchase order, a supplier direct delivery order, and a bonded warehouse allocation document. Traditional document tracking methods need to query all possible associated documents indiscriminately, while actual business data analysis shows that 80% of query scenarios only need to focus on the association of several specific types of documents. Based on this, the embodiments of the present application aim at the association relationship between business documents, and according to specific business rules and requirements, construct a condition filtering expression corresponding to the association relationship between documents, so as to limit and filter the association relationship between documents and filter out invalid document relationships that do not meet the conditions.
[0050] In one embodiment, there is an upstream and downstream relationship between business documents. According to the upstream and downstream relationship between business documents, the association relationship between business documents can be determined. For different document association relationships, a corresponding condition filtering expression is constructed, which includes field references, operators, function calls, and logical combinations. According to the upstream and downstream relationship between businesses, the condition filtering expression is divided into an upper search condition and a lower search condition. The upper search condition is used to track the upstream documents of a document, while the lower search condition is used to track the downstream documents of a document. For example, the document association relationship between a regular purchase order and an overseas warehouse entry document is based on the warehouse type and the purchase category, and the final condition filtering expression is an upper search condition, which is: warehouse type = special warehouse, purchase category = regular. When the condition filtering expression is met, the regular purchase order can be tracked according to the overseas warehouse entry document.
[0051] In one embodiment, after the condition filtering expression is constructed, it needs to be compiled to compile the condition filtering expression into executable code. During the compilation process, the execution efficiency of the condition filtering expression can be improved through constant folding technology. Specifically, the constant expressions in the condition filtering expression are calculated to obtain the corresponding constant values, and then the constant values are used to replace the original constant expressions to obtain the replaced condition filtering expression, which can effectively simplify the expression structure. The replaced condition filtering expression is compiled to convert the replaced condition filtering expression into executable code. By running the executable code, the association relationship between documents can be automatically evaluated and filtered.
[0052] For example, if the original condition filtering expression is "WHERE document type = 'purchase' AND creation time > NOW () - INTERVAL '30 days'", and the current time is 2025-6-26, the constant folding is performed on the above condition filtering expression, the constant expression of creation time is converted to 2025-5-27, and the final replaced condition filtering expression is "WHERE document type = 'purchase' AND creation time > '2025-05-27'". Through the constant replacement, the constant value can be directly used for comparison during the query, avoiding repeated calculation of time difference for each query, and saving computing resources.
[0053] It should be noted that the condition filtering expression in the embodiments of the present application needs to be version managed, and supports historical version saving and one-key rollback. When the filtering condition is modified, the server analyzes the dependency graph and marks the affected document association relationship, and then applies the configuration change in real time through the hot loading mechanism without restarting the system.
[0054] S102: Determine the target document to be tracked, filter the invalid document relationship corresponding to the target document according to the condition filtering expression, and obtain the filtered target query path.
[0055] In the case where there is a document tracking demand, the target document to be tracked is determined. In order to further clarify the source and destination of the target document, the associated documents of the target document need to be queried to realize complete business process tracking. The difference from the traditional tracking method is that, before executing the query, the condition filtering expression is needed to filter the invalid document relationship corresponding to the target document. Through the condition filtering mechanism, the effective document association relationship that meets the business rules can be selected from the numerous possible document relationships, and according to the remaining effective document association relationship, the target query path is constituted from the target document to its associated documents. Next, the server will execute the specific document tracking operation along the target query path to obtain the detailed tracking information of the target document.
[0056] Specifically, the basic attribute information corresponding to the target document is acquired, which can include document reference number, warehouse type, creation time, business data, and other key attributes. The acquired target basic attribute information is compared and matched with a pre-defined condition filtering expression. The condition filtering expression is formulated based on business rules and is used to determine whether the document association relationship is valid. If the basic attribute information of the target document does not match the condition filtering expression, it means that the document association relationship is invalid in the current query scenario, and the server will exclude the query path corresponding to such invalid document relationship from the subsequent query range. For example, the condition filtering expression of the regular purchase order→overseas warehouse entry order is warehouse type=special warehouse and purchase category=regular. If it is identified that the purchase category of the target document (i.e., the overseas warehouse entry order) is not regular, then it does not match the condition filtering expression. At this time, it is determined that the document association relationship between the regular purchase order and the overseas warehouse entry order is an invalid document relationship, and the corresponding query path will be excluded. By filtering out the query path corresponding to the invalid document relationship, it is possible to avoid wasting query resources on these invalid paths, reduce a large number of invalid query operations, significantly improve query efficiency, shorten query time, and the effect is more obvious especially in the business scenario with a large number of documents and complex association relationships.
[0057] It should be noted that the present application adopts a lazy evaluation strategy, and only when the query path may be used will it be conditionally evaluated. If the upstream condition fails in multi-layer document association, the downstream evaluation is skipped. That is, after finding that a certain document relationship is invalid and filtering it, if there are still lower-level document relationships of the invalid document relationship, the server will directly skip the filtering calculation of these lower-level document relationships. For example, if the relationship between the sales order and the delivery order is determined to be invalid, and the delivery order is associated with a transport document downstream, at this time, the relationship between the delivery order and the transport document will not be filtered and calculated, but this step will be directly skipped. In a complex business process, document relationships can present a multi-level association structure. If the lower-level relationships of each possible invalid document relationship are filtered and calculated, a large amount of system resources will be consumed, resulting in low query efficiency. Skipping these unnecessary calculation steps can focus more quickly on valid document relationship paths and improve overall filtering and query efficiency.
[0058] S103: A corresponding query request is generated according to the target query path, and the execution cost corresponding to the target query path is determined to determine the query order corresponding to the target query path according to the execution cost.
[0059] After filtering out a large number of invalid query paths, a query request needs to be initiated according to the target query path, and these query requests will be used to track the source and destination documents of the target document. Since the number of target query paths is large, the execution cost of each target query path needs to be calculated, and the query order is optimized based on the execution cost of each target query path, so as to determine the optimal query order. The query request with lower execution cost will be executed first, which can return the preliminary result faster and improve the user's response experience. When processing a large amount of data and complex queries, the user's waiting time can be effectively reduced.
[0060] In an embodiment, the server predefines factors for measuring query cost, such as data size (number of documents involved, number of rows of tables, etc.), query complexity (number of table joins involved, number of subqueries, etc.), computing resource consumption (CPU usage, memory occupation, etc.), network transmission volume (number of bytes of data transmission, etc.), different business scenarios and system architectures may have different preset cost indicators. According to the preset cost indicators, the target query path is analyzed and evaluated to determine the basic cost indicator value corresponding to each cost indicator. For example, a target query path needs to access 10,000 rows of data, involves 3 table joins, estimates CPU usage of 5%, network transmission volume of 1MB, etc. Different cost indicators have different importance in the overall query cost. Each cost indicator is assigned a weight value, the basic cost indicator value of each cost indicator is multiplied by its corresponding weight, and then the weighted values are added to obtain the basic cost of the target query path.
[0061] When the database load is high, the execution of the query may be more affected, and the execution time will increase. Therefore, in addition to the above basic indicators, the database load needs to be considered when measuring the execution cost of the target query path. Based on this, the current database load, that is, the current CPU utilization, is obtained, and the basic cost is corrected according to the current database load to obtain the execution cost corresponding to the target query path. When correcting the execution cost, the following formula can be used: Where C base represents the basic cost, L cpu is the current CPU utilization.
[0062] After calculating the execution cost of each target query path, the target query paths are arranged in ascending order of execution cost, so that the query order corresponding to each target query path is obtained. When querying, the target query path with lower execution cost is selected first for document tracking, which can effectively improve the response speed.
[0063] S104: According to the query order, the target document is tracked through the target query path to obtain the corresponding query result.
[0064] By the query order obtained above, the target document is tracked by each target query path in turn, and the corresponding query result is obtained. The business tracking view is formed by the query result, and the tracking of the complete business process is realized.
[0065] In an embodiment, in the query process, in order to quickly respond to repeated query requests, the embodiment of the application provides a multi-level cache mechanism for storing data at different levels to improve query efficiency. Among them, the first level cache stores high-frequency configuration data, the second level stores condition evaluation results, and the third level cache stores complete query results. This hierarchical cache strategy significantly reduces the database access pressure and significantly improves the query performance.
[0066] When tracking the target document through the target query path, through the above multi-level cache mechanism, it is first determined from the historical query results stored in the third-level query result cache whether there is a query result corresponding to the target document. If there is, it means that the query result already exists, and at this time the query result can be directly used to complete the tracking of the target document, without the need for subsequent query operations, avoiding repeated database access and improving query efficiency. If not, it means that the current query request is a new request, and at this time the query condition of the target document needs to be optimized based on the multi-level cache mechanism, so as to realize the minimization of the query of the target document and reduce the computing resources used in the query process.
[0067] Specifically, it is determined whether the condition filtering expression corresponding to the target document exists in the first-level configuration cache. If not, the condition filtering expression needs to be reconstructed and stored in the first-level configuration cache. If it exists, it means that the filtering rule has been configured and can be reused. Next, it is further determined whether the condition evaluation result of the condition filtering expression can be reused. That is, it is determined whether the condition evaluation result corresponding to the target document exists in the second-level evaluation result cache. If it exists, the invalid document relationship corresponding to the target document can be filtered directly through the condition evaluation result, without the need to execute the condition filtering expression again, which can avoid repeated calculation, save computing resources, and at the same time improve the response speed and timely feedback the optimized query condition.
[0068] If there are similar query requests, the server can process them in combination, and in the query process, a temporary index is automatically created according to the query characteristics of each query request, and the temporary index is used to replace the original query request to track the document, effectively improving the efficiency of document query.
[0069] Suppose a cross-border e-commerce platform needs to implement complete business process tracking from supplier procurement to final customer delivery. In a specific business scenario, an overseas warehouse entry document may come from four different types of upstream documents, including regular purchase orders, emergency purchase orders, supplier direct delivery orders, and bonded warehouse allocation documents. The document tracking method provided by the embodiments of the present application is implemented as follows:
[0070] The filter condition based on warehouse type and purchase category is set for the association relationship of "regular purchase order → overseas warehouse entry document", and the condition filtering expression is warehouse type = dedicated warehouse, purchase category = regular. The combination rule of time window and priority condition is configured for the association relationship of "emergency purchase order → overseas warehouse entry document", and the condition filtering expression is entry document creation time - purchase order submission time < 2 hours, priority > 5. The mapping relationship of key fields is clearly defined for each document association relationship, and after the condition filtering expression is constructed, all condition filtering expressions are precompiled and optimized to establish an efficient condition evaluation mechanism.
[0071] When a user queries the business source of a specific overseas warehouse entry document, first, the basic information of the current entry document is obtained, including the reference number, warehouse type, and creation time, and other key attributes. Then the intelligent condition filtering engine is started, and all pre-defined association relationships are evaluated one by one. First, the association conditions of the regular purchase order are dynamically evaluated to verify the matching of the warehouse type and the purchase category, and second, the association conditions of the emergency purchase order are verified to check the time sequence and priority settings. Through the above verification process, the association paths that do not meet the conditions are automatically excluded.
[0072] Based on the filtering results, only the document association relationships that meet the conditions are queried, which greatly reduces the database access volume. During the query process, a batch processing mechanism is also used to optimize the same type of queries.
[0073] After obtaining the query results, a business tracking view will be generated. The business tracking view needs to have node information function and condition prompt function, needs to clearly mark the document type and key business attributes, and needs to intuitively display the filtering conditions that affect the query results. At the same time, it will also display the query optimization effect and performance indicators in real time, and automatically optimize the graph layout to ensure readability.
[0074] In complex cross-border e-commerce supply chain scenarios, through intelligent condition filtering and optimization algorithms, the efficiency and accuracy of business process tracking can be significantly improved. Not only does it solve the performance bottleneck problem of traditional implementation methods, but it also provides better business adaptability and user experience, providing strong support for the digital operation of enterprises.
[0075] The above is a method embodiment provided by the present application. Based on the same idea, some embodiments of the present application also provide a device and a non-volatile computer storage medium corresponding to the above method.
[0076] Figure 2 A structure schematic diagram of a document tracking device based on intelligent condition filtering is provided by an embodiment of the present application. As shown in Figure 2 , it comprises:
[0077] at least one processor; and
[0078] a memory in communication connection with the at least one processor; wherein
[0079] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the document tracking method based on intelligent condition filtering according to any one of the above.
[0080] An embodiment of the present application provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to:
[0081] perform the document tracking method based on intelligent condition filtering according to any one of the above.
[0082] Each of the embodiments in the present application is described in a progressive manner, and the same and similar parts of each embodiment can be referred to each other. Each embodiment mainly describes the difference from other embodiments. Especially, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0083] The device and medium provided by the embodiments of the present application are one-to-one corresponding to the method, so the device and medium also have the similar beneficial technical effects as the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here.
[0084] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0085] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0086] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0087] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks.
[0088] In one typical configuration, the computing device includes one or more processors, input / output interfaces, network interfaces, and memory.
[0089] The memory can include non-persistent memory and / or persistent memory, such as flash memory, read-only memory (ROM), and / or volatile or non-volatile random access memory (RAM), among others. The memory is an example of computer-readable media.
[0090] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0091] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0092] The above description is only an embodiment of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.
Claims
1. A method for tracking a document based on smart condition filtering, the method comprising: The method comprises: For the document association relationship between each business document, a condition filtering expression corresponding to the document association relationship is constructed; A target document to be tracked is determined, and the invalid document relationship corresponding to the target document is filtered according to the condition filtering expression to obtain a filtered target query path; According to the target query path, a corresponding query request is generated, and the execution cost corresponding to the target query path is determined, so as to determine the query order corresponding to the target query path according to the execution cost; According to the query order, the target document is tracked through the target query path to obtain a corresponding query result.
2. The method of claim 1, wherein, According to the condition filtering expression, the invalid document relationship corresponding to the target document is filtered to obtain a filtered target query path, which specifically comprises: The basic attribute information corresponding to the target document is obtained, and it is determined whether the basic attribute information matches the condition filtering expression; If not, it is determined that the document association relationship corresponding to the condition filtering expression is an invalid document relationship, and the query path corresponding to the invalid document relationship is filtered out.
3. The method of claim 1, wherein, For the document association relationship between each business document, a condition filtering expression corresponding to the document association relationship is constructed, which specifically comprises: According to the upstream and downstream relationship between each business document, the document association relationship between the business documents is determined; The condition filtering expression corresponding to the document association relationship is constructed; wherein the condition filtering expression comprises field reference, operator, function call and logical combination.
4. The method of claim 1, wherein, The execution cost corresponding to the target query path is determined, and the query order corresponding to the target query path is determined according to the execution cost, which specifically comprises: According to the preset cost index, the cost of the target query path is evaluated to determine the basic cost index value corresponding thereto; According to the weight corresponding to each cost index and the basic cost index value, the basic cost of the target query path is calculated; The current database load is obtained, and the basic cost is corrected according to the current database load to obtain the execution cost corresponding to the target query path; The target query path is arranged in ascending order of the execution cost to determine the query order corresponding to the target query path.
5. The method of claim 1, wherein, The target document is tracked through the target query path, which specifically comprises: Based on the preset multi-level cache mechanism, it is tried to obtain the query result corresponding to the target document from the historical query result stored in the three-level query result cache to determine whether there is a query result in the historical query result; If not, the query condition of the target document is optimized according to the multi-level cache mechanism.
6. The method of claim 5, wherein, According to the multi-level cache mechanism, the query condition of the target document is optimized, which specifically comprises: It is determined whether the condition filtering expression corresponding to the target document exists in the first-level configuration cache; If yes, it is determined whether the condition evaluation result corresponding to the target document exists in the second-level evaluation result cache; If yes, the invalid document relationship corresponding to the target document is filtered according to the condition evaluation result.
7. The method of claim 1, wherein, After the condition filter expression corresponding to the document association relationship is constructed, the method further includes: calculating the constant expression in the condition filter expression to obtain a corresponding constant value; replacing the constant expression with the constant value to obtain a replaced condition filter expression; compiling the replaced condition filter expression to convert the replaced condition filter expression into executable code.
8. The method of claim 2, wherein, The invalid document relationship corresponding to the target document is filtered, specifically including: filtering the invalid document relationship corresponding to the target document; in the case that the invalid document relationship exists a subordinate document relationship, skipping the filtering calculation of the subordinate document relationship.
9. A document tracking device based on smart condition filtering, characterized by, The device includes: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a kind of document tracking method based on intelligent condition filtering as claimed in any one of claims 1-8.
10. A non-transitory computer storage medium storing computer-executable instructions that, when executed, cause a computer to perform: The computer executable instructions are set to: a kind of document tracking method based on intelligent condition filtering as claimed in any one of claims 1-8.
Citation Information
Patent Citations
Method and device for creating invoice filtrating condition
CN101334794A
Bill inquiring method and device based on general filtering condition compound assembly
CN102819545A
Order inquiry method and system
CN107862092A
Advertisement effect processing method and device
CN113743975A
Historical navigation route updating method of map navigation cache database
CN115523931A