Clearing method based on Blaze decision engine rule file historical version

Through an automated cleaning method based on the Blaze decision engine, the problem of the historical version of the rule file in the Fico Blaze decision engine is solved, and an efficient and easy-to-operate cleaning process is achieved, improving system performance and security.

CN120067069AActive Publication Date: 2025-05-30HAIER CONSUMER FINANCE CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411953605.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-30
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

During the use of the Fico Blaze decision engine, the rule components check in a new version each time they submit, causing a large number of historical version files to be generated in the background, occupying project space, resulting in system lag and slow project loading.

Method used

Provides a cleaning method based on the Blaze decision engine rule file history version, and realizes an efficient, easy-to-operate and easy-to-understand cleaning process through multiple simplified operation steps and automated scripts. The specific steps include preparing the script, generating a file path list, using Excel to process the path, conditional filtering and classification file paths, and finally generating and executing the delete script.

Benefits of technology

It realizes efficient and easy-to-operate rule file history version cleaning, reduces project space, improves system performance, reduces the risk of manual selection errors, and enhances the security and tidyness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067069A_ABST
    Figure CN120067069A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Linux software, and discloses a file historical version cleaning method based on a Blaze decision engine rule, which comprises the following steps: step 1, preparing a script for acquiring a file path and a file name getFilePaths.sh; step 2, putting a getFilePaths.sh script under a project path of the rule base; step 3, executing a getFilePaths.sh script, and executing a getFilePaths.sh script; 4, opening a flag correction decision engine system, and deleting historical version items; and 5, making a script according to the generated deletion path, and uploading the script to a server for operation. According to the method, a user only needs to execute a simple script getFilePaths.sh, the script automatically obtains all the file paths under the specified directory and generates the list, a large amount of time and energy are saved, the user processes the generated file paths through familiar tools such as Excel, unnecessary paths are deleted through simple batch replacement operation, and the user experience is improved. The beneficial effects that cleaning can be achieved through a simple method, operation is easy, and understanding is easy are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Linux software, and specifically provides a method for cleaning the historical versions of rule files based on the Blaze decision engine. Background Art

[0002] During the use of the Fico Blaze decision engine, each time a new version is submitted and checked in for a rule component, a historical version file will be generated in the background. Due to a large number of projects and a large number of configured rules, the number of rule historical version files will become more and more, occupying most of the project space, which will in turn cause phenomena such as the Blaze being stuck and the project loading slowly, affecting the system usage efficiency. Therefore, it is necessary to clean the historical version files of the rules generated in the background, which can effectively reduce the occupied space of the project and improve the system efficiency.

[0003] The system is deployed on a Linux server. Since the screening logic for the part of the historical version files to be deleted is complex, it is very difficult to directly clean them through shell scripts. The script writing logic is complex, with a high degree of difficulty and is prone to problems. Summary of the Invention

[0004] Technical Problem to be Solved

[0005] Aiming at the deficiencies of the prior art, the present invention provides a method for cleaning the historical versions of rule files based on the Blaze decision engine, which has the advantages of being able to be cleaned by using a simple method, being easy to operate and understand; the cleaning operation is more efficient, accurate and less risky than manual deletion, thus solving the above technical problems.

[0006] Technical Solution

[0007] To achieve the above object, the present invention provides the following technical solution: A method for cleaning the historical versions of rule files based on the Blaze decision engine, including the following steps:

[0008] Step 1: Prepare a script for obtaining the file path, with the file name getFilePaths.sh;

[0009] Step 2: Place the getFilePaths.sh script under the rule library project path;

[0010] Step 3: Execute the getFilePaths.sh script to obtain the file_paths.txt file. Use the sz file_paths.txt command to download it to the local. Copy the content in file_paths.txt to excel. Use the replace function in excel to delete the path before Business User Projects / , and save the file to the root directory of drive D;

[0011] Step 4: Open the Qizheng Decision Engine System - Delete historical version projects;

[0012] Step 5: Create a script based on the generated deletion path and upload it to the server for running.

[0013] Preferably, the script content in Step 1 is as follows:

[0014] #! / bin / bash

[0015] # Specify the output txt file path

[0016] output_file="file_paths.txt"

[0017] script_dir=$(pwd)

[0018] target_dir="$script_dir / Business User Projects"

[0019] find "$target_dir" -type f | sort > "$output_file"

[0020] echo "The file paths have been saved to $output_file".

[0021] Preferably, the rule library path in Step 2 is: / home / hcuser / app / Blaze77 / BlazeRepository.

[0022] Preferably, Step 4 includes the following detailed steps:

[0023] S4.1. Initialize printing: Print the log to prompt the start of processing;

[0024] S4.2. Set the file import path: Import the to-be-deleted.xlsx file on the D drive and print the file import path log;

