Master-slave domain name switching method, device, equipment, medium and product

By filtering the target resource type in the page access request and switching the primary domain name of the resource to the secondary domain name based on the primary and secondary domain name mapping relationship, the problem of poor flexibility and scalability of primary and secondary domain name switching in the existing technology is solved, and real-time access effectiveness and autonomous control are realized after network attacks.

CN119696916BActive Publication Date: 2025-12-05INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing primary and backup domain name switching technologies cannot synchronously replace multiple primary domain names in web page content in real time. They have poor flexibility and scalability, and rely on third-party domain name system services, which makes the web page content invalid after a network attack.

Method used

By responding to page access requests, the system filters target resource types based on preset filtering rules and switches the primary domain name of the resource to the secondary domain name based on the primary and secondary domain name mapping relationship, thereby achieving real-time replacement of resources and access effectiveness, and autonomously controlling the primary and secondary domain name switching process.

Benefits of technology

It enables real-time access to target page resources after a network attack, improves the efficiency and security of primary and backup domain name switching, enhances autonomy and controllability and flexibility, and avoids the problem of invalid resource access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696916B_ABST
    Figure CN119696916B_ABST
Patent Text Reader

Abstract

The present disclosure provides a primary and backup domain name switching method, device, equipment, medium and product, which can be applied to the technical fields of cloud computing and financial technology. 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 that the target domain name is a web page backup domain name, screening resources in the target page based on a preset filtering rule to determine a target resource type, wherein the target resource type represents a high access frequency element object that meets business requirements; based on a primary and backup domain name mapping relationship, switching a resource primary domain name corresponding to the target resource type to a 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.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of cloud computing and financial technology, in particular to a primary and backup domain name switching method, device, equipment, medium and product. BACKGROUND

[0002] With the increasing frequency of network attacks, setting a primary domain name and a backup domain name for a website is an effective method to improve the security of the website. The existing primary and backup domain name switching technology mainly parses access requests through a domain name system, and the switching and modification of the backup domain name rely on a third party of the domain name system service. In addition, after the webpage is attacked, the content in the webpage accessed based on the primary domain name may be in an invalid state, therefore, it is necessary to replace the primary domain name contained in the webpage content synchronously.

[0003] In the process of implementing the present disclosure, the inventors found that in the related art, for multiple primary domain names contained in webpage content, it is impossible to replace them into backup domain names in real time, and the replacement flexibility and scalability are poor. SUMMARY

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

[0005] According to a first aspect of the present disclosure, a primary and backup domain name switching method 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 a case where the target domain name is a webpage backup domain name, screening resources in the target page based on a preset filtering rule to determine a target resource type, wherein the target resource type represents a high access frequency element object meeting a business requirement; based on a primary and backup domain name mapping relationship, switching a resource primary domain name corresponding to the target resource type into a 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.

[0006] According to an embodiment of the present disclosure, the primary and backup domain name switching method further comprises: in a case where the target domain name is a webpage primary domain name and the webpage primary domain name is an invalid domain name, based on the primary and backup domain name mapping relationship, switching the webpage primary domain name into a webpage backup domain name; and accessing the target page based on the webpage backup domain name.

[0007] According to an embodiment of the present disclosure, in a case where the target domain name is a web page backup domain name, the target resource type is determined by screening the resources in the target page based on a preset filtering rule, which comprises: determining resource access demand from the obtained service resource access performance; determining the preset filtering rule based on the resource access demand; in a case where the target domain name is a web page backup domain name, triggering a traversal mechanism to traverse the source code corresponding to the target page; using a regular matching rule to map at least one resource address of the source code to determine the resource type corresponding to each of the at least one resource address; and determining the target resource type from the at least one resource type based on the preset filtering rule.

[0008] According to an embodiment of the present disclosure, the resource access demand comprises key content access demand and dynamic resource access demand; wherein, based on the resource access demand, the preset filtering rule is determined by: determining a target resource type variable value according to the key content access demand and the dynamic resource access demand, wherein the key content access demand represents a demand that the frequency and importance of accessing key content are both higher than a preset demand threshold; and constructing the preset filtering rule according to the target resource type variable value.

