Main and standby domain name switching method and device, equipment, medium and product

By switching the main domain name of the web page resource in real time based on preset filtering rules and the main and backup domain name mapping relationship when accessing the web page backup domain name, the problem of not being able to replace multiple main domain names in real time in the existing technology is solved, and the effectiveness and security of resource access are improved.

CN119696916AActive Publication Date: 2025-03-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411947875.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-25
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The existing master-support domain name switching technology cannot synchronize the replacement of multiple master domain names contained in web page content in real time, resulting in poor replacement flexibility and scalability.

Method used

By responding to page access requests, the target domain name is determined, and the target page resources are filtered based on preset filtering rules to determine the target resource type. Then, based on the primary and secondary domain name mapping relationship, the primary resource domain name corresponding to the target resource type is switched to the secondary domain name.

Benefits of technology

It automatically triggers the synchronous switching of the main domain name of the resource when accessing the web page backup domain name, ensures the effectiveness of real-time access of resources, avoids the problem of invalid resource access after network attacks, and improves security, autonomous controllability and flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696916A_ABST
    Figure CN119696916A_ABST
Patent Text Reader

Abstract

The invention provides a main and standby domain name switching method, device and equipment, a medium and a product, which can be applied to the technical field of cloud computing and financial science and technology. The method comprises the following steps: in response to a page access request for a target page, determining a target domain name in the page access request; under the condition that the target domain name is a webpage standby domain name, resources in the target page are screened based on a preset filtering rule, and a target resource type is determined, and the target resource type represents a high-access-frequency element object meeting the service requirement; and on the basis of a main and standby domain name mapping relationship, switching a resource main domain name corresponding to the target resource type to a resource standby domain name, the main and standby domain name mapping relationship representing a one-to-one correspondence relationship between the main domain name and the standby domain name.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of cloud computing and financial technology, and specifically to a method, device, equipment, medium and product for switching between primary and backup domain names. Background Art

[0002] With the increasing frequency of network attacks, setting up a primary domain name and a backup domain name for a website is an effective way to improve the security of the website itself. The existing primary and backup domain name switching technology mainly resolves access requests through the domain name system, and switching and modifying the backup domain name depends on the domain name system service third party. In addition, after a web page is attacked, the content of the web page accessed based on the primary domain name may be in an invalid state. Therefore, it is necessary to synchronously replace the primary domain name contained in the web page content.

[0003] In the process of implementing the present disclosure, the inventors found that in the related art, multiple primary domain names contained in web page content cannot be synchronously replaced with backup domain names in real time, and the replacement flexibility and scalability are poor. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a method, apparatus, device, medium and product for switching between primary and backup domain names.

[0005] According to the first aspect of the present disclosure, a method for switching between primary and backup domain names is provided, comprising: in response to a page access request for a target page, determining a target domain name in the page access request; in the case where the target domain name is a backup domain name of a web page, screening resources in the target page based on preset filtering rules to determine a target resource type, wherein the target resource type represents a high-access frequency element object that meets business needs; based on a primary-backup domain name mapping relationship, switching the resource primary domain name corresponding to the target resource type to the resource backup domain name, wherein the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

[0006] According to an embodiment of the present disclosure, the primary-backup domain name switching method also includes: when the target domain name is the primary domain name of the web page and the primary domain name of the web page is an invalid domain name, based on the primary-backup domain name mapping relationship, switching the primary domain name of the web page to the backup domain name of the web page; accessing the target page based on the backup domain name of the web page.

[0007] According to an embodiment of the present disclosure, when the target domain name is a backup domain name for a web page, the resources in the target page are screened based on preset filtering rules, and determining the target resource type includes: determining resource access requirements from the acquired business resource access performance; based on the resource access requirements, determining preset filtering rules; when the target domain name is a backup domain name for a web page, triggering a traversal mechanism to traverse the source code corresponding to the target page; using regular matching rules, mapping at least one resource address of the source code, and determining the resource type corresponding to each of the at least one resource addresses; based on the preset filtering rules, determining the target resource type from at least one resource type.

[0008] According to an embodiment of the present disclosure, resource access requirements include key content access requirements and dynamic resource access requirements; wherein, based on the resource access requirements, determining preset filtering rules includes: determining a target resource type variable value based on the key content access requirements and the dynamic resource access requirements, wherein the key content access requirement represents a requirement that the frequency and importance of accessing key content are both higher than a preset requirement threshold; and constructing preset filtering rules based on the target resource type variable value.

