URL pseudo-static mode identification method, system and device and medium

By identifying the original URL path in the URL tree and constructing a new URL tree, the problem of high cost and low efficiency in URL pseudo-static pattern recognition in the existing technology is solved, rapid automatic identification and aggregation is achieved, and the identification cost is reduced.

CN118748596APending Publication Date: 2024-10-08CTRIP TRAVEL NETWORK TECH SHANGHAI0
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410735647.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

In the existing technology, manual identification of URL pseudo-static patterns is costly and inefficient, and cannot meet the needs of rapid identification and security detection.

Method used

By obtaining the URL tree corresponding to the original URL domain name, identify whether the original URL path exists in the URL tree. If it exists, identify the pseudo-static mode. If it does not exist, build a new URL tree and add the new URL path to determine whether the requirements for generating pseudo-static mode are met. conditions to achieve rapid automated identification and aggregation.

Benefits of technology

It realizes the rapid automatic identification and aggregation of URL pseudo-static patterns, reduces the workload of manual identification, improves work efficiency and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748596A_ABST
    Figure CN118748596A_ABST
Patent Text Reader

Abstract

The invention provides a URL pseudo-static mode identification method, system and device and a medium. The identification method comprises the steps that a URL tree corresponding to an original URL domain name is acquired; if it is recognized that the original URL path exists in the URL tree, the URL pseudo-static mode is recognized based on the original URL path. According to the method and the device, the URL pseudo-static mode is identified by combining the original URL domain name with the original URL path, so that rapid and automatic identification and aggregation of the URL pseudo-static mode are realized, the workload of manually identifying the URL pseudo-static mode is reduced, and the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of information technology, and in particular to a method, system, device and medium for identifying a URL pseudo-static pattern. Background Art

[0002] With the rapid development of the Internet, various web pages and links are increasing every day. It is necessary to quickly identify the characteristics of URL (Uniform Resource Locator System) links in order to quickly identify new access portals from a technical perspective, conduct necessary security checks in a timely manner, and avoid a large number of repeated checks and identifications of known access portals. For example: the difference between the URL links corresponding to products of different brands in the same category of goods is only the product number. The product number may appear in the URL or in the parameters. This type of URL can be called a pseudo-static URL and can be regarded as the request path of the same business; therefore, this type of URL link can be aggregated into a type of URL pattern, such as: / goods / page / * (the product number appears in the URL) or / goods / page (the product number is used as a parameter);

[0003] Currently, most common URL trees are Trie trees constructed from specific URL paths. Their application scenarios cannot meet actual needs and usually require manual identification of URL pseudo-static patterns, which is costly and has low identification efficiency. Summary of the invention

[0004] The technical problem to be solved by the present disclosure is to overcome the defects of high identification cost and low efficiency in the prior art of manually identifying URL pseudo-static patterns, and to provide a method, system, device and medium for identifying URL pseudo-static patterns.

[0005] The present invention solves the above technical problems through the following technical solutions:

[0006] The first aspect of the present disclosure provides a method for identifying a pseudo-static pattern of a URL, the method comprising:

[0007] Get the URL tree corresponding to the original URL domain name;

[0008] If it is identified that there is an original URL path in the URL tree, a URL pseudo-static pattern is identified based on the original URL path.

[0009] Preferably, before the step of obtaining the URL tree corresponding to the original URL domain name, the identification method further includes:

[0010] Identify whether the original URL domain name exists. If so, obtain the URL tree corresponding to the original URL domain name; if not, construct a new URL domain name and the URL tree corresponding to the new URL domain name.

[0011] Preferably, the step of identifying the URL pseudo-static pattern based on the original URL path includes:

[0012] It is retrieved whether there is a matching URL pseudo-static pattern in the branch node of the URL tree corresponding to the original URL path. If so, the matching URL pseudo-static pattern is returned; if not, the original URL path is returned.

[0013] Preferably, the identification method further comprises:

[0014] If it is identified that the original URL path does not exist in the URL tree, the new URL path is added to the URL tree;

[0015] Store the new URL path in the database;

[0016] Determine whether the branch node of the URL tree corresponding to the new URL path meets the condition for generating a URL pseudo-static mode, and if so, generate a new URL pseudo-static mode;

[0017] Returns the new URL pseudo-static mode.

[0018] Preferably, the identification method further comprises:

[0019] If it is determined that the branch node of the URL tree corresponding to the new URL path does not meet the condition for generating the URL pseudo-static mode, the original URL path is returned.

[0020] Preferably, the identification method further comprises:

[0021] The new URL pseudo-static pattern is stored in the database and the tree node.

[0022] A second aspect of the present disclosure provides a system for identifying a URL pseudo-static pattern, the system comprising:

[0023] The first acquisition module is used to obtain the URL tree corresponding to the original URL domain name;

[0024] The first identification module is used to identify the URL pseudo-static pattern based on the original URL path if it is identified that there is an original URL path in the URL tree.

[0025] Preferably, the identification system further comprises:

[0026] The second identification module is used to identify whether the original URL domain name exists, and if so, call the second acquisition module; if not, call the construction module;

[0027] The second acquisition module is used to acquire the URL tree corresponding to the original URL domain name;

[0028] The construction module is used to construct a new URL domain name and a URL tree corresponding to the new URL domain name.

[0029] Preferably, the first identification module includes:

[0030] A retrieval unit, used to retrieve whether there is a matching URL pseudo-static pattern in the branch node of the URL tree corresponding to the original URL path, and if so, call the first return unit; if not, call the second return unit;

[0031] The first returning unit is used to return the matched URL pseudo-static pattern;

[0032] The second returning unit is used to return the original URL path.

[0033] Preferably, the identification system further comprises:

[0034] The adding module is used to add the new URL path to the URL tree if it is identified that the original URL path does not exist in the URL tree;

[0035] A first storage module, used to store the new URL path in a database;

[0036] A judgment module is used to judge whether the branch node of the URL tree corresponding to the new URL path meets the conditions for generating a URL pseudo-static mode. If so, the generation module is called;

[0037] The generating module is used to generate a new URL pseudo-static mode;

[0038] The return module is used to return the new URL pseudo-static mode.

[0039] Preferably, the identification system further comprises:

[0040] The judging module is further configured to call the second returning unit if it is judged that the branch node of the URL tree corresponding to the new URL path does not meet the condition for generating the URL pseudo-static mode;

[0041] The second returning unit is used to return the original URL path.

[0042] Preferably, the identification system further comprises:

[0043] The second storage module is used to store the new URL pseudo-static mode in a database and a tree node.

[0044] A third aspect of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and used to run on the processor, and when the processor executes the computer program, the method for identifying the URL pseudo-static pattern described in the first aspect is implemented.

[0045] A fourth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for identifying a pseudo-static pattern of a URL as described in the first aspect is implemented.

[0046] A fifth aspect of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the method for identifying a URL pseudo-static pattern as described in the first aspect.

[0047] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.

[0048] The positive and progressive effects of this disclosure are:

[0049] The present invention identifies URL pseudo-static patterns by combining the original URL domain name with the original URL path, thereby realizing rapid and automatic identification and aggregation of URL pseudo-static patterns, reducing the workload of manual identification of URL pseudo-static patterns and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flowchart of the method for identifying a pseudo-static pattern of a URL provided in the public embodiment 1.

[0051] Figure 2 A schematic diagram of the URL path provided for public embodiments 1 and 2.

[0052] Figure 3 A module diagram of a system for identifying pseudo-static patterns of URLs provided in Example 2 of the present disclosure.

[0053] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the method for identifying a URL pseudo-static pattern according to Embodiment 3 of the present disclosure. DETAILED DESCRIPTION

[0054] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.

[0055] Prefixes such as "first" and "second" are used in the embodiments of the present disclosure only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.