[0009] According to an embodiment of the present disclosure, the web page backup domain name is determined based on the following operations: constructing a primary-backup domain name mapping relationship according to an initial matching rule between a primary domain name and a backup domain name; modifying the initial matching rule to obtain a target matching rule in response to an operation and maintenance demand change request; 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 in a case where there is a backup domain name corresponding to the target domain name in the updated primary-backup domain name mapping relationship, determining that the target domain name is a web page backup domain name.

[0010] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship comprises a primary domain name, a backup domain name and a relationship state, wherein, switching the resource primary domain name corresponding to the target resource type to a resource backup domain name comprises: determining 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 an effective 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 web page primary domain name is determined based on the following operations: using a query tool to query a target primary domain name corresponding to a target web page from a database platform; and in a case where the target domain name is the same as the target primary domain name, determining that the target domain name is a web page primary domain name.

[0012] The second aspect of the present disclosure provides a primary and backup domain name switching device, comprising: a determination module configured to determine a target domain name in a page access request in response to a page access request for a target page; a filtering module configured to filter resources in the target page based on a preset filtering rule in a case where the target domain name is a web page backup domain name, and determine a target resource type, wherein the target resource type represents a high access frequency element object that meets a business requirement; and a switching module configured to switch a resource primary domain name corresponding to the target resource type to a resource backup domain name based on a primary and backup domain name mapping relationship, 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.

[0013] The third aspect of the present disclosure provides an electronic device, comprising: one or more processors; 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 method.

[0014] The fourth aspect of the present disclosure also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions are executed by a processor to implement the steps of the method.

[0015] The fifth aspect of the present disclosure also provides a computer program product comprising a computer program or instructions, wherein the computer program or instructions are executed by a processor to implement the steps of the method.

[0016] According to the primary and backup domain name switching method, device, equipment, medium and product provided by the present disclosure, in a case where the target domain name is a web page backup domain name, the resources in the target page are filtered based on a preset filtering rule to determine a target resource type; and based on a primary and backup domain name mapping relationship, a resource primary domain name corresponding to the target resource type is switched to a resource backup domain name. Since accessing the target page based on the web page backup domain name can determine that the target page has been attacked by a network attack, and then automatically triggering the synchronous switching of multiple groups of resource primary domain names corresponding to the target resource type in the target page to resource backup domain names each time the target page after being attacked by a network attack is accessed based on the web page backup domain name, the real-time access effectiveness of the resources in the target page is ensured, the problem of invalid access of the resources after the target page is attacked by a network attack is avoided, the preset filtering rule further improves the efficiency of the replacement of 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 the security, self-controllability and flexibility. BRIEF DESCRIPTION OF DRAWINGS

[0017] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure taken in conjunction with the accompanying drawings, in which:

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

[0019] Figure 2 A flowchart of the primary and secondary domain name switching method 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 structural block diagram of the primary and secondary domain name switching apparatus according to an embodiment of the present disclosure is schematically shown; and

[0022] Figure 5 A block diagram of an electronic device adapted to implement the primary and secondary domain name switching method 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. It should be understood, however, that the description which follows is merely exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description of embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it would be apparent to one skilled in the art that the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring the concepts of the present disclosure.

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

[0025] All terms used herein, including technical and scientific terms, have the same meanings as those generally understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings consistent with the context of the present specification, and should not be interpreted in an idealized or excessively formal manner.

[0026] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should generally be interpreted to include at least one of the items, unless otherwise defined (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C together, etc.).

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

[0028] Therefore, an embodiment of the present disclosure provides a primary and backup domain name switching method. In response to a page access request for a target page, a target domain name in the page access request is determined. In a case where the target domain name is a backup domain name of a webpage, resources in the target page are screened based on a preset filtering rule to determine a target resource type, wherein the target resource type represents a high-access-frequency element object that meets a business requirement. A resource primary domain name corresponding to the target resource type is switched into a resource backup domain name based on a primary and backup domain name mapping relationship, 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 and backup domain name switching method and the primary and backup domain name switching device provided by the present disclosure can be used in the field of financial technology, for example, financial institutions, and can also be used in any field other than the field of financial technology, for example, e-commerce platforms such as shopping websites, and therefore, the application field of the primary and backup domain name switching method and the primary and backup domain name switching device provided by the present disclosure is not limited.

