Model calling method and device based on geographic position, equipment and storage medium

By obtaining the client's IP address, GPS coordinates and language code, combining the geographical location database and semi-vector calculation, the target region code is determined, and the problem of selecting a suitable AI model in different countries or regions is solved, and more efficient model calls are achieved.

CN120494129APending Publication Date: 2025-08-15GUANGZHOU LANGO ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510568086.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, how to accurately select the appropriate AI model based on the user's geographical location and language preferences to meet their needs, especially under the differences in laws and regulations and network environments in different countries or regions, the output effects of the AI model are inconsistent.

Method used

By obtaining the client's IP address, GPS coordinates and language code, using IP geographic location database and semi-vector calculation combined with language code analysis, the target region code is determined, and the appropriate AI model is selected based on the region code.

Benefits of technology

It improves the accuracy of the target area code, ensures that the selected AI model is more in line with user needs, and improves the efficiency and effectiveness of model calling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120494129A_ABST
    Figure CN120494129A_ABST
Patent Text Reader

Abstract

The invention provides a model calling method and device based on a geographic position, equipment and a storage medium, and the method comprises the steps: obtaining user equipment information, including an IP address, a GPS coordinate and a language code, of a client, carrying out the comprehensive analysis of the IP address, the GPS coordinate and the language code, determining a target region code, and transmitting the target region code to the client; the accuracy of the target area code is improved through analysis of factors such as the geographic position and the language code of the user, the target model is determined according to the target area code and the preset model list, the client is connected with the AI interface of the target model to call the target model, the more suitable target model is determined, and the user experience is improved. And the model calling requirement of the user can be better met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a geographic location-based model calling method, apparatus, device, and storage medium. Background Art

[0002] With the rapid development of artificial intelligence (AI) applications, more and more users are leveraging their clients to invoke AI models to solve problems in daily life or work, saving time on independent research or data collection and improving efficiency. However, there are many different types of AI models. The applicable AI models and the output effects of using them vary based on the laws and regulations, network environment, language preferences, and other factors in the user's country or region. Therefore, in order to better meet users' AI model invocation needs, it is crucial to determine the appropriate AI model for their use. Summary of the Invention

[0003] The present application provides a geographic location-based model calling method, apparatus, device, and storage medium to address at least one problem in the related art. The technical solution is as follows:

[0004] In a first aspect, an embodiment of the present application provides a method for model invocation based on geographic location, comprising:

[0005] Obtaining user device information of the client, including IP address, GPS coordinates, and language code;

[0006] Performing a comprehensive analysis of the IP address, GPS coordinates, and language code to determine the target region code;

[0007] Determining a target model according to the target area code and the preset model list;

[0008] The client is connected to the AI interface of the target model to call the target model.

[0009] In one embodiment, the performing a comprehensive analysis on the IP address, GPS coordinates, and language code to determine the target region code includes:

[0010] Performing IP matching on the IP address through an IP geolocation database service to determine a first region result;

[0011] Performing GPS matching on the GPS coordinates by using a haversine calculation method to determine a second region result;

[0012] performing a correlation analysis on the language code to determine a third region result;

[0013] determining a region type according to the first region result, the second region result, and the third region result;

[0014] A target region code is determined according to the region type and the language code.

[0015] In one embodiment, determining the region type according to the first region result, the second region result, and the third region result includes:

[0016] comparing the first regional result, the second regional result, and the third regional result;

[0017] When at least one of the first region result, the second region result, and the third region result represents domestic, determining the region type as a domestic region;

[0018] When the first region result, the second region result, and the third region result all represent foreign countries, determining the region type as a foreign region;

[0019] Otherwise, the region type is determined to be an invalid region.

[0020] In one embodiment, determining the target region code according to the region type and the language code includes:

[0021] When the region type is an invalid region, determining the target region code as a default region;

[0022] When the region type is a domestic region, determining the target region code as domestic;