[0056] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0057] Example 1

[0058] Figure 1 A flowchart of a method for identifying a pseudo-static pattern of a URL provided in Embodiment 1 of the present disclosure, such as Figure 1 As shown, the identification method includes:

[0059] S1. Obtain the URL tree corresponding to the original URL domain name;

[0060] S2. If it is identified that there is an original URL path in the URL tree, a URL pseudo-static pattern is identified based on the original URL path.

[0061] This embodiment uses memory to construct multiple URL trees, and identifies URL pseudo-static patterns through the original URL domain name combined with the original URL path, thereby achieving rapid and automatic identification and aggregation of URL pseudo-static patterns, reducing the workload of manual identification of URL pseudo-static patterns, improving work efficiency, and thereby achieving the purpose of reducing costs.

[0062] In an optional embodiment, before S1, the identification method further includes:

[0063] S0, identify whether the original URL domain name exists, if it does, execute S01; if it does not exist, execute S02;

[0064] S01. Obtain the URL tree corresponding to the original URL domain name;

[0065] S02. Construct a new URL domain name and a URL tree corresponding to the new URL domain name.

[0066] In this embodiment, URL is a method for identifying a specific resource on the Internet, and mainly includes six parts: protocol, domain name, port, path, query parameter, anchor, etc. The request URL has anonymized the port during the collection process, so the present invention mainly performs URL pseudo-static pattern recognition on the combination of the URL domain name and the URL path. It should be noted that there is a unique binding relationship between the URL domain name and the application, so in actual implementation, the application number (appId) can be used instead of the URL domain name.

[0067] In this embodiment, a common solution for constructing a URL tree is to use a Trie tree, also known as a dictionary tree or a prefix tree. A Trie tree is a tree data structure used to efficiently store and retrieve key-value pairs in a string data set. In a URL tree, each node represents a part of a URL. Starting from the root node, each child node represents the next level path of a URL, such as Figure 2 Common usage scenarios include quick URL search, matching, and deduplication.

[0068] The definition of URL pseudo-static mode is that if there are equal to or more than the specified threshold number under the same domain name (the threshold number can be adjusted dynamically and defined according to the actual business), and there is only one sub-path different in the URL path, then the URL pseudo-static mode can be generated. For example, Figure 2 As shown, the threshold number is 2, the paths are / a / b / c and / a / b / d, and the pattern can be aggregated into: / a / b / *;

[0069] The URL pseudo-static pattern recognition algorithm is designed based on the construction method of the URL tree and actual business needs. The difference from the URL tree is: 1) The construction method of the URL tree is that the Trie tree treats each level of sub-path as an independent node and constructs an independent tree. Even sub-paths with the same name are different node instances. In order to quickly identify patterns, the URL pseudo-static pattern recognition algorithm uses a Map to store all nodes in the tree. The key is the node name (i.e., the path from the root node to the current location), and the value is the instance object of the node. Each node only stores the name of the associated node, but does not own the associated node. A separate URL tree is established for each domain name (application number), and the Trie tree also treats the domain name as a node to establish a globally unique URL tree. In non-leaf nodes, the sub-path name list of the next layer node, the number of child nodes, the pattern list identified in the next layer node, the parent node list of the current node, the number of grandchild nodes owned by the current node, etc. are stored. The parent node list of the current node and the sub-path information of the current node are stored in the leaf node.

[0070] In an optional embodiment, S2 includes:

[0071] S21, searching whether there is a matching URL pseudo-static pattern in the branch node of the URL tree corresponding to the original URL path, if yes, executing S22; if not, executing S23;

[0072] S22, returning the matched URL pseudo-static mode;

[0073] S23. Return the original URL path.

[0074] In an optional embodiment, the identification method further includes:

[0075] S3. If it is identified that the original URL path does not exist in the URL tree, the new URL path is added to the URL tree;

[0076] S4, storing the new URL path in the database;