[0030] In the technical solutions 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 for analysis, stored data, displayed data, etc.) involved are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portals for users to choose authorization or refusal.

[0031] In the scenario of making automated decisions by using personal information, the method, device and system provided by the embodiments of the present disclosure provide corresponding operation entrances for users to select to agree or reject the automated decision result; if the user selects to reject, the expert decision process is entered. The expression "automated decision" herein refers to the activity of automatically analyzing, evaluating the behavior habits, interests and hobbies, or economic, health, credit status, etc. of a person by a computer program, and making decisions. The expression "expert decision" herein refers to the activity of making decisions by personnel who are engaged in a certain field of work, have special experience, knowledge and skills, and reach a certain professional level.

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

[0033] As shown in Figure 1 , the application scenario 100 according to the embodiment can 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 a medium for providing 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 can 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, 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, the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

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

[0036] The server 105 can be a server providing various services, such as a background management server supporting the website browsed by the user using the first terminal device 101, the second terminal device 102, the third terminal device 103 (only as an example). The background management server can analyze and process the received user request data, etc., and feed back the processing result (such as a web page, information, or data, etc. obtained or generated according to the user request) to the terminal device.

[0037] It should be noted that the primary and backup domain name switching method provided by the embodiment of the disclosure can be generally executed by the server 105. Accordingly, the primary and backup domain name switching apparatus provided by the embodiment of the disclosure can be generally arranged in the server 105. The primary and backup domain name switching method provided by the embodiment of the disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating 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 apparatus provided by the embodiment of the disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating 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 above embodiment is only illustrative. According to the implementation needs, there can be any number of the first terminal device, the second terminal device, the third terminal device, the network and the server.

[0039] The primary and backup domain name switching method according to the embodiment of the disclosure will be described in detail based on the scenario described above. Figure 1 Figures 2-3 The primary and backup domain name switching method according to the embodiment of the disclosure will be described in detail based on the scenario described above.

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

[0041] As shown in Figure 2 The primary and backup domain name switching method 200 of the embodiment includes operations S210-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, in the case that the target domain name is a web page backup domain name, resources in the target page are filtered based on a preset filtering rule, and a target resource type is determined.

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

[0045] According to the embodiment of the disclosure, the target page is a web interface to be accessed, and the server intercepts a page access request sent by a user through a request interceptor, analyzes 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 an address of a target page, and a user can directly access resources on the target page through the target domain name.

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

[0048] According to an embodiment of the present disclosure, in a case where the target domain name is a backup domain name of a webpage, triggering the traversal mechanism to traverse resources in the target page includes: traversing, by a server, source code of the target page, the source code including the resources in the target page, and filtering, in the traversal process, the resources in the target page based on a preset filtering rule to determine a target resource type.

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

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

[0051] According to an embodiment of the present disclosure, the element object with a high access frequency is determined according to a business requirement, and then a key resource type is determined. The key resource type can also be determined according to an element object with a high security requirement and a high importance in constructing a webpage structure, for example, a HyperText Markup Language (HTML) element, a script element, a functional component element, and a hyperlink element.

[0052] According to an embodiment of the present disclosure, the preset filtering rule is defined according to the key resource type, and then a resource corresponding to the key resource type defined in the preset filtering rule is filtered from the resources in the target page, to obtain the target resource type. The target resource type represents an element object with a high access frequency that meets a business requirement.

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

[0054] According to an embodiment of the present disclosure, when the resource type of a resource is determined to be the target resource type, a resource master domain name of the resource is extracted from the response content, a resource backup domain name corresponding to the resource master domain name is determined according to the master-backup domain name mapping relationship, and the replacement is performed. The traversal is stopped until all resource master domain names of the target resource types in the response content are switched to resource backup domain names.

[0055] According to an embodiment of the present disclosure, after the switching is completed, information in Request Headers of response content obtained by the server in response to the page access request is returned to the client, and the resources in the target page are normally displayed and used in the browser of the client.

