Application domain name environment switching method and system and electronic equipment

By setting global environment variables and domain name mapping relationships in the vehicle computer system, the domain name environment switching of multiple applications is achieved, which solves the problem of difficulty in switching multiple application environments in the vehicle computer system, and improves the development and testing efficiency and user experience.

CN119254621APending Publication Date: 2025-01-03CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411551453.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the car computer system, the vehicle cloud interaction functions of self-developed APPs of multiple systems are correlated, which leads to frequent switching of environments during development and testing, which is difficult and high in operation and high workload, making it impossible to effectively switch domain name environments for multiple applications. .

Method used

By presetting global environment variables in the vehicle computer system, the target environment variable is obtained when the application is started, the target domain name is determined based on the mapping relationship between the environment variable and the domain name, and the application environment is switched to the domain name, so as to realize batch configuration of multiple applications and Simultaneous environment switching.

Benefits of technology

Improve flexibility and maintainability, ensure the correct operation and data access of applications in different environments, reduce the inconvenience caused by frequent environment switching during the development testing phase, and improve the development testing efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254621A_ABST
    Figure CN119254621A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle machine systems, and discloses an application domain name environment switching method and system and electronic equipment. According to the application, if it is monitored that any application is started, a target environment variable corresponding to the current application is obtained by accessing a global environment variable, and the global environment variable is preset in a vehicle-mounted terminal system and used for configuring the environment variable of each application; determining a target domain name pre-switched by any application according to a mapping relation between the environment variable value of the target environment variable and the domain name; and switching the application environment of any application to the target domain name. According to the method and the device, on one hand, the environment variables of the multiple applications can be configured in batches, the environment variable configuration efficiency is improved, on the other hand, the domain name environments of the multiple applications can be switched at the same time, the user operation is not interrupted, the user experience is not reduced, and the problem of inconvenience caused by frequent environment switching in the system development and test stage is solved; and the development and test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle computer systems, and in particular to an application domain name environment switching method, system and electronic equipment. Background Art

[0002] In the process of application development, as the development progresses and in order to debug the application, the environment needs to be switched frequently. Especially in the car system, as the intelligent cockpit IVI car-car cloud interaction function is widely used, in order to ensure the stability of the car cloud function, the cloud big data will use different domain names to distinguish the user environment and the development environment, so that technicians can fully self-test in the development environment, and at the same time, avoid test data from contaminating user data; for car platform projects that cover both domestic and foreign businesses, the cloud also uses domain names to distinguish environments in different countries.

[0003] However, for the car system, the car-cloud interaction functions of multiple system-developed APPs (applications) usually have a certain correlation. For example, the car account and the system setting account memory function, if the domain name is only switched within each APP, when more APPs need to switch the environment at the same time, this greatly increases the development / testing workload and the difficulty of operation. In view of this, a solution is needed to switch the domain name environment for multiple applications at the same time. Summary of the invention

[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0005] In view of the above-mentioned shortcomings of the prior art, the present application provides an application domain name environment switching method, system and electronic device to solve the problem of being unable to switch multiple application domain name environments.

[0006] The first aspect of the present application provides an application domain name environment switching method, including: if any of the applications is monitored to be started, obtaining the target environment variables corresponding to the current application by accessing the global environment variables, the global environment variables are pre-set in the vehicle system and are used to configure the environment variables of each of the applications; determining the target domain name for pre-switching of any of the applications based on the mapping relationship between the environment variable value of the target environment variable and the domain name; and switching the application environment of any of the applications to the target domain name.

[0007] In some possible embodiments of the present application, the global environment variables are pre-set in the vehicle system, including: in the vehicle system, pre-configuring the environment variable value and the environment variable KEY value of each application, determining the corresponding environment variable value through the environment variable KEY value, wherein the range corresponding to the environment variable value includes the domestic formal user environment, the domestic test environment, the foreign formal user environment and the foreign test environment; creating a common class for access by each of the applications, encapsulating the environment variable KEY value and the environment variable value of each application into the common class, and packaging them as a dependency library for each of the applications to call.