[0025] S4.3. Obtain the original file data: Extract and save the content of sheet1 in the to-be-deleted.xlsx to the file path memory table, and the file path memory table has only one column for the file path;

[0026] S4.4. Store the file classification path: Traverse the file path memory table saved in S4.3, and according to the conditions: the file path contains: / __Attic / and does not contain: version and does not contain: innovator_attbs, insert the results into the file classification 1 memory table, and the file classification 1 memory table also has only one column for the file path;

[0027] S4.5. Print the number of records in the file classification 1 memory table;

[0028] S4.6. Generate a path division table rule set:

[0029] S4.7. Obtain the array of rule names after deduplication: Summarize the path division table, with the summary columns being first, middle, last1, last2, max(last2), the grouping columns being first, last1, the condition column being empty, insert all the deduplicated data after grouping into the path division table after deduplication, and print the number of records in the path division table after deduplication in the log.

[0030] S4.8. Generate the final path storage table rule set: Traverse the memory table of the path division table after deduplication;

[0031] S4.9. Generate the final path table: Traverse the path storage table, concatenate the first, middle, last1, buchong, and last2 of the path storage table, and store them in the file path field of the memory table of the final path table;

[0032] S4.10. End printing: Save the data in the final path table to: the final table of the file version path to be deleted in the D drive: D:\RequiredDeletedFileVersionPathFinalTable.xlsx; Print the log, the total number of files to be deleted: obtain the number of records in the final path table; Print the log, the export path of the final table: D:\RequiredDeletedFileVersionPathFinalTable.xlsx; Print the log,-----***Processing ended***-------.

[0033] Preferably, the S4.6 further includes the following detailed steps:

[0034] S4.6.1. Character splitting: Traverse the file classification 1 memory table, assign the file path field of the file classification 1 memory table to the path (temporary variable) and print it out, then split the path by / __Attic / into a character array and assign it to the split array variable, then take the first data of the split array variable, and then split the array by _, and assign it to the secondary split array variable;

[0035] S4.6.2. Judgment and storage: For the created path division memory table, judge according to the length of the secondary split array variable, so it satisfies the otherwise logic in the judgment storage rule: Insert data into the path division memory table, where the first field stores the 0th position of the split array, that is: Self-operated Cash Loan Folder / ZYSX Self-operated Quota / Decision Flow Management; the middle field stores / __Attic / ; the last1 field stores: ZYSX_N070 Quota Pricing Strategy; the last2 field stores: 1.

[0036] Preferably, the step S4.8 further includes the following detailed steps:

[0037] S4.8.1. Variable initialization: Convert the last2 field of the deduplicated path partition table to the int type and assign it to the variable i, and assign the last1 field of the deduplicated path partition table to the rule name variable;

[0038] S4.8.2. Traverse the path partition table: The conditions are that the value of the rule name variable is equal to the value of the last1 field of the path partition table and the value of the first field of the deduplicated path partition table is equal to the value of the first of the path partition table;

[0039] S4.8.3. Generation of the path storage table: Insert a record in the in-memory table of the path storage table, insert the fields in the path partition table into the path storage table according to the corresponding relationship. The path storage table has an additional buchong field with the value of a single underscore _. Insert 2 records at a time, and insert.innovator_attbs into the last2 field of the path storage table.

[0040] Preferably, the length of the example secondary segmentation array in the step S4.6.1 is 3.

[0041] Preferably, the built path partition in-memory table in the step S4.6.2 has 4 fields.

[0042] Preferably, the converted integer value of the last2 field of the path partition table in the step S4.8.2 is less than the variable i.

[0043] Preferably, the difference between the second and the first records with the value of a single underscore _ in the step S4.8.3 is that the last2 field should concatenate the last2 in the path partition table;

[0044] Preferably, the detailed steps of the fifth step are as follows:

[0045] S5.1. Copy the final table.xlsx of the file version path to be deleted in the third step to a text file, open it, replace the spaces with backslash spaces \, search for the & symbol, replace it with \& or delete the path with the & symbol, search for the English parentheses, () and replace them with \(\), note: only replace the English format;

[0046] S5.2. Copy the replaced content to excel, add rm - rf, then copy it to txt, and add the first row.

[0047] Compared with the prior art, the present invention provides a method for cleaning the historical versions of the rule files based on the Blaze decision engine, having the following beneficial effects:

[0048] 1. The present invention effectively realizes an efficient, easy-to-operate, and easy-to-understand cleaning process through multiple simplified operation steps and automated scripts. The overall method refines complex cleaning logic into clear and specific steps, enabling users to easily follow. Users only need to execute a simple script getFilePaths.sh, which automatically obtains all file paths in a specified directory and generates a list, saving a large amount of time and effort. Users use familiar tools such as Excel to process the generated file paths and delete unnecessary paths through simple batch replacement operations. This process is intuitive and convenient. In the following steps, the method filters and classifies file paths by conditions, clearly retaining only files that meet specific conditions. This logic design that is easy to understand reduces the risk of errors and ensures accurate screening results. The detailed logging function included in the cleaning process can provide real-time feedback on the processing status, enhancing the user's sense of control over the operation process. Whether it is technical personnel or non-technical personnel, this user-friendly design allows everyone to more easily participate in the maintenance work of rules files, achieving the beneficial effects of easy cleaning, easy operation, and easy understanding with a simple method.

