Interface rule merging method and device, equipment and storage medium
Through multiple rounds of iterative updates and rule matching processing of the merged interface, the problem of interface rule conflicts in the merged interface is solved, and efficient management and security of the merged interface are achieved.
Patent Information
- Application Number
- CN202510748161.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-10-03
AI Technical Summary
When merging interfaces of multiple applications, there are conflicts between their respective interface rules, which reduces the efficiency of merging interfaces.
By performing multiple rounds of iterative updates on the original rule set of the merged interface until the rule set no longer changes, the reference rules are matched and deleted with the candidate rules to generate the target rule set and reduce duplicate rules, including node information and domain name matching processing.
It effectively solves the problem of interface rule conflicts, reduces the number of rules for merging interfaces, and improves the work efficiency and security of merging interfaces.
Smart Images

Figure CN120743327A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an interface rule merging method, apparatus, device, and storage medium. Background Art
[0002] With the rapid development of information technology, the scale of web applications and mobile applications is growing. In order to facilitate the management of multiple applications, multiple applications are often merged to obtain new applications. However, merging multiple applications inevitably requires merging the interfaces of each application.
[0003] However, each interface of an application corresponds to at least one interface rule. When multiple interfaces are merged to obtain a merged interface, conflicts may occur between the interface rules of the multiple interfaces, resulting in reduced efficiency of the merged interface. Summary of the Invention
[0004] The embodiments of the present invention provide an interface rule merging method, apparatus, device and storage medium, which are used to improve the working efficiency of each interface of the merged application.
[0005] In one aspect, an embodiment of the present application provides an interface rule merging method, the method comprising:
[0006] Acquire an original rule set of the merged interface, where the original rule set includes multiple interface rules, and each interface rule includes node information;
[0007] The original rule set is iteratively updated for multiple rounds until the original rule set stops changing, thereby obtaining a target rule set. Each round of iterative update process includes the following steps:
[0008] Select an interface rule from the original rule set updated in the previous round as a reference rule;
[0009] Select candidate rules from other interface rules in the original rule set updated in the previous round;
[0010] When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0011] Optionally, the interface rule further includes: a domain name;
[0012] When the node information in the reference rule matches the node information of at least one candidate rule, deleting the reference rule from the original rule set updated in the previous round to obtain the original rule set updated in this round includes:
[0013] When the node information in the reference rule matches the node information of at least one candidate rule, and the domain name in the reference rule matches the domain name of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0014] Optionally, it also includes:
[0015] When the node information in the reference rule matches the node information in at least one of the candidate rules, and the domain name in the reference rule does not match the domain name in the at least one candidate rule, splicing the reference rule into the at least one candidate rule;
[0016] The reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0017] Optionally, it also includes:
[0018] When the node information in the reference rule is identical to the node information in the candidate rule, determining that the node information in the reference rule matches the node information in the candidate rule;
[0019] The node information included in the interface rule is represented by a regular expression or a character string.
[0020] Optionally, the interface rule further includes: a rule name; and the interface rule merging method further includes:
[0021] When the node information in the reference rule does not match the node information of each candidate rule, and the rule name in the reference rule is the same as the rule name of at least one candidate rule, the rule name of the reference rule is modified, or the rule name of at least one candidate rule is modified.
[0022] Optionally, before obtaining the original rule set of the merged interface, the method further includes:
[0023] For each interface rule in the original rule set, execute the following steps:
[0024] Generate a rule name for an interface rule based on the domain name and node information of the interface rule;
[0025] The domain name in the rule name of the one interface rule is adjusted to the domain name of the merged interface.
[0026] Optionally, selecting a candidate rule from other interface rules in the original rule set updated in the previous round includes:
[0027] Obtaining a first number of node fields included in the node information in the reference rule;
[0028] For each of the other interface rules, execute the following steps:
[0029] Get the second number of node fields included in the node information in an interface rule;
[0030] When the second number is equal to the first number, the one interface rule is used as the candidate rule.
[0031] In one aspect, an embodiment of the present application provides an interface rule merging device, the device comprising:
[0032] An acquisition module, configured to acquire an original rule set of the merged interface, wherein the original rule set includes a plurality of interface rules, and each interface rule includes node information;
[0033] An iterative module is configured to perform multiple rounds of iterative updates on the original rule set until the original rule set stops changing, thereby obtaining a target rule set. Each round of iterative update process includes the following steps:
[0034] A processing module, configured to select an interface rule from the original rule set updated in the previous round as a reference rule; and select a candidate rule from other interface rules in the original rule set updated in the previous round;
[0035] When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0036] In one aspect, an embodiment of the present application provides a computer device, comprising:
[0037] a memory for storing program instructions;
[0038] The processor is used to call the program instructions stored in the memory and execute the steps of the above-mentioned interface rule merging method according to the obtained program.
[0039] On the one hand, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device. When the program runs on the computer device, the computer executes the steps of the above-mentioned interface rule merging method.
[0040] On the one hand, an embodiment of the present application provides a computer program product, including a computer program stored on a computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned interface rule merging method.
[0041] In an embodiment of the present application, the original rule set of the merged interface is iteratively updated for multiple rounds until the loop is stopped when the original rule set no longer changes, and a target rule set is obtained. In each round of iterative update process, an interface rule is selected from the original rule set updated in the previous round as a reference rule, and candidate rules are selected from other interface rules in the original rule set updated in the previous round. When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round, and the original rule set updated in this round is obtained. This realizes the comparison of the interface rules of the multiple interfaces constituting the merged interface, deletes duplicate interface rules, reduces the number of interface rules of the merged interface, facilitates management, and solves the problem of interface rule conflicts of multiple interfaces, thereby improving the working efficiency of the merged interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A schematic diagram of the structure of a system architecture provided in an embodiment of the present application;
[0044] Figure 2 A flowchart of an interface rule merging method provided in an embodiment of the present application;
[0045] Figure 3 A flowchart of an interface rule merging method provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of an interface rule merging device provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0049] It should be noted that the brief descriptions of terms in this application are only for the purpose of facilitating the understanding of the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and usual meanings.
[0050] In the specification and claims of this application and the accompanying drawings, the terms "first," "second," "third," etc. are used to distinguish similar or similar objects or entities, and are not necessarily intended to limit a particular order or sequence, unless otherwise noted. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances.
[0051] The terms "comprise," "include," and "have," and any variations thereof, are intended to cover but not exclude inclusion; for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0052] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functionality associated with that element.
[0053] Finally, it should be noted that the above embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
[0054] The following is a brief introduction to the system architecture diagram applicable to the technical solution of the embodiment of the present application. It should be noted that the process introduced below is only used to illustrate the embodiment of the present application and is not a limitation.
[0055] refer to Figure 1, which is a system architecture diagram applicable to an embodiment of the present application. The system architecture includes at least a terminal device 101 and a server 102. The number of terminal devices 101 can be one or more, and the number of servers 102 can also be one or more. This application does not specifically limit the number of terminal devices 101 and servers 102.
[0056] The terminal device 101 is pre-installed with an application having a rule merging function, which may be a client application, a web application, a mini-program application, etc. The terminal device 101 may be a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart home appliance, an intelligent voice interaction device, an intelligent vehicle-mounted device, etc., but is not limited thereto.
[0057] Server 102 is the background server of the application. Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited to these.
[0058] It should be noted that the method in the embodiment of the present application can be executed by the terminal device 101 or the server 102 alone, or can be executed by the terminal device 101 and the server 102 together.
[0059] In the embodiment of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected to each other through one or more networks. The network can be a wired network or a wireless network. For example, the wireless network can be a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, other possible networks are also possible, and the embodiment of the present application does not limit this.
[0060] The following is based on Figure 1 The system architecture diagram shown in FIG. 1 shows an embodiment of the present application, which provides a process of an interface rule merging method. The process of the method can be Figure 1 The terminal device 101 shown in FIG. 1 may also be executed by the server 102, or the terminal device 101 and the server 102 may interact to execute the execution. Figure 2 As shown, the following steps are included:
[0061] Step 201: Acquire an original rule set of a merged interface, where the original rule set includes multiple interface rules, and each interface rule includes node information.
[0062] Specifically, an interface is an abstract interaction specification between different components or systems; interface rules are specific constraints that must be followed during interface design or application to ensure the correctness and security of the interface.
[0063] A merged interface is an interface formed by merging the interfaces of multiple applications. It can also be an interface formed by merging multiple interfaces within the same application. The original rule set is the set of interface rules for the multiple interfaces combined into the merged interface.
[0064] Node information is dynamic parameter information separated by at least one separator in an interface rule. For example, if an interface rule is "www.aaa.com:80 / login / [az]+$", then " / login / [az]+$" is the node information of the interface rule.
[0065] Step 202: Perform multiple rounds of iterative updates on the original rule set until the original rule set no longer changes, and then stop the loop to obtain the target rule set. Each round of iterative update process includes the following steps 2021 to 2023:
[0066] Step 2021: Select an interface rule from the original rule set updated in the last round as a reference rule.
[0067] Specifically, the number of interface rules in the original rule set may change in each round of iterative update before the loop stops. At the beginning of each round of iterative update, an interface rule is randomly selected from the original rule set obtained in the previous round of update as a reference rule.
[0068] Step 2022: Select candidate rules from other interface rules in the original rule set updated in the last round.
[0069] Specifically, the candidate rule is at least one interface rule selected from other interface rules in the original rule set except the reference rule. During each round of iterative update, the reference rule is compared with the at least one candidate rule.
[0070] In some embodiments, a first number of node fields contained in the node information in the reference rule is obtained; for each interface rule in other interface rules, the following is performed respectively: a second number of node fields contained in the node information in an interface rule is obtained; when the second number is equal to the first number, an interface rule is used as a candidate rule.
[0071] Specifically, the node information includes at least one node field, and the node field is a field between every two delimiters in the node information.
[0072] For example, if an interface rule is "www.aaa.com:80 / login / [az]+$", then " / login / [az]+$" is the node information of the interface rule, and login and [az]+$ are the node fields of the node information.
[0073] In the original rule set, if the second number of node fields of an interface rule other than the reference rule is equal to the first number of node fields in the selected reference rule, the interface rule can be used as a candidate rule. Otherwise, a new candidate rule is selected from the original rule set. If, in the original rule set, there is no interface rule equal to the first number of node fields of the reference rule, it means that there is no interface rule in the original rule set that conflicts with the reference rule. In this case, the current round of iterative update ends and the next round of iterative update begins, i.e., a new interface rule is selected as the reference rule.
[0074] In an embodiment of the present application, when selecting reference rules and candidate rules in each round of iterative update, the number of node fields contained in the node information of the interface rule is compared with the reference rule to improve the accuracy of interface matching, thereby improving the accuracy of interface rule merging.
[0075] Step 2023: When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0076] Specifically, when the node information in the reference rule is the same as the node information in at least one candidate rule, or the node information in the reference rule can be covered by the node information in at least one candidate rule, the node information in the reference rule is considered to match the node information in at least one candidate rule.
[0077] In an embodiment of the present application, the original rule set of the merged interface is iteratively updated for multiple rounds until the loop is stopped when the original rule set no longer changes, and a target rule set is obtained. In each round of iterative update process, an interface rule is selected from the original rule set updated in the previous round as a reference rule, and candidate rules are selected from other interface rules in the original rule set updated in the previous round. When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round, and the original rule set updated in this round is obtained. This realizes the comparison of the interface rules of the multiple interfaces constituting the merged interface, deletes duplicate interface rules, reduces the number of interface rules of the merged interface, facilitates management, and solves the problem of interface rule conflicts of multiple interfaces, thereby improving the working efficiency of the merged interface.
[0078] In some embodiments, when the node information in the reference rule matches the node information of at least one candidate rule, and the domain name in the reference rule matches the domain name of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0079] Specifically, the domain name is the part of the interface rule excluding the node information. For example, if an interface rule is "www.aaa.com:80 / login / [az]+$", then "www.aaa.com:80" is the domain name of the interface rule.
[0080] When the domain name in the reference rule is the same as the domain name in at least one candidate rule, it is considered that the domain name in the reference rule matches the domain name in at least one candidate rule.
[0081] In some embodiments, when the node information in the reference rule is the same as the node information in the candidate rule, it is determined that the node information in the reference rule matches the node information in the candidate rule; the node information included in the interface rule is represented by a regular expression or a string.
[0082] Specifically, the node information can be a string divided by at least one delimiter, a regular expression divided by at least one delimiter, or a string and a regular expression divided by at least one delimiter. The node field in the node information is a string or a regular expression.
[0083] When comparing the node information of the reference rule and the node information of at least one candidate rule, a node field in the node information of the reference rule is compared with a node field at a corresponding position in the node information of at least one candidate rule.
[0084] For example, the reference rule is "www.aaa.com:80 / login / [az]+$" and a candidate rule is "www.bbb.com:80 / login / [az]+$". Then each node field in the node information " / login / [az]+$" of the reference rule is the same as the node field at the corresponding position in the node information " / login / [az]+$" of the candidate rule.
[0085] For another example, the reference rule is "www.aaa.com:80 / login / [az]+$", and a candidate rule is "www.bbb.com:80 / [az]+$ / [az]+$". Since the first node field "login" in the node information " / login / [az]+$" of the reference rule is a string composed of lowercase letters, it can be overwritten by the node field "[az]+$" at the corresponding position in the node information " / [az]+$ / [az]+$" of a candidate rule. Therefore, the node information of the reference rule is the same as the node information of the candidate rule.
[0086] In an embodiment of the present application, by comparing each node field in the node information of the reference rule to see whether it is identical or overlapped with the node field in the corresponding position in the node information of the candidate rule, it is determined whether the node information of the reference rule matches the node information of the selected rule, thereby improving the accuracy of the interface rule merging and improving the security of the subsequent interface merging work.
[0087] In some embodiments, when the node information in the reference rule matches the node information of at least one candidate rule, and the domain name in the reference rule does not match the domain name of at least one candidate rule, the reference rule is spliced into at least one candidate rule respectively; the reference rule is deleted from the original rule set of the previous update to obtain the original rule set of this update.
[0088] Specifically, the domain name of the interface rule is the network address identifier of the interface, is an important component of the interface rule, and is used to locate server resources.
[0089] For example, the reference rule is "www.aaa.com:80 / login / [az]+$" and its domain name is "www.aaa.com:80." A candidate rule is "www.bbb.com:80 / [az]+$ / [az]+$" and its domain name is "www.bbb.com:80." The reference rule's node information " / login / [az]+$" and the candidate rule's node information " / [az]+$ / [az]+$" are identical, but their domain names are different. In this case, the reference rule is concatenated into the candidate rule, resulting in the concatenated candidate rules "www.aaa.com:80 / login / [az]+$, www.bbb.com:80 / [az]+$ / [az]+$." The reference rule "www.aaa.com:80 / login / [az]+$" is then deleted from the original rule set.
[0090] In some embodiments, for each interface rule in the original rule set, the following steps are performed: generating a rule name of the interface rule based on the domain name and node information of the interface rule; and adjusting the domain name in the rule name of the interface rule to the domain name of the merged interface.
[0091] Specifically, before obtaining the original rule set for the merged interface, each interface rule in the original rule set includes a domain name and node information. A rule name for each interface rule is generated based on the domain name and node information of each interface rule, with the rule name also including the domain name. The rule name of each interface rule is then adjusted to the domain name of the merged interface. That is, a complete interface rule includes a rule name, a domain name, and node information, where the rule name includes the domain name and at least one node parameter separated by a delimiter.
[0092] For example, for the interface rules of multiple interfaces in the same application, the two interfaces are "www.bbb.com:80 / login / username1" and "www.bbb.com:80 / login / username2". The two interfaces are merged into the merged interface "www.bbb.com:80 / login / {param1}". Among the original multiple interface rules, there is an interface rule "www.bbb.com:80 / login / [az]+$". Based on the domain name "www.bbb.com:80" and the node information " / login / [az]+$" of the interface rule, the rule name "www.bbb.com:80 / login / {param1}" is generated for the interface rule, where {param1} is a node parameter.
[0093] Regarding the merger of two applications and the corresponding interface rules, the two applications are "www.aaa.com:80" and "www.bbb.com:80". The two applications are merged into the merged application "www.aaa.com:80". The domain name in the rule name of an interface rule contained in the original application "www.bbb.com:80" is adjusted to the domain name of the merged application. For example, the "www.bbb.com:80" in the rule name "www.bbb.com:80 / login / {param1}" is adjusted to "www.aaa.com:80". Then, a complete interface rule of the merged application is obtained: "www.aaa.com:80 / login / {param1}, www.bbb.com:80 / login / [az]+$".
[0094] In an embodiment of the present application, by generating a rule name for each interface rule in the original rule set, the distinctiveness of each interface rule is improved, and conflict resolution of interface rules is achieved based on the merging of independent applications and interfaces. This not only simplifies the management of interface rules, but also supports the simultaneous merging of different applications and interfaces.
[0095] In some embodiments, when the node information in the reference rule does not match the node information of each candidate rule, and the rule name in the reference rule is the same as the rule name of at least one candidate rule, the rule name of the reference rule is modified, or the rule name of at least one candidate rule is modified.
[0096] Specifically, since the domain name contained in the rule name of each interface rule in the original rule set is the same, when at least one node parameter contained in the rule name of the reference rule is the same as the node parameter at the corresponding position contained in the rule name of each candidate rule, the rule name in the reference rule is the same as the rule name of at least one candidate rule, and one of the at least one node parameters in the rule name of the reference rule is modified accordingly, or the node parameter at the corresponding position in the rule name of each candidate rule is modified.
[0097] For example, the reference rule includes the rule name, domain name and node information, which is "www.aaa.com:80 / login / {param1}, www.aaa.com:80 / login / [az]+$", and a candidate rule is "www.aaa.com:80 / login / {param1}, www.bbb.com:80 / login / [0-9]+$". The node information of the reference rule " / login / [az]+$" is the same as the node information of the candidate rule " / login / [az]+$". in / [0-9]+$" does not match, but the two node parameters " / login / {param1}" in the rule name of the reference rule are the same as the node parameters " / login / {param1}" at the corresponding positions in the rule name of a candidate rule. In this case, modify the multiple node parameters in the rule name of the reference rule to " / login / {param2}" or modify the multiple node parameters in the rule name of the reference rule to " / login / {param2}". You can modify either the reference rule or the candidate rule.
[0098] In an embodiment of the present application, when the node information of the reference rule and the candidate rule are different but the rule names are the same, the name of the reference rule is modified or the name of the candidate rule is modified to ensure the independence of the reference rule and the candidate rule, reduce the conflict of the interface rules of the merged interface, and thus improve the work efficiency and security of the merged interface.
[0099] In order to better explain the embodiment of the present application, the following describes a method for merging interface rules provided by the embodiment of the present application in combination with actual scenarios. The process of the method is as follows: Figure 1 The server execution shown includes the following steps: Figure 3 As shown:
[0100] Step 301: Acquire an original rule set for merging interface rules, and generate rule names for multiple interface rules in the original rule set.
[0101] Step 302, each round of iterative update process of the original rule set includes steps 3021 to 30210:
[0102] Step 3021: Select an interface rule from the original rule set as a reference rule.
[0103] Step 3022: Select at least one interface rule from other interface rules in the original rule set as a candidate rule.
[0104] Step 3023 , determining whether the second number of node fields of at least one candidate rule is equal to the first number of node fields of the reference rule; if so, executing step 3024 ; otherwise, returning to step 3022 .
[0105] Step 3024 , determine whether the node information of the candidate rule is the same as the node information of the reference rule. If so, execute step 3025 ; otherwise, execute step 3026 .
[0106] Specifically, the reference rules are judged separately
[0107] Step 3025, determine whether the domain name of the candidate rule is the same as the domain name of the reference rule. If so, execute step 3027; otherwise, execute step 3028 first and then execute step 3027.
[0108] Step 3026, determine whether the rule name of the candidate rule is the same as the rule name of the reference rule. If so, execute 3029; otherwise, execute step 30210.
[0109] Step 3027, delete the reference rule.
[0110] Step 3028: splice the reference rule into at least one candidate rule.
[0111] Step 3029: Modify the rule name of the reference rule, or modify the rule name of at least one candidate rule.
[0112] Step 30210, determine whether there are changes in the interface rules in the original rule set. If so, return to execute 3021 (i.e., start the next round of iterative update process); otherwise, execute step 303 (i.e., end the iterative update).
[0113] Step 303: Use the obtained original rule set as the target rule set.
[0114] In an embodiment of the present application, conflicts in the interface rules of multiple merged interfaces caused by the merging of multiple applications can be handled by generating a rule name for the interface rules of each merged interface and dividing the node parameters, dividing the node information of the interface rule into at least one node field, and analyzing and comparing the node fields, confirming the same interface rules and deleting one of the same interface rules. This solves the problem in the prior art that only applications can be merged or only interfaces can be merged, but conflicts in multiple interface rules cannot be resolved at the same time based on the merged interfaces. It realizes the dual merging of interfaces and interface rules, further reduces the number of interface rules that need to be managed for the merged interface, and improves the work efficiency of subsequent merged interfaces.
[0115] Based on the same technical concept, the embodiment of the present application provides a structural diagram of an interface rule merging device, such as Figure 4 As shown, the interface rule merging device 400 includes:
[0116] An acquisition module 401 is configured to acquire an original rule set for merging interfaces, wherein the original rule set includes multiple interface rules, and each interface rule includes node information.
[0117] The iterative module 402 is configured to perform multiple rounds of iterative updates on the original rule set until the original rule set stops changing, thereby obtaining a target rule set. Each round of iterative update process includes the following steps:
[0118] Processing module 403 is used to select an interface rule from the original rule set updated in the previous round as a reference rule; and select a candidate rule from other interface rules in the original rule set updated in the previous round;
[0119] When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0120] Optionally, the processing module 403 is specifically configured to:
[0121] When the node information in the reference rule matches the node information of at least one candidate rule, and the domain name in the reference rule matches the domain name of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0122] Optionally, the processing module 403 is further configured to:
[0123] When the node information in the reference rule matches the node information in at least one of the candidate rules, and the domain name in the reference rule does not match the domain name in the at least one of the candidate rules, splicing the reference rule into the at least one of the candidate rules;
[0124] The reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
[0125] Optionally, the processing module 403 is further configured to:
[0126] When the node information in the reference rule is identical to the node information in the candidate rule, determining that the node information in the reference rule matches the node information in the candidate rule;
[0127] The node information included in the interface rule is represented by a regular expression or a character string.
[0128] Optionally, the processing module 403 is further configured to:
[0129] When the node information in the reference rule does not match the node information of each candidate rule, and the rule name in the reference rule is the same as the rule name of at least one candidate rule, the rule name of the reference rule is modified, or the rule name of at least one candidate rule is modified.
[0130] The acquisition module 401 is further used to:
[0131] For each interface rule in the original rule set, execute the following steps:
[0132] Generate a rule name for an interface rule based on the domain name and node information of the interface rule;
[0133] The domain name in the rule name of the one interface rule is adjusted to the domain name of the merged interface.
[0134] The processing module 403 is specifically configured to:
[0135] Obtaining a first number of node fields included in the node information in the reference rule;
[0136] For each of the other interface rules, execute the following steps:
[0137] Get the second number of node fields included in the node information in an interface rule;
[0138] When the second number is equal to the first number, the one interface rule is used as the candidate rule.
[0139] In an embodiment of the present application, the original rule set of the merged interface is iteratively updated for multiple rounds until the loop is stopped when the original rule set no longer changes, and a target rule set is obtained. In each round of iterative update process, an interface rule is selected from the original rule set updated in the previous round as a reference rule, and candidate rules are selected from other interface rules in the original rule set updated in the previous round. When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round, and the original rule set updated in this round is obtained. This realizes the comparison of the interface rules of the multiple interfaces constituting the merged interface, deletes duplicate interface rules, reduces the number of interface rules of the merged interface, facilitates management, and solves the problem of interface rule conflicts of multiple interfaces, thereby improving the working efficiency of the merged interface.
[0140] Based on the same technical concept, the embodiment of the present application provides a computer device, which can be Figure 1 The server shown, such as Figure 5 As shown, it includes at least one processor 501 and a memory 502 connected to the at least one processor. The specific link medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 For example, the processor 501 and the memory 502 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.
[0141] In an embodiment of the present application, the memory 502 stores instructions executed by at least one processor 501, and the at least one processor 501 can perform the steps of the above-mentioned interface rule merging method by executing the instructions stored in the memory 502.
[0142] The processor 501 is the control center of the computer device and can connect the various parts of the computer device using various interfaces and lines. It can implement interface rule merging by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing modules. The processor 501 may integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, and application programs, while the modem processor mainly processes wireless communications. It is understood that the modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0143] The processor 501 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0144] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer device, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0145] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned interface rule merging method.
[0146] Based on the same inventive concept, an embodiment of the present application provides a computer program product, including a computer program stored on a computer-readable storage medium, wherein the computer program includes program instructions. When the program instructions are executed by a computer device, the computer device executes the steps of the above-mentioned interface rule merging method.
[0147] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0148] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0149] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0150] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0151] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for merging interface rules, characterized in that: include: Acquire an original rule set of the merged interface, where the original rule set includes multiple interface rules, and each interface rule includes node information; The original rule set is iteratively updated for multiple rounds until the original rule set stops changing, thereby obtaining a target rule set. Each round of iterative update process includes the following steps: Select an interface rule from the original rule set updated in the previous round as a reference rule; Select candidate rules from other interface rules in the original rule set updated in the previous round; When the node information in the reference rule matches the node information of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
2. The method according to claim 1, wherein The interface rules also include: domain name; When the node information in the reference rule matches the node information of at least one candidate rule, deleting the reference rule from the original rule set updated in the previous round to obtain the original rule set updated in this round includes: When the node information in the reference rule matches the node information of at least one candidate rule, and the domain name in the reference rule matches the domain name of at least one candidate rule, the reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
3. The method according to claim 2, wherein Also includes: When the node information in the reference rule matches the node information in at least one of the candidate rules, and the domain name in the reference rule does not match the domain name in the at least one of the candidate rules, splicing the reference rule into the at least one of the candidate rules; The reference rule is deleted from the original rule set updated in the previous round to obtain the original rule set updated in this round.
4. The method according to claim 1, wherein Also includes: When the node information in the reference rule is identical to the node information in the candidate rule, determining that the node information in the reference rule matches the node information in the candidate rule; The node information included in the interface rule is represented by a regular expression or a character string.
5. The method according to claim 1, wherein The interface rule further includes: a rule name; and the interface rule merging method further includes: When the node information in the reference rule does not match the node information of each candidate rule, and the rule name in the reference rule is the same as the rule name of at least one candidate rule, the rule name of the reference rule is modified, or the rule name of at least one candidate rule is modified.
6. The method according to any one of claims 1 to 5, characterized in that: Before obtaining the original rule set of the merged interface, the method further includes: For each interface rule in the original rule set, execute the following steps: Generate a rule name for an interface rule based on the domain name and node information of the interface rule; The domain name in the rule name of the one interface rule is adjusted to the domain name of the merged interface.
7. The method according to any one of claims 1 to 5, characterized in that The selecting of candidate rules from other interface rules in the original rule set updated in the previous round includes: Obtaining a first number of node fields included in the node information in the reference rule; For each of the other interface rules, execute the following steps: Get the second number of node fields included in the node information in an interface rule; When the second number is equal to the first number, the one interface rule is used as the candidate rule.
8. An interface rule merging device, characterized in that: include: An acquisition module, configured to acquire an original rule set of the merged interface, wherein the original rule set includes a plurality of interface rules, and each interface rule includes node information; An iterative module is configured to perform multiple rounds of iterative updates on the original rule set until the original rule set stops changing, thereby obtaining a target rule set. Each round of iterative update process includes the following steps: Select an interface rule from the original rule set updated in the previous round as a reference rule; Select candidate rules from other interface rules in the original rule set updated in the previous round; The processing module is configured to delete the reference rule from the original rule set updated in the previous round when the node information in the reference rule matches the node information of at least one candidate rule, so as to obtain the original rule set updated in this round.
9. A computer device, characterized in that: include: a memory for storing program instructions; A processor is configured to call the program instructions stored in the memory and execute the steps of the method according to any one of claims 1 to 7 according to the obtained program.
10. A computer-readable storage medium, characterized in that It stores a computer program that can be executed by a computer device. When the program is run on the computer device, the computer device executes the steps of the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises a computer program stored on a computer-readable storage medium, wherein the computer program comprises program instructions. When the program instructions are executed by a computer device, the computer device is caused to perform the steps of the method according to any one of claims 1 to 7.