[0008] In some possible embodiments of the present application, if it is monitored that before any of the applications are started, it also includes: starting any of the applications and reading the current environment variable value of any of the applications; if the current environment variable value is empty, writing the initial value of the environment variable to any of the applications and determining it as the current environment variable value; wherein the initial value of the environment variable is determined by the business type of any of the applications.

[0009] In some possible embodiments of the present application, determining the target domain name for pre-switching of any of the applications includes: if it is monitored that the environment variable value of any of the applications is different from the current environment variable value, changing the environment variable from the current environment variable value to the environment variable value of the target environment variable through debugging; determining the target domain name for pre-switching of any of the applications based on the mapping relationship between the environment variable value of the target environment variable and the domain name, until the target environment variables and target domain names of all of the applications in the pre-switching domain name environment are changed.

[0010] In some possible embodiments of the present application, switching the application environment of any of the applications to the target domain name includes: restarting the vehicle system, initializing the configuration of all the applications according to the changed target environment variables and the target domain name; running each of the applications after the initialization configuration, and switching each of the applications to the corresponding target domain name.

[0011] In some possible embodiments of the present application, the global environment variable also includes: calling the method of SettingsProvider to obtain and display the settings interface; in the settings interface, adding, editing, and deleting different settings items in response to the global environment variable according to different selected options, and providing a method interface to process the global environment variable; calling Settings Provider to classify the processed global environment variables, and store them separately according to system settings, global system settings, and security system settings.

[0012] In some possible embodiments of the present application, after switching the application environment of any of the applications to the target domain name, it also includes: using the application of the vehicle system to send an access request carrying the target domain name to the server, so that the server determines the page rendering result of the page corresponding to the pre-switched application environment based on the target domain name; receiving the page rendering result sent by the server, and switching the currently displayed page to the page corresponding to the pre-switched application environment based on the page rendering result.

[0013] In some possible embodiments of the present application, after switching the currently displayed page to the page corresponding to the pre-switching application environment, it also includes: determining the log identifier corresponding to the target environment variable according to the target environment variable corresponding to the current pre-switching application environment, and outputting log information according to the log identifier.

[0014] The second aspect of the present application also provides an application domain name environment switching system, including: an environment determination module, which is used to obtain the target environment variables corresponding to the current application by accessing the global environment variables if any of the applications is detected to be started, and the global environment variables are pre-set in the vehicle system and used to configure the environment variables of each of the applications; a domain name determination module, which is used to determine the target domain name for pre-switching of any of the applications based on the mapping relationship between the environment variable value of the target environment variable and the domain name; and a switching module, which is used to switch the application environment of any of the applications to the target domain name.

[0015] The third aspect of the present application also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device performs the above method.

[0016] The beneficial effects of the present application are as follows: the present application obtains the target environment variables corresponding to each application by accessing the global environment variables pre-set in the vehicle system, and improves flexibility and maintainability by configuring multiple application environment variables; determines the target domain name to which the application is pre-switched based on the preset mapping relationship between the environment variable value and the domain name in the environment variable, allowing the application to connect to the corresponding service domain name according to different environments, thereby ensuring the correct operation and data access of the application in different environments; switches the application environment to the domain name; on the one hand, it can batch configure the environment variables of multiple applications, thereby improving the efficiency of environment variable configuration, and on the other hand, it can switch the domain name environment of multiple applications at the same time without interrupting user operations and reducing user experience, solving the problem of the inconvenience of frequent environment switching during the system development and testing phase, and improving the development and testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1It is a flowchart of a method for switching an application domain name environment in an embodiment of the present application;

[0018] Figure 2 It is a structural diagram of an application domain name environment switching system in an embodiment of the present application;

[0019] Figure 3 It is a structural schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.

[0021] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0022] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0023] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned 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 terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0024] Unless otherwise stated, the term "plurality" means two or more.

[0025] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.

[0026] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0027] Combination Figure 1 As shown, the embodiment of the present disclosure provides a flow chart of a method for switching an application domain environment, including:

[0028] Step S101, if any of the applications is detected to be started, the target environment variables corresponding to the current application are obtained by accessing the global environment variables, the global environment variables are pre-set in the vehicle system and are used to configure the environment variables of each application;