[0077] S5, determine whether the branch node of the URL tree corresponding to the new URL path meets the condition for generating the URL pseudo-static mode, if so, execute S6; if not (that is, if it is determined that the branch node of the URL tree corresponding to the new URL path does not meet the condition for generating the URL pseudo-static mode), execute S23;

[0078] S6, generating a new URL pseudo-static mode;

[0079] S7. Return the new URL pseudo-static mode.

[0080] In an optional embodiment, the identification method further includes:

[0081] Store the new URL pseudo-static pattern into the database and tree node.

[0082] In this embodiment, the new URL pseudo-static pattern is stored in the database and the corresponding node in the URL tree.

[0083] In the specific implementation process, URL pseudo-static pattern recognition mainly consists of two parts: initialization and query. The following is a detailed introduction to the specific content:

[0084] Initialization: During initialization, the currently stored URLs and URL pseudo-static pattern information are loaded, which is divided into two parts: loading the identified URL pseudo-static pattern and loading the URL information that has not yet been aggregated;

[0085] Query: Query whether a specific URL has a matching URL pseudo-static pattern based on the URL tree. During the query process, if the URL pseudo-static pattern is matched, the matched URL pseudo-static pattern is returned; if not, it is determined whether the original URL already exists. If so, the original URL path is directly returned; if the original URL path does not exist, the original URL path is written into the URL memory tree and the URL path is stored in the database.

[0086] Specifically, the construction and use of the URL tree:

[0087] a) Definition of tree nodes

[0088] Assume that there is a URL path of / a / b / c / d, and the current node is the node storing the path information of b, then 1) cChildrenCountMap stores the number of paths from the current node to each grandchild node;

[0089] 2) cChildrenList stores the relative path from the current node to the grandchild node;

[0090] 3) childrenList stores the list of child node names owned by the current node;

[0091] 4)leafChildrenList is the list of leaf nodes owned by the current node;

[0092] 5) leafNode Whether the current node is a leaf node;

[0093] 6)parentNodeList is the parent node list of the current node;

[0094] 7) path is the name of a segment of the URL path stored in the current node;

[0095] 8) The complete path of the URL from the root node to the current node;

[0096] 9) urlPatternList is the list of patterns that can be recognized when reaching the current node;

[0097] b) Construction of URL tree

[0098] The present invention constructs a URL tree by using a map to store node instances and a node to store associated node names. For example, if the current node is / a / b and you want to query the information of its child node c, you only need to concatenate the path of the current node and the name of the child node c, i.e. / a / b / c, and then search in the map.

[0099] c) URL pseudo-static mode generation

[0100] There are two forms of URL pseudo-static mode: (1) The pseudo-static sub-path is at the end of the URL path, such as: / a / b / *; (2) The pseudo-static sub-path is in the middle or beginning of the URL path, such as: / a / * / c. The intermediate statistics method of the two modes is the same. When a new path is added, the statistical information is updated at each node along the way.

[0101] Assume that the threshold number of pattern aggregation is 2, and the current URL tree already has the information of the paths / a / b / c, / a, and / a / b. The newly added path is / a / b / d. In the process of adding a new path, the statistical data on each node will be updated along the direction of a->b->d. For example, when reaching node a, the cChildrenList list will be updated, and the relative path b / d will be added. The number of paths from node a to node d will be increased in cChildrenCountMap. When reaching node b, the leafChildrenList list will be updated, and the newly added child node d will be added. When reaching node d, node d will be added to the map, and the parentNodeList of node d will add the path / a / b of parent node b. After node d is added, check whether a new URL pseudo-static pattern is generated along the direction of d->b>a. When node b is detected, it is found that node b has 2 child nodes, which meets the threshold number requirement of 2. At this time, a new URL pseudo-static pattern / a / b / * is generated at node b, and the detection ends here.

[0102] d) Identification of pseudo-static URL patterns

