A rule file comparison method, device, readable storage medium and terminal device

Through syntax parsing and coordinate system fitting technology, the rule file comparison process is simplified, solving the existing problems of cumbersome and slow comparison, and achieving efficient rule file difference analysis.

CN111258628BActive Publication Date: 2024-10-18PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010054757.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-17
Publication Date
2024-10-18
Estimated Expiration
2040-01-17

AI Technical Summary

Technical Problem

The existing rule file comparison process is cumbersome and slow, and the comparison results are difficult to read and understand.

Method used

Perform syntax analysis by obtaining the rule file, establish a preset coordinate system, fit the rule curve in the coordinate system, and compare the curves to obtain file differences.

Benefits of technology

The rule file comparison process is simplified, the comparison efficiency is improved, and the comparison results are easy to read and understand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111258628B_ABST
    Figure CN111258628B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of computer technology, and in particular, relates to a rule file comparison method, device, readable storage medium and terminal device. The method includes obtaining a first rule file and a second rule file, and parsing the first rule file and the second rule file respectively, obtaining a first rule condition and a first execution data corresponding to the first rule file, and obtaining a second rule condition and a second execution data corresponding to the second rule file; establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data; fitting a first rule curve corresponding to the first rule file in the preset coordinate system using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system using the second rule condition and the second execution data; comparing the first rule curve and the second rule curve to obtain the rule difference between the first rule file and the second rule file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a rule file comparison method, device, computer-readable storage medium and terminal device. Background Art

[0002] Conditional branches are an important feature of programming languages ​​and have a significant impact on the execution of programs. When there are a large number of conditional branches in a program, the program code becomes difficult to manage. The prior art extracts these conditional branches from the program code and converts the extracted conditional branches into rule files for centralized storage and management, so as to convert the original code content management into file management, which greatly improves the management efficiency. In the process of program development, programs are often updated according to changes in requirements. In order to determine whether the content changed by the updated program meets the requirements, it is necessary to obtain the difference between the new and old versions of the program, that is, it is necessary to compare the rule files corresponding to the new and old versions of the program. However, in the current rule file management, the difference between the two rule files is often obtained by directly comparing the code packages of the two rule files one by one. This method of comparing the code packages one by one is not only cumbersome and slow in comparison, but also difficult to read and understand in comparison results. Summary of the invention

[0003] The embodiments of the present application provide a rule file comparison method, apparatus, computer-readable storage medium and terminal device, which can solve the problems of cumbersome comparison process, slow comparison speed and difficult reading and understanding of comparison results in existing rule file comparison.

[0004] In a first aspect, an embodiment of the present application provides a rule file comparison method, comprising:

[0005] Obtaining a first rule file and a second rule file, and performing syntax parsing on the first rule file and the second rule file respectively, obtaining a first rule condition and a first execution data corresponding to the first rule file, and obtaining a second rule condition and a second execution data corresponding to the second rule file;

[0006] Establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data;

[0007] Fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data;

[0008] The first rule curve and the second rule curve are compared to obtain rule differences between the first rule file and the second rule file.

[0009] In a second aspect, an embodiment of the present application provides a rule file comparison device, comprising:

[0010] A syntax parsing module, used for acquiring a first rule file and a second rule file, and performing syntax parsing on the first rule file and the second rule file respectively, to obtain a first rule condition and a first execution data corresponding to the first rule file, and to obtain a second rule condition and a second execution data corresponding to the second rule file;

[0011] A coordinate system establishing module, used for establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data;

[0012] a rule curve fitting module, configured to fit a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and to fit a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data;

[0013] The rule file comparison module is used to compare the first rule curve and the second rule curve to obtain the rule difference between the first rule file and the second rule file.

[0014] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the rule file comparison method described in any one of the first aspects above is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer-readable instructions:

[0016] Obtaining a first rule file and a second rule file, and performing syntax parsing on the first rule file and the second rule file respectively, obtaining a first rule condition and a first execution data corresponding to the first rule file, and obtaining a second rule condition and a second execution data corresponding to the second rule file;

[0017] Establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data;

[0018] Fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data;