[0029] Among them, the vehicles equipped with the vehicle-machine system are divided according to the driving energy, including but not limited to fuel vehicles and new energy vehicles. For example, new energy vehicles include pure electric vehicles, hybrid vehicles, extended-range electric vehicles or plug-in hybrid vehicles. Vehicles can also be divided into ordinary passenger vehicles and large vehicles, such as trucks or buses, according to their uses, which are not limited here.

[0030] Specifically, the number of any of the applications can be one or more, that is, multiple applications can be started at the same time, and the environment variables of multiple applications in the vehicle system can be set in batches at the same time. An application is a software program designed for mobile devices (such as vehicle-mounted devices, smart phones and tablets) with specific functions to meet the user's driving-related needs.

[0031] For example, global environment variables are set in the operating system of the vehicle system, and are visible to all shell (i.e., a command line interpreter or graphical user interface in a computer operating system) sessions and all generated subshells of the current user. For example, global environment variables are stored in the system's global configuration file and are set by modifying the system's global configuration file. For example, in a Linux system, the global configuration file includes / etc / profile, / etc / bash.bashrc, and .sh files in the / etc / profile.d directory, etc., which are read when the system starts or when the user logs in, and the corresponding environment variables are set.

[0032] Optionally, in some embodiments, the global environment variable further includes:

[0033] Call the method of Settings Provider to obtain and display the settings interface;

[0034] In the setting interface, according to different options selected, different setting items are added, edited, and deleted in response to the global environment variables, and a method interface is provided to process the global environment variables;

[0035] Call Settings Provider to classify the processed global environment variables and store them separately according to system settings, global system settings and security system settings.

[0036] Specifically, global environment variables use the Settings Provider mechanism provided by Android, which is a mechanism for managing system settings. It allows apps to add, edit, and delete settings items in the system settings, and provides a method interface for editing at the Java level.

[0037] The Settings Provider classifies the edited data into three types: Global, System, and Secure. The data is stored in three XML files, with the following differences:

[0038] Global (local system settings) - all preferences are open to all users of the system, and third-party apps have read but not write permissions;

[0039] System (System Settings) - contains various user preference system settings;

[0040] Secure (Security System Settings) - User preference system settings for security. Third-party apps have read but not write permissions.

[0041] For example, select the type to store environment variables according to your needs.

[0042] Step S102, determining a target domain name for pre-switching any of the applications according to a mapping relationship between the environment variable value of the target environment variable and the domain name;

[0043] It should be noted that the environment variables of each application include environment variable values ​​and environment variable KEY values. The corresponding environment variable value can be determined by the environment variable KEY value. In this way, the target domain name for pre-switching of any application can be determined through the mapping relationship between the environment variable value and the domain name.

[0044] In one embodiment, in response to a running domain name environment switching instruction, a pre-switching system configuration file (i.e., a target environment variable) corresponding to the pre-switching domain name environment is obtained; the current system configuration file (current environment variable) corresponding to the current running environment is replaced with the pre-switching system configuration file; and based on the target environment variable value and domain name in the pre-switching system configuration file, the target domain name corresponding to the pre-switching running environment is obtained.

[0045] Optionally, in another implementation, the determining a target domain name for pre-switching any of the applications includes:

[0046] If it is detected that the environment variable value of any of the applications is different from the current environment variable value, the environment variable is changed from the current environment variable value to the environment variable value of the target environment variable in a debugging manner;

[0047] According to the mapping relationship between the environment variable value of the target environment variable and the domain name, the target domain name for pre-switching of any application is determined until the target environment variables and the target domain names of all the applications in the pre-switching domain name environment are changed.

[0048] Specifically, monitor whether the environment variable value of each application is consistent with the current system environment variable value, for example, by regularly scanning the application configuration file, environment variable settings or calling a specific API to obtain the currently set environment variable value. When it is detected that the environment variable value of a certain application is inconsistent (different) from the current system environment variable value, record the mismatch, for example, including the application name, the current environment variable value and the target environment variable value; change the application's environment variable value from the current value to the target value, if the environment variable value is updated, determine the target domain name of the application pre-switch based on the mapping relationship between the new environment variable value (i.e., the target environment variable value) and the domain name, and the mapping relationship is predefined and stored in the configuration file, database or environment variable. If there are multiple applications that need to switch to the target environment, then the corresponding environment variable values ​​and domain names need to be updated, and the above steps are repeated until the target environment variables and target domain names of all applications are successfully updated.