[0056] According to an embodiment of the present disclosure, since the target page can be determined to be attacked by the network attack based on the webpage backup domain name, and the multiple sets of resource primary domain names corresponding to the target resource types in the target page are automatically triggered to be switched to the resource backup domain names, the real-time access validity of the resources in the target page is ensured, the problem of invalid access of the resources after the target page is attacked by the network attack is avoided, the preset filtering rules further improve the efficiency of the replacement of the multiple sets of resource primary domain names, the switching and configuration of the primary and backup domain names do not need to depend on the third party, and the security, self-controllability and flexibility are improved.

[0057] According to an embodiment of the present disclosure, the primary and backup domain name switching method comprises: in the case that the target domain name is a webpage primary domain name and the webpage primary domain name is an invalid domain name, switching the webpage primary domain name to a webpage backup domain name based on a primary and backup domain name mapping relationship; and accessing the target page based on the webpage backup domain name.

[0058] According to an embodiment of the present disclosure, one target page corresponds to one webpage primary domain name, in the case that the target domain name is the same as the webpage primary domain name, it is determined whether the webpage primary domain name is valid, and in the case that the webpage primary domain name is a valid domain name, the server directly returns the response content to the client.

[0059] According to an embodiment of the present disclosure, in the case that the webpage primary domain name is an invalid domain name, the primary and backup domain name mapping relationship is obtained from a database, the webpage backup domain name corresponding to the webpage primary domain name is determined from the primary and backup domain name mapping relationship, and the webpage primary domain name is switched to the webpage backup domain name.

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

[0061] According to an embodiment of the present disclosure, if the target domain name is a web page main domain name and is a valid domain name, it is represented that the target page can be safely accessed, the target page is directly accessed, and the response content is returned; if the target domain name is a web page main domain name and is an invalid domain name, it is represented that the target page handles a non-safe access state, needs to be replaced by a web page backup domain name for access, and based on the web page backup domain name access, the respective resource main domain names of the switching target resource types are triggered, the effectiveness and safety of resource access in the target page are ensured, and the data security is improved.

[0062] According to an embodiment of the present disclosure, in the case that the target domain name is a web page backup domain name, the resources in the target page are screened based on a preset filtering rule, and the target resource type is determined, including: determining resource access demand from the obtained business resource access performance; determining the preset filtering rule based on the resource access demand; in the case that the target domain name is a web page backup domain name, triggering a traversal mechanism to traverse the source code corresponding to the target page; using a regular matching rule to map at least one resource address of the source code to determine the respective resource types corresponding to the at least one resource address; and determining the target resource type from the at least one resource type based on the preset filtering rule.

[0063] According to an embodiment of the present disclosure, the business resource access performance is obtained by analyzing the historical access requests to the target page, and the business resource access performance is the performance generated by accessing the 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, the high-access-frequency resources, the important resources, and the high-security resources are determined from the obtained business resource access performance, and then the resource access demand is determined according to the high-access-frequency resources, the important resources, and the high-security resources, the key resource type parameters are constructed based on the resource access demand, and the preset filtering rule is designed according to the key resource type parameters.

[0065] According to an embodiment of the present disclosure, in the case that the target domain name is a web page backup domain name, 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, a regular matching rule is used to map the resource address of the source code to determine the resource type corresponding to the resource address, for example, the page access request is http: / / www.xxx.com.cn / test.html, and the resource address: / test.html is mapped to obtain the resource type text / html according to the regular matching rule.

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

[0068] According to an embodiment of the present disclosure, the target resource type is determined from at least one resource type in the source code according to a plurality of key resource types defined in the 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 backup domain name of the resource main domain name corresponding to the target resource type is replaced, thereby improving the efficiency of resource main backup domain name replacement.

[0070] According to an embodiment of the present disclosure, the resource access requirement includes key content access requirement and dynamic resource access requirement; wherein, based on the resource access requirement, the preset filtering rule is determined, including: 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 higher than a preset requirement threshold; and constructing the preset filtering rule according to 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 high-frequency and important key resources. For example, the key resources include functional component elements, hyperlink elements, etc.

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

[0073] According to an embodiment of the present disclosure, the target resource is determined according to the key content access requirement and the dynamic resource access requirement, the target resource includes the key resource and the dynamic resource, the target resource type variable value is determined according to the resource type of the target resource, and the judgment condition is defined in the preset filtering rule according to the resource type variable and the target resource type variable value to be screened.