[0019] The first rule curve and the second rule curve are compared to obtain rule differences between the first rule file and the second rule file.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the rule file comparison method described in any one of the above-mentioned first aspects.

[0021] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0022] In an embodiment of the present application, when it is necessary to compare the first rule file and the second rule file, the first rule file and the second rule file can be firstly parsed separately to parse out the first rule condition and the first execution data corresponding to the first rule file, and parse out the second rule condition and the second rule data corresponding to the second rule file; then a preset coordinate system can be established according to the first rule condition, the first execution data, the second rule condition and the second execution data, and a first rule curve corresponding to the first rule file and a second rule curve corresponding to the second rule file can be fitted in the preset coordinate system, so that the rule difference between the first rule file and the second rule file can be quickly obtained by comparing the first rule curve and the second rule curve, that is, by fitting and comparing the rule curves in the same preset coordinate system, the comparison process of the rule files can be simplified and the comparison efficiency can be improved. In addition, by visualizing the rule files, the comparison results can be intuitively reflected, making the comparison results easy to read and understand. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0024] Figure 1 It is a flowchart of a rule file comparison method provided in an embodiment of the present application;

[0025] Figure 2 It is a flowchart of a rule file comparison method provided in an embodiment of the present application for performing syntax parsing in an application scenario;

[0026] Figure 3a It is a schematic diagram of a preset coordinate system established in an application scenario by a rule file comparison method provided in an embodiment of the present application;

[0027] Figure 3b is a schematic diagram of a preset coordinate system established by the rule file comparison method provided in one embodiment of the present application in another application scenario;

[0028] Figure 4 It is a schematic diagram of a flow chart of a rule curve fitting performed by a rule file comparison method provided in an embodiment of the present application in an application scenario;

[0029] Figure 4a It is a rule curve diagram fitted by the rule file comparison method provided by an embodiment of the present application in an application scenario;

[0030] Figure 5 It is a structural schematic diagram of a rule file comparison device provided in an embodiment of the present application;

[0031] Figure 6 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0033] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0034] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0035] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0036] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0037] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0038] like Figure 1 As shown, an embodiment of the present application provides a rule file comparison method, and the rule file comparison method may include:

[0039] Step S101: Obtain a first rule file and a second rule file, and perform syntax analysis on the first rule file and the second rule file respectively to obtain a first rule condition and a first execution data corresponding to the first rule file, and obtain a second rule condition and a second execution data corresponding to the second rule file;

[0040] The execution subject of the embodiment of the present application is a terminal device, and the terminal device includes but is not limited to: computing devices such as desktop computers, notebooks, PDAs, and cloud servers. When a user needs to compare rule files, the user can send a comparison request to the terminal device, and the terminal device can obtain the first rule file and the second rule file to be compared according to the comparison request, for example, the first rule file and the second rule file can be obtained through the acquisition path carried in the comparison request. After obtaining the first rule file and the second rule file, the terminal device can perform syntax parsing on the first rule file and the second rule file respectively to obtain the first rule condition and the first execution data corresponding to the first rule file, and obtain the second rule condition and the second execution data corresponding to the second rule file.

[0041] Specifically, Figure 2 As shown, the performing grammatical parsing on the first rule file and the second rule file respectively to obtain the first rule condition and the first execution data corresponding to the first rule file and to obtain the second rule condition and the second execution data corresponding to the second rule file may include:

[0042] Step S201, respectively obtaining a first rule code corresponding to the first rule file and a second rule code corresponding to the second rule file;

[0043] Step S202: converting the first rule code into a first execution code in a preset form by a preset conversion method, and converting the second rule code into a second execution code in the preset form by the preset conversion method;

[0044] Step S203: parse the first execution code and the second execution code respectively to obtain the first rule condition and the first execution data corresponding to the first rule file, and obtain the second rule condition and the second execution data corresponding to the second rule file.