[0049] Step S103: switch the application environment of any of the applications to the target domain name.

[0050] Specifically, access is performed according to the target domain name to implement application environment switching of the application.

[0051] Through the above method, this embodiment can synchronously switch the networking domain names of multiple application environments. By setting a global environment variable in advance and saving it in the system, each app that requires vehicle-cloud interaction can obtain the environment variable value and set the corresponding domain name when it starts. When the environment needs to be switched, the environment variable is modified and the vehicle is restarted, so that all apps re-read the environment variable and set it to the target domain name for switching.

[0052] Optionally, in some embodiments, the global environment variables are pre-set in the vehicle system, including:

[0053] In the vehicle system, the environment variable value and the environment variable KEY value of each application are pre-configured, and the corresponding environment variable value is determined by the environment variable KEY value, wherein the range corresponding to the environment variable value includes a domestic formal user environment, a domestic test environment, a foreign formal user environment, and a foreign test environment;

[0054] A common class is created for access by each of the applications, and the environment variable KEY value and the environment variable value of each of the applications are encapsulated into the common class, and packaged into a dependency library for calling by each of the applications.

[0055] Specifically, in the vehicle system, the required environment variable value (Value) and the corresponding environment variable KEY value (Key) are pre-configured for each application, covering different operating environments, including: domestic formal user environment, domestic test environment, foreign formal user environment and foreign test environment; in this way, by configuring global environment variables to adapt and test according to different environments, the flexibility and scalability of the system are improved.

[0056] In addition, create a public class to encapsulate and manage the above environment variables. You can use static methods to obtain the value of the environment variable and return the corresponding value based on the passed KEY value. Package this public class and its related dependencies into a library (such as a JAR file) so that each application can reference this library to obtain the value of the environment variable. For example, after configuring the packaging task and generating the library file, add it to the dependencies of each application. When each application needs to obtain the value of the environment variable, it only needs to reference this public library and call it.

[0057] Optionally, in some embodiments, the if monitoring before any of the applications are started further includes:

[0058] Open any of the applications and read the current environment variable value of any of the applications;

[0059] If the current environment variable value is empty, the initial value of the environment variable is written into any one of the applications and is determined as the current environment variable value; wherein the initial value of the environment variable is determined by the business type of any one of the applications.

[0060] Through the above manner, after the system is restarted, that is, after initialization, the problem of being unable to determine the current environment variable value of the application can be avoided, ensuring that the current environment variable value is not empty.

[0061] Optionally, in some embodiments, switching the application environment of any of the applications to the target domain name includes:

[0062] Restart the vehicle system, initialize and configure all the applications according to the changed target environment variables and the target domain name; run the applications after initialization configuration, and switch each application to the corresponding target domain name.

[0063] Specifically, restarting the vehicle system not only clears the current operating environment, but also prepares for loading a new configuration (the target environment variables and the target domain name); after restarting, new environment variables and domain name configurations are loaded, for example, by reading an updated configuration file, from a database or environment variables, to ensure that the new configuration is updated according to previous environment variable changes and domain name mapping relationships; after loading the new configuration, each application is initialized, and the application's startup parameters, network settings and any necessary service dependencies are set according to the new environment variables and domain name configurations, to ensure that each application can recognize and use its corresponding target environment variables and target domain name.

[0064] Additionally, after the switch, continuously monitor the performance and stability of the application and log any exceptions or errors for troubleshooting or performance tuning when needed.

[0065] Optionally, in some embodiments, after switching the application environment of any of the applications to the target domain name, the method further includes:

[0066] The application of the vehicle system is used to send an access request carrying the target domain name to the server, so that the server determines the page rendering result of the page corresponding to the pre-switching application environment according to the target domain name; the page rendering result sent by the server is received, and according to the page rendering result, the currently displayed page is switched to the page corresponding to the pre-switching application environment.