[0023] When the region type is a foreign region, the language code and the country code are mapped to determine the degree of mapping, and the distance between the target area corresponding to the second region result and the GPS coordinates and the preset value corresponding to the successful match of the first region result are determined. A confidence score is determined based on the mapping degree, the distance, and the preset value, and a target region code is determined based on the confidence score.

[0024] In one embodiment, determining a confidence score based on the mapping degree, the distance, and the preset value, and determining a target area code based on the confidence score includes:

[0025] Normalizing the mapping degree, the distance, and the preset value to obtain a normalized mapping degree, a normalized distance, and a normalized preset value;

[0026] A confidence score is obtained by performing a weighted calculation based on the normalized mapping degree, the normalized distance, the normalized preset value, the mapping degree weight, the distance weight, and the weight of the preset value;

[0027] When the confidence score is greater than or equal to the score threshold, the target area code is determined to be a foreign country; when the confidence score is less than the score threshold, the target area code is determined to be a default area or a manual determination is prompted.

[0028] In one embodiment, determining the target model according to the target area code and the preset model list includes:

[0029] When the target region code is a default region, determining the default model in the preset model list as the target model;

[0030] When the target area code is domestic, determining a first candidate model list containing all domestic models in a preset model list, randomly determining a target model from the first candidate model list, or obtaining operating parameters of each domestic model, determining a first selection weight for each domestic model based on a first preset weight and the operating parameters of each domestic model, and selecting the domestic model corresponding to the largest first selection weight as the target model;

[0031] When the target area code is foreign, determine a second candidate model list containing all foreign models in the preset model list, randomly determine the target model from the second candidate model list, or obtain the operating parameters of each of the foreign models, and determine the second selection weight of each of the foreign models according to the second preset weight and the operating parameters of each of the foreign models, and use the foreign model corresponding to the largest second selection weight as the target model.

[0032] In one embodiment, the method further comprises:

[0033] In the process of calling the target model, the operating parameters of the target model are monitored in real time. When the operating parameters of the target model do not meet the preset threshold, if the target model is one of the domestic models, the domestic model with the largest first selection weight other than the current target model is switched to as the new target model; if the target model is one of the foreign models, the foreign model with the largest second selection weight other than the current target model is switched to as the new target model;

[0034] or,

[0035] The number of calls of each domestic model and each foreign model within the specified time is counted respectively, and the number of calls is compared with the number threshold. The domestic models and foreign models with a number of calls greater than the number threshold are determined as high-frequency models, and the high-frequency models are LRU cached. The high-frequency models in the LRU cache are used to call when the same client issues a call request or when a call request with the same content is received within a specified time interval.

[0036] In a second aspect, an embodiment of the present application provides a model calling device based on geographic location, comprising:

[0037] An acquisition module is used to obtain user device information of the client, wherein the user device information includes IP address, GPS coordinates and language code;

[0038] A first determination module is used to perform a comprehensive analysis of the IP address, GPS coordinates, and language code to determine a target area code;

[0039] A second determining module is used to determine a target model according to the target area code and a preset model list;

[0040] A calling module is used to connect the client to the AI interface of the target model to call the target model.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method in any one of the above-mentioned embodiments.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method in any one of the above-mentioned embodiments.

[0043] The beneficial effects of the above technical solution include at least:

[0044] By obtaining the client's user device information, including IP address, GPS coordinates and language code, a comprehensive analysis of the IP address, GPS coordinates and language code is performed to determine the target area code. The accuracy of the target area code is improved by combining the user's geographic location and language code and other factors. Based on the target area code and the preset model list, the target model is determined. The client is connected to the AI interface of the target model to call the target model and determine a more suitable target model, which is conducive to better meeting the user's model calling needs.

[0045] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in this application and should not be construed as limiting the scope of this application.

[0047] Figure 1 This is a flowchart of the steps of a geographic location-based model calling method according to an embodiment of the present application;

[0048] Figure 2 This is a structural block diagram of a model calling device based on geographic location according to an embodiment of the present application;

