APP multi-country network request adaptation methods, devices, storage media and terminals

CN119743533BActive Publication Date: 2026-11-17QINGDAO HAIER TECH +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411742151.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2026-11-17
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

[0003]本发明实施例提供一种APP多国网络请求适配方法、装置、存储介质及终端,目的在于解决现有技术中APP无法同时支持多数据中心的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743533B_ABST
    Figure CN119743533B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and terminal for adapting to multi-country network requests in an app, relating to the field of smart home technology. The method for adapting to multi-country network requests in an app includes: extracting regional information from the original network request information of the app to be accessed, the original network request information including the original domain name; determining a first target domain name based on the regional information and a first predetermined mapping relationship, the first predetermined mapping relationship being the mapping relationship between regional information and domain name; replacing the original domain name in the original network request information with the first target domain name to obtain first update request information, and sending the first update request information to the server interface to which the first target domain name belongs to request network services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a method, device, storage medium, and terminal for adapting to multi-country network requests of an app. Background Technology

[0002] When an app is released, it may initially have only one data center or a few data centers, meaning only one server or a few servers. As the app gains wider adoption and more users, the number of countries it needs to support will increase. However, different countries have different laws and regulations regarding personal privacy. In this case, it is necessary to add data centers for different countries. After adding data centers, the app needs to be compatible with multiple data centers, meaning the device on which the app is running needs to consider how to enable the app to support multiple data centers simultaneously. Therefore, a multi-data center compatibility solution needs to be developed. Summary of the Invention

[0003] This invention provides a method, apparatus, storage medium, and terminal for adapting to multi-country network requests in an app, aiming to solve the problem that apps cannot simultaneously support multiple data centers in the prior art.

[0004] In a first aspect, embodiments of the present invention provide a method for adapting to multi-country network requests in an app, the method being applied to a terminal, comprising:

[0005] Extract the region information from the original network request information of the APP to be connected, wherein the original network request information includes the original domain name;

[0006] Based on the regional information and the first predetermined mapping relationship, a first target domain name is determined, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name;

[0007] The original domain name in the original network request information is replaced with the first target domain name to obtain the first update request information, and the first update request information is sent to the server interface to which the first target domain name belongs to request network services.

[0008] In one optional scheme, the original network request information further includes: an interface path, and regional information extracted from the original network request information of the APP to be accessed, including:

[0009] Determine whether the interface path in the original network request information is located in a predetermined ignore list, the predetermined ignore list including the interface paths of multiple server interfaces;

[0010] If the interface path in the original network request information is not in the predetermined ignore list, the region information is extracted from the original network request information of the APP to be accessed.

[0011] In one optional approach, if the interface path in the original network request information is not located in the predetermined ignore list, extracting the region information from the original network request information of the APP to be accessed includes:

[0012] Determine whether the type of the APP to be connected is a predetermined type;

[0013] If the interface path in the original network request information is not in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the region information is extracted from the original network request information of the APP to be accessed. One APP of the predetermined type corresponds to one server interface. The type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

[0014] In one optional approach, determining whether the type of the app to be accessed is a predetermined type includes:

[0015] If the original network request information does not include an existing user identifier or the interface path in the original network request information is not in the predetermined existing interface list, the type of the APP to be accessed is determined to be not the predetermined type. If the original network request information includes the existing user identifier and the interface path in the original network request information is in the predetermined existing interface list, the type of the APP to be accessed is determined to be the predetermined type. The existing user identifier is used to identify that the type of the APP is the predetermined type. The predetermined existing interface list includes the interface paths of server interfaces corresponding to multiple APPs of the predetermined type.

[0016] In one alternative approach, after extracting the region information from the original network request information of the app to be accessed, the method further includes:

[0017] If the region information in the original network request information does not exist in the first predetermined mapping relationship, the name of the server to be accessed is determined according to the original domain name and the second predetermined mapping relationship, wherein the second predetermined mapping relationship is a mapping relationship between the domain name and the server name, and the server to be accessed is the server to which the original domain name belongs.