[0067] Exemplarily, an application in the vehicle system sends an access request carrying a target domain name to the server. The server can dynamically determine and render the page corresponding to the pre-switched application environment based on the target domain name. When using the vehicle system, the user can seamlessly switch to different application environments or pages without going through a tedious switching process or waiting time. The page rendering result returned by the server can be directly received and displayed by the application in the vehicle system, thereby reducing the user's waiting time and operation complexity, and improving user satisfaction and loyalty.

[0068] For example, since the page rendering results are dynamically generated by the server according to the target domain name, all page content and application environment can be centrally managed and maintained on the server side, which reduces the complexity and maintenance cost of the vehicle system itself, and makes updates and upgrades easier and more efficient. The page rendered by the server according to the target domain name contains the latest data and information. When the application in the vehicle system receives these rendering results and displays them to the user, it can ensure that the user sees the latest and most accurate data, which helps to improve the user's trust and usage experience.

[0069] For example, by sending access requests carrying different target domain names to the server, applications in the vehicle system can easily switch to different application environments or pages, supporting a variety of application scenarios and requirements, such as navigation, entertainment, information display, etc., and meeting the diverse needs of users.

[0070] Optionally, in some embodiments, after switching the currently displayed page to the page corresponding to the pre-switched application environment, the method further includes:

[0071] The log identifier corresponding to the target environment variable is determined according to the target environment variable corresponding to the current pre-switching application environment, and log information is output according to the log identifier.

[0072] First, you need to clearly define the target environment variables corresponding to the pre-switched application environment. Second, assign a unique log identifier to the target environment variable, which can be a number, string, or other identifier. Third, configure the corresponding rules in the log system to ensure that the corresponding log information can be output according to the log identifier. When the system is running, the corresponding log information is output according to the log identifier of the target environment variable. Finally, analyze and process the output log information to support problem location, performance optimization, compliance auditing, and other needs.

[0073] Through the above methods, effective management and tracking of log information can be achieved, providing strong support for the stable operation and optimization of the system.

[0074] In some embodiments, the present implementation uses a complete flow chart of the method for switching the application domain environment, which is described in detail as follows:

[0075] Step 1: First, unify the Key and Value values ​​of the environment variables agreed by the system to correspond to the environment, so that each APP can read them easily.

[0076] For example, encapsulate it into a public class and upload it as a dependency for app use, such as:

[0077] public class Constants{

[0078] public static final String DOMAIN = "DOMAIN"; / / Set the environment variable KEY value

[0079] public static final class DOMAIN ENV{ / / Set the environment variable value range (can be increased according to business needs)

[0080] public static final string CHINA_TEST = "CHINA_TEST"; / / China test environment

[0081] public static final string CHINA_FORMAL = "CHINA_FORMAL"; / / China official user environment

[0082] public static final string OVERSEA_TEST = "OVERSEA_TEST"; / / Foreign test environment

[0083] public static final string OVERSEA_FORMAL = "OVERSEA_FORMAL"; / / Foreign official user environment

[0084] }

[0085] }

[0086] Step 2: Determine the initial value of the environment variable and decide who will write it.

[0087] For example, an app that starts automatically at startup writes the initial value of the environment variable (such as system settings, background services, etc.). The initial default environment is determined by the business project. The writing method is as follows (executed in the application on Create started by the app):

[0088] / / First read the current environment value

[0089] val current=Settings.System.getString(contentResolver,Constants.DOMAIN)