[0103] Assume that the paths / a / b / c and / a / b / d already exist in the URL tree, and the URL pseudo-static pattern / a / b / * is stored on the b node; at this time, if you search for / a / b / c and / a / b / e, both will hit the URL pseudo-static pattern / a / b / *, but / a / b / c / d will not hit the URL pseudo-static pattern; the specific process is as follows:

[0104] i. Traverse along the direction of a->b->e;

[0105] ii. When traversing to node b, first check whether node b has a URL pseudo-static pattern. If so, traverse the pattern and compare whether the URL path meets the conditions. Replace the corresponding position (level 3) in the URL ( / a / b / e) with * and compare it with the pattern ( / a / b / *). If it meets the conditions, return the result; if not, traverse to the next node;

[0106] iii. If the URL pseudo-static pattern is not hit, the detection process of adding a new path to the URL tree is executed.

[0107] The most distinctive feature of the present invention is that, in the process of querying whether the URL path exists in the URL tree, the new URL path is added to the URL memory tree. After the new URL path is added, each node in the tree branch where the new URL path is located is checked to see whether the generation condition of the URL pseudo-static mode is met. If the condition is met, a new URL pseudo-static mode is generated without the need for additional operations. That is, when the original URL path is not in the URL tree, it is necessary to initiate a request again to add the URL path to the URL tree and determine whether to generate a new URL pseudo-static mode, thereby reducing network overhead once.

[0108] It should be noted that the present invention provides services to the outside world through APIs. After the user holds a legal authentication token, he can call the corresponding service interface.

[0109] In addition, the service can be deployed using a single 4c8g docker container, and the URL tree is currently built from 2.27 million specific URL paths.

[0110] This embodiment reduces one network request by adding the pseudo-static pattern of the query URL path and the new URL path into the URL tree and integrating them into one request; the URL tree node stores the matching URL pseudo-static pattern, which can return the matching result in advance and speed up the query; the URL node stores the intermediate statistical results, which can speed up the recognition of the URL pseudo-static pattern.

[0111] Example 2

[0112] Corresponding to the aforementioned URL pseudo-static pattern recognition method embodiment, the present disclosure also provides an embodiment of a URL pseudo-static pattern recognition system.

[0113] Figure 3 A module diagram of a URL pseudo-static pattern recognition system provided in Example 2 of the present disclosure, such as Figure 3 As shown, the recognition system includes: a first acquisition module 21, a first recognition module 22;

[0114] A first acquisition module 21 is used to acquire a URL tree corresponding to the original URL domain name;

[0115] The first identification module 22 is configured to identify a URL pseudo-static pattern based on the original URL path if it is identified that the original URL path exists in the URL tree.

[0116] This embodiment uses memory to construct multiple URL trees, and identifies URL pseudo-static patterns through the original URL domain name combined with the original URL path, thereby achieving rapid and automatic identification and aggregation of URL pseudo-static patterns, reducing the workload of manual identification of URL pseudo-static patterns, improving work efficiency, and thereby achieving the purpose of reducing costs.

[0117] In an optional embodiment, the identification system further includes:

[0118] The second identification module is used to identify whether the original URL domain name exists, and if so, call the second acquisition module; if not, call the construction module;

[0119] The second acquisition module is used to obtain the URL tree corresponding to the original URL domain name;

[0120] The construction module is used to construct a new URL domain name and a URL tree corresponding to the new URL domain name.

[0121] In this embodiment, URL is a method for identifying a specific resource on the Internet, and mainly includes six parts: protocol, domain name, port, path, query parameter, anchor, etc. The request URL has anonymized the port during the collection process, so the present invention mainly performs URL pseudo-static pattern recognition on the combination of the URL domain name and the URL path. It should be noted that there is a unique binding relationship between the URL domain name and the application, so in actual implementation, the application number (appId) can be used instead of the URL domain name.