[0049] Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0050] Hereinafter, only certain exemplary embodiments are briefly described. As will be appreciated by those skilled in the art, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and description are to be regarded as illustrative in nature and not restrictive.

[0051] Reference Figure 1 , a flowchart of a model calling method based on geographic location according to an embodiment of the present application is shown. The model calling method based on geographic location may include at least steps S100-S400:

[0052] S100: Obtain user device information of the client.

[0053] It should be noted that the client includes but is not limited to the user's mobile phone, tablet, computer, vehicle terminal and other electronic devices. User device information (UserDeviceInfo structure) includes but is not limited to IP address (ip_address), GPS coordinates (gps_location), device type (device_type), network type (network_type) and language code (language_code). After obtaining the user device information, pre-processing such as normalization, legitimacy verification and missing value filling can be performed. For example, if the GPS coordinate latitude or longitude exceeds [-90,90] or [-180,180], it is considered an invalid coordinate and triggers the GPS fallback process. The coordinate is re-acquired or directly determined to be invalid. The result of the second region is subsequently determined to be invalid and cannot represent domestic or foreign conditions. At the same time, when analyzing data, the IP address, GPS coordinates, etc. can be desensitized (xxx.xxx.xxx.***), and only 4 decimal places are retained for GPS. AES-256 encryption is used during transmission or storage, and OAuth2.0 authorization is introduced to ensure the security of subsequent AI interface calls and avoid unauthorized access or malicious attacks.

[0054] S200: Comprehensively analyze the IP address, GPS coordinates, and language code to determine the target area code.

[0055] S300: Determine a target model according to the target area code and the preset model list.

[0056] S400: Connect the client to the AI interface of the target model to call the target model.

[0057] The geographic location-based model calling method of the embodiment of the present application can be executed by an electronic control unit, controller, processor, etc. of a terminal such as a computer, mobile phone, tablet, or vehicle-mounted terminal, or can be executed by a cloud server.

[0058] The technical solution of the embodiment of the present application obtains the user device information of the client, including the IP address, GPS coordinates and language code, performs a comprehensive analysis of the IP address, GPS coordinates and language code, determines the target area code, combines the analysis with factors such as the user's geographical location and language code, improves the accuracy of the target area code, determines the target model based on the target area code and the preset model list, connects the client to the AI interface of the target model to call the target model, and determines a more suitable target model, which is conducive to better meeting the user's model calling needs.

[0059] In one embodiment, step S200 includes steps S210-S240:

[0060] S210: Perform IP matching on the IP address through an IP geographic location database service to determine a first region result.

[0061] Optionally, the IP address may be matched with an IP geographic location database service such as MaxMind or GeoIP2 to determine a first region result, which may be a country or a city.

[0062] S220 , performing GPS matching on the GPS coordinates by using a haversine calculation method to determine a second region result.

[0063] Optionally, the GPS coordinates are matched by GPS using a Haversine calculation method to determine the second region result. For example, the distance between the GPS coordinates and the target area (such as the preset center point of each country or city) can be calculated by a Haversine calculation method, and the country or city with the closest distance is used as the second region result.

[0064] S230: Perform association analysis on the language codes to determine the third region result.

[0065] Optionally, if the language code language_code is zh, then the association (or mapping) is zh-CN→CN; if the language code language_code is en, then the association is en-US→US to obtain the third region result; if there is no mapping, the third region result is marked as Unknown.

[0066] S240: Determine the region type according to the first region result, the second region result, and the third region result.

[0067] Optionally, compare the first region results, the second region results, and the third region results:

[0068] 1. When at least one of the first region result, the second region result, and the third region result represents domestic, the region type is determined to be a domestic region.

[0069] In the embodiment of the present application, for example, China is considered domestic and other countries are considered foreign. Therefore, if at least one of the first region results, the second region results, and the third region results is a country of our country or a city of our country, the region type is determined to be a domestic region.