[0045] For the above steps S201 to S203, both the first rule file and the second rule file can be drools files, wherein the drools file is a file in code form, that is, both the first rule file and the second rule file can be files in code form. After obtaining the first rule file and the rule file, the terminal device can obtain the first rule code corresponding to the first rule file and the second rule code corresponding to the second rule file, and then convert the first rule code into a first execution code in a preset form and convert the second rule code into a second execution code in a preset form respectively through a preset conversion method, wherein the preset conversion method can be a reflection method or other similar methods, and the preset form can be in the form of Java code, and then the first rule condition and the first execution data corresponding to the first rule file can be obtained by parsing the first execution code, and the second rule condition and the second execution data corresponding to the second rule file can be obtained by parsing the second execution code. Specifically, the terminal device can perform syntax parsing on the first execution code and the second execution code by calling the drools parsing engine running in the kie-container.

[0046] For example, the terminal device can perform syntax analysis on the following first execution code by calling the drools parsing engine running in the kie-container to obtain the first rule condition A and the first rule condition B corresponding to the first rule file, and can obtain the first execution data corresponding to the first rule condition A (a="123") and the first execution data corresponding to the first rule condition B (b="CK").

[0047] A(

[0048] a="123" )

[0050] B(

[0051] b=”CK”, )

[0053] then

[0054] RuleResult.setResultCode("FailCode1");

[0055] RuleResult.setResultMessage("rule statement").

[0056] Step S102: establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data;

[0057] It should be understood that after the terminal device obtains the first rule condition and the first execution data corresponding to the first rule file and obtains the second rule condition and the second execution data corresponding to the second rule file, the preset coordinate system can be established based on the first rule condition, the first execution data, the second rule condition and the second execution data. Specifically, a condition set can be first constructed based on the first rule condition and the second rule condition, wherein the condition set is a set composed of rule conditions, and the rule conditions include the first rule condition and the second rule condition, and a data set can be constructed based on the condition set, the first execution data and the second execution data, wherein the data set is a set composed of execution data, and the execution data includes the first execution data and the second execution data, and the construction order of each execution data in the data set is associated with the construction order of each rule condition in the condition set. For example, if the first rule condition in the constructed condition set is rule condition A, the first execution data in the constructed data set can be set as the execution data corresponding to condition rule A, and then the preset coordinate system can be established with the condition set as the horizontal axis and the data set as the vertical axis.

[0058] In a possible implementation, the constructing the data set based on the condition set, the first execution data, and the second execution data may include:

[0059] Constructing data sets corresponding to the rule conditions in the condition set based on the condition set, the first execution data and the second execution data;

[0060] Accordingly, establishing the preset coordinate system with the condition set as the horizontal axis and the data set as the vertical axis may include:

[0061] The preset coordinate system is established with the condition set as the horizontal axis and the data sets corresponding to each rule condition as the virtual vertical axis.

[0062] Here, the terminal device may first organize and analyze the first rule condition corresponding to the first rule file and the second rule condition corresponding to the second rule file to construct a condition set corresponding to the first rule file and the second rule file, wherein the condition set is the union of the first rule condition and the second rule condition, and may organize and analyze the first execution data corresponding to the first rule file and the second execution data corresponding to the second rule file to construct a data set corresponding to each rule condition in the condition set. For example, when the first rule file includes condition A, condition C, and condition D, and the second rule file includes condition A, condition B, condition C, and condition D, and the first execution data corresponding to condition A in the first rule file is value 1, the first execution data corresponding to condition C is value K, and the first execution data corresponding to condition D is value true, and the second execution data corresponding to condition A in the second rule file is value 2, the second execution data corresponding to condition B is value Y, the second execution data corresponding to condition C is value K, and the second execution data corresponding to condition D is value false, then the condition set corresponding to the first rule file and the second rule file can be constructed as {condition A, condition B, condition C, condition D}, and the data set corresponding to condition A can be constructed according to the execution data of condition A in the first rule file and the second rule file as {not involved, value 1, value 2}, root According to the execution data of condition B in the first rule file and the second rule file, the data set corresponding to condition B is constructed as {not involved, value Y}, according to the execution data of condition C in the first rule file and the second rule file, the data set corresponding to condition C is constructed as {not involved, value K}, and according to the execution data of condition D in the first rule file and the second rule file, the data set corresponding to condition D is constructed as {not involved, value true, value false}, where "not involved" means that the rule condition is not included in the rule file. For example, when condition B is not included in the first rule file mentioned above, the execution data in condition B of the first rule file takes the value of "not involved". At this time, the terminal device can use the condition set as the horizontal axis, and use the data sets corresponding to each rule condition in the condition set as the virtual vertical axis to establish the preset coordinate system. Specifically, the terminal device can use each condition in the condition set as a horizontal axis value in the horizontal axis, and use each execution data in the data set corresponding to each condition as each vertical axis value corresponding to the condition in the virtual vertical axis, so as to obtain the preset coordinate system. Based on the above example, the following can be obtained: Figure 3a In the embodiment of the present application, the virtual vertical axis can be understood as the vertical axis corresponding to each horizontal axis value, but the actual vertical axis is not shown in the preset coordinate system, but only the vertical axis value is shown.