[0090] if(current == null){ / / If the current environment value is empty, the initial value needs to be written

[0091] Settings.System.putString(contentResolver,Constants.DOMAIN,Constants.DomainENV.CHINA_TEST)

[0092] Step 3: When the app starts, read the environment variables and set the domain name to be used according to the environment variables.

[0093] First, each app sets its own mapping between specific domain names and environment variable values, such as:

[0094] fun getDomain(domain:String):String{

[0095] return when(domain){ / / Domain name is for example, not real domain name

[0096] Constants.DomainENV.CHINA_TEST->"www.seres.china-test.com"

[0097] Constants.DomainENV.CHINA_FORMAL->"www.seres.china-formal.com"

[0098] Constants.DomainENV.OVERSEA_TEST->"www.seres.oversea-test.com"

[0099] Constants.DomainENV.OVERSEA_FORMAL->"www.seres.oversea-formal.com"

[0100] }

[0101] }

[0102] Secondly, the app itself needs to set a default domain name value to avoid abnormal app functions caused by abnormal environment reading. It is recommended to set a global domain name variable and assign an initial value, such as:

[0103] var domain="www.seres.china-test.com"

[0104] Finally, the app can read the domain name and set it at startup using the following method:

[0105] val current = Settings.System.getString(contentResolver,Constants.DOMAIN) / / Read the current environment value

[0106] if(current!=null){ / / If the current environment value is empty, the domain name is assigned, otherwise the domain name remains unchanged

[0107] domain=current

[0108] }

[0109] Step 4: Set the environment switching method to enable modification of environment variables.

[0110] First, under the Settings Provider mechanism, you can modify it directly through adb. After connecting the PC adb (computer debugging tool) to the car computer, modify it through the following command:

[0111] adb shell settings put system DOMAIN OVERSEA_TEST

[0112] For example, you can also read the current environment variables directly through adb using the following command:

[0113] adb shell settings get system DOMAIN

[0114] Secondly, you can also add environment variable options in the developer mode in the settings, and set the options to determine the event execution Settings value writing, such as:

[0115] binding.item.setOnClickListener{ / / Set option click event

[0116] Settings.System.putString(contentResolver,Constants.DOMAIN,Constants.DomainENV.CHINA_TEST)

[0117] }

[0118] Step 5: Restart the vehicle computer to make the environment variable changes take effect.

[0119] After the car computer restarts, all apps will re-execute the on Create method of the application and re-read the environment variable value to respond to the environment variable modification.

[0120] In this embodiment, the Settings Provider mechanism is used to set environment variables, so that domain name reading and switching can be synchronized for multiple apps, which effectively improves the development and testing efficiency. In addition, by providing a network environment switching solution for synchronously modifying domain names of multiple apps on a vehicle computer, the problem of frequent and inconvenient environment switching during the system development and testing phase is solved, thereby improving the development and testing efficiency. At the same time, it also has certain applicability in multiple scenarios. For example, in a multi-national platform development scenario, the domain names of all related apps can be synchronously set through this environment variable value, without the need to set each app separately, which greatly improves the efficiency of environment variable configuration.

[0121] See also Figure 2 , is a schematic diagram of the structure of an application domain name environment switching system in an embodiment of the present application, including:

[0122] An environment determination module 201 is used for obtaining target environment variables corresponding to the current application by accessing global environment variables if any application is detected to be started, wherein the global environment variables are pre-set in the vehicle system and are used to configure environment variables of each application;

[0123] A domain name determination module 202, configured to determine a target domain name for pre-switching of any of the applications according to a mapping relationship between an environment variable value of the target environment variable and a domain name;

[0124] The switching module 203 is used to switch the application environment of any of the applications to the target domain name.

[0125] Among them, the environment determination module 201 is used to execute the aforementioned step 101, the domain name determination module 202 is used to execute the aforementioned step 102, and the switching module 203 is used to execute the aforementioned step 103. The above modules correspond to the steps of the application domain name environment switching method, and their execution process corresponds to the corresponding steps, which will not be described in detail here.

[0126] The application domain name environment switching system provided by the embodiment of the present disclosure obtains the target environment variables corresponding to each application by accessing the global environment variables pre-set in the vehicle system, and improves flexibility and maintainability by configuring multiple application environment variables; determines the target domain name to which the application is pre-switched according to the preset mapping relationship between the environment variable value in the environment variable and the domain name, allowing the application to connect to the corresponding service domain name according to different environments, thereby ensuring the correct operation and data access of the application in different environments; switches the application environment to the domain name; on the one hand, it can batch configure the environment variables of multiple applications, thereby improving the efficiency of environment variable configuration, and on the other hand, it can switch the domain name environments of multiple applications at the same time without interrupting user operations and reducing user experience, thereby solving the problem of frequent and inconvenient environment switching during the system development and testing phase and improving development and testing efficiency.

[0127] Figure 3 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 3 The computer system 300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0128] like Figure 3As shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method in the above embodiment. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0129] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0130] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.