[0009] According to an embodiment of the present disclosure, a backup domain name for a web page is determined based on the following operations: constructing a primary-backup domain name mapping relationship according to an initial matching rule between the primary domain name and the backup domain name; modifying the initial matching rule in response to a request for change in operation and maintenance requirements to obtain a target matching rule; updating the primary-backup domain name mapping relationship according to the target matching rule to obtain an updated primary-backup domain name mapping relationship; and determining the target domain name to be a backup domain name for the web page when there is a backup domain name corresponding to the target domain name in the updated primary-backup domain name mapping relationship.

[0010] According to an embodiment of the present disclosure, a primary-backup domain name mapping relationship includes a primary domain name, a backup domain name, and a relationship status, wherein switching the resource primary domain name corresponding to the target resource type to the resource backup domain name includes: determining the primary domain name corresponding to the resource primary domain name from multiple primary domain names in the primary-backup domain name mapping relationship; when the relationship status corresponding to the primary domain name is a valid state, determining the backup domain name corresponding to the primary domain name as the resource backup domain name; and switching the resource primary domain name corresponding to the target resource type to the resource backup domain name.

[0011] According to an embodiment of the present disclosure, the primary domain name of a web page is determined based on the following operations: using a query tool to query the target primary domain name corresponding to the target web page from a database platform; when the target domain name is the same as the target primary domain name, determining the target domain name as the primary domain name of the web page.

[0012] A second aspect of the present disclosure provides a primary-backup domain name switching device, including: a determination module, used to determine the target domain name in the page access request in response to the page access request for the target page; a filtering module, used to filter the resources in the target page based on preset filtering rules when the target domain name is a backup domain name of the web page, and determine the target resource type, wherein the target resource type represents a high-access frequency element object that meets business needs; a switching module, used to switch the resource primary domain name corresponding to the target resource type to the resource backup domain name based on the primary-backup domain name mapping relationship, wherein the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0014] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.

[0015] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.

[0016] According to the primary and backup domain name switching method, device, equipment, medium and product provided by the present disclosure, when the target domain name is a backup domain name of a web page, the target resource type is determined by screening the resources in the target page based on the preset filtering rules; based on the mapping relationship between the primary and backup domain names, the resource primary domain name corresponding to the target resource type is switched to the resource backup domain name. Since it can be determined that the target page has been attacked by a network attack by accessing the target page based on the backup domain name of the web page, each time the target page that has been attacked by a network attack is accessed based on the backup domain name of the web page, it is automatically triggered to synchronously switch the multiple groups of resource primary domain names corresponding to the target resource type in the target page to the resource backup domain name, thereby ensuring the real-time access validity of the resources in the target page and avoiding the problem of invalid access to resources after the target page has been attacked by a network attack. The preset filtering rules further improve the efficiency of replacing multiple groups of resource primary domain names, and the switching and configuration of the primary and backup domain names do not need to rely on a third party, thereby improving security, autonomous controllability and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0018] Figure 1The following schematically shows an application scenario diagram of the method for switching between primary and backup domain names according to an embodiment of the present disclosure;

[0019] Figure 2 A flowchart of a method for switching a primary domain name and a backup domain name according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 3 A flowchart of processing a page access request according to an embodiment of the present disclosure is schematically shown;

[0021] Figure 4 A schematic diagram shows a structural block diagram of a device for switching between primary and backup domain names according to an embodiment of the present disclosure; and

[0022] Figure 5 A block diagram of an electronic device suitable for implementing a method for switching between primary and backup domain names according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0027] In the process of implementing the present disclosure, it is found that with the increasing frequency of network attacks, setting a primary domain name and a backup domain name for a website is an effective way to improve the security of the website itself. The existing primary and backup domain name switching technology mainly resolves access requests through the domain name system, and switching and modifying the backup domain name depends on the domain name system serving a third party. In addition, after a web page is attacked, the content in the web page accessed based on the primary domain name may be in an invalid state. Therefore, it is necessary to synchronously replace the primary domain name contained in the web page content. However, for multiple primary domain names contained in the web page content, the existing technology cannot synchronously replace them with backup domain names in real time, and the replacement flexibility and scalability are poor.

[0028] In view of this, an embodiment of the present disclosure provides a method for switching between primary and backup domain names, which determines the target domain name in the page access request in response to a page access request for a target page; when the target domain name is a backup domain name of a web page, the resources in the target page are screened based on preset filtering rules to determine the target resource type, wherein the target resource type represents a high-access frequency element object that meets business needs; based on the primary and backup domain name mapping relationship, the resource primary domain name corresponding to the target resource type is switched to the resource backup domain name, wherein the primary and backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