[0018] Based on the name of the server to be accessed and the third predetermined mapping relationship, the second target domain name is determined, wherein the third predetermined mapping relationship is the mapping relationship between the server name and the domain name;

[0019] The original domain name in the original network request information is replaced with the second target domain name to obtain the second update request information, and the second update request information is sent to the server interface to which the second target domain name belongs to request network services.

[0020] In one optional scheme, determining the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship includes:

[0021] At least if the name of the server to be accessed is in a predetermined name list, the second target domain name is determined based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the predetermined name list includes the names of multiple servers.

[0022] In one alternative approach, determining the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship, at least when the name of the server to be accessed is in a predetermined name list, includes:

[0023] If the name of the server to be accessed is in the predetermined name list and the name of the server to be accessed is in the third predetermined mapping relationship, the second target domain name is determined according to the name of the original network request information and the third predetermined mapping relationship.

[0024] Secondly, embodiments of the present invention provide an APP multi-country network request adaptation device, the device being applied to a terminal, comprising:

[0025] The extraction module is used to extract region information from the original network request information of the APP to be accessed, wherein the original network request information includes the original domain name;

[0026] The first determining module is used to determine a first target domain name based on the regional information and a first predetermined mapping relationship, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name;

[0027] The first replacement sending module is used to replace the original domain name in the original network request information with the first target domain name to obtain the first update request information, and send the first update request information to the server interface to which the first target domain name belongs in order to request network services.

[0028] Thirdly, embodiments of the present invention provide a computer-readable storage medium, the computer-readable storage medium including a stored program, wherein the program executes the APP multi-country network request adaptation method provided in any embodiment of the present invention when it runs.

[0029] Fourthly, embodiments of the present invention provide a terminal, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the APP multi-country network request adaptation method provided in any embodiment of the present invention through the computer program.

[0030] This invention provides a method, apparatus, storage medium, and terminal for adapting to multi-country network requests in an app. By extracting regional information from the original network request information of the app to be accessed, and determining a first target domain name based on the extracted regional information and a first predetermined mapping relationship, each regional information in the first predetermined mapping relationship has a corresponding server domain name, or a group of regional information corresponds to the domain name of a server interface. This means each country uses a different data center, or a group of countries shares a single data center. The original domain name in the original network request information is replaced with the first target domain name to obtain first update request information, which is then sent to the server interface of the first target domain name to request network services. This enables the terminal to allow the app to access the data center corresponding to the regional information, solving the problem in the prior art where apps cannot simultaneously support multiple data centers. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram of the hardware environment for an APP multi-country network request adaptation method according to an embodiment of this application;

[0034] Figure 2 This is a flowchart illustrating the first method for adapting multi-country network requests in an app according to an embodiment of this application.

[0035] Figure 3 This is a flowchart illustrating the second method for adapting multi-country network requests in an app according to an embodiment of this application.

[0036] Figure 4 This is a timing diagram illustrating an APP multi-country network request adaptation method according to an embodiment of this application;

[0037] Figure 5This is a structural block diagram of an APP multi-country network request adaptation device according to an embodiment of this application. Detailed Implementation

[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0039] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0040] According to one aspect of the embodiments of this application, a method for adapting to multi-country network requests in an app is provided. This method is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0041] The network may include, but is not limited to, at least one of the following: wired network, wireless network. The wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0042] like Figure 2 As shown, this application provides a method for adapting network requests to multiple countries in an app, including:

[0043] S110. Extract the region information from the original network request information of the APP to be accessed, wherein the original network request information includes the original domain name;

[0044] Specifically, the original network request information indicates a request to access the server interface to which the original domain name belongs.

[0045] Specifically, the regional information is a country code, and a country code is used to identify a country.

[0046] S120. Determine a first target domain name based on the regional information and the first predetermined mapping relationship, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name;

[0047] Specifically, the first target domain name is the domain name corresponding to the extracted regional information in the first predetermined mapping relationship.

[0048] Specifically, in the first predetermined mapping relationship, each region information has a corresponding server interface domain name, or a group of region information has a corresponding server interface domain name, so that each country corresponds to a different data center, or a group of countries share a data center.