[0131] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" used in this application refers to any and all possible combinations listed in association with one or more. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0132] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the systems, devices and units described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0133] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0134] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for switching an application domain name environment, characterized in that: include: If any of the applications is detected to be started, the target environment variables corresponding to the current application are obtained by accessing the global environment variables, where the global environment variables are pre-set in the vehicle computer system and are used to configure the environment variables of each application; Determine the target domain name for pre-switching of any of the applications according to the mapping relationship between the environment variable value of the target environment variable and the domain name; Switch the application environment of any of the applications to the target domain name.

2. The method according to claim 1, characterized in that The global environment variables are pre-set in the vehicle system and include: In the vehicle system, the environment variable value and the environment variable KEY value of each application are pre-configured, and the corresponding environment variable value is determined by the environment variable KEY value, wherein the range corresponding to the environment variable value includes a domestic formal user environment, a domestic test environment, a foreign formal user environment, and a foreign test environment; A common class is created for access by each of the applications, and the environment variable KEY value and the environment variable value of each of the applications are encapsulated into the common class, and packaged into a dependency library for calling by each of the applications.

3. The method according to claim 1, characterized in that If it is detected that any of the applications are started, the method further includes: Open any of the applications and read the current environment variable value of any of the applications; If the current environment variable value is empty, the initial value of the environment variable is written into any one of the applications and is determined as the current environment variable value; wherein the initial value of the environment variable is determined by the business type of any one of the applications.

4. The method according to claim 3, characterized in that The determining of a target domain name for pre-switching of any application includes: If it is detected that the environment variable value of any of the applications is different from the current environment variable value, the environment variable is changed from the current environment variable value to the environment variable value of the target environment variable in a debugging manner; According to the mapping relationship between the environment variable value of the target environment variable and the domain name, the target domain name for pre-switching of any application is determined until the target environment variables and the target domain names of all the applications in the pre-switching domain name environment are changed.

5. The method according to claim 4, characterized in that The switching the application environment of any of the applications to the target domain name includes: Restart the vehicle system, initialize and configure all the applications according to the changed target environment variables and the target domain name; run the applications after initialization configuration, and switch each application to the corresponding target domain name.

6. The method according to any one of claims 1 to 5, characterized in that: The global environment variables also include: Call the method of Settings Provider to obtain and display the settings interface; In the setting interface, according to different options selected, different setting items are added, edited, and deleted in response to the global environment variables, and a method interface is provided to process the global environment variables; Call Settings Provider to classify the processed global environment variables and store them separately according to system settings, global system settings and security system settings.

7. The method according to any one of claims 1 to 5, characterized in that: After switching the application environment of any of the applications to the target domain name, the method further includes: The application of the vehicle system is used to send an access request carrying the target domain name to the server, so that the server determines the page rendering result of the page corresponding to the pre-switching application environment according to the target domain name; the page rendering result sent by the server is received, and according to the page rendering result, the currently displayed page is switched to the page corresponding to the pre-switching application environment.

8. The method according to claim 7, characterized in that After the currently displayed page is switched to the page corresponding to the pre-switched application environment, the method further includes: The log identifier corresponding to the target environment variable is determined according to the target environment variable corresponding to the current pre-switching application environment, and log information is output according to the log identifier.

9. An application domain name environment switching system, characterized in that: include: An environment determination module, for obtaining target environment variables corresponding to the current application by accessing global environment variables if any of the applications are detected to be started, wherein the global environment variables are pre-set in the vehicle computer system and are used to configure the environment variables of each of the applications; A domain name determination module, used to determine the target domain name for pre-switching of any of the applications according to the mapping relationship between the environment variable value of the target environment variable and the domain name; A switching module is used to switch the application environment of any of the applications to the target domain name.

10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 8.