[0074] For example, the target resource is a style element and a script element, the target resource type variable value is determined 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), wherein the resource type variable is xxx_content_type.

[0075] According to an embodiment of the present disclosure, the webpage backup domain name 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 change request of an operation and maintenance requirement 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 as the webpage backup domain name in a case where the updated primary-backup domain name mapping relationship contains a backup domain name corresponding to the target domain name.

[0076] According to an embodiment of the present disclosure, the initial matching rule can be obtained from a shared database platform, and the primary-backup domain name mapping relationship is constructed in a 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 an embodiment of the present disclosure, an operation and maintenance personnel can modify and extend the correspondence between the primary domain name and the backup domain name according to actual requirements, modify the initial matching rule in response to a change request of an operation and maintenance requirement of the operation and maintenance personnel to obtain a target matching rule, and the target matching rule defines 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 requirements, the target domain name in the page access request is matched with backup domain name information in the primary-backup domain name mapping relationship at a response time after responding to the page access request, and the target domain name is determined as the webpage backup domain name in a case where the matching is successful.

[0080] According to an embodiment of the present disclosure, the operation and maintenance personnel can dynamically update the primary-backup domain name mapping relationship in the database according to actual requirements, ensure real-time effectiveness of the primary-backup domain name mapping relationship, and improve accuracy of primary-backup domain name replacement.

[0081] According to an embodiment of the present disclosure, the primary-backup domain name mapping relationship includes a primary domain name, a backup domain name, and a relationship state, and switching the resource primary domain name corresponding to the target resource type to a resource backup domain name includes: determining the 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; determining the backup domain name corresponding to the primary domain name as the resource backup domain name in a case where the relationship state corresponding to the primary domain name is an effective state; 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 state, a creation date, and an update date.

[0083] Table 1 shows a field meaning system table of the master-backup domain name mapping relationship according to an embodiment of the present disclosure.

[0084]

[0085] According to an embodiment of the present disclosure, the relationship state includes a valid state and an invalid state, and is_deleted is 0, which represents that this group of master-backup domain name mapping relationships is deleted and in an invalid state; is_deleted is 1, which represents that this group of master-backup domain name mapping relationships is not deleted and in a valid state.

[0086] Table 2 shows a master-backup 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 web master domain name A; in the case that the web master domain name A is a valid domain name, the target page is accessed, the source code of the target page is obtained, and the source code is traversed to obtain the resource master domain name B and the resource master domain name C. <link type="text / css" href=" / / 资源主域名B / test.css"> <script src=" / / resource master domain name C / test.js" ”, and the source code is traversed to obtain the resource master domain name B and the resource master domain name C.

[0089] According to an embodiment of the present disclosure, in the case that the web master domain name A is an invalid domain name, the web master domain name A is switched to the web backup domain name B according to the master-backup domain name mapping relationship, the target page is accessed based on the web backup domain name A, the page access request http: / / web backup domain name A / index.html is obtained, the source code is traversed, the resource master domain name is switched according to the master-backup domain name mapping relationship, and the switched source code is obtained. <link type="text / css" href=" / / 资源备域名B / test.css"> <script src=" / / resource backup domain name C / test.js" ”, and the response content is returned to the client according to the switched source code.

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