[0070] 2. When the results of the first region, the second region, and the third region all represent foreign countries, the region type is determined to be a foreign region.

[0071] Therefore, if the country in the first region result, the second region result, and the third region result is another country or the city is a city in another country, the region type is determined to be a foreign region.

[0072] 3. Otherwise, if the above conditions 1 and 2 are not met, it means that the current positioning result is very likely to be ambiguous, for example, it may be at the boundary of the region, and the region type is directly determined to be an invalid region.

[0073] S240: Determine the target region code according to the region type and the language code.

[0074] Optionally, S240 includes steps S2401-S2403:

[0075] S2401: When the region type is an invalid region, determine the target region code as a default region.

[0076] Optionally, if the region type is an invalid region, it means that it is impossible to determine whether the user is in China or abroad. In this case, the target region code (regionCode) is determined to be a default region.

[0077] S2402: When the region type is a domestic region, determine the target region code as domestic.

[0078] Optionally, since for domestic users, the location determined based on IP address, GPS coordinates, language code, etc. is more accurate than that of foreign users, and the judgment is more reliable, when the region type is domestic, the target region code is directly determined to be domestic.

[0079] S2403. When the region type is a foreign region, the language code and the country code are mapped to determine the degree of mapping, and the distance between the target area corresponding to the second region result and the GPS coordinates and the preset value corresponding to the successful match of the first region result are determined. A confidence score is determined based on the degree of mapping, the distance, and the preset value, and the target region code is determined based on the confidence score.

[0080] Optionally, when the region type is a foreign region, for foreign international users, due to the complexity of their network environment, the acquisition of language codes, GPS coordinates, etc. may be inaccurate, so further analysis is required. For example, the language code is mapped to the country code (such as zh-CN), and the mapping degree is determined (for example, a certain number of mappings can be performed, and the maximum number of the same mapping results is counted, and the maximum number of times is divided by the total number of times to determine the mapping degree), and the distance between the target area corresponding to the second regional result and the GPS coordinates and the preset value corresponding to the successful match of the first regional result are determined. The size of the preset value is adjusted according to actual needs. Then, a weighted polling algorithm is used to determine the confidence score based on the mapping degree, distance and preset value, and the target region code is determined based on the confidence score. Specifically:

[0081] 1. Normalize the mapping degree, the distance, and the preset value to obtain a normalized mapping degree, a normalized distance, and a normalized preset value, so that the normalized mapping degree, the normalized distance, and the normalized preset value are all uniformly between 0 and 1.

[0082] 2. A confidence score (confidenceScore) is obtained by performing weighted calculation based on the normalized mapping degree, normalized distance, normalized preset value, mapping degree weight, distance weight, and weight of the preset value. The size of each weight can be adjusted based on actual conditions. For example, the mapping degree weight, distance weight, and weight of the preset value are 0.4, 0.35, and 0.25.

[0083] 3. When the confidence score is greater than or equal to the scoring threshold (such as 0.85), the target area code is determined to be abroad. When the confidence score is less than the scoring threshold (such as 0.85), it indicates that the current result accuracy is low, and the target area code is determined to be the default area or a manual determination prompt is provided, so that the specific target area code can be manually determined.

[0084] In one embodiment, step S300 includes steps S310-S330:

[0085] S310: When the target region code is the default region, determine the default model in the preset model list as the target model.

[0086] It should be noted that a preset model list is pre-set in the configuration center of the embodiment of the present application. The preset model list contains all currently effective AI models, such as the default model default_model, domestic models omestic_models, and international models international_models. Domestic models include but are not limited to ["TencentCloud", "Baidu"], and international models include but are not limited to ["OpenAI", "Anthropic"]. Therefore, when the target region code is the default region, the default model default_model in the preset model list is determined as the target model.