[0029] It should be noted that the primary-backup domain name switching method and the primary-backup domain name switching device provided by the present disclosure can be used in the field of financial technology, such as financial institutions, and can also be used in any field other than the field of financial technology, such as e-commerce platforms such as shopping websites. Therefore, the application field of the primary-backup domain name switching method and the primary-backup domain name switching device provided by the present disclosure is not limited.

[0030] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0031] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0032] Figure 1 The application scenario diagram of the primary and backup domain name switching method according to an embodiment of the present disclosure is schematically shown.

[0033] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0034] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0036] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0037] It should be noted that the primary and backup domain name switching method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the primary and backup domain name switching device provided in the embodiment of the present disclosure can generally be set in the server 105. The primary and backup domain name switching method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the primary and backup domain name switching device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0038] It should be understood that Figure 1 The number of the first terminal device, the second terminal device, the third terminal device, the network and the server in the embodiment is only for illustration. According to the implementation requirements, there may be any number of the first terminal device, the second terminal device, the third terminal device, the network and the server.

[0039] The following will be based on Figure 1 The scene described by Figure 2~Figure 3 The method for switching the primary and backup domain names in an embodiment of the present disclosure is described in detail.

[0040] Figure 2 The flowchart of the method for switching the primary and backup domain names according to an embodiment of the present disclosure is schematically shown.

[0041] like Figure 2 As shown, the primary-backup domain name switching method 200 of this embodiment includes operations S210 to S230.

[0042] In operation S210, in response to a page access request for a target page, a target domain name in the page access request is determined.

[0043] In operation S220, when the target domain name is a webpage backup domain name, resources in the target page are screened based on preset filtering rules to determine the target resource type.

[0044] In operation S230, based on the primary-backup domain name mapping relationship, the resource primary domain name corresponding to the target resource type is switched to the resource backup domain name.

[0045] According to an embodiment of the present disclosure, the target page is a web page interface to be accessed, and the server intercepts a page access request sent by a user through a request interceptor, parses the page access request, and obtains a target domain name in the page access request.

[0046] According to an embodiment of the present disclosure, the target domain name is the address of the target page, which is used to identify and access the target page. Through the target domain name, the user can directly access the resources on the target page.

[0047] According to an embodiment of the present disclosure, a primary-backup domain name mapping relationship is dynamically configured in a database, and the backup domain name information in the primary-backup domain name mapping relationship can be matched with the target domain name. If the match is successful, the target domain name is determined to be the backup domain name of the web page.

[0048] According to an embodiment of the present disclosure, when the target domain name is a backup domain name for a web page, triggering a traversal mechanism to traverse the resources in the target page includes: the server traversing the source code of the target page, the source code including the resources in the target page, and screening the resources in the target page based on preset filtering rules during the traversal process to determine the target resource type.

[0049] According to an embodiment of the present disclosure, the resources in the target page are all elements constituting the content and functions of the target page, and the elements can be correctly displayed and used by the browser on the target page.

[0050] For example, the resources in the target page may be style elements, image elements, audio elements, functional component elements, document elements, and the like.

[0051] According to an embodiment of the present disclosure, element objects with high access frequency are determined according to business needs and then the key resource types are determined. The key resource types can also be determined according to element objects with high security requirements and high importance in building the web page structure in the target page, for example, HyperText Markup Language (HTML) elements, script elements, functional component elements, hyperlink elements, etc.

[0052] According to an embodiment of the present disclosure, preset filtering rules are defined according to key resource types, and then resources in the target page that meet the preset filtering rules and correspond to the key resource types are screened to obtain target resource types. The target resource type represents a high-access frequency element object that meets business requirements.

[0053] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

[0054] According to an embodiment of the present disclosure, while determining that the resource type of a resource is the target resource type, the resource primary domain name of this resource is extracted from the response content, and the resource backup domain name corresponding to the resource primary domain name is determined according to the primary-backup domain name mapping relationship and replaced; until the resource primary domain names of all target resource types in the response content are switched to the resource backup domain name, the traversal is stopped.

[0055] According to an embodiment of the present disclosure, after the switching is completed, the resources requested in the response content are returned to the client based on the information in the request header (Request Headers) of the response content obtained by the server in response to the page access request, so that the resources in the target page can be displayed and used normally in the client's browser.

