APP multinational network request adaptation method and device, storage medium and terminal

By extracting the region information in the original network request information of the APP and determining the target domain name based on the predetermined mapping relationship, the problem that the APP cannot support multiple data centers at the same time is solved, and flexible data center adaptation for the APP when users in different countries are accessed.

CN119743533APending Publication Date: 2025-04-01QINGDAO HAIER TECH +2
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202411742151.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, APPs cannot support multiple data centers at the same time, resulting in the need to add data centers and adapt to multiple data centers when users in different countries access.

Method used

By extracting the area information from the original network request information to be accessed to the APP, the target domain name is determined based on the extracted area information and the predetermined mapping relationship, the original domain name is replaced with the target domain name, and the update request information is sent to the server interface to which the target domain name belongs to, so as to request network services.

Benefits of technology

It realizes that the terminal can enable the APP to access the corresponding data center according to the area information based on the area information, solves the problem that the APP cannot support multiple data centers at the same time, and simplifies the workload of the APP to adapt to multiple data centers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743533A_ABST
    Figure CN119743533A_ABST
Patent Text Reader

Abstract

The invention discloses an APP multinational network request adaptation method and device, a storage medium and a terminal, and relates to the technical field of smart home, the APP multinational network request adaptation method comprises the following steps: extracting regional information from original network request information of a to-be-accessed APP, the original network request information comprising an original domain name; determining a first target domain name according to the regional information and a first predetermined mapping relationship, the first predetermined mapping relationship being a mapping relationship between the regional information and the domain name; and replacing an 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 a server interface to which the first target domain name belongs to request a network service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and more specifically, to a method, device, storage medium and terminal for adapting APP multi-country network requests. Background Art

[0002] When an APP (Application) is released, it may have only one data center or only a few data centers, that is, only one server or a few servers. As the APP is used by more and more users in a wider range, the number of countries that the APP needs to support will increase. However, the laws and regulations on personal privacy in different countries are not exactly the same, and there may be differences. In this case, it is necessary to add data centers for different countries. After adding data centers, the APP needs to adapt to multiple data centers, that is, the terminal where the APP is located needs to consider how to make the APP support multiple data centers at the same time. Therefore, it is necessary to develop a plan to adapt to multiple data centers. Summary of the invention

[0003] The embodiments of the present invention provide an APP multi-country network request adaptation method, device, storage medium and terminal, aiming to solve the problem in the prior art that APP cannot support multiple data centers at the same time.

[0004] In a first aspect, an embodiment of the present invention provides an APP multi-country network request adaptation method, the method being applied to a terminal, comprising:

[0005] Extracting 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;

[0006] Determine a first target domain name according to the area information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the area 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 first update request information, and the first update request information is sent to a server interface to which the first target domain name belongs to request network service.

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

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

[0010] At least when the interface path in the original network request information is not located in the predetermined ignore list, the area information is extracted from the original network request information of the APP to be accessed.

[0011] In an optional solution, when at least the interface path in the original network request information is not located in the predetermined ignore list, extracting the area information from the original network request information of the APP to be accessed includes:

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

[0013] At least when the interface path in the original network request information is not located in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the area information is extracted from the original network request information of the APP to be accessed, an APP of the predetermined type corresponds to a server interface, and the type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

[0014] In an optional solution, determining whether the type of the APP to be accessed is a predetermined type includes:

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

[0016] In an optional solution, after extracting the area information from the original network request information of the APP to be accessed, the method further includes:

[0017] In the case where the area information in the original network request information does not exist in the first predetermined mapping relationship, determining the name of the server to be accessed according to the original domain name and the second predetermined mapping relationship, wherein the second predetermined mapping relationship is a mapping relationship between a domain name and a server name, and the server to be accessed is a server to which the original domain name belongs;

[0018] Determine a second target domain name according to the name of the server to be accessed and a third predetermined mapping relationship, wherein the third predetermined mapping relationship is a mapping relationship between the name of the server 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 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 service.

[0020] In an optional solution, determining the second target domain name according to the name of the server to be accessed and the third predetermined mapping relationship includes:

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

[0022] In an optional solution, at least when the name of the server to be accessed is in a predetermined name list, determining the second target domain name according to the name of the server to be accessed and the third predetermined mapping relationship includes:

[0023] When 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] In a second aspect, an embodiment of the present invention provides an APP multi-country network request adaptation device, which is applied to a terminal and includes:

[0025] An extraction module, used to 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;

[0026] A first determination module, configured to determine a first target domain name according to the area information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the area 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, obtain 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 service.

[0028] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is run, the APP multi-country network request adaptation method provided by any embodiment of the present invention is executed.