[0087] S320. When the target area code is domestic, determine the first candidate model list containing all domestic models in the preset model list, randomly determine the target model from the first candidate model list, or obtain the operating parameters of each domestic model, and determine the first selection weight of each domestic model according to the first preset weight and operating parameters of each domestic model, and use the domestic model corresponding to the largest first selection weight as the target model.

[0088] Optionally, when the target area code is domestic, a first candidate model list ["TencentCloud", "Baidu"] containing all domestic models in the preset model list is determined, and the target model is randomly determined from the first candidate model list. Alternatively, in another embodiment, the operating parameters of each domestic model are obtained, and the operating parameters include but are not limited to the response time or the call success rate (the response time and the call success rate can be obtained based on the historical data statistics of each domestic model). The first selection weight weight(i) of each domestic model is determined according to the first preset weight base_weight(i) (i.e., the preset weight of the i-th domestic model) and the operating parameter β(i) (i.e., the operating parameter of the i-th domestic model): weight(i)=base_weight(i)×e (-λ×β(i)) , weight(i) is the first choice weight of the i-th domestic model, λ is a constant, and then the largest first choice weight weight(i) is max The corresponding domestic model is used as the target model. Optionally, the response time includes the total time from receiving the user device information to the final call of the model and the return of data.

[0089] S330. When the target area code is foreign, determine a second candidate model list containing all foreign models in the preset model list, randomly determine the target model from the second candidate model list, or obtain the operating parameters of each foreign model, and determine the second selection weight of each foreign model according to the second preset weight and operating parameters of each foreign model, and use the foreign model corresponding to the largest second selection weight as the target model.

[0090] Optionally, when the target region code is foreign, a second candidate model list ["OpenAI", "Anthropic"] containing all foreign models in the preset model list is determined, and the target model is randomly determined from the second candidate model list. Alternatively, in another embodiment, the operating parameters (such as response time or call success rate) of each foreign model are obtained, and the second selection weight of each foreign model is determined based on the second preset weight and operating parameters of each foreign model. The foreign model corresponding to the largest second selection weight is selected as the target model. The calculation principle is the same as that of step S320 above and will not be repeated here.

[0091] In an embodiment of the present application, a large amount of historical data such as regionCode, confidenceScore, etc. is collected in advance and labeled as a training set, and a decision tree or other supervised learning algorithm is used to learn features and rules for correctly determining regionCode, thereby implementing the above-mentioned methods in S200 and S300 based on the rules.

[0092] In one embodiment, in step S400, after the target model is determined, the client is connected to the target model's AI interface, allowing the user to call the target model through the client to implement the desired functions, better meeting user needs and tailoring to their actual needs. Furthermore, when new rules are introduced, the decision tree or supervised learning algorithm can be updated to adapt to new data and changing network environments, providing strong adaptability.

[0093] In one embodiment, the geographic location-based model calling method of the embodiment of the present application may further include steps S510-S520:

[0094] S510. In the process of calling the target model, the operating parameters of the target model are monitored in real time. When the operating parameters of the target model do not meet the preset threshold, if the target model is one of the domestic models, switch to the domestic model with the largest first selection weight other than the current target model as the new target model; if the target model is one of the foreign models, switch to the foreign model with the largest second selection weight other than the current target model as the new target model.

[0095] Optionally, in the process of calling the target model, the operating parameters of the target model are monitored in real time. Since the operating parameters such as response time or call success rate will change as one or more users request the model, when the operating parameters of the target model do not meet the preset threshold, for example, the response time is greater than 2s or the call success rate is less than 95%, if the target model is one of the domestic models, switch to the domestic model with the largest first selection weight other than the current target model as the new target model (that is, select the domestic model with the second largest first selection weight as the new target model); if the target model is one of the foreign models, switch to the foreign model with the largest second selection weight other than the current target model as the new target model (that is, select the foreign model with the second largest second selection weight as the new target model).