[0049] S130. Replace the original domain name in the original network request information with the first target domain name to obtain the first update request information, and send the first update request information to the server interface to which the first target domain name belongs to request network services.

[0050] The technical solution of this embodiment extracts regional information from the original network request information of the APP to be accessed. Based on the extracted regional information and the first predetermined mapping relationship, a first target domain name is determined. Each regional information in the first predetermined mapping relationship has a corresponding server interface domain name, or a group of regional information corresponds to the server interface domain name of a server. That is, each country uses a different data center, or a group of countries share a data center. The original domain name in the original network request information is replaced with the first target domain name to obtain the first update request information. The first update request information is sent to the server interface to which the first target domain name belongs to request network services. This enables the terminal to enable the APP to access the data center corresponding to the regional information according to the regional information, thereby solving the problem that the APP cannot support multiple data centers at the same time in the prior art.

[0051] In an optional embodiment, the original network request information further includes: an interface path, and step S110 can be implemented as follows:

[0052] Step S210: Determine whether the interface path in the original network request information is located in a predetermined ignore list, wherein the predetermined ignore list includes the interface paths of multiple server interfaces;

[0053] Specifically, the interface path in the original network request information and the original domain name belong to the same server interface.

[0054] Step S220: If the interface path in the original network request information is not in the predetermined ignore list, extract the region information from the original network request information of the APP to be accessed.

[0055] Specifically, in order to provide a more flexible APP adaptation to the data center function, a pre-defined ignore list is set up. The pre-defined ignore list sets up the interface paths of multiple server interfaces that do not require domain name replacement. That is, if the APP to be connected requests access to these server interfaces, the APP to be connected does not adapt to the data center and requests network services using the original domain name. If the APP to be connected does not request access to these server interfaces, the APP to be connected adapts to the data center and performs domain name replacement.

[0056] In an alternative approach, step S220 can be implemented as follows:

[0057] Step S310: Determine whether the type of the APP to be accessed is a predetermined type;

[0058] Step S320: If at least the interface path in the original network request information is not in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the region information is extracted from the original network request information of the APP to be accessed. One APP of the predetermined type corresponds to one server interface. The type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

[0059] Specifically, the pre-defined type of APP refers to existing users, which means that older versions of the APP are only available to users in one data center regardless of their country of origin. They can only access the corresponding data center and cannot adapt to other data centers. Therefore, in order to provide a more flexible APP data center adaptation function, while setting the pre-defined ignore list, it is determined whether the type of the APP to be connected is a pre-defined type. If not, the APP to be connected adapts to the data center and the domain name is replaced. If so, the APP to be connected does not adapt to the data center and the original domain name is used to request network services.

[0060] In an alternative approach, step S310 can be implemented as follows:

[0061] If the original network request information does not include an existing user identifier or the interface path in the original network request information is not in the predetermined existing interface list, the type of the APP to be accessed is determined to be not the predetermined type. If the original network request information includes the existing user identifier and the interface path in the original network request information is in the predetermined existing interface list, the type of the APP to be accessed is determined to be the predetermined type. The existing user identifier is used to identify that the type of the APP is the predetermined type. The predetermined existing interface list includes the interface paths of server interfaces corresponding to multiple APPs of the predetermined type.

[0062] Specifically, if the original network request information contains an existing user identifier, it indicates that the APP to be connected is an existing user. A pre-defined list of existing interfaces is set up, and the interface paths of the server interfaces corresponding to multiple existing users are stored in the pre-defined list of existing interfaces. If the interface path in the original network request information is in the pre-defined list of existing interfaces, it indicates that the APP to be connected is an existing user. In order to accurately determine whether the APP to be connected is an existing user, a dual determination scheme is adopted, which determines whether the original network request information contains an existing user identifier and whether the interface path in the original network request information is in the pre-defined list of existing interfaces. Only if the original network request information contains an existing user identifier and the interface path in the original network request information is in the pre-defined list of existing interfaces is the APP to be connected determined to be an existing user; otherwise, the APP to be connected is not an existing user.