[0049] 2. The present invention sets clear screening conditions, so that only files that meet specific requirements are retained or deleted, reducing possible errors in manual selection. Since the entire cleaning process follows a unified processing standard, the logical consistency of different steps reduces the risks of inconsistency and omission during the operation process, ensuring the accuracy of the final result. Through the real-time logging function, the current operation status is timely feedback, helping users monitor their execution process and reducing errors caused by improper operations. The fully automated process minimizes human intervention, reduces the risk of accidentally deleting important files, and enhances the security of the system, achieving the beneficial effects of higher efficiency, higher accuracy, and lower risk in cleaning operations compared to manual deletion. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the method flow of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0051] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0052] Please refer to Figure 1 ,

[0053] The entire cleaning process is broken down into clear steps, each with a specific purpose. This breakdown makes the overall process less confusing and reduces the complexity of the operations.

[0054] For example, the step of obtaining the file paths is very straightforward. That is, by simply executing a script, a list of the required file paths can be automatically generated.

[0055] Automating the acquisition of file paths using the getFilePaths.sh script improves efficiency. Users only need to simply execute the script, and the system automatically handles file searching and saving, reducing manual intervention.

[0056] The content of the script is reasonably designed so that non - professional users can easily understand its function and master how to use it.

[0057] Using Excel for data processing makes full use of a tool that many users are already familiar with. Excel's replace function facilitates batch editing of paths, reducing the learning curve.

[0058] This step transforms complex text processing into simple graphical operations, enabling even those without a programming background to complete it easily.

[0059] In step four, through conditional filtering and classification, the complex path cleaning logic is simplified into several clear conditional judgments. Users only need to focus on specific keywords and path structures, making file classification easier and more intuitive.

[0060] This method can help users quickly identify files that need to be deleted, reducing the time for manual inspection.

[0061] Each step has specific operation guides. This step - by - step design makes it easy for users to follow, especially for those who are not familiar with the system or file management.

[0062] The certainty of the specified paths and output files enables users to clearly define their goals when performing each step.

[0063] The method includes a log - printing function that can provide real - time feedback on the processing status, enhancing the user's sense of control and security. When users know the current processing flow, it can further reduce the uncertainty in operations and boost confidence.

[0064] This method is based on common scripts and Excel tools, with strong applicability and no dependence on a specific operating system or software version, making it more flexible.

[0065] For different user groups, this method can be appropriately adjusted to suit their specific needs.

[0066] Through automated and simplified steps, this method significantly improves the efficiency of cleaning historical rule files, saving time and labor costs. This saving is particularly important in long-term rule management.

[0067] Clear path screening conditions and classification logic provide accurate file identification, reducing the risk of accidental deletion and omission, and helping to maintain the cleanliness and effectiveness of the system.

[0068] Simplifying the operations into easy-to-understand steps enhances the user experience. Whether technical or non-technical personnel, they can easily participate in the maintenance of rule files.

[0069] This method can be easily reused and modified to adapt to possible future changes, such as file structure updates or new classification requirements, thereby improving the long-term effectiveness of the method.

[0070] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for cleaning historical versions of rule files based on the Blaze decision engine, characterized in that: The following steps are involved: Step 1: Prepare a script to get the file path, the file name is getFilePaths.sh; Step 2: Put the getFilePaths.sh script into the rule base project path; Step 3. Execute the getFilePaths.sh script to get the file_paths.txt file, download it to the local computer using the sz file_paths.txt command, copy the contents of file_paths.txt to Excel, use the Excel replace function to delete the path before BusinessUser Projects / , and save the file to the root directory of drive D. Step 4: Open the Qizheng Decision Engine System and delete the historical version project; Step 5: Create a script based on the generated deletion path and upload it to the server for execution.

2. According to claim 1, a method for cleaning up historical versions of Blaze decision engine rule files is characterized in that: The script content in step 1 is: #! / bin / bash #Specify the output txt file path output_file="file_paths.txt" script_dir = $(pwd) target_dir="$script_dir / Business User Projects" find"$target_dir"-type f|sort>"$output_file" echo "File path saved to $output_file".

3. According to claim 1, a method for cleaning up historical versions of Blaze decision engine rule files is characterized in that: The rule library path in step 2 is: / home / hcuser / app / Blaze77 / BlazeRepository.