[0096] S520. Count the number of calls of each domestic model and each foreign model within the specified time, compare the number of calls with the number threshold, determine the domestic models and foreign models whose number of calls is greater than the number threshold as high-frequency models, and perform LRU cache on the high-frequency models, wherein the high-frequency models in the LRU cache are used for calling when the same client issues a call request or when a call request with the same content is received within a specified time interval.

[0097] Optionally, the number of calls to each domestic model and each foreign model within a specified time period is counted separately, and the number of calls is compared with a threshold. If the domestic model and the foreign model whose number of calls is greater than the threshold are determined to be high-frequency models, it means that a large number of users access and call them. Then, the high-frequency models are LRU cached. The high-frequency models in the LRU cache are used to call when the same client issues a call request or receives a call request for the same content within a specified time interval (the similarity of the requested content can be analyzed, and the similarity is greater than the similarity threshold to be considered as the same content). This reduces repeated calculations and model calls on the back end, thereby reducing latency and improving response performance.

[0098] In one embodiment, the hit rate of the high-frequency model of the LRU cache is counted in real time, that is, the ratio of the number of requests that hit the high-frequency model to the number of requests that miss. If it is lower than a preset ratio (for example, 70%), there may be problems such as cache strategy mismatch, insufficient cache capacity, or access pattern changes, prompting the operation and maintenance personnel to check whether the cache configuration needs to be expanded or the strategy needs to be adjusted to better meet the cache requirements of high-frequency requests, such as adjusting the number threshold.

[0099] In an embodiment of the present application, the policies in S300, S510 and S520 are centrally managed using YAML configuration files or database records. When a change is detected in the policy content in the configuration file, a change notification is sent to each service node through the cloud policy management system (for example, based on ConsulKV storage), so that hot updates are achieved without restarting the service, version numbers, ETags and other mechanisms. At the same time, management indicators such as the number threshold and the preset threshold are managed. If, after real-time monitoring, the operating parameters of all domestic models and foreign models do not meet the preset threshold, the default model is directly determined as the target model for calling to ensure that the request can be responded to and the service is not interrupted due to the lack of a model. In addition, when the policy content changes, the cloud configuration management will generate a new ETAG. After the service node detects the change, it will load the new configuration through hot update and update the policy content. For example, an update cycle can be set or an update request can be issued by the administrator. When a new ETag is found, the new configuration is pulled and hot updated without restarting the system. ETag, as a version identifier, is a summary or hash value of the cloud-based configuration content (including model lists, policies, various thresholds, weights, etc.). This identifier reflects the uniqueness of the current configuration state. In other words, as long as any key parameter of the cloud-based configuration content or hash value changes, the calculated ETAG will be different and a new ETAG will be generated. By comparing the locally saved ETAG with the cloud-based ETAG, if the comparison results are inconsistent, it means that the configuration has been updated and it is necessary to pull the latest configuration file, load the new configuration, and update the model list, policy, various thresholds, weights, etc. In one embodiment, updates are automatically notified via Slack or email, and audit logs are recorded.

[0100] In the embodiment of this application, an A / B testing framework is introduced:

[0101] 1) For new models or new strategies, use feature switches to control the grayscale of small traffic, hash (user_id) to the bucket of [0,1000). If it is in the first 50 buckets, enter the new model, and the rest maintain the old model. If it is, gradually expand the grayscale ratio, otherwise roll back to the original plan. It should be noted that "bucket" here refers to bucketing (i.e. segmenting) users according to a certain hash algorithm. For example, after hashing the user ID, map it to the interval [0,1000) to form 1000 discrete buckets. [0,1000) means that all hash values are between 0 and 999, which is often achieved through modulo operation. Each bucket represents a part of users. The system can pre-specify certain buckets (such as the first 50 buckets) to test new models or strategies.

[0102] Bucket storage and usage: Buckets themselves do not store large amounts of data, but rather serve as identifiers for user groups. Based on the number of each bucket, the system decides whether to allocate that portion of traffic to the new model. This allows for control over the proportion of traffic receiving the new policy and the scope of testing.