[0063] In an alternative embodiment, after step S110, the method further includes:

[0064] Step S410: If the region information in the original network request information does not exist in the first predetermined mapping relationship, determine the name of the server to be accessed according to the original domain name and the second predetermined mapping relationship. The second predetermined mapping relationship is a mapping relationship between the domain name and the server name. The server to be accessed is the server to which the original domain name belongs.

[0065] Specifically, the name of the server to be accessed is the name of the server corresponding to the original domain name in the second predetermined mapping relationship.

[0066] Step S420: Determine the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the third predetermined mapping relationship is the mapping relationship between the server name and the domain name;

[0067] Specifically, the second target domain name is the domain name corresponding to the name of the server to be accessed in the third predetermined mapping relationship.

[0068] Step S430: Replace the original domain name in the original network request information with the second target domain name to obtain the second update request information, and send the second update request information to the server interface to which the second target domain name belongs to request network services.

[0069] Specifically, if the region information in the original network request information does not exist in the first predetermined mapping relationship, it means that the region information is not defined in the first predetermined mapping relationship. In this case, the name of the server to be accessed is determined according to the original domain name and the second predetermined mapping relationship. The second target domain name is determined according to the name of the server to be accessed and the third predetermined mapping relationship. The original domain name in the original network request information is replaced with the second target domain name to obtain the second update request information. The second update request information is sent to the server interface to which the second target domain name belongs to request network services. This realizes the transfer of network services of all APPs under the responsibility of one data center to another data center for processing. For example, in the third predetermined mapping relationship, the name of server A corresponds to the domain name of server B. Then, the network services of all APPs under the responsibility of server A are transferred to server B for processing, thereby further providing a more flexible APP adaptation data center function.

[0070] In an alternative implementation, step S420 can be performed as follows:

[0071] At least if the name of the server to be accessed is in a predetermined name list, the second target domain name is determined based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the predetermined name list includes the names of multiple servers.

[0072] Specifically, in order to further provide a more flexible APP adaptation data center function, a pre-defined name list is set up. The pre-defined name list sets up the names of multiple servers that do not require domain name replacement. That is, if the APP to be connected requests to access these servers, the APP to be connected does not adapt to the data center and requests network services using the original domain name. If the APP to be connected does not request to access these servers, the APP to be connected adapts to the data center and performs domain name replacement.

[0073] In one alternative approach, at least if the name of the server to be accessed is in a predetermined name list, determining the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship can be implemented as follows:

[0074] If the name of the server to be accessed is in the predetermined name list and the name of the server to be accessed is in the third predetermined mapping relationship, the second target domain name is determined according to the name of the interface of the server to be accessed and the third predetermined mapping relationship.

[0075] Specifically, if the name of the server to be accessed does not exist in the third predetermined mapping relationship, the APP to be accessed can adapt to the data center and replace the domain name. If the name of the server to be accessed does not exist in the third predetermined mapping relationship, it means that the name of the server to be accessed is not defined in the third predetermined mapping relationship. If so, the APP to be accessed does not adapt to the data center and uses the original domain name to request network services.

[0076] Example 1

[0077] like Figure 3 As shown, this application provides a method for adapting network requests to multiple countries in an app, including:

[0078] Step 1: Determine whether the interface path in the original network request information is in the pre-defined ignore list;

[0079] Step 2: If Step 1 is not, determine whether the original network request information includes the existing user identifier. If Step 1 is yes, send the original network request information to the server interface to which the original domain name belongs to request network services.

[0080] Step 3: If step 2 is not, determine whether the interface path in the original network request information is in the pre-defined list of existing interfaces. If step 2 is yes, send the original network request information to the server interface to which the original domain name belongs to request network services.

[0081] Step 4: If step 3 is not true, extract the region information from the original network request information of the APP to be accessed, and determine whether the first predetermined mapping relationship exists in the region information in the original network request information. If step 3 is true, send the original network request information to the server interface to which the original domain name belongs to request network services.

[0082] Step 5: If step 4 is yes, proceed to step 6; if step 4 is no, proceed to step 7.