[0063] It should be noted that the terminal device can also directly establish the preset coordinate system with the condition set as the horizontal axis and the data set as the vertical axis, that is, the data sets corresponding to the various rule conditions in the condition set can be first integrated to obtain the final total data set, and then the preset coordinate system can be established with the condition set as the horizontal axis and the total data set as the vertical axis. For example, when the condition set constructed above is {condition A, condition B, condition C, condition D} and the data set corresponding to condition A is {not involved, value 1, value 2}, the data set corresponding to condition B is {not involved, value Y}, the data set corresponding to condition C is {not involved, value K}, and the data set corresponding to condition D is {not involved, value true, value false}, the terminal device can construct a corresponding total data set of {not involved, value 1, value 2, value Y, value K, value true, value false}, and can use the condition set as the horizontal axis and the total data set as the vertical axis, that is, use each condition in {condition A, condition B, condition C, condition D} as the horizontal axis value in the horizontal axis, and use each execution data in {not involved, value 1, value 2, value Y, value K, value true, value false} as the vertical axis value in the vertical axis to establish the following. Figure 3b The preset coordinate system shown.

[0064] Step S103: fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data;

[0065] Specifically, Figure 4 As shown, fitting the first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data may include:

[0066] Step S401, determining the horizontal coordinate of the first rule condition in the preset coordinate system, and determining the vertical coordinate of the first execution data in the preset coordinate system;

[0067] Step S402: drawing a first regular point in the preset coordinate system according to the horizontal coordinate and the vertical coordinate;

[0068] Step S403: fitting a first rule curve corresponding to the first rule file in the preset coordinate system using the first rule points.

[0069] For the above steps S401 to S403, after establishing the preset coordinate system, the terminal device can determine the horizontal coordinates of each first rule condition in the first rule file in the preset coordinate system, and determine the vertical coordinates of the first execution data corresponding to each first rule condition in the preset coordinate system, so that multiple first rule points corresponding to the first rule file can be drawn according to the horizontal coordinates corresponding to the first rule conditions and the vertical coordinates corresponding to the first execution data corresponding to the first rule conditions, and finally, the first rule curve corresponding to the first rule file can be obtained by connecting each first rule point through a line segment or a curve.

[0070] Similarly, fitting the second rule curve corresponding to the second rule file in the preset coordinate system using the second rule condition and the second execution data may include: determining the horizontal coordinate of the second rule condition in the preset coordinate system, and determining the vertical coordinate of the second execution data in the preset coordinate system; drawing a plurality of second rule points in the preset coordinate system according to the horizontal coordinate and the vertical coordinate; and fitting the second rule curve corresponding to the second rule file in the preset coordinate system using a plurality of second rule points.

[0071] For example, based on the above-mentioned example in which the first rule file includes conditions A, C, and D, the second rule file includes conditions A, B, C, and D, and the first execution data corresponding to condition A in the first rule file is value 1, the first execution data corresponding to condition C is value K, and the first execution data corresponding to condition D is value true, and the second execution data corresponding to condition A in the second rule file is value 2, the second execution data corresponding to condition B is value Y, the second execution data corresponding to condition C is value K, and the second execution data corresponding to condition D is value false, the following can be fitted: Figure 4a The first regular curve and the second regular curve are shown.

[0072] Step S104: Compare the first rule curve and the second rule curve to obtain rule differences between the first rule file and the second rule file.