[0029] In a fourth aspect, an embodiment of the present invention provides a terminal, comprising 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] An embodiment of the present invention provides an APP multi-country network request adaptation method, device, storage medium and terminal, which extracts regional information from the original network request information of the APP to be accessed, and determines the first target domain name according to the extracted regional information and the 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 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, and the first update request information is sent to the server interface to which the first target domain name belongs to request network service, so that the terminal can enable the APP to be accessed to access the data center corresponding to the regional information according to the regional information, thereby solving the problem in the prior art that the APP cannot support multiple data centers at the same time, and realizing that the APP cannot support multiple data centers at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

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

[0034] Figure 2 It is a flowchart of a first APP multi-country network request adaptation method according to an embodiment of the present application;

[0035] Figure 3 It is a flowchart of a second APP multi-country network request adaptation method according to an embodiment of the present application;

[0036] Figure 4 It is a timing diagram of a method for adapting APP multi-country network requests according to an embodiment of the present application;

[0037] Figure 5It is a structural block diagram of an APP multi-country network request adaptation device according to an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0040] According to one aspect of an embodiment of the present application, a method for adapting APP multi-country network requests is provided. The method for adapting APP multi-country network requests is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for adapting APP multi-country network requests can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0041] The network may include but is not limited to at least one of the following: a wired network, a wireless network. The wired network may include but is not limited to at least one of the following: a wide area network, a metropolitan area network, and a local area network. The wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0042] like Figure 2 As shown, the present application provides an APP multi-country network request adaptation method, including:

[0043] S110, extracting 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 a server interface to which the original domain name belongs.

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

[0046] S120: Determine a first target domain name according to the area information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the area information and the domain name;

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

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

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

[0050] The technical solution of this embodiment extracts regional information from the original network request information of the APP to be accessed, and determines the first target domain name based on the extracted regional information and the first predetermined mapping relationship. Each regional information in the first predetermined mapping relationship has a corresponding domain name of the server interface of the server, or a group of regional information corresponds to the domain name of the server interface 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, and the first update request information is sent to the server interface to which the first target domain name belongs to request network service, so that the terminal can enable the APP to be accessed to access the data center corresponding to the regional information according to the regional information, thereby solving the problem in the prior art that the APP cannot support multiple data centers at the same time.

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

[0052] Step S210, determining whether the interface path in the original network request information is located in a predetermined ignore list, wherein the predetermined ignore list includes 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: extracting the area 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 located in the predetermined ignore list.

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

[0056] In an optional solution, step S220 may be implemented as follows:

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

[0058] Step S320, at least when the interface path in the original network request information is not located in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the area information is extracted from the original network request information of the APP to be accessed, an APP of the predetermined type corresponds to a server interface, and 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 predetermined type of APP is an existing user, and the existing user refers to the old version of the APP, that is, this type of user has only one data center regardless of which country it belongs to, and can only access the corresponding data center, and cannot adapt to the data center. Therefore, in order to further provide a more flexible APP adaptation data center function, while setting the predetermined ignore list, it is determined whether the type of the APP to be accessed is the predetermined type. If not, the APP to be accessed adapts to the data center and replaces the domain name. If so, the APP to be accessed is not compatible with the data center and uses the original domain name to request network services.

[0060] In an optional solution, step S310 may be implemented as follows:

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

[0062] Specifically, if the original network request information includes an existing user identifier, indicating that the APP to be accessed is an existing user, a predetermined existing interface list is set, and the interface paths of the server interfaces corresponding to multiple existing users are stored in the predetermined existing interface list. If the interface path in the original network request information is located in the predetermined existing interface list, it indicates that the APP to be accessed is an existing user. In order to accurately determine whether the APP to be accessed is an existing user, a dual determination scheme is adopted to determine whether the original network request information includes an existing user identifier and whether the interface path in the original network request information is located in the predetermined existing interface list. Only when the original network request information contains an existing user identifier and the interface path in the original network request information is located in the predetermined existing interface list, it is determined that the APP to be accessed is an existing user. Otherwise, the APP to be accessed is not an existing user.

[0063] In an optional solution, after step S110, the method further includes:

[0064] Step S410, when the area 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 a domain name and a server name, and the server to be accessed is a 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, determining a second target domain name according to the name of the server to be accessed and a third predetermined mapping relationship, wherein the third predetermined mapping relationship is a mapping relationship between the name of the server and the domain name;

[0067] Specifically, the second target domain name is a domain name corresponding to the name of the server to be accessed in a 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 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 service.

[0069] Specifically, if the area information in the original network request information does not exist in the first predetermined mapping relationship, it means that the area information is not defined in the first predetermined mapping relationship. At this time, the name of the server to be accessed is determined according to the original domain name and the second predetermined mapping relationship, and 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, and the second update request information is sent to the server interface to which the second target domain name belongs to request network service, thereby realizing the transfer of network services of all APPs that one data center is responsible for 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 that server A is responsible for are transferred to server B for processing, thereby further providing a more flexible APP adaptation data center function.

