Rule data conversion method and data conversion system
By converting multiple target rule data into two-dimensional metadata and using mapping relationships for calculation, the problem of low efficiency in combining multi-dimensional rules in the existing technology is solved, and efficient business processing and rule management are achieved.
Patent Information
- Application Number
- CN202410665264.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-20
Smart Images

Figure CN118673069A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data conversion, and in particular to a rule data conversion method and a data conversion system. Background Art
[0002] When designing and developing business systems, a large number of personalized business rules and logical judgments need to be set to determine guiding decisions such as resource allocation. Business rules are usually stored in memory in the form of code. However, as time goes by, business rules increase with demand, and when users need to modify a rule, they need to rewrite and adjust the relevant program code. Due to the large number of business rules, it is difficult for developers to link business rules of multiple dimensions, and when modifying, they need to adjust the business rule sets of multiple dimensions, which takes a lot of time.
[0003] An existing table generation method includes the following steps: obtaining first input data for displaying a target table; determining a preset table rule corresponding to the first input data, the preset table rule being used to determine first display data to be displayed in the target table and first structural data for determining a first logical structure of the target table according to the first input data; displaying a first rule editing area according to the first display data and the first structural data; editing the preset table rule through the first rule editing area to obtain a target table rule for determining second display data to be displayed in the target table and second structural data for determining a second logical structure of the target table; and displaying a target table generated by the target table rule in the first preset area. However, this editing method does not combine multiple rules. If a business has multiple rules, the business takes a long time to search for the rules, which affects the execution efficiency of the processor. Summary of the invention
[0004] A first object of the present invention is to provide a rule data conversion method for improving processing efficiency and management efficiency.
[0005] The second object of the present invention is to provide a data conversion system applying the above-mentioned regular data conversion method.
[0006] In order to achieve the above-mentioned first purpose, the present invention provides a rule data conversion method, which includes: obtaining multiple rule data in a memory; screening multiple target rule data of the same business, combining the multiple target rule data, and converting them into two-dimensional metadata; storing the two-dimensional metadata in the memory; obtaining input data, querying the target two-dimensional metadata according to the input data, and calculating the input data according to the target two-dimensional metadata to obtain an output result.
[0007] It can be seen from the above scheme that in the same business, multiple target rule data may be of different dimensions. For example, in the course selection business of the course selection system, its rule data can be limited to student campus, student college, student grade, student basic courses, etc. Student campus, student college, student grade, student basic courses, etc. are rule data of different dimensions for a subject selection. The memory stores rule data of multiple businesses. The rule data conversion method of the present invention converts target rule data of multiple dimensions of the same business into two-dimensional metadata. When executing the business, the two-dimensional metadata can be directly called, and there is no need to query the target rule data of the business from multiple rule data in the memory, thereby improving the processing efficiency of the business. When the user needs to modify the rules, the two-dimensional metadata can be directly viewed, which is convenient for user management.
[0008] In a further solution, the step of combining multiple target rule data and converting them into two-dimensional metadata includes: forming a rule set from the multiple target rule data, setting a mapping relationship for the rule set, and forming the two-dimensional metadata with the rule set and the mapping relationship.
[0009] It can be seen that by using the mapping relationship, the target rule data is integrated into a mapping relationship. When the service needs to be used, the output result can be calculated through the mapping relationship.
[0010] In a further solution, the step of calculating the input data according to the target two-dimensional metadata includes: inputting the input data into a mapping relationship, and mapping to obtain an output result.
[0011] It can be seen that the target rule data can be integrated through the mapping relationship to reduce the processing volume of business execution.
[0012] In a further solution, after the two-dimensional metadata is stored in the memory, the following steps are further performed: querying the two-dimensional metadata to obtain modification data of the two-dimensional metadata; and modifying the two-dimensional metadata using the modification data to obtain modified two-dimensional metadata.
[0013] It can be seen from this that after the two-dimensional metadata is formed, the two-dimensional metadata can be modified later.
[0014] In a further solution, the step of modifying the two-dimensional metadata with the modification data includes: modifying the rule data corresponding to the two-dimensional metadata with the modification data to obtain the modification rule data.
[0015] It can be seen that since the two-dimensional metadata is modified, the corresponding rule data will also be modified.
[0016] In a further solution, after combining a plurality of target rule data and converting them into two-dimensional metadata, the following is further performed: forming the plurality of two-dimensional metadata into a two-dimensional table.
[0017] It can be seen that two-dimensional metadata can be visualized through a two-dimensional table.
[0018] In a further solution, after the plurality of two-dimensional metadata are formed into a two-dimensional table, the following is further performed: querying the two-dimensional metadata from the two-dimensional table.
[0019] It can be seen that through the two-dimensional table visualization, the user can query the two-dimensional metadata through the two-dimensional table so that the user can intuitively check whether the two-dimensional metadata is incorrect and modify the two-dimensional metadata.
[0020] In order to achieve the above-mentioned second purpose, the data conversion system provided by the present invention includes a data collection module, a two-dimensional data processing module, a data storage module and a business execution module; the data collection module is used to obtain multiple rule data in the memory; the two-dimensional data processing module is used to screen multiple target rule data of the same business, combine the multiple target rule data, and convert them into two-dimensional metadata; the data storage module is used to store the two-dimensional metadata in the memory; the business execution module is used to obtain input data, query the target two-dimensional metadata according to the input data, and calculate the input data according to the target two-dimensional metadata to obtain an output result.
[0021] As can be seen from the above scheme, the memory stores rule data of multiple services. The two-dimensional data processing module in the data conversion system of the present invention converts the target rule data of multiple dimensions of the same service into two-dimensional metadata. When the service execution module executes the service, it can directly call the two-dimensional metadata, and no longer needs to query the target rule data of the service from the multiple rule data in the memory, thereby improving the processing efficiency of the service. When the user needs to modify the rules, the two-dimensional metadata can be directly viewed, which is convenient for user management.
[0022] In a further solution, when the two-dimensional data processing module combines multiple target rule data into two-dimensional metadata, the multiple target rule data are formed into a rule set, a mapping relationship is set for the rule set, and the rule set and the mapping relationship form two-dimensional metadata.
[0023] It can be seen that by using the mapping relationship, the target rule data is integrated into a mapping relationship. When the service needs to be used, the output result can be calculated through the mapping relationship.
[0024] In a further solution, when the business execution module calculates the input data according to the target two-dimensional metadata, the input data is input into the mapping relationship to obtain an output result.
[0025] It can be seen that the target rule data can be integrated through the mapping relationship to reduce the processing volume of business execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1It is a system structure block diagram of a data conversion system embodiment of the present invention.
[0027] Figure 2 It is a flow chart of an embodiment of the rule data conversion method of the present invention.
[0028] The present invention is further described below in conjunction with the accompanying drawings and embodiments. DETAILED DESCRIPTION
[0029] The present invention collects the rule data in the memory, converts multiple target rule data of the same service into two-dimensional metadata, and when the service is executed, queries the target two-dimensional metadata from the multiple two-dimensional metadata in the memory, calculates the input data according to the target two-dimensional metadata, and obtains the output result. This method can form the rules written into the program into two-dimensional metadata, and when the service is executed, the two-dimensional metadata can be directly queried without querying the target rule data of the service from the memory, thereby improving the processing efficiency of the service.
[0030] Data conversion system embodiment:
[0031] See also Figure 1 The data conversion system includes a data collection module 11, a two-dimensional data processing module 12, a data storage module 13 and a business execution module 14. The data collection module 11 can collect all the rule data of the system from the memory, and capture the rule data therefrom through an intelligent data capture and screening mechanism. The two-dimensional metadata processing module 12 converts the target rule data corresponding to the business into two-dimensional metadata according to the business. The data storage module 13 stores the two-dimensional metadata in the memory. The business execution module 14 can calculate the input data according to the queried target two-dimensional metadata to obtain the output result. The business execution module 14 can also perform operations such as modification and query on the two-dimensional metadata.
[0032] The data conversion system also includes a data sharing module 15 and a rule effect evaluation module 16. The data sharing module can share two-dimensional metadata, and the rule effect evaluation module can evaluate and score the system. The data sharing module, rule effect evaluation module and other modules can be added and used according to personal needs.
[0033] Example of rule data conversion method:
[0034] See also Figure 2When the data conversion system executes the data conversion method, it first executes step S1 to obtain multiple rule data in the memory. The rule data of each business is stored in the memory. For example, in the course selection system, the course selection rules of each subject are stored in the memory. In this embodiment, the rule data is data that limits the business data according to the preset business rules. For example, the course in the business data is advanced mathematics, and the course selection rules (business rules) of the course are: student campus, student college, student grade, student basic courses, etc. The student grade can be limited to freshman, the student basic courses can be set to none, and the student college can be limited to colleges related to science and engineering. Each course selection rule is a dimension, that is, the course selection rules of one dimension are set using program coding. For example, the grade of the student who chooses the course of advanced mathematics is judged to determine whether the student grade is freshman. If so, the course can be selected. The course selection rules of each subject are different, and the course selection rules of all subjects are stored in the memory. Multiple course selection rules are multi-dimensional course selection rules. When using traditional methods to calculate whether a student can choose a course, it is necessary to query the course selection rules of multiple dimensions in the memory for screening.
[0035] When acquiring multiple rule data in the memory, the data collection module will automatically call the corresponding data collection algorithm to capture and collect data according to the data type involved in the rule data, such as structured data, unstructured data or semi-structured data. Using intelligent data capture and screening mechanisms, key rule data can be discovered and captured to improve the efficiency and accuracy of data collection. In order to prevent data from being missed, the data is preliminarily checked and filtered after data collection to ensure the integrity and correctness of the acquired rule data.
[0036] After acquiring the plurality of rule data in the memory, the plurality of rule data are backed up. When the rule data are subsequently converted into two dimensions, if a conversion error occurs, the backup data can be used for verification.
[0037] After acquiring multiple rule data in the memory, step S2 is executed to screen multiple target rule data of the same business, combine the multiple target rule data, and convert them into two-dimensional metadata. The multiple target rule data are formed into a rule set X = (X1, X2, X3, ..., Xn), and a mapping relationship is set for the rule set, that is, a mapping function Y = f (X) is set. The rule set and the mapping relationship form two-dimensional metadata, that is, the two-dimensional metadata is the mapping function Y = f (X), where Y is the output result, and the input data needs to be judged by the rule data in the X set to obtain the output result of Y.
[0038] For example, the course selection rules of advanced mathematics are screened to obtain student campus, student college, student grade, student basic courses, etc., and the course selection rules are formed into a rule set, where the student campus can be X1, the student college can be X2, the student grade can be X3, and the student basic course can be X4. In the mapping function Y=f(X), Y is the course selection result calculated by the course selection rules of the subject.
[0039] In another embodiment, after the rule data acquired in the memory is converted into a plurality of two-dimensional metadata, the plurality of two-dimensional metadata can be formed into a two-dimensional table, and the two-dimensional table is a collection of two-dimensional metadata of the system. The rule data can be visualized through the table, the rule data can be viewed, and the user can edit and modify the rules conveniently.
[0040] After the multiple target rule data are converted into two-dimensional metadata, step S3 is executed to store the two-dimensional metadata in a memory. Using large-scale storage technology, such as a distributed file system or a NoSQL database, to store the two-dimensional metadata can reduce the complexity of data storage and improve reliability when accessing and retrieving data.
[0041] After the two-dimensional metadata is stored in the memory, step S4 is executed to obtain input data, query the target two-dimensional metadata according to the input data, calculate the input data according to the target two-dimensional metadata, and obtain an output result.
[0042] For example, a student needs to choose an advanced mathematics course. The business execution module can query the two-dimensional metadata of advanced mathematics, that is, the mapping function Y=f(X) of advanced mathematics, and input the student's student campus, student college, student grade, and student basic courses into the formula of the mapping function to obtain the course selection result, that is, whether the student can choose the advanced mathematics course.
[0043] In another embodiment, when querying the two-dimensional metadata, the two-dimensional metadata may be queried through a two-dimensional table. The user may query the two-dimensional metadata through the two-dimensional table so that the user can visually check whether the two-dimensional metadata is incorrect, and thus modify the two-dimensional metadata.
[0044] By setting the two-dimensional metadata, when a business needs to be executed, the processor does not need to search and filter the rule data one by one in the memory, but directly retrieves the two-dimensional metadata for calculation, thereby improving the processing efficiency of the business.
[0045] After the two-dimensional metadata is stored in the memory, if the rule data needs to be adjusted, the two-dimensional metadata can be modified. The two-dimensional data processing module queries the two-dimensional metadata, obtains the modification data of the two-dimensional metadata, and modifies the two-dimensional metadata with the modification data to obtain the modified two-dimensional metadata. After the two-dimensional metadata is modified, the modification data can be used to modify the rule data corresponding to the two-dimensional metadata to obtain the modified rule data. After the two-dimensional metadata is formed, the two-dimensional metadata can be modified later. When modifying the data, modifying the two-dimensional metadata can reduce the amount of data modification.
[0046] This method can visualize rule data, reduce the programming modifications required for business rule changes, and improve the flexibility of the business system. For example, a student is a senior, but needs to retake advanced mathematics. Since the rule limits the student to freshman, the course cannot be selected at this time. However, after querying the two-dimensional metadata, the user can add rule data to the two-dimensional metadata or modify the rule data without modifying the programming, which improves the flexibility of the business system.
[0047] This embodiment converts multiple rule data into two-dimensional metadata, so that rule adjustment does not rely on code changes, reduces the technical requirements for programmers, and improves the efficiency of business rule management, execution and adjustment.
[0048] The above are only preferred embodiments of the present invention, but the design concept of the invention is not limited thereto. Without departing from the concept of the present invention, more other equivalent embodiments may be included. It is possible for those skilled in the art to make various obvious changes, readjustments and substitutions without departing from the protection scope of the present invention.
Claims
1. A rule data conversion method, characterized in that: Acquire multiple rule data in the memory; Screening multiple target rule data of the same business, combining the multiple target rule data, and converting them into two-dimensional metadata; Storing the two-dimensional metadata in a memory; Input data is acquired, target two-dimensional metadata is queried according to the input data, and the input data is calculated according to the target two-dimensional metadata to obtain an output result.
2. The rule data conversion method according to claim 1, characterized in that: The step of combining a plurality of the target rule data and converting them into the two-dimensional metadata comprises: The plurality of target rule data are formed into a rule set, a mapping relationship is set for the rule set, and the rule set and the mapping relationship form two-dimensional metadata.
3. The rule data conversion method according to claim 2, characterized in that: The step of calculating the input data according to the target two-dimensional metadata comprises: The input data is input into the mapping relationship to obtain the output result.
4. The rule data conversion method according to any one of claims 1 to 3, characterized in that: After storing the two-dimensional metadata in the memory, further executing: Querying the two-dimensional metadata to obtain modification data of the two-dimensional metadata; The two-dimensional metadata is modified by using the modification data to obtain modified two-dimensional metadata.
5. The rule data conversion method according to claim 4, characterized in that: The step of modifying the two-dimensional metadata by using the modification data comprises: The modification data is used to modify the rule data corresponding to the two-dimensional metadata to obtain modified rule data.
6. The rule data conversion method according to any one of claims 1 to 3, characterized in that: After combining the target rule data and converting them into two-dimensional metadata, the following steps are further performed: The plurality of two-dimensional metadata are formed into a two-dimensional table.
7. The rule data conversion method according to claim 6, characterized in that: After forming the plurality of two-dimensional metadata into a two-dimensional table, further executing: The two-dimensional metadata is queried from the two-dimensional table.
8. A data conversion system, characterized in that: It includes a data collection module, a two-dimensional data processing module, a data storage module and a business execution module; The data collection module is used to obtain multiple rule data in the memory; The two-dimensional data processing module is used to screen multiple target rule data of the same business, combine the multiple target rule data, and convert them into two-dimensional metadata; The data storage module is used to store the two-dimensional metadata in a memory; The business execution module is used to obtain input data, query target two-dimensional metadata according to the input data, calculate the input data according to the target two-dimensional metadata, and obtain an output result.
9. The data conversion system according to claim 8, characterized in that: When the two-dimensional data processing module combines the multiple target rule data into the two-dimensional metadata, the multiple target rule data are formed into a rule set, a mapping relationship is set for the rule set, and the rule set and the mapping relationship form the two-dimensional metadata.
10. The data conversion system according to claim 9, characterized in that: When the service execution module calculates the input data according to the target two-dimensional metadata, the input data is input into the mapping relationship to obtain the output result.
Citation Information
Patent Citations
Data processing method and device based on rule engine, equipment and medium
CN114328682A
Business data processing method and device, computer equipment and storage medium
CN117827902A