[0073] Here, after fitting the first rule curve corresponding to the first rule file and the second rule curve corresponding to the second rule file, the terminal device can directly compare the first rule curve with the second rule curve to intuitively obtain the rule difference between the first rule file and the second rule file.

[0074] In a possible implementation, comparing the first rule curve and the second rule curve to obtain a rule difference between the first rule file and the second rule file may include:

[0075] Step a, comparing the first ruled curve and the second ruled curve, and determining the difference regular points between the first ruled curve and the second ruled curve;

[0076] Step b: determining the difference rule point as the rule difference between the first rule file and the second rule file, and marking the difference rule point with a preset color.

[0077] It should be understood that after obtaining the first rule curve and the second rule curve, the terminal device can compare the first rule curve and the second rule curve to obtain the difference rule point between the first rule curve and the second rule curve, and the difference rule point can be used to indicate the difference rule conditions between the first rule file and the second rule file, that is, the rule condition indicated by the difference rule point is the rule difference between the first rule file and the second rule file. Here, after obtaining the difference rule point, the terminal device can mark the difference rule point with a preset color to facilitate intuitive understanding of the difference between the first rule file and the second rule file.

[0078] It should be noted that the terminal device can also determine the overlapping rule points between the first rule curve and the second rule curve. The overlapping rule points can be used to indicate the same rule conditions between the first rule file and the second rule file, and the overlapping rule points can be marked with a preset color, wherein the colors used for color marking the overlapping rule points and the different rule points are different. For example, the overlapping rule points can be marked in red, and the different rule points can be marked in yellow, so as to intuitively display the similarities and differences between the first rule file and the second rule file through charts and color distinctions, thereby facilitating an intuitive understanding of the same rule conditions and different rule conditions between the first rule file and the second rule file.

[0079] In an embodiment of the present application, when it is necessary to compare the first rule file and the second rule file, the first rule file and the second rule file can be firstly parsed separately to parse out the first rule condition and the first execution data corresponding to the first rule file, and parse out the second rule condition and the second rule data corresponding to the second rule file; then a preset coordinate system can be established according to the first rule condition, the first execution data, the second rule condition and the second execution data, and a first rule curve corresponding to the first rule file and a second rule curve corresponding to the second rule file can be fitted in the preset coordinate system, so that the rule difference between the first rule file and the second rule file can be quickly obtained by comparing the first rule curve and the second rule curve, that is, by fitting and comparing the rule curves in the same preset coordinate system, the comparison process of the rule files can be simplified and the comparison efficiency can be improved. In addition, by visualizing the rule files, the comparison results can be intuitively reflected, making the comparison results easy to read and understand.

[0080] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0081] Corresponding to the rule file comparison method described in the above embodiment, Figure 5 A structural block diagram of a rule file comparison device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0082] Reference Figure 5 , the rule file comparison device may include:

[0083] The syntax parsing module 501 is used to obtain a first rule file and a second rule file, and perform syntax parsing on the first rule file and the second rule file respectively to obtain a first rule condition and a first execution data corresponding to the first rule file and to obtain a second rule condition and a second execution data corresponding to the second rule file;

[0084] A coordinate system establishing module 502, configured to establish a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data;

[0085] A rule curve fitting module 503, configured to fit a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and to fit a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data;

[0086] The rule file comparison module 504 is used to compare the first rule curve and the second rule curve to obtain the rule difference between the first rule file and the second rule file.

[0087] Optionally, the grammar parsing module 501 may include:

[0088] A rule code acquisition unit, used to respectively acquire a first rule code corresponding to the first rule file and a second rule code corresponding to the second rule file;

[0089] A rule code conversion unit, configured to convert the first rule code into a first execution code in a preset form through a preset conversion method, and to convert the second rule code into a second execution code in the preset form through the preset conversion method;

[0090] The syntax parsing unit is used to perform syntax parsing on the first execution code and the second execution code respectively to obtain the first rule condition and the first execution data corresponding to the first rule file and to obtain the second rule condition and the second execution data corresponding to the second rule file.

[0091] In a possible implementation, the coordinate system establishing module 502 may include:

[0092] a condition data set construction unit, configured to construct a condition set based on the first rule condition and the second rule condition, and to construct a data set based on the condition set, the first execution data, and the second execution data, wherein the condition set is a set composed of rule conditions, the rule conditions include the first rule condition and the second rule condition, and the data set is a set composed of execution data, the execution data includes the first execution data and the second execution data;

[0093] The coordinate system establishing unit is used to establish the preset coordinate system with the condition set as the horizontal axis and the data set as the vertical axis.

[0094] Optionally, the condition data set construction unit is further used to construct data sets corresponding to each rule condition in the condition set based on the condition set, the first execution data and the second execution data;

[0095] The coordinate system establishing unit is further used to establish the preset coordinate system with the condition set as the horizontal axis and the data sets corresponding to each rule condition as the virtual vertical axis.

[0096] In a possible implementation, the regular curve fitting module 503 may include:

[0097] A first coordinate determining unit, used to determine the horizontal coordinate of the first rule condition in the preset coordinate system, and determine the vertical coordinate of the first execution data in the preset coordinate system;

[0098] A first regular point drawing unit, used for drawing a first regular point in the preset coordinate system according to the horizontal coordinate and the vertical coordinate;

[0099] The first rule curve fitting unit is used to fit a first rule curve corresponding to the first rule file in the preset coordinate system using the first rule points.

[0100] In another possible implementation, the regular curve fitting module 503 may further include:

[0101] A second coordinate determining unit, used to determine the horizontal coordinate of the second rule condition in the preset coordinate system, and determine the vertical coordinate of the second execution data in the preset coordinate system;

[0102] A second regular point drawing unit, used for drawing a second regular point in the preset coordinate system according to the horizontal coordinate and the vertical coordinate;

[0103] The second rule curve fitting unit is used to fit the second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule points.

[0104] Optionally, the rule file comparison device may further include:

[0105] a distinguishing regular point determining module, configured to compare the first regular curve with the second regular curve, and determine a distinguishing regular point between the first regular curve and the second regular curve;

[0106] The color marking module is used to determine the difference rule point as the rule difference between the first rule file and the second rule file, and mark the difference rule point with a preset color.

[0107] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0108] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0109] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 6 As shown, the terminal device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and computer-readable instructions 62 stored in the memory 61 and executable on the at least one processor 60, and when the processor 60 executes the computer-readable instructions 62, the steps in any of the above-mentioned rule file comparison method embodiments are implemented.

[0110] The terminal device 6 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0111] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer-readable instructions, etc. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0113] An embodiment of the present application further provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0114] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0115] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes can be in source code form, object code form, executable files or some intermediate forms. The computer-readable medium can at least include: any entity or device that can carry the computer-readable instruction code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0116] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0117] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0118] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0120] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A rule file comparison method, characterized in that: include: Obtain a first rule file and a second rule file, and respectively obtain a first rule code corresponding to the first rule file and a second rule code corresponding to the second rule file; Converting the first rule code into a first execution code in a preset form by a preset conversion method, and converting the second rule code into a second execution code in the preset form by the preset conversion method; Parsing the first execution code and the second execution code respectively to obtain a first rule condition and first execution data corresponding to the first rule file and a second rule condition and second execution data corresponding to the second rule file; Establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data; Fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data; Comparing the first rule curve with the second rule curve to obtain rule differences between the first rule file and the second rule file; The establishing of a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data includes: A condition set is constructed based on the first rule condition and the second rule condition, and a data set is constructed based on the condition set, the first execution data, and the second execution data, wherein the condition set is a set composed of rule conditions, the rule conditions include the first rule condition and the second rule condition, and the data set is a set composed of execution data, the execution data includes the first execution data and the second execution data; The preset coordinate system is established with the condition set as the horizontal axis and the data set as the vertical axis.

2. The rule file comparison method according to claim 1, characterized in that: The constructing a data set based on the condition set, the first execution data and the second execution data comprises: Constructing data sets corresponding to the rule conditions in the condition set based on the condition set, the first execution data and the second execution data; The establishing of the preset coordinate system with the condition set as the horizontal axis and the data set as the vertical axis includes: The preset coordinate system is established with the condition set as the horizontal axis and the data sets corresponding to each rule condition as the virtual vertical axis.

