CN111563178A - Rule logic diagram comparison method, device, medium and electronic equipment - Google Patents

Rule logic diagram comparison method, device, medium and electronic equipment Download PDF

Info

Publication number
CN111563178A
CN111563178A CN202010349673.3A CN202010349673A CN111563178A CN 111563178 A CN111563178 A CN 111563178A CN 202010349673 A CN202010349673 A CN 202010349673A CN 111563178 A CN111563178 A CN 111563178A
Authority
CN
China
Prior art keywords
information
logic diagram
rule logic
tree
tree node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010349673.3A
Other languages
Chinese (zh)
Inventor
李肖磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010349673.3A priority Critical patent/CN111563178A/en
Publication of CN111563178A publication Critical patent/CN111563178A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Economics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Development Economics (AREA)
  • Evolutionary Computation (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to the field of block chains, and discloses a method, a device, a medium and an electronic device for comparing rule logic diagrams. The method comprises the following steps: respectively acquiring two rule logic diagrams to be compared; analyzing the first rule logic diagram and the second rule logic diagram respectively to obtain the structured data object tree information of each rule logic diagram; aiming at each second tree node information of a second rule logic diagram, comparing the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information; and returning the second tree node information with inconsistent comparison result information to the user through the front-end page. By the method, automatic comparison of different rule logic diagrams is realized, a user can quickly find differences among the different rule logic diagrams, time consumed by troubleshooting is reduced, and efficiency is improved. Wherein the structured data object tree information for each rule logic diagram can be stored in a blockchain.

Description

Rule logic diagram comparison method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of block chain technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for comparing a rule logic diagram.
Background
With the development of mobile internet and internet finance, it is becoming more and more important to establish a wind control system to prevent risks. In some wind control engines or wind control models, wind control decisions are often a very important part. The most central decision logic of the wind control decision is generally decision logic, which can be represented in the form of a regular logic diagram. Since the wind control model is adjusted frequently according to the actual business result and the customer requirement, the rule logic diagram of the wind control model has a plurality of versions (a new version is generated for each adjustment). Generally, in order to determine the difference between the rule logic diagrams of different versions, business personnel often adopt methods of reading and querying configuration personnel item by item, and the methods are time-consuming and labor-consuming, long in troubleshooting time and low in efficiency.
Disclosure of Invention
In the field of block chain technology, to solve the above technical problem, an object of the present disclosure is to provide a method, an apparatus, a medium, and an electronic device for comparing a rule logic diagram.
According to an aspect of the present disclosure, there is provided a rule logic diagram comparison method, the method including:
respectively acquiring two rule logic diagrams to be compared, wherein the two rule logic diagrams are respectively a first rule logic diagram and a second rule logic diagram, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagrams are represented in a structured data object tree form;
analyzing the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, wherein the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information comprises the tree node information of the corresponding tree nodes;
aiming at each second tree node information of the second rule logic diagram, comparing the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information;
and returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
According to another aspect of the present disclosure, there is provided a rule logic diagram comparison apparatus, the apparatus including:
the system comprises an acquisition module, a comparison module and a comparison module, wherein the acquisition module is configured to acquire two rule logic diagrams to be compared respectively, the two rule logic diagrams are a first rule logic diagram and a second rule logic diagram respectively, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagram is represented in a structured data object tree form;
an analysis module configured to analyze the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, wherein the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information includes tree node information of the corresponding tree nodes;
the comparison module is configured to compare the second tree node information with the first tree node information of the first rule logic diagram aiming at each piece of second tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information;
and the return module is configured to return the second tree node information of which the comparison result information is inconsistent to the user through a front-end page.
According to another aspect of the present disclosure, there is provided a computer readable program medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method as previously described.
According to another aspect of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method as previously described.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the comparison method of the rule logic diagram provided by the disclosure comprises the following steps: respectively acquiring two rule logic diagrams to be compared, wherein the two rule logic diagrams are respectively a first rule logic diagram and a second rule logic diagram, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagrams are represented in a structured data object tree form; analyzing the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, wherein the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information comprises the tree node information of the corresponding tree nodes; aiming at each second tree node information of the second rule logic diagram, comparing the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information; and returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
According to the method, after two rule logic diagrams to be compared are obtained, the two rule logic diagrams are analyzed respectively to obtain structured data object tree information including tree node information, then the tree node information is compared, and after the comparison result information is obtained, second tree node information with the comparison result information being inconsistent is returned to a user. Therefore, automatic comparison of different rule logic diagrams is realized, a user can quickly obtain the difference between the different rule logic diagrams, the time consumed by troubleshooting is reduced, and the efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a system architecture diagram illustrating a rule logic diagram comparison method in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a rule logic diagram comparison method in accordance with an exemplary embodiment;
FIG. 3 is a simplified schematic diagram illustrating a rule logic diagram in accordance with an exemplary embodiment;
FIG. 4 is a diagram illustrating a relationship between entry conditions and termination conditions corresponding to tree nodes of a rule logic diagram in accordance with an exemplary embodiment;
FIG. 5 is a block diagram illustrating a rule logic diagram comparison apparatus in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating an example of an electronic device implementing the above rule logic diagram comparison method in accordance with one illustrative embodiment;
fig. 7 illustrates a computer-readable storage medium implementing the rule logic diagram comparison method according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The present disclosure first provides a rule logic diagram comparison method. The rule logic diagram is commonly used in a wind control engine or a wind control model, and realizes the judgment and the filtration of information by combining a series of rules or conditions according to a specific mode, so that the function of risk control can be realized in the wind control engine or the wind control model. In the wind control decision engine project, the wind control model is frequently adjusted according to the actual business result and the customer requirements, so that a plurality of versions of the wind control model (a new version is generated in each adjustment) are generated, and correspondingly, rule logic diagrams of different versions are also generated. The rule logic diagram comparison method provided by the disclosure can realize automatic comparison of different rule logic diagrams.
The implementation terminal of the present disclosure may be any device having computing, processing, and communication functions, which may be connected to an external device for receiving or sending data, and specifically may be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, a pda (personal Digital assistant), or the like, or may be a fixed device, such as a computer device, a field terminal, a desktop computer, a server, a workstation, or the like, or may be a set of multiple devices, such as a physical infrastructure of cloud computing or a server cluster.
Optionally, the implementation terminal of the present disclosure may be a server or a physical infrastructure of cloud computing.
FIG. 1 is a system architecture diagram illustrating a rule logic diagram comparison method in accordance with an exemplary embodiment. As shown in fig. 1, the system architecture includes a server 120, a desktop computer 110, and a database 130, and the desktop computer 110 and the database 130 and the server 120 and the database 130 are connected through communication links, so as to receive and transmit data. The server 120 is fixedly provided with a wind control engine, and the rule logic diagram used by the wind control engine is stored in the database 130, so that when the rule logic diagram of the wind control engine is changed, the rule logic diagrams before and after the change are stored in the database 130. In this embodiment, the desktop computer 110 is a terminal for implementing the present disclosure, and the desktop computer 110 may obtain the two rule logic diagrams from the database 130 connected thereto for comparison, and then return various information generated by the comparison to the user operating the desktop computer 110.
It is worth mentioning that fig. 1 is only one embodiment of the present disclosure. Although the implementation terminal in this embodiment is a desktop computer, in other embodiments, the implementation terminal may be various terminals or devices as described above; although in the present embodiment, the terminal where the wind control engine is located, the terminal where the rule logic diagram is stored, and the implementation terminal of the present disclosure are different terminals, in other embodiments or specific applications, they may be on the same terminal; although the information generated by the comparison is returned to the user by using the implementation terminal of the present disclosure in the present embodiment, in other embodiments, the information generated by the comparison may be returned to the user by a terminal device connected to the implementation terminal of the present disclosure. The present disclosure is not intended to be limited thereby, nor should the scope of the present disclosure be limited thereby.
FIG. 2 is a flow chart illustrating a rule logic diagram comparison method in accordance with an exemplary embodiment. The comparison method for the rule logic diagram provided by this embodiment may be executed by a server, as shown in fig. 2, and includes the following steps:
step 210, two rule logic diagrams to be compared are obtained respectively.
The two rule logic diagrams are respectively a first rule logic diagram and a second rule logic diagram, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagram is represented in a structured data object tree form.
The rule logic diagram is a representation of the rule logic implemented with a particular data structure, and the structured data object tree is a structured representation of the rule logic diagram implemented with the data structure of a tree.
In one embodiment, the separately obtaining two logic diagrams of rules to be compared includes:
and acquiring two JSON objects derived from a preset database as two rule logic diagrams to be compared.
JSON (JavaScript Object Notation) is a lightweight data exchange format, which stores and represents data in a text format completely independent of a programming language, and has a concise and clear hierarchical structure.
Step 220, analyzing the first rule logic diagram and the second rule logic diagram respectively to obtain the structured data object tree information of each rule logic diagram.
Wherein the structured data object tree information corresponds to tree nodes of the rule logic graph, and the structured data object tree information includes tree node information of the corresponding tree nodes.
The structured data object tree information may be a collection of tree node information for corresponding tree nodes.
In one embodiment, the parsing the first rule logic diagram and the second rule logic diagram respectively to obtain the structured data object tree information of each rule logic diagram includes:
and traversing the tree nodes of the first rule logic diagram and the second rule logic diagram respectively by using a depth-first search algorithm to obtain the structured data object tree information of each rule logic diagram.
When the depth-first search algorithm is adopted to traverse the tree nodes, the tree nodes can be traversed by adopting a mode of forward-order traversal, middle-order traversal, backward-order traversal and the like.
The process of traversing the tree nodes using the depth-first search algorithm may be such that: for a selected node, searching the child nodes of the node, sequentially searching the child nodes of the child nodes until the leaf nodes are searched, and then tracing back upwards to find the next child node, thereby sequentially traversing the whole rule logic diagram.
FIG. 3 is a simplified schematic diagram illustrating a rule logic diagram in accordance with an exemplary embodiment. The rule logic diagram may be presented in the form shown in fig. 3. Referring to fig. 3, a-H are tree nodes included in the regular logic graph, respectively, and then the regular logic graph shown in the upper graph is traversed by using a depth-first search algorithm, so as to search for the structured data object tree information corresponding to the F node, the traversal mode may be performed in the following order: A-B-D-H-E-C-F.
Step 230, comparing the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information, for each second tree node information of the second rule logic diagram.
In one embodiment, the structured data object tree information includes hierarchical information of corresponding tree nodes in the rule logic diagram, and the parsing the first rule logic diagram and the second rule logic diagram respectively to obtain the structured data object tree information of each rule logic diagram includes:
respectively traversing the tree nodes of the first rule logic diagram and the second rule logic diagram by using a depth-first search algorithm to obtain the structured data object tree information of each rule logic diagram;
respectively storing the structured data object tree information of the first rule logic diagram and the second rule logic diagram according to the hierarchical information of the corresponding tree nodes in the first rule logic diagram and the second rule logic diagram, and storing the hierarchical information in a block chain;
the comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information includes:
and obtaining second tree node information of the second rule logic diagram from the stored structured data object tree information of the second rule logic diagram by using a breadth-first search algorithm, and comparing the second tree node information with the first tree node information of the first rule logic diagram aiming at each second tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information.
In this embodiment, on the one hand, the structured data object tree information is stored according to the hierarchical information of the corresponding tree node in the regular logic diagram, so that the structured data object tree information can be stored more regularly, and the comparison efficiency of the node information is improved to a certain extent.
In one embodiment, the tree node information in the structured data object tree information includes entry conditions, termination conditions, and selection rules of corresponding tree nodes, and the storing the structured data object tree information of the first rule logic diagram and the second rule logic diagram according to hierarchy information of corresponding tree nodes in the first rule logic diagram and the second rule logic diagram, and storing the tree information in the block chain includes:
utilizing a first group of pre-established storage information containers to store the hierarchical information of the structured data object tree information of the first rule logic diagram in the first rule logic diagram according to the corresponding tree nodes, and storing the hierarchical information in a block chain, wherein the first group of storage information containers comprises a first storage information container, a second storage information container and a third storage information container, the first storage information container is used for storing entry conditions, termination conditions and selection rules corresponding to the tree nodes of the first rule logic diagram, the second storage information container is used for storing the hierarchy of the tree nodes of the first rule logic diagram, the third storage information container is used for storing all the rules and conditions of the tree nodes of the first rule logic diagram, the entry conditions are conditions required for entering the corresponding tree nodes, and the termination conditions are conditions when the rule logic diagram terminates, the selection rule is a judgment result used for entering a child node of the tree node from the corresponding tree node to judge whether the entry condition of the child node is met, and all the rules and conditions of all the tree nodes of the rule logic diagram are an integral body consisting of the rules and conditions of all the tree nodes of the rule logic diagram;
and storing the structured data object tree information of the second rule logic diagram according to the hierarchy information of the corresponding tree nodes in the second rule logic diagram by using a second group of pre-established storage information containers, and storing the hierarchy information in a block chain, wherein the second group of storage information containers comprises a fourth storage information container, a fifth storage information container and a sixth storage information container, the fourth storage information container is used for storing entry conditions, termination conditions and selection rules corresponding to the tree nodes of the second rule logic diagram, the fifth storage information container is used for storing the hierarchy of the tree nodes of the second rule logic diagram, and the sixth storage information container is used for storing all the rules and conditions of the tree nodes of the second rule logic diagram.
The first group of storage information containers and the second group of storage information containers can be HashSet containers and HashMap containers, for example, the HashSet containers and the HashMap containers are used for storing the structured data object tree information of the first rule logic diagram and the second rule logic diagram, the information retrieval efficiency can be improved, the tree node information acquisition efficiency is improved, and therefore the comparison efficiency of the second tree node information and the first tree node information is improved.
It is emphasized that, in order to further ensure the privacy and security of the structured data object tree information of each rule logic diagram, the structured data object tree information of each rule logic diagram may also be stored in a node of a block chain.
FIG. 4 is a diagram illustrating a relationship between entry conditions and termination conditions corresponding to tree nodes of a rule logic diagram, according to an example embodiment. Referring to fig. 4, an entry condition and a termination condition corresponding to each tree node of a rule logic diagram are shown, where each square box is a tree node, contents in the square box are tree node information, the tree node is entered after the entry condition of one tree node is satisfied, if the termination condition of the tree node is not satisfied and the entry condition of any child node of the tree node is satisfied, the child node satisfying the entry condition is entered, and when the termination condition of any tree node is satisfied, the entire rule logic diagram is terminated.
The selection rule is a result of determination for entering a child node of the tree node from the corresponding tree node to determine whether the entry condition of the child node is met, for example, for a tree node whose entry condition is engineer, the selection rule of the tree node may be, for example, age >50, age ═ 40, and the selection rules all meet the entry condition of age >30, so that the child node of the tree node whose entry condition is age >30 may be entered.
For example, in the field of loan wind control, the termination condition used by the rule logic diagram may be one of refusal, pass, and change to manual work, wherein the refusal is to refuse the loan, the pass is to approve the loan, the change to manual work is not determined, and the change is further determined by a manual mode.
In an embodiment, the comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information includes:
for each second tree node information of the second rule logic diagram, obtaining a tree node type of the second tree node information, an identifier type corresponding to the tree node type and an identifier corresponding to the identifier type as a target tree node type, a target identifier type and a target identifier respectively;
obtaining first tree node information with a tree node type consistent with the target tree node type;
determining first tree node information of which the identifier type and the corresponding identifier are consistent with the target identifier type and the target identifier respectively in the obtained first tree node information as target first tree node information;
and comparing the second tree node information with the target first tree node information to obtain comparison result information corresponding to the second tree node information.
Only two tree node information with the same tree node type, identifier type and identifier can be compared, and the specific tree node information is not directly compared, so that the compared information amount is reduced, and the comparison efficiency is improved to a certain extent.
If the tree node type is a rule, whether the tree node type is the same rule or not is determined only by the identifier type of the name, whether the specific content of the same rule is the identifier or not is determined, if the tree node type is a quota or a rating card, whether the tree node type is the same quota or the rating card is determined by the identifier type of the ID, and whether the tree node type is the same quota or the actual ID of the rating card is determined to be the identifier.
In one embodiment, the tree node information includes entry conditions and termination conditions of corresponding tree nodes, and when the second tree node information is compared with the first tree node information of the first rule logic diagram, the entry conditions and the termination conditions are compared respectively.
In one embodiment, the tree node information further comprises: and rejecting the reason code, namely comparing the second tree node information with the first tree node information of the first rule logic diagram, and comparing the rejecting reason code.
The reject reason code is a code number representing the reason for entering a reject this termination condition. For example, the reject reason code may be E0001, which may represent a reason for rejection.
And 240, returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
The final purpose of returning the second tree node information of which the comparison result information is inconsistent to the user through the front-end page is to enable the user to know in time what change and what content are specifically modified in the second rule logic diagram compared with the first rule logic diagram. Therefore, only the second tree node information may be returned, or the second tree node information and the corresponding comparison result information may be returned at the same time, and for the second tree node information, only the information items in the second tree node information that are not compared with each other may be returned, or all the second tree node information may be returned, or in addition, the information items in the second tree node information that are not compared with each other may be returned at the same time.
In one embodiment, the returning the second tree node information of which the comparison result information is inconsistent to the user through the front-end page includes:
and returning the second tree node information with inconsistent comparison result information and the corresponding comparison result information to the user through a front-end page.
In one embodiment, the structured data object tree information further includes hierarchical information of corresponding tree nodes in the rule logic diagram, and after comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information, the method further includes:
storing comparison result information corresponding to each second tree node information according to the hierarchy information of each second tree node in the second rule logic diagram;
the step of returning the second tree node information with inconsistent comparison result information to the user through a front-end page includes:
sorting the second tree node information with inconsistent comparison result information according to the hierarchical information of each second tree node in the second rule logic diagram;
and according to the sorting sequence, returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
In this embodiment, the second tree node information whose comparison result information is inconsistent is sorted according to the hierarchy information, and then the second tree node information is returned to the user through the front-end page according to the sorting order, so that the change situation of the second rule logic diagram relative to the first rule logic diagram is displayed more hierarchically and clearly, and the information acquisition efficiency of the user is improved.
In one embodiment, before the second tree node information of which the comparison result information is inconsistent is returned to the user through the front-end page, the method further includes:
comparing the first tree node information with second tree node information of the second rule logic diagram aiming at each first tree node information of the first rule logic diagram to obtain first tree node information corresponding to the deleted tree node in the first rule logic diagram;
storing first tree node information corresponding to the deleted tree nodes in the first rule logic diagram according to the hierarchy information of the deleted tree nodes in the first rule logic diagram;
the step of returning the second tree node information with inconsistent comparison result information to the user through a front-end page includes:
and returning the second tree node information with inconsistent comparison result information and the first tree node information corresponding to the deleted tree node in the first rule logic diagram to a user through a front page, wherein the first tree node information corresponding to the deleted tree node in the first rule logic diagram is sorted on the front page according to a storage sequence.
In this embodiment, on one hand, the first tree node information corresponding to the deleted tree node in the first rule logic diagram is obtained by comparing the first tree node information with the second tree node information of the second rule logic diagram, so that the user can quickly know which tree nodes are deleted in the second rule logic diagram compared with the first rule logic diagram; on the other hand, the first tree node information corresponding to the deleted tree nodes in the first rule logic diagram is stored according to the hierarchical information of the deleted tree nodes in the first rule logic diagram, and then the first tree node information corresponding to the deleted tree nodes is displayed to the user according to the storage sequence, so that the information hierarchy returned to the user is clearer, and the user experience is improved.
In summary, according to the comparison method for the rule logic diagrams provided in the embodiment of fig. 2, automatic comparison of different rule logic diagrams is achieved, so that a user can quickly obtain differences between different rule logic diagrams, time consumed by troubleshooting is reduced, and efficiency is improved.
The disclosure also provides a rule logic diagram comparison device, and the following is an embodiment of the device disclosed herein.
Fig. 5 is a block diagram illustrating a rule logic diagram comparison apparatus, according to an exemplary embodiment, and as shown in fig. 5, the apparatus 500 includes:
an obtaining module 510, configured to obtain two rule logic diagrams to be compared, where the two rule logic diagrams are a first rule logic diagram and a second rule logic diagram, respectively, and the second rule logic diagram is obtained by modifying the first rule logic diagram, and the rule logic diagrams are represented in a structured data object tree form;
a parsing module 520 configured to parse the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, where the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information includes tree node information of the corresponding tree nodes;
a comparing module 530 configured to compare, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information;
and a returning module 540 configured to return the second tree node information of which the comparison result information is inconsistent to the user through the front-end page.
According to a third aspect of the present disclosure, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that couples the various system components including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention as described in the section "example methods" above in this specification.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)621 and/or a cache memory unit 622, and may further include a read only memory unit (ROM) 623.
The storage unit 620 may also include a program/utility 624 having a set (at least one) of program modules 625, such program modules 625 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. As shown, the network adapter 660 communicates with the other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-mentioned method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 7, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for comparing rule logic diagrams, the method comprising:
respectively acquiring two rule logic diagrams to be compared, wherein the two rule logic diagrams are respectively a first rule logic diagram and a second rule logic diagram, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagrams are represented in a structured data object tree form;
analyzing the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, wherein the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information comprises the tree node information of the corresponding tree nodes;
aiming at each second tree node information of the second rule logic diagram, comparing the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information;
and returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
2. The method of claim 1, wherein parsing the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information for each rule logic diagram comprises:
and traversing the tree nodes of the first rule logic diagram and the second rule logic diagram respectively by using a depth-first search algorithm to obtain the structured data object tree information of each rule logic diagram.
3. The method of claim 1, wherein the structured data object tree information includes hierarchical information of corresponding tree nodes in the rule logic diagram, and the parsing the first rule logic diagram and the second rule logic diagram respectively to obtain the structured data object tree information of each rule logic diagram comprises:
respectively traversing the tree nodes of the first rule logic diagram and the second rule logic diagram by using a depth-first search algorithm to obtain the structured data object tree information of each rule logic diagram;
respectively storing the structured data object tree information of the first rule logic diagram and the second rule logic diagram according to the hierarchical information of the corresponding tree nodes in the first rule logic diagram and the second rule logic diagram, and storing the hierarchical information in a block chain;
the comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information includes:
and obtaining second tree node information of the second rule logic diagram from the stored structured data object tree information of the second rule logic diagram by using a breadth-first search algorithm, and comparing the second tree node information with the first tree node information of the first rule logic diagram aiming at each second tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information.
4. The method according to claim 3, wherein the tree node information in the structured data object tree information includes entry conditions, termination conditions, and selection rules of corresponding tree nodes, and the storing the structured data object tree information of the first rule logic diagram and the second rule logic diagram according to the hierarchical information of the corresponding tree nodes in the first rule logic diagram and the second rule logic diagram, and storing the tree information in the blockchain includes:
utilizing a first group of pre-established storage information containers to store the hierarchical information of the structured data object tree information of the first rule logic diagram in the first rule logic diagram according to the corresponding tree nodes, and storing the hierarchical information in a block chain, wherein the first group of storage information containers comprises a first storage information container, a second storage information container and a third storage information container, the first storage information container is used for storing entry conditions, termination conditions and selection rules corresponding to the tree nodes of the first rule logic diagram, the second storage information container is used for storing the hierarchy of the tree nodes of the first rule logic diagram, the third storage information container is used for storing all the rules and conditions of the tree nodes of the first rule logic diagram, the entry conditions are conditions required for entering the corresponding tree nodes, and the termination conditions are conditions when the rule logic diagram terminates, the selection rule is a judgment result used for entering a child node of the tree node from the corresponding tree node to judge whether the entry condition of the child node is met, and all the rules and conditions of all the tree nodes of the rule logic diagram are an integral body consisting of the rules and conditions of all the tree nodes of the rule logic diagram;
and storing the structured data object tree information of the second rule logic diagram according to the hierarchy information of the corresponding tree nodes in the second rule logic diagram by using a second group of pre-established storage information containers, and storing the hierarchy information in a block chain, wherein the second group of storage information containers comprises a fourth storage information container, a fifth storage information container and a sixth storage information container, the fourth storage information container is used for storing entry conditions, termination conditions and selection rules corresponding to the tree nodes of the second rule logic diagram, the fifth storage information container is used for storing the hierarchy of the tree nodes of the second rule logic diagram, and the sixth storage information container is used for storing all the rules and conditions of the tree nodes of the second rule logic diagram.
5. The method of claim 1, wherein the tree node information includes a tree node type, an identifier type corresponding to the tree node type, and an identifier corresponding to the identifier type, and the comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the first rule logic diagram to obtain comparison result information corresponding to the second tree node information comprises:
for each second tree node information of the second rule logic diagram, obtaining a tree node type of the second tree node information, an identifier type corresponding to the tree node type and an identifier corresponding to the identifier type as a target tree node type, a target identifier type and a target identifier respectively;
obtaining first tree node information with a tree node type consistent with the target tree node type;
determining first tree node information of which the identifier type and the corresponding identifier are consistent with the target identifier type and the target identifier respectively in the obtained first tree node information as target first tree node information;
and comparing the second tree node information with the target first tree node information to obtain comparison result information corresponding to the second tree node information.
6. The method of claim 1, wherein the structured data object tree information further includes hierarchical information of corresponding tree nodes in the rule logic diagram, and after comparing, for each second tree node information of the second rule logic diagram, the second tree node information with the first tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information, the method further includes:
storing comparison result information corresponding to each second tree node information according to the hierarchy information of each second tree node in the second rule logic diagram;
the step of returning the second tree node information with inconsistent comparison result information to the user through a front-end page includes:
sorting the second tree node information with inconsistent comparison result information according to the hierarchical information of each second tree node in the second rule logic diagram;
and according to the sorting sequence, returning the second tree node information with inconsistent comparison result information to the user through a front-end page.
7. The method according to claim 1, wherein before returning the second tree node information whose comparison result information is inconsistent to the user through a front-end page, the method further comprises:
comparing the first tree node information with second tree node information of the second rule logic diagram aiming at each first tree node information of the first rule logic diagram to obtain first tree node information corresponding to the deleted tree node in the first rule logic diagram;
storing first tree node information corresponding to the deleted tree nodes in the first rule logic diagram according to the hierarchy information of the deleted tree nodes in the first rule logic diagram;
the step of returning the second tree node information with inconsistent comparison result information to the user through a front-end page includes:
and returning the second tree node information with inconsistent comparison result information and the first tree node information corresponding to the deleted tree node in the first rule logic diagram to a user through a front page, wherein the first tree node information corresponding to the deleted tree node in the first rule logic diagram is sorted on the front page according to a storage sequence.
8. A rule logic diagram comparison apparatus, comprising:
the system comprises an acquisition module, a comparison module and a comparison module, wherein the acquisition module is configured to acquire two rule logic diagrams to be compared respectively, the two rule logic diagrams are a first rule logic diagram and a second rule logic diagram respectively, the second rule logic diagram is obtained by modifying on the basis of the first rule logic diagram, and the rule logic diagram is represented in a structured data object tree form;
an analysis module configured to analyze the first rule logic diagram and the second rule logic diagram respectively to obtain structured data object tree information of each rule logic diagram, wherein the structured data object tree information corresponds to tree nodes of the rule logic diagram, and the structured data object tree information includes tree node information of the corresponding tree nodes;
the comparison module is configured to compare the second tree node information with the first tree node information of the first rule logic diagram aiming at each piece of second tree node information of the second rule logic diagram to obtain comparison result information corresponding to the second tree node information;
and the return module is configured to return the second tree node information of which the comparison result information is inconsistent to the user through a front-end page.
9. A computer-readable program medium, characterized in that it stores computer program instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the method of any of claims 1 to 7.
CN202010349673.3A 2020-04-28 2020-04-28 Rule logic diagram comparison method, device, medium and electronic equipment Pending CN111563178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010349673.3A CN111563178A (en) 2020-04-28 2020-04-28 Rule logic diagram comparison method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010349673.3A CN111563178A (en) 2020-04-28 2020-04-28 Rule logic diagram comparison method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111563178A true CN111563178A (en) 2020-08-21