[0103] In addition, the feature switch controls the specific process of low-traffic grayscale: Feature Flag: A configuration mechanism used to dynamically turn certain features on or off. A feature flag is defined in the configuration center, and the specific user bucket range for grayscale release is set (for example, users with hash values in [0,50) enable the new model). When a user request arrives, the hash value is calculated based on its unique identifier (such as user_id) and falls into the corresponding bucket. If the hash value falls within the defined grayscale bucket, the request will be routed to the new model or new strategy; otherwise, the current stable version will still be used.

[0104] 2) Detect differences in key indicators. The system compares key performance indicators (response time, accuracy, user feedback, etc.) during the grayscale period. If the new strategy is better than the existing version, the grayscale ratio and traffic will be gradually expanded. Otherwise, roll back to the original plan.

[0105] Accuracy refers to the degree of conformity between the results returned by the model and the expected results (which may be obtained through back-end quality monitoring or user feedback statistics), and is used to measure the effectiveness of the model.

[0106] 3) The role of data storage and subsequent analysis: After inserting the key indicators obtained into the database table, the operations and technical teams can use this historical data to perform statistical analysis and trend forecasting, adjust the weights of candidate models in real time, and warn of system performance anomalies or quality issues, thereby continuously optimizing the system and updating strategies.

[0107] Reference Figure 2 , shows a structural block diagram of a model calling device based on geographic location according to an embodiment of the present application, which may include:

[0108] The acquisition module is used to obtain the user device information of the client, which includes the IP address, GPS coordinates and language code;

[0109] The first determination module is used to perform a comprehensive analysis of the IP address, GPS coordinates and language code to determine the target area code;

[0110] A second determination module is used to determine a target model according to the target area code and a preset model list;

[0111] The calling module is used to connect the client to the AI interface of the target model to call the target model.

[0112] The functions of each module in the device of the embodiment of the present application can be found in the corresponding description in the above method and will not be repeated here.

[0113] Reference Figure 3, shows a block diagram of an electronic device according to an embodiment of the present application. The electronic device includes a memory 310 and a processor 320. The memory 310 stores instructions executable on the processor 320. The processor 320 loads and executes the instructions to implement the geographic location-based model calling method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.

[0114] In one embodiment, the electronic device further includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320, and the communication interface 330 are implemented independently, the memory 310, the processor 320, and the communication interface 330 can be interconnected through a bus and complete communication with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0115] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.

[0116] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the geographic location-based model calling method provided in the above embodiment.

[0117] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided in the embodiment of the present application.

[0118] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory. The input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0119] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the advanced reduced instruction set machine (ARM) architecture.

[0120] Furthermore, optionally, the above-mentioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory may include random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).

[0121] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0122] In the description of this specification, the reference terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0123] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, features specified as "first" or "second" may explicitly or implicitly include at least one of such features. In the description of this application, "plurality" means two or more, unless otherwise specifically defined.

[0124] Any process or method description in a flow chart or otherwise described herein can be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process. The scope of the preferred embodiments of the present application includes additional implementations in which the functions may be performed in a different order than shown or discussed, including in a substantially simultaneous manner or in a reverse order depending on the functions involved.

[0125] The logic and / or steps represented in the flowchart or otherwise described herein may be considered, for example, as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device).

[0126] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0127] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the aforementioned integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, or an optical disk, etc.

[0128] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A model calling method based on geographic location, characterized in that: include: Obtaining user device information of the client, including IP address, GPS coordinates, and language code; Performing a comprehensive analysis of the IP address, GPS coordinates, and language code to determine the target region code; Determining a target model according to the target area code and the preset model list; The client is connected to the AI interface of the target model to call the target model.

2. The geographic location-based model calling method according to claim 1, characterized in that: The comprehensive analysis of the IP address, GPS coordinates, and language code to determine the target region code includes: Performing IP matching on the IP address through an IP geolocation database service to determine a first region result; Performing GPS matching on the GPS coordinates by using a haversine calculation method to determine a second region result; performing a correlation analysis on the language code to determine a third region result; determining a region type according to the first region result, the second region result, and the third region result; A target region code is determined according to the region type and the language code.