[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 to obtain the target domain name in the page access request, judges whether the target domain name is the web main domain name, in the case that the target domain name is the web main domain name and the web main domain name is a valid domain name, the server directly returns the response content to the client; in the case that the web main domain name is an invalid domain name, the web main domain name is replaced with the web backup domain name, the target page is accessed based on the web backup domain name to obtain the page access request; the target domain name in the page access request is judged again, it is determined that the target domain name is the web backup domain name, the traversal mechanism is triggered to traverse the resources in the target page, in the traversal process, the resources in the target page are screened based on the preset filtering rule, in the case that the resource type corresponding to the resource does not conform to the preset filtering rule, the resource is directly returned to the client; otherwise, the resource main domain name of the resource is replaced with the resource backup domain name according to the main-backup domain name mapping relationship, and the resource is returned to the client.

[0092] According to the embodiment of the present disclosure, the operation and maintenance personnel can maintain the original mapping relationship in the database. If it is necessary to update the main-backup domain name mapping relationship, the dynamic reading module on the system will read and update the main-backup domain name mapping relationship regularly.

[0093] According to the embodiment of the present disclosure, the web main domain name is determined based on the following operation: the target main domain name corresponding to the target web page is queried from the database platform by using the query tool; in the case that the target domain name is the same as the target main domain name, it is determined that the target domain name is the web main domain name.

[0094] According to the embodiment of the present disclosure, the target main domain name corresponding to the target web page is queried from the shared database platform by using the query tool, and in the case that the target domain name is the same as the target main domain name, it is determined that the target domain name is the web main domain name.

[0095] According to the embodiment of the present disclosure, one target page corresponds to one web main domain name, and in the case that the target domain name is the same as the web main domain name, it is determined that the target domain name is the web main domain name.

[0096] According to the embodiment of the present disclosure, whether the target domain name is the web main domain name can be judged according to the level of the target domain name, including: in the case that the level of the target domain name is the highest level domain name, it is determined that the target domain name is the web main domain name, otherwise, it is the web backup domain name.

[0097] According to the embodiment of the present disclosure, the efficiency and matching accuracy of determining the web domain name can be accelerated by combining the query tool, the domain name level and the like.

[0098] Based on the above main-backup domain name switching method, the present disclosure further provides a main-backup domain name switching device. The device will be described in detail below. Figure 4 The device will be described in detail below.

[0099] Figure 4 A structural block diagram of a primary and backup domain name switching apparatus is shown.

[0100] As shown in the figure, the primary and backup domain name switching apparatus 400 of the embodiment includes a determination module 410, a filtering module 420, and a switching module 430. Figure 4 The determination module 410 is configured to determine a target domain name in a page access request in response to a page access request for a target page. In an embodiment, the determination module 410 can be configured to perform the operation S210 described above, and thus details are not repeated here.

[0101] The determination module 410 is configured to determine a target domain name in a page access request in response to a page access request for a target page. In an embodiment, the determination module 410 can be configured to perform the operation S210 described above, and thus details are not repeated here.

[0102] The filtering module 420 is configured to filter resources in the target page based on a preset filtering rule in a case where the target domain name is a web page backup domain name, and determine a target resource type, where the target resource type represents a high access frequency element object that meets a business requirement. In an embodiment, the filtering module 420 can be configured to perform the operation S220 described above, and thus details are not repeated here.

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

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

[0105] The identification module is configured to switch a web page primary domain name to a web page backup domain name based on the primary and backup domain name mapping relationship in a case where the target domain name is the web page primary domain name and the web page primary domain name is an invalid domain name.

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

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

[0108] The first filtering sub-module is configured to determine a resource access requirement from the obtained business resource access performance.

[0109] The second filtering sub-module is configured to determine a preset filtering rule based on the resource access requirement.

[0110] The third filtering sub-module is configured to trigger a traversal mechanism to traverse source code corresponding to the target page in a case where the target domain name is the web page backup domain name.

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

[0112] The fifth filtering sub-module is configured to determine a target resource type from the at least one resource type based on a preset filtering rule.

[0113] According to an embodiment of the present disclosure, the second filtering sub-module includes a first filtering unit and a second filtering unit.

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

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

[0116] According to an embodiment of the present disclosure, the master-slave domain name switching device 400 further includes a construction module, a response module, an update module, and a first matching module.

[0117] The construction module is configured to construct a master-slave domain name mapping relationship according to an initial matching rule between a master domain name and a slave domain name.

[0118] The response module is configured to modify the initial matching rule to obtain a target matching rule in response to a change request of an operation and maintenance demand.

[0119] The update module is configured to update the master-slave domain name mapping relationship according to the target matching rule to obtain an updated master-slave domain name mapping relationship.

[0120] The first matching module is configured to determine that the target domain name is a web slave domain name in a case where the updated master-slave domain name mapping relationship includes a slave domain name corresponding to the target domain name.

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

[0122] The first switching sub-module is configured to determine a master domain name corresponding to a resource master domain name from a plurality of master domain names in the master-slave domain name mapping relationship.

[0123] The second switching sub-module is configured to determine a slave domain name corresponding to the master domain name as a resource slave domain name in a case where a relationship state corresponding to the master domain name is an effective state.

[0124] The third switching sub-module is configured to switch a resource master domain name corresponding to the target resource type to a resource slave domain name.

[0125] According to embodiments of this disclosure, the primary / backup domain name switching device 400 further includes a query module and a second matching module.

[0126] The query module is used to retrieve the target main domain name corresponding to the target webpage from the database platform using query tools.

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

[0128] According to embodiments of this disclosure, any plurality of modules among the determining module 410, filtering module 420, and switching module 430 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the determining module 410, filtering module 420, and switching module 430 can be at least partially implemented as hardware circuitry, 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-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the determining module 410, filtering module 420, and switching module 430 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0129] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a primary / backup domain name switching method according to an embodiment of the present disclosure.