Family

ID=72067890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010349673.3A Pending CN111563178A (en) 2020-04-28 2020-04-28 Rule logic diagram comparison method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111563178A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023138466A1 (en) * 2022-01-20 2023-07-27 北京字跳网络技术有限公司 Graph generation method and apparatus, and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060031730A1 (en) * 2004-08-04 2006-02-09 Hsiao Michael S Decision selection and associated learning for computing all solutions in automatic test pattern generation (ATPG) and satisfiability
CN109271160A (en) * 2018-09-29 2019-01-25 北京京东金融科技控股有限公司 Active rule construction method, device and computer system, medium
CN109656453A (en) * 2018-12-20 2019-04-19 树根互联技术有限公司 Rule editing method, apparatus and equipment
US20190156228A1 (en) * 2016-07-22 2019-05-23 Alibaba Group Holding Limited Terminal rule operation device and method
CN110389874A (en) * 2018-04-20 2019-10-29 比亚迪股份有限公司 Journal file method for detecting abnormality and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060031730A1 (en) * 2004-08-04 2006-02-09 Hsiao Michael S Decision selection and associated learning for computing all solutions in automatic test pattern generation (ATPG) and satisfiability
US20190156228A1 (en) * 2016-07-22 2019-05-23 Alibaba Group Holding Limited Terminal rule operation device and method
CN110389874A (en) * 2018-04-20 2019-10-29 比亚迪股份有限公司 Journal file method for detecting abnormality and device
CN109271160A (en) * 2018-09-29 2019-01-25 北京京东金融科技控股有限公司 Active rule construction method, device and computer system, medium
CN109656453A (en) * 2018-12-20 2019-04-19 树根互联技术有限公司 Rule editing method, apparatus and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
万华舰;: "继电保护的图形化建模", 电气开关, no. 01 *
王胜, 王家华, 兰金波: "图形化保护的原理与实现", 电力自动化设备, no. 02 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023138466A1 (en) * 2022-01-20 2023-07-27 北京字跳网络技术有限公司 Graph generation method and apparatus, and device and storage medium