[0056] According to the embodiments of the present disclosure, since accessing the target page based on the backup domain name of the web page can determine that the target page has been attacked by a network attack, each time the target page after the network attack is accessed based on the backup domain name of the web page, the multiple groups of resource primary domain names corresponding to the target resource types in the target page are automatically triggered to be synchronously switched to the resource backup domain names, thereby ensuring the real-time access validity of the resources in the target page and avoiding the problem of invalid access to the resources after the target page is attacked by a network attack. The preset filtering rules further improve the efficiency of replacing multiple groups of resource primary domain names, and the switching and configuration of the primary and backup domain names do not need to rely on a third party, thereby improving security, autonomous controllability, and flexibility.

[0057] According to an embodiment of the present disclosure, the primary-backup domain name switching method includes: when the target domain name is the primary domain name of the web page and the primary domain name of the web page is an invalid domain name, based on the primary-backup domain name mapping relationship, switching the primary domain name of the web page to the backup domain name of the web page; accessing the target page based on the backup domain name of the web page.

[0058] According to an embodiment of the present disclosure, a target page corresponds to a main domain name of a web page. When the target domain name is the same as the main domain name of the web page, it is determined whether the main domain name of the web page is valid. When the main domain name of the web page is a valid domain name, the server directly returns the response content to the client.

[0059] According to an embodiment of the present disclosure, when the primary domain name of a web page is an invalid domain name, the primary-backup domain name mapping relationship is obtained from the database, the backup domain name of the web page corresponding to the primary domain name of the web page is determined from the primary-backup domain name mapping relationship, and the primary domain name of the web page is switched to the backup domain name of the web page.

[0060] According to an embodiment of the present disclosure, the target page is accessed again based on the backup domain name of the web page, triggering a traversal mechanism to filter out all target resource types, and switching the resource primary domain name corresponding to the target resource type to the resource backup domain name. After all resource primary domain names are switched, the server returns the response content to the client.

[0061] According to an embodiment of the present disclosure, if the target domain name is the primary domain name of the web page and is a valid domain name, it means that the target page can be safely accessed, and the target page is directly accessed and the response content is returned; if the target domain name is the primary domain name of the web page and is an invalid domain name, it means that the target page is in a non-safe access state and needs to be replaced with the backup domain name of the web page for access. The access based on the backup domain name of the web page triggers the switching of the primary domain names of the resources of each target resource type, thereby ensuring the effectiveness and security of resource access in the target page and improving data security.

[0062] According to an embodiment of the present disclosure, when the target domain name is a backup domain name for a web page, the resources in the target page are screened based on preset filtering rules, and determining the target resource type includes: determining resource access requirements from the acquired business resource access performance; based on the resource access requirements, determining preset filtering rules; when the target domain name is a backup domain name for a web page, triggering a traversal mechanism to traverse the source code corresponding to the target page; using regular matching rules, mapping at least one resource address of the source code, and determining the resource type corresponding to each of the at least one resource addresses; based on the preset filtering rules, determining the target resource type from at least one resource type.

[0063] According to an embodiment of the present disclosure, business resource access performance is obtained by analyzing historical access requests to a target page. The business resource access performance is the performance generated by accessing resources in the target page, such as resource access frequency, resource access time, response time, etc.

[0064] According to an embodiment of the present disclosure, high-access frequency resources, important resources, and high-security resources are determined from the acquired business resource access performance, and then resource access requirements are determined based on the high-access frequency resources, important resources, and high-security resources. Key resource type parameters are constructed based on the resource access requirements, and preset filtering rules are designed based on the key resource type parameters.

[0065] According to an embodiment of the present disclosure, when the target domain name is a backup domain name of a web page, a traversal mechanism is triggered to traverse the source code corresponding to the target page, and the source code defines the structure and resource content of the target page.

[0066] According to an embodiment of the present disclosure, the resource address of the source code is mapped using regular matching rules to determine the resource type corresponding to the resource address. For example, if the page access request is http: / / www.xxx.com.cn / test.html, the resource address: / test.html is mapped according to the regular matching rules to obtain the resource type text / html.

[0067] For example, the regular matching rule may be "~(.*xxx)$", and the resource type corresponding to the resource address ".mp4" is video / mp4.

[0068] According to an embodiment of the present disclosure, a target resource type is determined from at least one resource type in a source code according to a plurality of key resource types defined in a preset filtering rule.