[0122] In this embodiment, a common solution for constructing a URL tree is to use a Trie tree, also known as a dictionary tree or a prefix tree. A Trie tree is a tree data structure used to efficiently store and retrieve key-value pairs in a string data set. In a URL tree, each node represents a part of a URL. Starting from the root node, each child node represents the next level path of a URL, such as Figure 2 Common usage scenarios include quick URL search, matching, and deduplication.

[0123] The definition of URL pseudo-static mode is that if there are equal to or more than the specified threshold number under the same domain name (the threshold number can be adjusted dynamically and defined according to the actual business), and there is only one sub-path different in the URL path, then the URL pseudo-static mode can be generated. For example, Figure 2 As shown, the threshold number is 2, the paths are / a / b / c and / a / b / d, and the pattern can be aggregated into: / a / b / *;

[0124] The URL pseudo-static pattern recognition algorithm is designed based on the construction method of the URL tree and actual business needs. The difference from the URL tree is: 1) The construction method of the URL tree is that the Trie tree treats each level of sub-path as an independent node and constructs an independent tree. Even sub-paths with the same name are different node instances. In order to quickly identify patterns, the URL pseudo-static pattern recognition algorithm uses a Map to store all nodes in the tree. The key is the node name (i.e., the path from the root node to the current location), and the value is the instance object of the node. Each node only stores the name of the associated node, but does not own the associated node. A separate URL tree is established for each domain name (application number), and the Trie tree also treats the domain name as a node to establish a globally unique URL tree. In non-leaf nodes, the sub-path name list of the next layer node, the number of child nodes, the pattern list identified in the next layer node, the parent node list of the current node, the number of grandchild nodes owned by the current node, etc. are stored. The parent node list of the current node and the sub-path information of the current node are stored in the leaf node.

[0125] In an optional embodiment, the first identification module includes:

[0126] A retrieval unit is used to retrieve whether there is a matching URL pseudo-static pattern in the branch node of the URL tree corresponding to the original URL path, and if so, call the first return unit; if not, call the second return unit;

[0127] A first returning unit, used to return a matched URL pseudo-static pattern;

[0128] The second returning unit is used to return the original URL path.

[0129] In an optional embodiment, the identification system further includes:

[0130] The adding module is used to add the new URL path to the URL tree if it is identified that the original URL path does not exist in the URL tree;

[0131] A first storage module, used to store the new URL path in a database;

[0132] A judgment module is used to judge whether the branch node of the URL tree corresponding to the new URL path meets the conditions for generating a URL pseudo-static mode. If so, the generation module is called;

[0133] A generation module is used to generate a new URL pseudo-static pattern;

[0134] Return module, used to return the new URL pseudo-static mode.

[0135] In an optional embodiment, the identification system further includes:

[0136] The judging module is further configured to call the second returning unit if it is judged that the branch node of the URL tree corresponding to the new URL path does not meet the condition for generating the URL pseudo-static mode;

[0137] The second returning unit is used to return the original URL path.

[0138] In an optional embodiment, the identification system further includes:

[0139] The second storage module is used to store the new URL pseudo-static mode in the database and the tree node.

[0140] In this embodiment, the new URL pseudo-static pattern is stored in the database and the corresponding node in the URL tree.

[0141] In the specific implementation process, URL pseudo-static pattern recognition mainly consists of two parts: initialization and query. The following is a detailed introduction to the specific content:

[0142] Initialization: During initialization, the currently stored URLs and URL pseudo-static pattern information are loaded, which is divided into two parts: loading the identified URL pseudo-static pattern and loading the URL information that has not yet been aggregated;

[0143] Query: Query whether a specific URL has a matching URL pseudo-static pattern based on the URL tree. During the query process, if the URL pseudo-static pattern is matched, the matched URL pseudo-static pattern is returned; if not, it is determined whether the original URL already exists. If so, the original URL path is directly returned; if the original URL path does not exist, the original URL path is written into the URL memory tree and the URL path is stored in the database.

[0144] Specifically, the construction and use of the URL tree:

[0145] a) Definition of tree nodes