[0083] Step 6: Based on the regional information and the first predetermined mapping relationship, determine the first target domain name, replace the original domain name in the original network request information with the first target domain name to obtain the first update request information, and send the first update request information to the server interface to which the first target domain name belongs to request network services;

[0084] Step 7: Based on the original domain name and the second pre-defined mapping relationship, determine the name of the server to be accessed, and determine whether the name of the server to be accessed is in the pre-defined name list;

[0085] Step 8: If step 7 is yes, then determine whether the name of the server to be accessed is in the third predetermined mapping relationship; if step 7 is no, then send the original network request information to the server interface to which the original domain name belongs to request network services.

[0086] Step 9: If step 8 is yes, then determine the second target domain name according to the name of the server to be accessed and the third predetermined mapping relationship, replace the original domain name in the original network request information with the second target domain name to obtain the second update request information, and send the second update request information to the server interface to which the second target domain name belongs to request network services. If step 8 is no, then send the original network request information to the server interface to which the original domain name belongs to request network services.

[0087] Example 2

[0088] like Figure 4As shown, existing terminals generally consist of an H5 frontend, an API layer, a plugin layer, a native frontend, and a network layer. The H5 frontend is a type of frontend page displayed to the user in the app, i.e., a page written using HTML code. The API layer is the API interface layer for interaction between H5 and native code. The plugin layer is the specific implementation layer of the native code logic called by the API layer. The native frontend is another type of frontend page displayed to the user in the app, i.e., a page written using native code (e.g., Java, Kotlin, Objective-C, Swift, etc.). The network layer is the network capability layer for accessing server interfaces. This application sets an interceptor after the terminal's network layer to execute the app's multi-country network request adaptation method, eliminating the need to modify the frontend code. This avoids the problem of the frontend code becoming very bloated and difficult to maintain, greatly simplifying the workload of app adaptation to multiple data centers. In existing technologies, most apps adopt hybrid development, i.e., simultaneously using H5 and native pages to interact with the user. The app network request adaptation method is applied as follows:

[0089] like Figure 4 As shown, H5 login is a common method. The login process for this method is as follows:

[0090] H5 frontend calls the login interface of API layer;

[0091] API layer calls the interface of plugin layer;

[0092] The plugin layer calls the network layer's interface;

[0093] After processing by the interceptor, the interceptor executes the APP's multi-country network request adaptation method;

[0094] The system requests the server to execute the login logic and determine whether the current user is an existing user (if so, the existing user identifier needs to be returned to the H5 frontend). The server then returns the login status and existing user identifier to the H5 frontend step by step.

[0095] like Figure 4 As shown, native login is the most basic user interaction method for an app. The login process for this method is as follows:

[0096] The native front-end calls the login interface of the network layer;

[0097] After processing by the interceptor, the interceptor executes the APP's multi-country network request adaptation method;

[0098] The system requests the server to execute the login logic and determine whether the current user is an existing user (if so, the existing user identifier needs to be returned to the H5 frontend). The server then returns the login status and existing user identifier to the native frontend level by level.

[0099] like Figure 4 As shown, when H5 initiates a network request, and certain functions are used on the H5 front-end page to initiate a network request, the interface call process is similar to that of H5 login:

[0100] H5 front-end calls the corresponding function interface of API layer;

[0101] API layer calls the interface of plugin layer;

[0102] The plugin layer calls the network layer's interface;

[0103] After processing by the interceptor, the interceptor executes the APP network request adaptation method;

[0104] The server is requested to execute the interface logic.

[0105] The server returns the API execution results to the H5 frontend step by step.

[0106] like Figure 4 As shown, the native method initiates a network request by using certain functions on the native front-end page. The API call process is similar to that of the native login method.

[0107] The native front-end calls the corresponding functional interfaces of the network layer;

[0108] After processing by the interceptor, the interceptor executes the APP network request adaptation method;

[0109] The server is requested to execute the interface logic.

[0110] The server returns the API execution results to the native frontend step by step.