[0070] In an optional solution, step S420 may be implemented as follows:

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

[0072] Specifically, in order to further provide a more flexible APP adaptation data center function, a preset name list is set. The preset name list sets the names of multiple servers that do not require domain name replacement. That is, if the APP to be accessed requests access to these servers, the APP to be accessed is not adapted to the data center and uses the original domain name to request network services. If the APP to be accessed does not request access to these servers, the APP to be accessed adapts to the data center and replaces the domain name.

[0073] In an optional solution, at least when the name of the server to be accessed is in the predetermined name list, determining the second target domain name according to the name of the server to be accessed and the third predetermined mapping relationship may be implemented as follows:

[0074] When 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 is not compatible with the data center and uses the original domain name to request network services.

[0076] Example 1

[0077] like Figure 3 As shown, the present application provides an APP multi-country network request adaptation method, including:

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

[0079] Step 2: If the answer to step 1 is no, determine whether the original network request information includes an existing user identifier; if the answer to 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 the answer to step 2 is no, determine whether the interface path in the original network request information is in the predetermined stock interface list; if the answer to step 2 is yes, send the original network request information to the server interface to which the original domain name belongs to request network service;

[0081] Step 4: If the answer to step 3 is no, extract the region information from the original network request information of the APP to be accessed, and determine whether the first predetermined mapping relationship contains the region information in the original network request information; if the answer to step 3 is yes, send the original network request information to the server interface to which the original domain name belongs to request network service;

[0082] Step 5: If the answer to step 4 is yes, go to step 6; if the answer to step 4 is no, go to step 7;

[0083] Step 6: Determine the first target domain name according to the area information and the first predetermined mapping relationship, replace the original domain name in the original network request information with the first target domain name, 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 service;

[0084] Step 7: Determine the name of the server to be accessed according to the original domain name and the second predetermined mapping relationship, and determine whether the name of the server to be accessed is in the predetermined name list;

[0085] Step 8, if step 7 is yes, determining whether the name of the server to be accessed is located in a third predetermined mapping relationship, and if step 7 is no, sending the original network request information to the server interface to which the original domain name belongs to request a network service;

[0086] Step 9: If step 8 is yes, determine the second target domain name based on 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, 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 service. If step 8 is no, send the original network request information to the server interface to which the original domain name belongs to request network service.

[0087] Example 2

[0088] like Figure 4As shown, the terminal in the prior art is generally composed of an H5 front-end, an API layer, a plug-in layer, a native front-end and a network layer. The H5 front-end is a type of front-end page displayed to users in the APP, that is, a page written in Html code. The API layer is an API interface layer for H5 to interact with native code. The plug-in layer is a specific implementation layer of the native code logic called by the API layer interface. The native front-end is a type of front-end page displayed to users in the APP, that is, a page written in native code (for example, java, kotlin, OC, swift, etc.). The network layer is a network capability layer for accessing the server interface. The present application sets an interceptor after the network layer of the terminal to execute the APP multi-country network request adaptation method, so that the front-end does not need to modify the code, thereby avoiding the problem that the front-end code appears to be very bloated and difficult to maintain, and greatly simplifies the workload of APP adapting to multiple data centers. In the prior art, most APPs adopt hybrid development, that is, H5 and native pages are used to interact with users at the same time. The APP network request adaptation method is applied as follows:

[0089] like Figure 4 As shown, H5 login is a common way to log in. The process of this login method is as follows:

[0090] The H5 front-end calls the login interface of the API layer;

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

[0092] The plugin layer calls the interface of the network layer;

[0093] After being processed by the interceptor, the interceptor executes the APP multi-country network request adaptation method;

[0094] Request the server, the server executes the login logic, and determines whether the current user is an existing user (if it is an existing user, the existing user ID needs to be returned to the H5 front-end). The server returns the login status and existing user ID to the H5 front-end step by step.

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

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

[0097] After being processed by the interceptor, the interceptor executes the APP multi-country network request adaptation method;

[0098] Request the server, the server executes the login logic, and determines whether the current user is an existing user (if it is an existing user, the existing user ID needs to be returned to the H5 front-end). The server returns the login status and existing user ID to the native front-end step by step.

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

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

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

[0102] The plugin layer calls the interface to the network layer;

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

[0104] Request the server, and the server executes the interface logic;

[0105] The server returns the interface execution results to the H5 front end step by step.

[0106] like Figure 4 As shown, the native method initiates a network request and uses certain functions on the native front-end page to initiate a network request. The interface call process is similar to the native login method:

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

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