3. The geographic location-based model calling method according to claim 2, characterized in that: Determining the region type according to the first region result, the second region result, and the third region result includes: comparing the first regional result, the second regional result, and the third regional result; When at least one of the first region result, the second region result, and the third region result represents domestic, determining the region type as a domestic region; When the first region result, the second region result, and the third region result all represent foreign countries, determining the region type as a foreign region; Otherwise, the region type is determined to be an invalid region.

4. The geographic location-based model calling method according to claim 3, characterized in that: The determining of the target region code according to the region type and the language code includes: When the region type is an invalid region, determining the target region code as a default region; When the region type is a domestic region, determining the target region code as domestic; When the region type is a foreign region, the language code and the country code are mapped to determine the degree of mapping, and the distance between the target area corresponding to the second region result and the GPS coordinates and the preset value corresponding to the successful match of the first region result are determined. A confidence score is determined based on the mapping degree, the distance, and the preset value, and a target region code is determined based on the confidence score.

5. The geographic location-based model calling method according to claim 4, characterized in that: Determining a confidence score based on the mapping degree, the distance, and the preset value, and determining a target area code based on the confidence score includes: Normalizing the mapping degree, the distance, and the preset value to obtain a normalized mapping degree, a normalized distance, and a normalized preset value; A confidence score is obtained by performing a weighted calculation based on the normalized mapping degree, the normalized distance, the normalized preset value, the mapping degree weight, the distance weight, and the weight of the preset value; When the confidence score is greater than or equal to the score threshold, the target area code is determined to be a foreign country; when the confidence score is less than the score threshold, the target area code is determined to be a default area or a manual determination is prompted.

6. The geographic location-based model calling method according to any one of claims 1 to 5, characterized in that: Determining the target model according to the target area code and the preset model list includes: When the target region code is a default region, determining the default model in the preset model list as the target model; When the target area code is domestic, determining a first candidate model list containing all domestic models in a preset model list, randomly determining a target model from the first candidate model list, or obtaining operating parameters of each domestic model, determining a first selection weight for each domestic model based on a first preset weight and the operating parameters of each domestic model, and selecting the domestic model corresponding to the largest first selection weight as the target model; When the target area code is foreign, determine a second candidate model list containing all foreign models in the preset model list, randomly determine the target model from the second candidate model list, or obtain the operating parameters of each of the foreign models, and determine the second selection weight of each of the foreign models according to the second preset weight and the operating parameters of each of the foreign models, and use the foreign model corresponding to the largest second selection weight as the target model.

7. The geographic location-based model calling method according to claim 6, characterized in that: The method further comprises: In the process of calling the target model, the operating parameters of the target model are monitored in real time. When the operating parameters of the target model do not meet the preset threshold, if the target model is one of the domestic models, the domestic model with the largest first selection weight other than the current target model is switched to as the new target model; if the target model is one of the foreign models, the foreign model with the largest second selection weight other than the current target model is switched to as the new target model; or, The number of calls of each domestic model and each foreign model within the specified time is counted respectively, and the number of calls is compared with the number threshold. The domestic models and foreign models with a number of calls greater than the number threshold are determined as high-frequency models, and the high-frequency models are LRU cached. The high-frequency models in the LRU cache are used to call when the same client issues a call request or when a call request with the same content is received within a specified time interval.

8. A model calling device based on geographic location, characterized in that: include: An acquisition module is used to obtain user device information of the client, wherein the user device information includes IP address, GPS coordinates and language code; A first determination module is used to perform a comprehensive analysis of the IP address, GPS coordinates, and language code to determine a target area code; A second determining module is used to determine a target model according to the target area code and a preset model list; A calling module is used to connect the client to the AI interface of the target model to call the target model.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.