Similar Documents

Publication Publication Date Title
US11409744B2 (en) Query generation based on merger of subqueries
CN110795509B (en) Method and device for constructing index blood-margin relation graph of data warehouse and electronic equipment
CN103336790B (en) Hadoop-based fast neighborhood rough set attribute reduction method
US9268766B2 (en) Phrase-based data classification system
CN110825882A (en) Knowledge graph-based information system management method
US20230162051A1 (en) Method, device and apparatus for execution of automated machine learning process
CN103336791B (en) Hadoop-based fast rough set attribute reduction method
US20070162482A1 (en) Method and system of using artifacts to identify elements of a component business model
CN110543571A (en) knowledge graph construction method and device for water conservancy informatization
US10635662B2 (en) Signature detection
US20200151276A1 (en) Cognitive automation tool
CN110807016A (en) Data warehouse construction method and device applied to financial business and electronic equipment
CN113326247A (en) Cloud data migration method and device and electronic equipment
US10963686B2 (en) Semantic normalization in document digitization
Boopathy et al. Predictive analytics with data visualization
CN112084448A (en) Similar information processing method and device
CN111861004B (en) Automatic commission prediction method, system, device and storage medium for daily income output
Subramanian et al. Systems dynamics-based modeling of data warehouse quality
CN111563178A (en) Rule logic diagram comparison method, device, medium and electronic equipment
CN110765100B (en) Label generation method and device, computer readable storage medium and server
CN110110153A (en) A kind of method and apparatus of node searching
CN114036921A (en) Policy information matching method and device
CN111782820A (en) Knowledge graph creating method and device, readable storage medium and electronic equipment
EP4270239A1 (en) Supervised machine learning method for matching unsupervised data
CN115841365A (en) Model selection and quotation method, system, equipment and medium based on natural language processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240621