[0069] According to an embodiment of the present disclosure, the resources of the target page are filtered to exclude some static resources such as pictures and styles, and the target resource type is screened out, and then the resource primary domain name corresponding to the target resource type is replaced with the resource backup domain name, thereby improving the efficiency of replacing the resource primary and backup domain names.

[0070] According to an embodiment of the present disclosure, resource access requirements include key content access requirements and dynamic resource access requirements; wherein, based on the resource access requirements, determining preset filtering rules includes: determining a target resource type variable value based on the key content access requirements and the dynamic resource access requirements, wherein the key content access requirement represents a requirement that the frequency and importance of accessing key content are both higher than a preset requirement threshold; and constructing preset filtering rules based on the target resource type variable value.

[0071] According to an embodiment of the present disclosure, the key content access requirement is a requirement for accessing key resources of high frequency and importance. For example, key resources include functional component elements, hyperlink elements, and the like.

[0072] According to an embodiment of the present disclosure, the dynamic resource access requirement is a requirement for accessing dynamic resources of a target page. Dynamic resources are resources that are dynamically generated or changed as needed when an application is running. For example, dynamic resources include script elements, style elements, hypertext markup language elements, etc.

[0073] According to an embodiment of the present disclosure, target resources are determined based on key content access requirements and dynamic resource access requirements, and the target resources include key resources and dynamic resources. The target resource type variable value is determined based on the resource type of the target resource. The judgment conditions are defined in the preset filtering rules based on the resource type variable and the target resource type variable value to be screened.