[0146] Assume that there is a URL path of / a / b / c / d, and the current node is the node storing the path information of b, then 1) cChildrenCountMap stores the number of paths from the current node to each grandchild node;

[0147] 2) cChildrenList stores the relative path from the current node to the grandchild node;

[0148] 3) childrenList stores the list of child node names owned by the current node;

[0149] 4)leafChildrenList is the list of leaf nodes owned by the current node;

[0150] 5) leafNode Whether the current node is a leaf node;

[0151] 6)parentNodeList is the parent node list of the current node;

[0152] 7) path is the name of a segment of the URL path stored in the current node;

[0153] 8) The complete path of the URL from the root node to the current node;

[0154] 9) urlPatternList is the list of patterns that can be recognized when reaching the current node;

[0155] b) Construction of URL tree

[0156] The present invention constructs a URL tree by using a map to store node instances and a node to store associated node names. For example, if the current node is / a / b and you want to query the information of its child node c, you only need to concatenate the path of the current node and the name of the child node c, i.e. / a / b / c, and then search in the map.

[0157] c) URL pseudo-static mode generation

[0158] There are two forms of URL pseudo-static mode: (1) The pseudo-static sub-path is at the end of the URL path, such as: / a / b / *; (2) The pseudo-static sub-path is in the middle or beginning of the URL path, such as: / a / * / c. The intermediate statistics method of the two modes is the same. When a new path is added, the statistical information is updated at each node along the way.

[0159] Assume that the threshold number of pattern aggregation is 2, and the current URL tree already has the information of the paths / a / b / c, / a, and / a / b. The newly added path is / a / b / d. In the process of adding a new path, the statistical data on each node will be updated along the direction of a->b->d. For example, when reaching node a, the cChildrenList list will be updated, and the relative path b / d will be added. The number of paths from node a to node d will be increased in cChildrenCountMap. When reaching node b, the leafChildrenList list will be updated, and the newly added child node d will be added. When reaching node d, node d will be added to the map, and the parentNodeList of node d will add the path / a / b of parent node b. After node d is added, check whether a new URL pseudo-static pattern is generated along the direction of d->b>a. When node b is detected, it is found that node b has 2 child nodes, which meets the threshold number requirement of 2. At this time, a new URL pseudo-static pattern / a / b / * is generated at node b, and the detection ends here.

[0160] d) Identification of pseudo-static URL patterns

[0161] Assume that the paths / a / b / c and / a / b / d already exist in the URL tree, and the URL pseudo-static pattern / a / b / * is stored on the b node; at this time, if you search for / a / b / c and / a / b / e, both will hit the URL pseudo-static pattern / a / b / *, but / a / b / c / d will not hit the URL pseudo-static pattern; the specific process is as follows:

[0162] i. Traverse along the direction of a->b->e;

[0163] ii. When traversing to node b, first check whether node b has a URL pseudo-static pattern. If so, traverse the pattern and compare whether the URL path meets the conditions. Replace the corresponding position (level 3) in the URL ( / a / b / e) with * and compare it with the pattern ( / a / b / *). If it meets the conditions, return the result; if not, traverse to the next node;

[0164] iii. If the URL pseudo-static pattern is not hit, the detection process of adding a new path to the URL tree is executed.

[0165] The most distinctive feature of the present invention is that, in the process of querying whether the URL path exists in the URL tree, the new URL path is added to the URL memory tree. After the new URL path is added, each node in the tree branch where the new URL path is located is checked to see whether the generation condition of the URL pseudo-static mode is met. If the condition is met, a new URL pseudo-static mode is generated without the need for additional operations. That is, when the original URL path is not in the URL tree, it is necessary to initiate a request again to add the URL path to the URL tree and determine whether to generate a new URL pseudo-static mode, thereby reducing network overhead once.

[0166] It should be noted that the present invention provides services to the outside world through APIs. After the user holds a legal authentication token, he can call the corresponding service interface.