[0111] like Figure 5 As shown in the figure, this application embodiment provides an APP multi-country network request adaptation device, including:

[0112] Extraction module 510 is used to extract region information from the original network request information of the APP to be accessed, wherein the original network request information includes the original domain name;

[0113] The first determining module 520 is used to determine a first target domain name based on the regional information and a first predetermined mapping relationship, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name;

[0114] The first replacement sending module 530 is used to replace the original domain name in the original network request information with the first target domain name to obtain the first update request information, and send the first update request information to the server interface to which the first target domain name belongs in order to request network services.

[0115] In one alternative approach, the original network request information further includes: an interface path; the extraction module includes:

[0116] The determination submodule is used to determine whether the interface path in the original network request information is located in a predetermined ignore list, the predetermined ignore list including the interface paths of multiple server interfaces;

[0117] An extraction submodule is used to extract the region information from the original network request information of the APP to be accessed, at least when the interface path in the original network request information is not in the predetermined ignore list.

[0118] In one alternative embodiment, the extraction submodule includes:

[0119] A determining unit is used to determine whether the type of the APP to be accessed is a predetermined type;

[0120] The extraction unit is used to extract the region information from the original network request information of the APP to be accessed, at least when the interface path in the original network request information is not in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type. One APP of the predetermined type corresponds to one server interface, and the type of the APP is the predetermined type, which means that only the APP is allowed to access the corresponding server interface.

[0121] In one alternative embodiment, the determining unit is configured to:

[0122] If the original network request information does not include an existing user identifier or the interface path in the original network request information is not in the predetermined existing interface list, the type of the APP to be accessed is determined to be not the predetermined type. If the original network request information includes the existing user identifier and the interface path in the original network request information is in the predetermined existing interface list, the type of the APP to be accessed is determined to be the predetermined type. The existing user identifier is used to identify that the type of the APP is the predetermined type. The predetermined existing interface list includes the interface paths of server interfaces corresponding to multiple APPs of the predetermined type.

[0123] In one alternative embodiment, the device further includes:

[0124] The second determining module is used to determine the name of the server to be accessed based on the original domain name and the second predetermined mapping relationship when the region information in the original network request information does not exist in the first predetermined mapping relationship. The second predetermined mapping relationship is a mapping relationship between the domain name and the server name, and the server to be accessed is the server to which the original domain name belongs.

[0125] The second determining module is used to determine the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the third predetermined mapping relationship is the mapping relationship between the server name and the domain name;

[0126] The second replacement sending module is used to replace the original domain name in the original network request information with the second target domain name to obtain the second update request information, and send the second update request information to the server interface to which the second target domain name belongs in order to request network services.

[0127] In one alternative embodiment, the second determining module is configured to:

[0128] At least if the name of the server to be accessed is in a predetermined name list, the second target domain name is determined based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the predetermined name list includes the names of multiple servers.

[0129] In one alternative embodiment, the second determining module is configured to:

[0130] If the name of the server to be accessed is in the predetermined name list and the name of the server to be accessed is in the third predetermined mapping relationship, the second target domain name is determined according to the name of the interface of the server to be accessed and the third predetermined mapping relationship.

[0131] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for adapting to a request of a multi-national network of an APP, characterized in that, The method is applied to a terminal and includes: Extract the region information from the original network request information of the APP to be connected, wherein the original network request information includes the original domain name; Based on the regional information and the first predetermined mapping relationship, a first target domain name is determined, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name; The original domain name in the original network request information is replaced with the first target domain name to obtain the first update request information, and the first update request information is sent to the server interface to which the first target domain name belongs to request network services; The method further includes, after extracting the region information from the original network request information of the APP to be connected, the following: If the region information in the original network request information does not exist in the first predetermined mapping relationship, the name of the server to be accessed is determined according to the original domain name and the second predetermined mapping relationship, wherein the second predetermined mapping relationship is a mapping relationship between the domain name and the server name, and the server to be accessed is the server to which the original domain name belongs. Based on the name of the server to be accessed and the third predetermined mapping relationship, a second target domain name is determined, wherein the third predetermined mapping relationship is the mapping relationship between the server name and the domain name; The original domain name in the original network request information is replaced with the second target domain name to obtain the second update request information, and the second update request information is sent to the server interface to which the second target domain name belongs to request network services.