[0074] For example, if the target resource is a style element or a script element, the target resource type variable value is determined to be "text / css" or "application / javascript" according to the resource type of the target resource, and the judgment condition is constructed as IF (xxx_content_type == "text / css" or xxx_content_type == "application / javascript", where the resource type variable is xxx_content_type.

[0075] According to an embodiment of the present disclosure, a backup domain name for a web page is determined based on the following operations: constructing a primary-backup domain name mapping relationship according to an initial matching rule between the primary domain name and the backup domain name; modifying the initial matching rule in response to a request for change in operation and maintenance requirements to obtain a target matching rule; updating the primary-backup domain name mapping relationship according to the target matching rule to obtain an updated primary-backup domain name mapping relationship; and determining the target domain name to be a backup domain name for the web page when there is a backup domain name corresponding to the target domain name in the updated primary-backup domain name mapping relationship.

[0076] According to an embodiment of the present disclosure, the initial matching rule can be obtained from the shared database platform, and the primary and backup domain name mapping relationship is constructed in the configuration file of the database according to the initial matching rule between the primary domain name and the backup domain name. The initial matching rule defines a one-to-one correspondence between the primary domain name and the backup domain name.

[0077] According to the embodiments of the present disclosure, operation and maintenance personnel can modify and expand the correspondence between the primary and backup domain names according to actual needs. In response to the operation and maintenance personnel's request for change in operation and maintenance needs, the initial matching rules are modified to obtain target matching rules. The target matching rules define a one-to-one correspondence between the modified primary domain name and the backup domain name.

[0078] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship is modified according to the target matching rule to obtain an updated primary-backup domain name mapping relationship.

[0079] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship is dynamically updated in real time according to actual needs. After responding to a page access request, the target domain name in the page access request is matched with the backup domain name information in the primary-backup domain name mapping relationship at the response time. If the match is successful, the target domain name is determined to be the backup domain name of the web page.

[0080] According to the embodiments of the present disclosure, operation and maintenance personnel can dynamically update the primary and backup domain name mapping relationships in the database according to actual needs, ensure the real-time validity of the primary and backup domain name mapping relationships, and improve the accuracy of primary and backup domain name replacement.

[0081] According to an embodiment of the present disclosure, a primary-backup domain name mapping relationship includes a primary domain name, a backup domain name, and a relationship status, wherein switching the resource primary domain name corresponding to the target resource type to the resource backup domain name includes: determining the primary domain name corresponding to the resource primary domain name from multiple primary domain names in the primary-backup domain name mapping relationship; when the relationship status corresponding to the primary domain name is a valid state, determining the backup domain name corresponding to the primary domain name as the resource backup domain name; and switching the resource primary domain name corresponding to the target resource type to the resource backup domain name.

[0082] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship includes a relationship identifier, a primary domain name, a backup domain name, a relationship status, a creation date, and an update date.

[0083] Table 1 shows the table of the meanings of fields in the primary and standby domain name mapping relationship according to an embodiment of the present disclosure.

[0084]

[0085] According to an embodiment of the present disclosure, the relationship status includes a valid status and an invalid status. is_deleted being 0 indicates that this group of primary and standby domain name mapping relationships has been deleted and is in an invalid status; is_deleted being 1 indicates that this group of primary and standby domain name mapping relationships has not been deleted and is in a valid status.

[0086] Table 2 shows the primary and standby domain name mapping relationship table according to an embodiment of the present disclosure.

[0087]

[0088] According to an embodiment of the present disclosure, in response to a page access request http: / / target domain name / index.html for a target page, it is determined that the target domain name is the primary web domain name A; when the primary web domain name A is a valid domain name, the target page is accessed, and the source code of the target page is obtained " <link type="text / css" href=" / / 资源主域名B / test.css"> <script src=" / / resource primary domain name C / test.js ", traverse the source code to obtain the resource primary domain name B and the resource primary domain name C.

[0089] According to an embodiment of the present disclosure, when the primary web domain name A is an invalid domain name, according to the primary and standby domain name mapping relationship, the primary web domain name A is switched to the standby web domain name B, and the target page is accessed based on the standby web domain name A to obtain a page access request http: / / standby web domain name A / index.html, triggering the traversal of the source code, and performing resource primary domain name switching according to the primary and standby domain name mapping relationship to obtain the switched source code " <link type="text / css" href=" / / 资源备域名B / test.css"> <script src=" / / resource standby domain name C / test.js ", and then return the response content to the client according to the switched source code.

[0090] Figure 3 Schematically shows the flowchart of processing a page access request according to an embodiment of the present disclosure.

[0091] As Figure 3As shown, the server intercepts the page access request sent by the user through the request interceptor, parses the page access request, and obtains the target domain name in the page access request. Determine whether the target domain name is the main domain name of the web page. When the target domain name is the main domain name of the web page and the main domain name of the web page is a valid domain name, the server directly returns the response content to the client; when the main domain name of the web page is an invalid domain name, the main domain name of the web page is replaced with the backup domain name of the web page, and the target page is accessed based on the backup domain name of the web page to obtain a page access request; the target domain name in the page access request is judged again, and it is determined that the target domain name is the backup domain name of the web page, and the traversal mechanism is triggered to traverse the resources in the target page. During the traversal process, the resources in the target page are screened based on the preset filtering rules. When the resource type corresponding to the resource does not meet the preset filtering rules, the resource is directly returned to the client; otherwise, the resource main domain name of this resource is replaced with the resource backup domain name according to the mapping relationship between the primary and backup domain names, and then the resource is returned to the client.

[0092] According to the embodiments of the present disclosure, operation and maintenance personnel can maintain the original mapping relationship in the database. If the primary and backup domain name mapping relationship needs to be updated, the dynamic reading module on the system will periodically read and update the primary and backup domain name mapping relationship.

[0093] According to an embodiment of the present disclosure, the primary domain name of a web page is determined based on the following operations: using a query tool to query the target primary domain name corresponding to the target web page from a database platform; when the target domain name is the same as the target primary domain name, determining the target domain name as the primary domain name of the web page.

[0094] According to an embodiment of the present disclosure, a query tool is used to query a target primary domain name corresponding to a target web page from a shared database platform, and when the target domain name is the same as the target primary domain name, the target domain name is determined to be the primary domain name of the web page.

[0095] According to an embodiment of the present disclosure, one target page corresponds to one main domain name of the web page. When the target domain name is the same as the main domain name of the web page, the target domain name is determined to be the main domain name of the web page.

[0096] According to an embodiment of the present disclosure, whether the target domain name is the primary domain name of the web page can be judged according to the level of the target domain name, including: when the level of the target domain name is the highest level domain name, determining the target domain name as the primary domain name of the web page, otherwise it is a backup domain name of the web page.

[0097] According to the embodiments of the present disclosure, the efficiency of determining the webpage domain name and the matching accuracy can be accelerated by combining query tools, domain name levels, etc.

[0098] Based on the above-mentioned primary and backup domain name switching method, the present disclosure also provides a primary and backup domain name switching device. Figure 4 The device is described in detail.

[0099] Figure 4 The structure block diagram of the apparatus for switching between primary and backup domain names according to an embodiment of the present disclosure is schematically shown.

[0100] like Figure 4 As shown, the apparatus 400 for switching between primary and backup domain names in this embodiment includes a determination module 410 , a filtering module 420 and a switching module 430 .

[0101] The determination module 410 is used to determine the target domain name in the page access request in response to the page access request for the target page. In one embodiment, the determination module 410 can be used to perform the operation S210 described above, which will not be described in detail here.

[0102] The filtering module 420 is used to filter the resources in the target page based on the preset filtering rules when the target domain name is a backup domain name of the web page, and determine the target resource type, wherein the target resource type represents a high-access frequency element object that meets the business requirements. In one embodiment, the filtering module 420 can be used to perform the operation S220 described above, which will not be repeated here.

[0103] The switching module 430 is used to switch the resource primary domain name corresponding to the target resource type to the resource backup domain name based on the primary-backup domain name mapping relationship, wherein the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name. In one embodiment, the switching module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0104] According to an embodiment of the present disclosure, the apparatus 400 for switching between primary and backup domain names further includes an identification module and an access module.