[0167] In addition, the service can be deployed using a single 4c8g docker container, and the URL tree is currently built from 2.27 million specific URL paths.

[0168] This embodiment reduces one network request by adding the pseudo-static pattern of the query URL path and the new URL path into the URL tree and integrating them into one request; the URL tree node stores the matching URL pseudo-static pattern, which can return the matching result in advance and speed up the query; the URL node stores the intermediate statistical results, which can speed up the recognition of the URL pseudo-static pattern.

[0169] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.

[0170] Example 3

[0171] Figure 4 This is a structural diagram of an electronic device shown in Example 3 of the present disclosure, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and when the processor executes the computer program, the method for identifying the URL pseudo-static pattern described in any of the above embodiments is implemented. Figure 4 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0172] like Figure 4As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).

[0173] The bus 93 includes a data bus, an address bus, and a control bus.

[0174] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .

[0175] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 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 may include an implementation of a network environment.

[0176] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the URL pseudo-static pattern recognition method provided in any of the above embodiments.

[0177] The electronic device 90 may also be connected to one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). ) communication. Such communication can be performed through an input / output (I / O) interface 95. In addition, the electronic device 90 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 96. Figure 4 As shown, the network adapter 96 communicates with other modules of the electronic device 90 via the bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0178] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0179] Example 4

[0180] Embodiment 4 of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for identifying a pseudo-static pattern of a URL provided in any of the above embodiments is implemented.

[0181] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0182] Example 5

[0183] Embodiment 5 of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for identifying a pseudo-static pattern of a URL.

[0184] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0185] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A method for identifying a pseudo-static pattern of a URL, characterized in that: The identification method comprises: Get the URL tree corresponding to the original URL domain name; If it is identified that there is an original URL path in the URL tree, a URL pseudo-static pattern is identified based on the original URL path.

2. The method for identifying a pseudo-static pattern of a URL as claimed in claim 1, characterized in that: Before the step of obtaining the URL tree corresponding to the original URL domain name, the identification method further includes: Identify whether the original URL domain name exists. If so, obtain the URL tree corresponding to the original URL domain name; if not, construct a new URL domain name and the URL tree corresponding to the new URL domain name.

3. The method for identifying a pseudo-static pattern of a URL as claimed in claim 1, characterized in that: The step of identifying the URL pseudo-static mode based on the original URL path comprises: It is retrieved whether there is a matching URL pseudo-static pattern in the branch node of the URL tree corresponding to the original URL path. If so, the matching URL pseudo-static pattern is returned; if not, the original URL path is returned.

4. The method for identifying a pseudo-static pattern of a URL as claimed in claim 1, wherein: The identification method further comprises: If it is identified that the original URL path does not exist in the URL tree, the new URL path is added to the URL tree; Store the new URL path in the database; Determine whether the branch node of the URL tree corresponding to the new URL path meets the condition for generating a URL pseudo-static mode, and if so, generate a new URL pseudo-static mode; Returns the new URL pseudo-static mode.

5. The method for identifying a pseudo-static pattern of a URL as claimed in claim 4, characterized in that: The identification method further comprises: If it is determined that the branch node of the URL tree corresponding to the new URL path does not meet the condition for generating the URL pseudo-static mode, the original URL path is returned.

6. The method for identifying a pseudo-static pattern of a URL as claimed in claim 4, characterized in that: The identification method further comprises: The new URL pseudo-static pattern is stored in the database and the tree node.

7. A URL pseudo-static pattern recognition system, characterized in that: The identification system comprises: The first acquisition module is used to obtain the URL tree corresponding to the original URL domain name; The first identification module is used to identify the URL pseudo-static pattern based on the original URL path if it is identified that there is an original URL path in the URL tree.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the method for identifying the URL pseudo-static pattern according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying a pseudo-static pattern of a URL according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying a pseudo-static pattern of a URL as claimed in any one of claims 1 to 6 is implemented.