2. The method of claim 1, wherein the APP multi-national network request adaptation method is characterized by, The original network request information also includes: the interface path, and regional information extracted from the original network request information of the APP to be connected, including: Determine whether the interface path in the original network request information is located in a predetermined ignore list, the predetermined ignore list including the interface paths of multiple server interfaces; If the interface path in the original network request information is not in the predetermined ignore list, the region information is extracted from the original network request information of the APP to be accessed.

3. The method of claim 2, wherein the APP multi-national network request adaptation method is characterized by, When the interface path in the original network request information is not in the predetermined ignore list, the extraction of the region information from the original network request information of the APP to be accessed includes: Determine whether the type of the APP to be connected is a predetermined type; If the interface path in the original network request information is not in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the region information is extracted from the original network request information of the APP to be accessed. One APP of the predetermined type corresponds to one server interface. The type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

4. The method of claim 3, wherein the APP multi-national network request adaptation method is characterized by, Determining whether the type of the APP to be accessed is a predetermined type includes: If the original network request information does not include an existing user identifier or the interface path in the original network request information is not in the predetermined existing interface list, the type of the APP to be accessed is determined to be not the predetermined type. If the original network request information includes the existing user identifier and the interface path in the original network request information is in the predetermined existing interface list, the type of the APP to be accessed is determined to be the predetermined type. The existing user identifier is used to identify that the type of the APP is the predetermined type. The predetermined existing interface list includes the interface paths of server interfaces corresponding to multiple APPs of the predetermined type.

5. The APP multi-country network request adaptation method according to claim 1, characterized in that, The step of determining the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship includes: At least if the name of the server to be accessed is in a predetermined name list, the second target domain name is determined based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the predetermined name list includes the names of multiple servers.

6. The APP multi-country network request adaptation method according to claim 5, characterized in that, The step of determining the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship, at least when the name of the server to be accessed is in the predetermined name list, includes: If the name of the server to be accessed is in the predetermined name list and the name of the server to be accessed is in the third predetermined mapping relationship, the second target domain name is determined according to the name of the original network request information and the third predetermined mapping relationship.

7. An APP multi-country network request adaptation device, characterized in that, The device is applied to a terminal and includes: The extraction module is used to extract region information from the original network request information of the APP to be accessed, wherein the original network request information includes the original domain name; The first determining module is used to determine a first target domain name based on the regional information and a first predetermined mapping relationship, wherein the first predetermined mapping relationship is the mapping relationship between the regional information and the domain name; The first replacement sending module is used to replace the original domain name in the original network request information with the first target domain name to obtain the first update request information, and send the first update request information to the server interface to which the first target domain name belongs in order to request network services; The second determining module is used to determine the name of the server to be accessed based on the original domain name and the second predetermined mapping relationship when the region information in the original network request information does not exist in the first predetermined mapping relationship. The second predetermined mapping relationship is a mapping relationship between the domain name and the server name, and the server to be accessed is the server to which the original domain name belongs. The second determining module is used to determine the second target domain name based on the name of the server to be accessed and the third predetermined mapping relationship, wherein the third predetermined mapping relationship is the mapping relationship between the server name and the domain name; The second replacement sending module is used to replace the original domain name in the original network request information with the second target domain name to obtain the second update request information, and send the second update request information to the server interface to which the second target domain name belongs in order to request network services.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the APP multi-country network request adaptation method according to any one of claims 1 to 6.

9. A terminal, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the APP multi-country network request adaptation method according to any one of claims 1 to 6 through the computer program.

Citation Information

Patent Citations

  • Internet access method and device, storage medium and electronic equipment

    CN107451250A

  • Multi-user center access method and device

    CN115878909A

  • CDN (Content Delivery Network) request scheduling method and device, electronic equipment and storage medium

    CN116233127A

  • Request updating method and device, storage medium and electronic device

    CN119011667A