4. According to claim 1, a method for cleaning up historical versions of Blaze decision engine rule files is characterized in that: The step 4 includes the following detailed steps: S4.1, initialization printing: print log, prompt processing start; S4.

2. Set the file import path: import the .xlsx file to be deleted in the D drive and print out the file import path log; S4.

3. Get the original data of the file: extract the content of sheet1 page in the .xlsx file to be deleted and save it into the file path memory table. The file path memory table only has one column, file path. S4.4, file classification path storage: traverse the file path memory table saved in S4.3, and according to the conditions: the file path contains: / __Attic / and does not contain: version and does not contain: innovator_attbs, insert the result into the file classification 1 memory table, which also has only one file path column; S4.5, print the number of records in the memory table of file category 1; S4.

6. Generate a path partitioning table rule set: S4.

7. Get the array of rule names after deduplication: summarize the path partition table, with the summary columns as first, middle, last1, last2, max(last2), the grouping columns as first, last1, and the condition column as empty. Insert all the grouped deduplicated data into the path partition table after deduplication, and print the number of records in the path partition table after log deduplication. S4.8, generate the final path storage table rule set: traverse the memory table of the path partition table after deduplication; S4.9, final path table generation: traverse the path storage table, concatenate first, middle, last1, buchong, and last2 of the path storage table, and store them in the file path field of the final path table memory table; S4.10, end printing: save the data of the final path table to: the file version path final table to be deleted.xlsx in the D disk; Print log, total number of files to be deleted: take the number of records in the final path table; Print log, final table export path: D:\\file version path to be deleted final table.xlsx; Printing log,-----***Processing ended***-------.

5. A method for cleaning up historical versions of Blaze decision engine rule files according to claim 4, characterized in that: The S4.6 also includes the following detailed steps: S4.6.1, character segmentation: traverse the file category 1 memory table, assign the file path field of the file category 1 memory table to the path (temporary variable) and print it out, then split the path into a character array according to / __Attic / and assign it to the segmentation array variable, then take the [1]th bit of the segmentation array variable, split the array according to _, and assign it to the secondary segmentation array variable; S4.6.

2. Judgment storage: Create a path partition memory table, and judge according to the length of the secondary partition array variable, so that the otherwise logic in the judgment storage rule is satisfied: insert data into the path partition memory table, where the first field stores the 0th bit of the partition array, namely: self-operated cash loan folder / ZYSX self-operated quota / decision flow management; the middle field stores / __Attic / ; the last1 field stores: ZYSX_N070 quota pricing strategy; the last2 field stores:

1.

6. A method for cleaning up historical versions of Blaze decision engine rule files according to claim 1, characterized in that: The S4.8 also includes the following detailed steps: S4.8.

1. Variable initialization: convert the last2 field of the path partition table after deduplication to int type and assign it to the i variable, and assign the last1 field of the path partition table after deduplication to the rule name variable; S4.8.2, traverse the path partition table: the condition is: the rule name variable value is equal to the last1 field value of the path partition table and the first field value of the path partition table after deduplication is equal to the first value of the path partition table; S4.8.3, Path storage table generation: insert records into the path storage table memory table, insert the fields in the path partition table into the path storage table according to the corresponding relationship, add one more buchong field into the path storage table, the value is an underscore _, insert 2 records at a time, and insert .innovator_attbs into the last2 field of the path storage table.

7. The method for cleaning up historical versions of Blaze decision engine rule files according to claim 1, characterized in that: The length of the secondary partition array in the example of S4.6.1 is 3.

8. The method for cleaning up historical versions of Blaze decision engine rule files according to claim 1, characterized in that: The path partitioning memory table constructed in S4.6.2 has 4 fields.

9. The method for cleaning up historical versions of Blaze decision engine rule files according to claim 1, characterized in that: The last2 field of the conversion path partitioning table in S4.8.2 is an integer value less than the variable i, and the second item of the S4.8.3 value deposit underline _ is different from the first item in that the last2 field needs to concatenate the last2 in the path partitioning table.

10. The method for cleaning up historical versions of Blaze decision engine rule files according to claim 1, characterized in that: The detailed steps of step five are: S5.

1. Copy the file version path final table.xlsx to be deleted in step 3 to a text file, open it and replace the space with a backslash space \, search for the & symbol and replace it with \& or delete the path with the & symbol, search for English brackets, and replace () with \(\). Note: only replace the English format; S5.

2. Copy the replaced content to excel, add rm-rf, then copy it to txt and add the first line.

Citation Information

Patent Citations

  • A method and apparatus for cleaning log file cache

    CN109271355A

  • Implementation method for quickly opening file based on command line mode

    CN111045991A

  • File cleaning method and device

    CN115422136A

  • Service decision processing method and rule engine system thereof

    CN115756901A

  • Version information generation method and device, electronic equipment and nonvolatile storage medium

    CN115794197A