[0109] Request the server, and the server executes the interface logic;

[0110] The server returns the interface execution results to the native front end step by step.

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

[0112] An extraction module 510 is used to 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;

[0113] A first determination module 520, configured to determine a first target domain name according to the region information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the region 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, obtain 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 service.

[0115] In an optional solution, the original network request information further includes: an interface path, and the extraction module includes:

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

[0117] The extraction submodule is used to extract the area 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 located in the predetermined ignore list.

[0118] In an optional solution, the extraction submodule includes:

[0119] A determination unit, configured to determine whether the type of the APP to be accessed is a predetermined type;

[0120] An extraction unit is used to extract the area 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 located in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, wherein an APP of the predetermined type corresponds to a server interface, and the type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

[0121] In an optional solution, the determining unit is used to:

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

[0123] In an optional solution, the device further includes:

[0124] A second determination module is used to determine the name of the server to be accessed according to the original domain name and a second predetermined mapping relationship when the area information in the original network request information does not exist in the first predetermined mapping relationship, wherein the second predetermined mapping relationship is a mapping relationship between a domain name and a server name, and the server to be accessed is a server to which the original domain name belongs;

[0125] A second determination module, configured to determine a second target domain name according to the name of the server to be accessed and a third predetermined mapping relationship, wherein the third predetermined mapping relationship is a mapping relationship between the name of the server 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, obtain 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 service.

[0127] In an optional solution, the second determining module is used to:

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

[0129] In an optional solution, the second determining module is used to:

[0130] When 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 is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for adapting APP multi-country network requests, characterized in that: The method is applied to a terminal, comprising: Extracting 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; Determine a first target domain name according to the area information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the area 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 first update request information, and the first update request information is sent to a server interface to which the first target domain name belongs to request network service.

2. The APP multi-country network request adaptation method according to claim 1 is characterized in that: The original network request information also includes: interface path, and the region information is extracted from the original network request information of the APP to be accessed, including: Determining whether the interface path in the original network request information is located in a predetermined ignore list, wherein the predetermined ignore list includes interface paths of multiple server interfaces; At least when the interface path in the original network request information is not located in the predetermined ignore list, the area information is extracted from the original network request information of the APP to be accessed.

3. The APP multi-country network request adaptation method according to claim 2 is characterized in that: The extracting the area information from the original network request information of the APP to be accessed comprises: Determine whether the type of the APP to be accessed is a predetermined type; At least when the interface path in the original network request information is not located in the predetermined ignore list and the type of the APP to be accessed is not the predetermined type, the area information is extracted from the original network request information of the APP to be accessed, an APP of the predetermined type corresponds to a server interface, and the type of the APP being the predetermined type indicates that only the APP is allowed to access the corresponding server interface.

4. The APP multi-country network request adaptation method according to claim 3 is characterized in that: The determining whether the type of the APP to be accessed is a predetermined type includes: In a case where the original network request information does not include an existing user identifier or the interface path in the original network request information is not located in a predetermined existing interface list, it is determined that the type of the APP to be accessed is not the predetermined type; in a case where the original network request information includes the existing user identifier and the interface path in the original network request information is located in the predetermined existing interface list, it is determined that the type of the APP to be accessed is the predetermined type, the existing user identifier is used to identify the type of the APP as the predetermined type, and the predetermined existing interface list includes 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 is characterized in that: After extracting the area information from the original network request information of the APP to be accessed, the method further includes: In the case where the area information in the original network request information does not exist in the first predetermined mapping relationship, determining the name of the server to be accessed according to the original domain name and the second predetermined mapping relationship, wherein the second predetermined mapping relationship is a mapping relationship between a domain name and a server name, and the server to be accessed is a server to which the original domain name belongs; Determine a second target domain name according to the name of the server to be accessed and a third predetermined mapping relationship, wherein the third predetermined mapping relationship is a mapping relationship between the name of the server and the domain name; The original domain name in the original network request information is replaced with the second target domain name to obtain 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 service.

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

7. The APP multi-country network request adaptation method according to claim 6 is characterized in that: The determining the second target domain name according to 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: When 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.

8. An APP multi-country network request adaptation device, characterized in that: The device is applied to a terminal, and includes: An extraction module, used to 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; A first determination module, configured to determine a first target domain name according to the area information and a first predetermined mapping relationship, where the first predetermined mapping relationship is a mapping relationship between the area 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, obtain 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 service.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program, when running, executes the APP multi-country network request adaptation method described in any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Method and system for accessing website

    CN102647482A

  • Transparent proxy authentication via DNS processing

    CN106068639A

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

    CN107451250A

  • Site access method and device, site registration method and device, equipment and storage medium

    CN111953811A

  • Client domain name switching method and device, electronic equipment and storage medium

    CN115333927A