[0105] The identification module is used to switch the main domain name of the web page to the backup domain name of the web page based on the mapping relationship between the main and backup domain names when the target domain name is the main domain name of the web page and the main domain name of the web page is an invalid domain name.

[0106] The access module is used to access the target page based on the web backup domain name.

[0107] According to an embodiment of the present disclosure, the filtering module 420 includes a first filtering submodule, a second filtering submodule, a third filtering submodule, a fourth filtering submodule, and a fifth filtering submodule.

[0108] The first filtering submodule is used to determine the resource access requirement from the acquired service resource access performance.

[0109] The second filtering submodule is used to determine preset filtering rules based on resource access requirements.

[0110] The third filtering submodule is used to trigger a traversal mechanism to traverse the source code corresponding to the target page when the target domain name is a backup domain name of a web page.

[0111] The fourth filtering submodule is used to map at least one resource address of the source code by using a regular matching rule, and determine the resource type corresponding to each of the at least one resource addresses.

[0112] The fifth filtering submodule is used to determine a target resource type from at least one resource type based on a preset filtering rule.

[0113] According to an embodiment of the present disclosure, the second filter submodule includes a first filter unit and a second filter unit.

[0114] The first filtering unit is used to determine the target resource type variable value according to the key content access requirement and the dynamic resource access requirement, wherein the key content access requirement represents the requirement that the frequency and importance of accessing the key content are higher than a preset requirement threshold.

[0115] The second filtering unit is used to construct a preset filtering rule according to the target resource type variable value.

[0116] According to an embodiment of the present disclosure, the apparatus 400 for switching between primary and backup domain names further includes a construction module, a response module, an update module and a first matching module.

[0117] The construction module is used to construct a mapping relationship between the primary domain name and the backup domain name according to an initial matching rule between the primary domain name and the backup domain name.

[0118] The response module is used to modify the initial matching rules in response to the operation and maintenance demand change request to obtain the target matching rules.

[0119] The update module is used to update the primary and backup domain name mapping relationship according to the target matching rule to obtain an updated primary and backup domain name mapping relationship.

[0120] The first matching module is used to determine that the target domain name is a backup domain name for the web page when there is a backup domain name corresponding to the target domain name in the updated primary-backup domain name mapping relationship.

[0121] According to an embodiment of the present disclosure, the switching module 430 includes a first switching submodule, a second switching submodule, and a third switching submodule.

[0122] The first switching submodule is used to determine a primary domain name corresponding to the resource primary domain name from a plurality of primary domain names in the primary-backup domain name mapping relationship.

[0123] The second switching submodule is used to determine the backup domain name corresponding to the primary domain name as the resource backup domain name when the relationship status corresponding to the primary domain name is a valid status.

[0124] The third switching submodule is used to switch the resource primary domain name corresponding to the target resource type to the resource backup domain name.

[0125] According to an embodiment of the present disclosure, the apparatus 400 for switching between primary and backup domain names further includes a query module and a second matching module.

[0126] The query module is used to query the target primary domain name corresponding to the target web page from the database platform using a query tool.

[0127] The second matching module is used to determine that the target domain name is the main domain name of the webpage when the target domain name is the same as the target main domain name.

[0128] According to an embodiment of the present disclosure, any multiple modules of the determination module 410, the filtering module 420 and the switching module 430 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the determination module 410, the filtering module 420 and the switching module 430 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the determination module 410, the filtering module 420 and the switching module 430 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.

[0129] Figure 5 A block diagram of an electronic device suitable for implementing a method for switching between primary and backup domain names according to an embodiment of the present disclosure is schematically shown.

[0130] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0131] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.

[0132] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.