3. The rule file comparison method according to claim 1, characterized in that: The step of fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data includes: Determine the horizontal coordinate of the first rule condition in the preset coordinate system, and determine the vertical coordinate of the first execution data in the preset coordinate system; Draw a first regular point in the preset coordinate system according to the horizontal coordinate and the vertical coordinate; The first rule points are used to fit a first rule curve corresponding to the first rule file in the preset coordinate system.

4. The rule file comparison method according to claim 1, characterized in that: The step of fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data includes: Determine the horizontal coordinate of the second rule condition in the preset coordinate system, and determine the vertical coordinate of the second execution data in the preset coordinate system; Draw a second regular point in the preset coordinate system according to the abscissa and the ordinate; The second rule points are used to fit a second rule curve corresponding to the second rule file in the preset coordinate system.

5. The rule file comparison method according to any one of claims 1 to 4, characterized in that: The comparing the first rule curve and the second rule curve to obtain the rule difference between the first rule file and the second rule file includes: comparing the first ruled curve and the second ruled curve to determine different regular points between the first ruled curve and the second ruled curve; The difference rule point is determined as the rule difference between the first rule file and the second rule file, and the difference rule point is marked with a preset color.

6. A rule file comparison device, characterized in that: include: A syntax parsing module, used to obtain a first rule file and a second rule file, and respectively obtain a first rule code corresponding to the first rule file and a second rule code corresponding to the second rule file; The first rule code is converted into a first execution code of a preset form by a preset conversion method, and the second rule code is converted into a second execution code of the preset form by the preset conversion method; the first execution code and the second execution code are parsed respectively to obtain a first rule condition and a first execution data corresponding to the first rule file, and to obtain a second rule condition and a second execution data corresponding to the second rule file; A coordinate system establishing module, used for establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data; a rule curve fitting module, configured to fit a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and to fit a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data; A rule file comparison module, used for comparing the first rule curve and the second rule curve, and obtaining a rule difference between the first rule file and the second rule file; Among them, the coordinate system establishment module is specifically used to construct a condition set based on the first rule condition and the second rule condition, and to construct a data set based on the condition set, the first execution data and the second execution data, wherein the condition set is a set composed of rule conditions, the rule conditions include the first rule conditions and the second rule conditions, and the data set is a set composed of execution data, the execution data includes the first execution data and the second execution data; the preset coordinate system is established with the condition set as the horizontal axis and the data set as the vertical axis.

7. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the rule file comparison method according to any one of claims 1 to 5 is implemented.

8. A terminal device, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the following steps are implemented: Obtain a first rule file and a second rule file, and respectively obtain a first rule code corresponding to the first rule file and a second rule code corresponding to the second rule file; Converting the first rule code into a first execution code in a preset form by a preset conversion method, and converting the second rule code into a second execution code in the preset form by the preset conversion method; Parsing the first execution code and the second execution code respectively to obtain a first rule condition and first execution data corresponding to the first rule file and a second rule condition and second execution data corresponding to the second rule file; Establishing a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data; Fitting a first rule curve corresponding to the first rule file in the preset coordinate system by using the first rule condition and the first execution data, and fitting a second rule curve corresponding to the second rule file in the preset coordinate system by using the second rule condition and the second execution data; Comparing the first rule curve with the second rule curve to obtain rule differences between the first rule file and the second rule file; The establishing of a preset coordinate system based on the first rule condition, the first execution data, the second rule condition and the second execution data includes: A condition set is constructed based on the first rule condition and the second rule condition, and a data set is constructed based on the condition set, the first execution data, and the second execution data, wherein the condition set is a set composed of rule conditions, the rule conditions include the first rule condition and the second rule condition, and the data set is a set composed of execution data, the execution data includes the first execution data and the second execution data; The preset coordinate system is established with the condition set as the horizontal axis and the data set as the vertical axis.

Citation Information

Patent Citations

  • System and method for decoding video coding data stream

    CN101616323A

  • Method and device for playing television programs

    CN110419226A