[0130] like Figure 5 As shown, an 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 portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include 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] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in one or more memories.

[0132] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 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 disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0133] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0134] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0135] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the primary / backup domain name switching method provided in embodiments of this disclosure.

[0136] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

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

[0138] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0139] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0141] Those skilled in the art will understand that the features described in the various embodiments of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0142] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A method for switching between primary and backup domain names, characterized in that, The method includes: In response to a page access request for a target page, determine the target domain name in the page access request; When the target domain name is a backup domain name for a webpage, the resources in the target page are filtered based on preset filtering rules to determine the target resource type, wherein the target resource type represents a high-frequency access element object that meets business needs; Based on the primary and backup domain name mapping relationship, the primary domain name of the resource corresponding to the target resource type is switched to the backup domain name of the resource. The primary and backup domain name mapping relationship represents the 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 includes: If the target domain name is the main domain name of the webpage and the main domain name of the webpage is an invalid domain name, the main domain name of the webpage will be switched to the backup domain name of the webpage based on the primary and backup domain name mapping relationship. Access the target page based on the webpage's backup domain name.

3. The method according to claim 1, characterized in that, When the target domain name is a backup domain name for a webpage, resources on the target page are filtered based on preset filtering rules to determine the target resource types, including: Determine resource access requirements from the acquired business resource access performance; Based on the resource access requirements, the preset filtering rules are determined; If the target domain name is a backup domain name for a webpage, a traversal mechanism is triggered to traverse the source code corresponding to the target page. Using regular expression matching rules, at least one resource address of the source code is mapped to determine the resource type corresponding to each of the at least one resource address; Based on the preset filtering rules, the 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 critical content access requirements and dynamic resource access requirements; wherein, based on the resource access requirements, the preset filtering rules are determined as follows: Based on the key content access requirements and the dynamic resource access requirements, the target resource type variable value is determined, wherein the key content access requirements represent the requirements where the frequency and importance of accessing key content are both higher than the preset requirement threshold. Based on the target resource type variable value, construct the preset filtering rules.

5. The method according to claim 1, characterized in that, The backup domain name for the webpage is determined based on the following operations: Based on the initial matching rules between the primary domain name and the backup domain name, construct the primary and backup domain name mapping relationship; In response to a request for changes in operational and maintenance requirements, the initial matching rules are modified to obtain the target matching rules; The primary and backup domain name mapping relationship is updated according to the target matching rule to obtain the updated primary and backup domain name mapping relationship; If a backup domain name corresponding to the target domain name exists in the updated primary and backup domain name mapping relationship, the target domain name is determined to be a backup domain name for the webpage.

6. The method according to claim 5, characterized in that, The primary and backup domain name mapping relationship includes the primary domain name, the backup domain name, and the relationship status. Switching the primary domain name corresponding to the target resource type to the backup domain name includes: Determine the primary domain name corresponding to the resource primary domain name from among the multiple primary domain names in the primary and backup domain name mapping relationship; If the relationship status corresponding to the primary domain name is valid, the backup domain name corresponding to the primary domain name will be determined as the resource backup domain name; Switch the primary domain name of the resource corresponding to the target resource type to the backup domain name of the resource.

7. The method according to claim 2, characterized in that, The main domain name of the webpage was determined based on the following operations: Use a query tool to retrieve the target main domain name corresponding to the target webpage from the database platform; If the target domain name is the same as the target main domain name, the target domain name is determined to be the main domain name of the webpage.

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

9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is 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 instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.

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

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