[0133] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0134] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.

[0135] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the primary and backup domain name switching method provided by the embodiment of the present disclosure.

[0136] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0137] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0138] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0139] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0140] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0141] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0142] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for switching between primary and backup domain names, characterized in that: The method comprises: In response to a page access request for a target page, determining a target domain name in the page access request; In the case where the target domain name is a backup domain name for a web page, resources in the target page are screened based on preset filtering rules to determine a target resource type, wherein the target resource type represents a high-access frequency element object that meets business requirements; Based on the primary-backup domain name mapping relationship, the resource primary domain name corresponding to the target resource type is switched to the resource backup domain name, wherein the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

2. The method according to claim 1, characterized in that The method further comprises: When the target domain name is the primary domain name of the webpage and the primary domain name of the webpage is an invalid domain name, based on the primary and backup domain name mapping relationship, the primary domain name of the webpage is switched to the backup domain name of the webpage; The target page is accessed based on the web page backup domain name.

3. The method according to claim 1, characterized in that In the case where the target domain name is a backup domain name for a web page, filtering resources in the target page based on a preset filtering rule to determine the target resource type includes: Determine resource access requirements from the obtained business resource access performance; Based on the resource access requirement, determining the preset filtering rule; In the case where the target domain name is a backup domain name for a web page, a traversal mechanism is triggered to traverse the source code corresponding to the target page; Using a regular matching rule, mapping at least one resource address of the source code, and determining a resource type corresponding to each of the at least one resource addresses; Based on the preset filtering rule, a target resource type is determined from at least one of the resource types.

4. The method according to claim 3, characterized in that The resource access requirements include key content access requirements and dynamic resource access requirements; wherein, based on the resource access requirements, determining the preset filtering rules includes: Determining a target resource type variable value according to the key content access requirement and the dynamic resource access requirement, wherein the key content access requirement represents a requirement that the frequency and importance of accessing key content are both higher than a preset requirement threshold; The preset filtering rule is constructed according to the target resource type variable value.

5. The method according to claim 1, characterized in that The webpage backup domain name is determined based on the following operations: According to the initial matching rules between the primary domain name and the backup domain name, a mapping relationship between the primary and backup domain names is established; In response to the operation and maintenance requirement change request, modify the initial matching rule to obtain a target matching rule; The primary and backup domain name mapping relationship is updated according to the target matching rule to obtain an updated primary and backup domain name mapping relationship; In the case that a backup domain name corresponding to the target domain name exists in the updated primary-backup domain name mapping relationship, the target domain name is determined to be a backup domain name for the web page.

6. The method according to claim 5, characterized in that The primary-backup domain name mapping relationship includes a primary domain name, a backup domain name, and a relationship status, wherein switching the resource primary domain name corresponding to the target resource type to the resource backup domain name includes: Determine a primary domain name corresponding to the resource primary domain name from a plurality of primary domain names in the primary-backup domain name mapping relationship; In a case where the relationship state corresponding to the primary domain name is a valid state, determining the backup domain name corresponding to the primary domain name as the resource backup domain name; The resource primary domain name corresponding to the target resource type is switched to the resource backup domain name.

7. The method according to claim 2, characterized in that The primary domain name of the webpage is determined based on the following operations: Using a query tool to query a database platform for a target primary domain name corresponding to the target web page; In the case that the target domain name is the same as the target primary domain name, the target domain name is determined to be the primary domain name of the webpage.

8. A device for switching between primary and backup domain names, characterized in that: The device comprises: A determination module, configured to determine a target domain name in a page access request in response to the page access request for the target page; A filtering module, for filtering resources in the target page based on preset filtering rules to determine a target resource type when the target domain name is a backup domain name of a web page, wherein the target resource type represents a high-access frequency element object that meets business requirements; The switching module is used to switch the resource primary domain name corresponding to the target resource type to the resource backup domain name based on the primary-backup domain name mapping relationship, wherein the primary-backup domain name mapping relationship represents a one-to-one correspondence between the primary domain name and the backup domain name.

9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Systems and methods for securely and transparently proxying saas applications through a cloud-hosted or on-premise network gateway for enhanced security and visibility

    CN110710184A

  • Switching method, device, equipment and computer storage medium

    CN111885145A

  • Webpage link updating method and device, equipment and medium

    CN115344801A

  • Domain name switching method and device and computer readable storage medium

    CN115955459A

  • Methods and devices for identifying tampered webpage and inentifying hijacked web address

    US20140380477A1