Network configuration method and electronic device

By detecting the connection situation and modifying the network configuration file, the login failure problem caused by connection timeout in the OOBE stage was solved, the normal activation of the electronic device was achieved, and the original environment of the operating system was restored after activation.

CN118449855BActive Publication Date: 2024-12-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410890856.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-12-20
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

During the OOBE stage, the electronic device fails to log in due to the timeout of the connection with the authentication server and cannot be activated normally.

Method used

Modify network configuration files to improve transmission speed by detecting connections, for example, changing the transmission channel between electronic devices and authentication server from the original channel to a faster channel, and restoring the original configuration after successful login to ensure that in OOBE The device is activated normally in the stage.

Benefits of technology

It effectively avoids login failure caused by connection timeout, ensures normal activation of electronic devices during the OOBE stage, and restores the original operating environment of the operating system after activation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118449855B_ABST
    Figure CN118449855B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a network configuration method and an electronic device, which are applicable to the field of computer technology, wherein the network configuration method includes: when the electronic device is in the unboxing experience stage, detecting the connection status of the electronic device and the first server; when the connection status is a connection failure, modifying the network configuration file, and modifying the network configuration file includes: modifying the first transmission channel between the electronic device and the first server to a second transmission channel, and the transmission speed of the second transmission channel is greater than the transmission speed of the first transmission channel. In the embodiment of the present application, when the electronic device cannot establish a network connection with the authentication server in the OOBE stage, by modifying the network configuration file, the transmission speed between the electronic device and the authentication server can be accelerated, thereby quickly establishing a connection, avoiding login failure due to connection timeout, and realizing normal activation of the electronic device in the OOBE stage.
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 network configuration method and electronic device. Background Art

[0002] Out of Box Experience (OOBE) refers to the entire experience that users go through when they open and use a newly purchased electronic product for the first time. OOBE is designed to allow users to easily and quickly start using new electronic products and have a good experience during use. During the OOBE stage, users can interact with the electronic product according to the various interfaces displayed on the electronic product screen to activate the electronic product.

[0003] New electronic products are usually pre-installed with an operating system, such as Windows. During the OOBE phase, you need to log in to an online account, such as a Microsoft account, and authenticate the electronic device online before you can activate the new electronic product. However, since the authentication server, such as the Microsoft account authentication server, is often located overseas and physically far away, domestic users often fail to log in due to connection timeouts when logging in to their online accounts, making it impossible to activate the new electronic product. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a network configuration method, an electronic device, a computer-readable storage medium, a chip system and a computer program product, which can solve the problem of login failure due to connection timeout, thereby realizing the normal activation of the electronic device in the OOBE stage.

[0005] In a first aspect, an embodiment of the present application provides a network configuration method, the method comprising: when an electronic device is in an OOBE stage, the electronic device can detect the connection status between the electronic device and a first server (or referred to as an authentication server). The connection status includes a connection failure or a connection success, and the first server is used to authenticate the identity of the electronic device. Afterwards, the electronic device can modify the network configuration file when the connection status is a connection failure.

[0006] Specifically, modifying the network configuration file may include: modifying a first transmission channel between the electronic device and the first server to a second transmission channel, wherein a transmission speed of the second transmission channel is greater than a transmission speed of the first transmission channel.

[0007] The network configuration file is a file used to configure the network in the operating system of the electronic device. When the operating system of the electronic device is a Windows system, the network configuration file is a host file.

[0008] In an embodiment of the present application, during the OOBE stage, when the electronic device cannot establish a network connection with the authentication server, the electronic device can speed up the transmission speed between the electronic device and the authentication server by modifying the network configuration file, thereby quickly establishing a connection and avoiding login failure due to connection timeout, thereby achieving normal activation of the electronic device during the OOBE stage.

[0009] It should be noted that when an electronic device is powered on, the operating system in the electronic device is started. After the operating system is started, and when it is determined that the current startup is the first time, the OOBE service that comes with the operating system can be started. From the start of OOBE to the end of the operation, the electronic device is in the OOBE stage, or it is called the OOBE process.

[0010] The operating system of the electronic device is usually a Windows system. When the operating system is a Windows system, the account required to log in when activating the electronic device is a Microsoft account, and the server connected to the Microsoft account is the authentication server of the Microsoft account. It can be understood that the solution of the embodiment of the present application can also be applied to other operating system scenarios, and the other operating system requires online account login during the OOBE process to achieve activation.

[0011] In some embodiments, the electronic device may modify the network configuration file in the following manner: write a preset configuration item into the network configuration file. The written configuration item is used to modify the first transmission channel between the electronic device and the first server to the second transmission channel.

[0012] In some embodiments, since the electronic device enters OOBE when it is started for the first time, the electronic device can directly determine that it is currently in the OOBE stage when it is started for the first time.

[0013] In a first possible implementation manner of the first aspect, the electronic device can detect the connection status between the electronic device and the first server through a computer manager.

[0014] Among them, Computer Manager is the security software that comes with electronic devices when they leave the factory, which is used to protect electronic devices from malware, viruses, hacker attacks and other security threats.

[0015] Specifically, the process of the computer manager detecting the connection between the electronic device and the first server may be: first, the computer manager may send a connection request to the first server. Then, the computer manager may determine that the connection between the electronic device and the first server fails if no response message to the connection request is received from the first server.

[0016] In the embodiment of the present application, the real-time interaction process and the interaction results between the operating system, the OOBE service in the operating system, and the authentication server, such as whether the online account is successfully logged in, are difficult to be known by the outside world. Therefore, the electronic device indirectly determines the connection status of the OOBE service and the authentication server through the connection status between the computer housekeeper and the authentication server. Specifically, if the computer housekeeper is successfully connected to the authentication server, it is considered that the OOBE service can also be successfully connected to the authentication server to complete the account login. If the computer housekeeper fails to connect to the authentication server, it is considered that the OOBE service and the authentication server cannot be connected either, that is, the account login cannot be completed.

[0017] It should be pointed out that indirectly judging the connection status between the OOBE service and the authentication server through the computer manager in the electronic device is easy to implement and requires little computation. It can reduce R&D costs and difficulty while ensuring the performance of the electronic device, and help improve R&D efficiency.

[0018] In some optional implementations, the electronic device may also detect the connection status between the electronic device and the first server through other software programs besides PC Manager.

[0019] In a second possible implementation manner of the first aspect, the computer manager detects the connection status between the electronic device and the first server, and may also include: the computer manager may determine that the electronic device is successfully connected to the first server when a response message to the connection request is received from the first server.

[0020] In a third possible implementation manner of the first aspect, the second transmission channel passes through the second server, and the second server is point-to-point connected to the first server.

[0021] The second server and the electronic device are located in the same physical area, for example, in the same country.

[0022] In the embodiment of the present application, since the point-to-point connection method can achieve efficient and secure data transmission and can reduce delays and interference in the communication process, the point-to-point connection between the first server and the second server can greatly improve the network transmission speed between the electronic device and the first server, thereby ensuring that the electronic device can be successfully connected to the first server (or authentication server), that is, it can ensure that the electronic device is normally activated in the OOBE stage.

[0023] In a fourth possible implementation manner of the first aspect, the electronic device may determine whether the electronic device is in the OOBE stage through a computer manager.

[0024] Specifically, the process of the computer housekeeper determining whether the electronic device is in the OOBE stage can be: first, the computer housekeeper can send a query message to the operating system, and the query message is used to query whether it is currently in the OOBE stage. Then, the computer housekeeper can receive a reply message returned by the operating system. Among them, the reply message includes the first message or the second message, the first message indicates that it is currently in the OOBE stage, and the second message indicates that it is not currently in the OOBE stage. Finally, the computer housekeeper can determine whether the electronic device is in the OOBE stage based on the reply message. For example, if the computer housekeeper receives the first message, it can be determined that the electronic device is currently in the OOBE stage. If the computer housekeeper receives the second message, it can be determined that the electronic device is not currently in the OOBE stage.

[0025] In an embodiment of the present application, an operating system, such as a Windows system, may support inquiries about whether it is in the OOBE stage. Each time the computer manager is started, it may send a query message to the operating system, and query the operating system through the query message whether it is currently in the OOBE stage. Upon receiving the query from the computer manager, the operating system may send a reply message to the computer manager, and reply whether it is currently in the OOBE stage through the reply message. When the operating system starts the OOBE service, the operating system may reply to the computer manager with a first message, and when the operating system does not start the OOBE service, the operating system may reply to the computer manager with a second message. It will be understood that the embodiments of the present application do not limit the specific contents of the query information, the first information, and the second information.

[0026] In some optional implementations, since the OOBE service is running, the process information of the OOBE service can be found from the running process list, so the computer manager can determine whether the OOBE is running by analyzing the process list, thereby determining whether the electronic device is in the OOBE stage. Specifically, if the OOBE process is in the process list, the computer manager can determine that the electronic device is in the OOBE stage, and conversely, if the OOBE process does not appear in the process list, the computer manager can determine that the electronic device is not in the OOBE stage.

[0027] In a fifth possible implementation of the first aspect, the electronic device may first obtain a first user name of an operating system in the electronic device. Then, when a login event is detected, the electronic device may obtain a second user name of the operating system. Finally, when the first user name is different from the second user name, the electronic device may restore the network configuration file.

[0028] The first user name and the second user name are user names used by the operating system at two different times respectively.

[0029] The first user name is obtained before the login event occurs, and the second user name is obtained after the login event occurs.

[0030] It should be noted that when an operating system, such as a Windows system, is started for the first time, in order to ensure that system resources can be accessed normally, the operating system will automatically create a temporary user account, such as defaultuser0. If the OOBE service successfully logs in to an online account, such as a Microsoft account, the user account of the operating system will change, and the changed user account can be associated with the logged in online account, for example, the changed user account can be Microsoft. That is, after the OOBE service successfully logs in to the online account, the user name of the operating system, that is, the identifier of the user account, will change.

[0031] In addition, during the entire process of the electronic device being in the OOBE stage, there are usually multiple restarts, that is, there are multiple login events, but the login events caused by the restart will not change the user name of the operating system.

[0032] Therefore, in the embodiment of the present application, the electronic device determines whether the OOBE service has successfully logged into the online account by analyzing the changes in the user name before and after the login event, with high accuracy and low computational complexity. After the OOBE service successfully logs into the online account, the electronic device promptly restores the network configuration file, which can ensure that the modification in the OOBE stage will not affect the operating system environment when the operating system is running normally.

[0033] In some embodiments, the electronic device may restore the network configuration file in the following manner: deleting the configuration items written when the network configuration file is modified from the network configuration file.

[0034] In a sixth possible implementation manner of the first aspect, after modifying the network configuration file, the electronic device may also subscribe to a login event to the inter-process communication service through a computer manager.

[0035] When the electronic device detects a login event, it obtains the second user name of the operating system. Specifically, it can be implemented as follows: when the computer manager in the electronic device receives the first event message sent by the inter-process communication service, it obtains the second user name of the operating system, wherein the first event message indicates that a login event has been detected.

[0036] In the embodiment of the present application, the electronic device can subscribe to the login event from the inter-process communication service through the computer manager, and then the inter-process communication service can send the event message to the computer manager in time when the login event is detected, so that the computer manager can obtain the second user name of the operating system in time, and use the first user name and the second user name for consistency analysis in time, so as to ensure the timely recovery of the network configuration file. That is, the present application can restore the modified network configuration file in time during the OOBE stage to ensure that the modification during the OOBE stage will not affect the operating system environment during the normal operation of the operating system.

[0037] It is understandable that the electronic device can adopt the method of subscribing to login events disclosed in the relevant technology to implement a service in the electronic device (that is, a computer manager) and successfully subscribe to the login event to the inter-process communication service, which will not be elaborated here.

[0038] In a seventh possible implementation manner of the first aspect, after restoring the network configuration file, the electronic device may also unsubscribe from the login event to the inter-process communication service through the computer manager.

[0039] In an embodiment of the present application, the computer manager can unsubscribe from the login event to the inter-process communication service in a timely manner after restoring the network configuration file. In this way, unnecessary information transmission can be reduced, thereby avoiding unnecessary loss of computing resources.

[0040] It is understandable that the electronic device can unsubscribe from the login event by using the method of unsubscribing from the login event disclosed in the relevant technology, which will not be elaborated here.

[0041] In an eighth possible implementation of the first aspect, the electronic device obtains the first user name of the operating system in the electronic device, which can be implemented by the following steps: when the electronic device is started, detecting whether the user name is recorded in the registry. If the user name is not recorded in the registry, obtaining the user name currently used by the operating system, and determining the obtained user name as the first user name.

[0042] In an embodiment of the present application, the user name used by the operating system can be recorded in the registry. When the electronic device is started, the user name used by the operating system last time is usually recorded in the registry. If the user name is not recorded in the registry when the electronic device is started, it means that this startup is the first startup. Only when the user name is not recorded in the registry, the electronic device interacts with the operating system to obtain the user name currently used by the operating system, which can ensure that the network configuration related operations of the embodiment of the present application are performed when the electronic device is started for the first time.

[0043] It is understandable that the operating system supports querying the user name currently used by the operating system. Other services in the electronic device can query and obtain the user name currently used by the operating system by sending a query request message to the operating system.

[0044] Optionally, after obtaining the first user name of the operating system in the electronic device, the electronic device can also store the first user name in the registry if the user name is not recorded in the registry. In this way, the registry can record the user name used when the electronic device is started, that is, when the operating system is started.

[0045] In a ninth possible implementation of the first aspect, when the electronic device detects a login event, it obtains the second user name of the operating system. Specifically, it can be implemented as follows: when a login event is detected, it obtains the user name currently used by the operating system, and determines the obtained user name as the second user name.

[0046] In an embodiment of the present application, the electronic device can interact with the operating system to obtain the user name currently used by the operating system, and also obtain the second user name in a timely manner.

[0047] In practice, the electronic device can interact with the operating system through a computer manager to obtain the user name currently used by the operating system.

[0048] Optionally, if the first user name is different from the second user name and the network configuration file is restored, the electronic device can also update the user name in the registration table to the second user name. That is, the electronic device can update the registration table in a timely manner and write the latest user name into the registration table.

[0049] In a second aspect, an embodiment of the present application provides a network configuration device, the device comprising:

[0050] A network connection unit, used to detect the connection status between the electronic device and the first server when the electronic device is in the unboxing experience stage, the connection status including connection failure or connection success, and the first server is used to authenticate the identity of the electronic device;

[0051] The data processing unit is used to modify the network configuration file when the connection status is a connection failure, and the modification of the network configuration file includes: modifying the first transmission channel between the electronic device and the first server to a second transmission channel, and the transmission speed of the second transmission channel is greater than the transmission speed of the first transmission channel.

[0052] As an embodiment of the present application, the network configuration device can implement any method of the first aspect described above.

[0053] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, and the processor implementing any method of the first aspect when executing the computer program.

[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method of any one of the above-mentioned first aspects is implemented.

[0055] In a fifth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method as described in the first aspect above. The chip system can be a single chip or a chip module composed of multiple chips.

[0056] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods of the first aspect above.

[0057] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A schematic diagram of the interface interaction process in the OOBE phase provided in an embodiment of the present application;

[0059] Figure 2A A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0060] Figure 2B A block diagram of the hardware layer and the software structure of the processor provided on the electronic device according to the embodiment of the present application;

[0061] Figure 3 A flowchart of a network configuration method provided in an embodiment of the present application;

[0062] Figure 4 A flowchart of another network configuration method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0064] The following are some concepts that may be involved in the embodiments of the present application:

[0065] (1) Multiple: Unless otherwise specified, in the embodiments of the present application, multiple refers to two or more.

[0066] (2) Out of Box Experience (OOBE): In the embodiments of the present application, OOBE is an important process in the operating system. When a user starts a newly purchased electronic product for the first time or performs a system recovery, the system will start the OOBE process (or OOBE service). The OOBE service guides the user to complete the initial setup and configuration so that the system can operate normally.

[0067] Here, the process from the start of the OOBE service to the end of its operation can be called the OOBE process or the OOBE stage.

[0068] In practice, the OOBE service provides an interactive interface, and users can complete various settings by interacting with the interface, such as language, time zone, keyboard layout and other basic settings, and can also create or log in to online accounts, such as Microsoft accounts, and set network connections, privacy options, security settings, etc. In other words, through the OOBE service, users can personalize the operating system to meet their specific needs and preferences.

[0069] Taking the Windows operating system as an example, after the OOBE service ends, the system will officially enter the Windows desktop environment and start running normally.

[0070] (3) Hosts file: In the embodiments of the present application, the Hosts file is a local text file used for domain name resolution. The Hosts file exists in the operating system and is used to map host names to Internet Protocol (IP) addresses. When an electronic device attempts to access a host on the network, it first searches the Hosts file to determine the IP address corresponding to the host name, thereby establishing a connection.

[0071] (4) Computer Manager and Stability Plug-in: In the embodiments of the present application, computer manager refers to security software used to protect personal computers from malware, viruses, hacker attacks and other security threats.

[0072] The stability plug-in is a functional module in PC Manager that is used to improve the stability and performance of the system and protect the user's personal computer from various security threats.

[0073] Stability plugins can include the following features:

[0074] Real-time protection: The stability plug-in monitors the processes and files running on the system, detects and blocks potential malware and threats in a timely manner, thereby improving system stability.

[0075] System Repair: Stability plugins may include system repair tools to repair system files and restore system settings to help resolve system instability caused by malware or system failures.

[0076] Memory Management: Stability plugins may provide memory management tools for monitoring and optimizing system memory usage to improve system stability and performance.

[0077] Startup Management: The stability plug-in can improve the system startup speed and stability by managing system startup items and optimizing the startup process.

[0078] (5) Waiting for the unboxing experience to be completed (RegisterWaitUntilOOBECompleted): In the embodiment of the present application, RegisterWaitUntilOOBECompleted is an application programming interface (API) function provided by the Windows system. The API function allows developers to register one or more callback functions with the operating system. The operating system can execute the operation corresponding to the callback function after waiting for OOBE to be completed.

[0079] In actual applications, the RegisterWaitUntilOOBECompleted function can only be used during the OOBE process, and is usually used to perform operations that require waiting for the system to be ready before starting.

[0080] (6) Interprocess Communication (IPC): In the embodiments of the present application, the IPC service allows different processes in the operating system to communicate and exchange data. In a multitasking operating system, different processes may need to collaborate, share data, or communicate with each other, and the IPC service provides such a mechanism.

[0081] IPC services can start running immediately after the operating system is started and communicate with other processes. IPC services play an important role in the operating system. They provide the infrastructure for inter-process communication, allowing different processes to interact effectively, thereby realizing more complex and powerful applications.

[0082] (7) Login event (SESSION_LOGON): In the embodiment of the present application, when a user logs in on the operating system, a SESSION_LOGON event is triggered, indicating that the user session has been successfully logged in. In other words, a login event refers to an event triggered when a user successfully logs in on the operating system.

[0083] In practice, when a user logs into the operating system, the SESSION_LOGON event is triggered, which notifies the system that a new user session has been started. In some cases, other running processes may need to know the user's login status and related information. In this case, the IPC service can send a message to the receiving process for corresponding processing or collaboration. In other words, the IPC service can help different processes to effectively transmit information and collaborate when the SESSION_LOGON event occurs.

[0084] In practice, it is found that when a user logs into the online account and local account (or user account) of the operating system, the SESSION_LOGON event will be triggered.

[0085] (8) User account and user name of the operating system: In the present embodiment of the application, the user account of the operating system is the account of the user logging into the operating system. The user name of the operating system is a name or identifier used by the operating system to identify and manage the user identity.

[0086] When the operating system is started for the first time, in order to ensure that system resources can be accessed normally, the operating system will automatically create a temporary user account, such as defaultuser0. If the OOBE service successfully logs in to the online account, the operating system user account will change, and the changed user account can be associated with the logged in online account, for example, the changed user account can be Microsoft. That is, after the OOBE service successfully logs in to the online account, the operating system user name will change.

[0087] After the OOBE service of the electronic device is completed, the system will officially enter the desktop environment of the operating system and start operating normally.

[0088] When the electronic device is in normal operation, taking a laptop computer with a Windows system as an example, when a user turns on the laptop computer, he or she may need to log in to the user account by entering a fingerprint or password, etc., so as to start using the laptop computer. At this time, the identifier of the logged-in user account is the user name of the Windows system.

[0089] (9) Registry: In the embodiments of the present application, the registry is an important system database in the operating system. It contains configuration information of the operating system, applications, hardware devices, and users. The registry is used to store various system settings and options, including hardware drivers, operating system settings, user preferences, and application configurations.

[0090] The registry allows users and system administrators to perform advanced configuration and customization of the system. Through the registry, users can change the appearance, behavior, and functionality of the system, modify application settings, install new hardware device drivers, etc. Therefore, the registry plays a key role in the stability and flexibility of the operating system.

[0091] OOBE refers to the entire experience that a user goes through when they turn on and use a new electronic product for the first time. OOBE is designed to allow users to easily and quickly start using new electronic products and have a good experience during use.

[0092] During the OOBE stage, users can activate electronic products by interacting with various interfaces displayed on the electronic products. The interfaces displayed by electronic products during the OOBE stage may include: language selection interface, region selection interface, keyboard setting interface, network connection interface, account login interface, etc.

[0093] The following briefly describes the OOBE process of an electronic device by taking the Windows operating system of the electronic device as an example. Figure 1 The following is a schematic diagram of the interface interaction process of an electronic device in the OOBE stage provided by an embodiment of the present application. It can be understood that when the operating system of the electronic device is a Windows system, the online account required to log in is a Microsoft account.

[0094] Combination Figure 1 In (a), during the OOBE stage, the electronic device may display a language selection interface 101, which displays a variety of language options for the user to select. The language options are used to select the language used by the electronic device, such as Chinese, English, Russian, etc. It is understandable that the language options listed on the language selection interface 101 are only examples. The electronic device can increase or decrease the number of language options based on actual needs. Figure 1As shown in (a), the electronic device can respond to the user clicking the "Chinese" option 1a on the language selection interface 101 to set Chinese as the working language. After that, the electronic device can further respond to the user clicking the "OK" control 1b to enter the region selection interface 102.

[0095] Combination Figure 1 In (b), the region selection interface 102 displays a plurality of country options for the user to select, and the country options are used to select the country or region where the electronic device is currently located. It can be understood that the country options listed in the region selection interface 102 are only examples. Figure 1 As shown in (b), the electronic device can respond to the user clicking the "Country 1" option 2a on the region selection interface 102 to determine that the electronic device is currently in country 1. Afterwards, the electronic device can further respond to the user clicking the "OK" control 2b to enter the keyboard setting interface 103.

[0096] Combination Figure 1 In (c), the keyboard setting interface 103 displays a keyboard icon 3a, text 3d, an "add layout" control 3b, and a "skip" control 3c. The electronic device prompts the user through the keyboard icon 3a and text 3d that the current interface is used to add and set a second keyboard layout. The electronic device can respond to the user clicking the "add layout" control 3b and enter the interface for adding a new keyboard layout (not shown in the figure) to add a second keyboard layout. The electronic device can also respond to the user clicking the "skip" control 3c and enter the network connection interface 104.

[0097] Combination Figure 1 In (d), the network connection interface 104 displays multiple networks available for connection, such as Ethernet, Test1 wireless network, and Test2 wireless network. It is understandable that the networks displayed in the network connection interface 104 are only examples. Figure 1 As shown in (d), the electronic device automatically connects to the Test1 wireless network. The electronic device can disconnect from the Test1 wireless network in response to the user clicking the "disconnect" control 4a under the Test1 wireless network. The electronic device can also enter the account login interface 105 in response to the user clicking the "next" control 4B.

[0098] Combination Figure 1In (e), the account login interface 105 displays a "Login" control 5a, a "Register" control 5b, a "Learn More" control 5c, and a "Next" control 5d. The electronic device can respond to the user clicking the "Login" control 5a to enter the login interface (not shown in the figure) to log in to the Microsoft account. In the case where the user does not have a Microsoft account, the electronic device can also respond to the user clicking the "Register" control 5b to enter the registration interface (not shown in the figure) to register and log in to the account. The electronic device can respond to the user clicking the "Learn More" control 5c to display relevant prompt information about login or registration. The electronic device can also respond to the user clicking the "Next" control 5d to enter the interface 106.

[0099] Combination Figure 1 In (f), a prompt text 6a and a "next" control 6b are displayed on the interface 106. The electronic device informs the user through the prompt text 6a that the account login has been completed. The electronic device can respond to the user clicking the "next" control 6b and enter other setting interfaces (not shown in the figure).

[0100] Understandably, the above Figure 1 The interface displayed by the electronic device in the OOBE stage is only for illustration and does not constitute any limitation on the interfaces and interaction processes in the OOBE stage of the embodiment of the present application. The electronic device in the OOBE stage may also display an interface for setting other information, such as an interface for entering facial information, an interface for setting a power-on password, etc.

[0101] In practice, new electronic products are usually pre-installed with an operating system, such as Windows. During the OOBE phase, you need to log in to an online account corresponding to the operating system, such as a Microsoft account, to activate the new electronic product. Figure 1 In (e), the electronic device can be activated normally only when the user clicks the "Login" control 5a and logs in successfully, or when the user clicks the "Register" control 5b and successfully registers a Microsoft account and logs in successfully.

[0102] Among them, the electronic device successfully logs in to the Microsoft account in the OOBE stage, which means that the electronic device logs in to the Microsoft account authentication server (or simply the authentication server) based on the Microsoft account in the OOBE stage. In actual applications, in the OOBE stage, the electronic device logs in to the Microsoft account through the OOBE service and communicates with the authentication server.

[0103] Since the operating system's authentication servers are often located overseas and physically far away, domestic users often encounter login failures due to connection timeouts when logging into the operating system's online accounts, making it impossible to activate the new machine normally.

[0104] In order to solve the problem that the electronic device fails to log in due to connection timeout, so that the new machine cannot be activated normally, an optional approach is that the electronic device can change the network configuration file in the operating system (when the operating system is a Windows system, the network configuration file is the Hosts file) to switch the first transmission channel between the electronic device and the authentication server to a second transmission channel with a faster transmission speed, thereby accelerating the connection between the electronic device and the authentication server, avoiding login failure due to connection timeout, and realizing normal activation of the electronic device in the OOBE stage. Among them, the first transmission channel is the transmission channel between the electronic device and the authentication server described in the original network configuration file. The second transmission channel is the transmission channel between the electronic device and the authentication server described in the modified network configuration file.

[0105] Considering that after the network configuration file of the operating system is modified, the operating environment of the operating system is not the original operating system environment, after the new machine is activated, other problems may be caused by the modification of the network configuration file in the operating system.

[0106] In some optional implementations, when the electronic device modifies the network configuration file of the operating system during the OOBE stage, it is also necessary to restore the network configuration file in a timely manner during the OOBE stage.

[0107] During the development process, the researchers found that Microsoft's Windows system provides the following API function interface: RegisterWaitUntilOOBECompleted. This API function interface is specifically used in the Windows system to immediately execute a custom callback function when OOBE ends. In other words, the electronic device can register a callback function with the Windows system, and the callback function will be called after OOBE is completed, so as to restore the changes to the network configuration file (specifically, the Hosts file). In other words, by registering a callback function with the operating system, the network configuration file can be restored by executing the callback function when the OOBE service ends.

[0108] However, the researchers also found that during the OOBE process, after the electronic device successfully logs into the authentication server, the Windows system and / or the OOBE service program in the Windows system may be updated. The above update may cause the callback function pre-registered with the Windows system to become invalid, that is, the callback function cannot be executed, resulting in the inability to restore the Hosts file in time during the OOBE phase. In other words, when the electronic device ends the OOBE service, the solution of restoring the network configuration file by executing the callback function may become invalid due to the update, and the stability of the solution is poor.

[0109] It should be pointed out that since the operating system and the OOBE service in the operating system are often not open source, the real-time interaction process and results between the operating system, OOBE service and authentication server, such as whether the account is successfully logged in, are difficult for the outside world to know.

[0110] Based on the above problem description, in order to solve the above technical problems, in the embodiment of the present application, during the OOBE process, the electronic device indirectly determines the file modification time through the computer manager, and when the file modification time is met, the network configuration file in the operating system is modified to accelerate the connection between the electronic device and the authentication server, thereby realizing the normal activation of the electronic device during the OOBE stage. After modifying the network configuration file, the electronic device indirectly determines the file restoration time through the computer manager, and when the file restoration time is met, the computer manager restores the network configuration file of the operating system, specifically restoring it to the state before the modification.

[0111] Among them, the process of the electronic device indirectly determining the file modification time through the computer manager can be: the computer manager attempts to connect to the authentication server by sending a connection request to the authentication server. Specifically, if the computer manager successfully connects to the authentication server, it is considered that the OOBE service can also successfully connect to the authentication server to complete the account login. If the computer manager fails to connect to the authentication server, it is considered that the OOBE service cannot connect to the authentication server either, that is, the account login cannot be completed.

[0112] At this time, the opportunity for file modification is met, which means that the computer manager fails to connect to the authentication server, or the OOBE service cannot connect to the authentication server.

[0113] Among them, the process of the electronic device indirectly judging the timing of file recovery through the computer manager can be: the computer manager monitors the login events of the operating system in real time. When the login event is monitored, the computer manager indirectly judges whether the OOBE service has successfully logged in to the authentication server through the changes in the user name of the operating system. Specifically, if the user name of the operating system has changed, it is considered that the OOBE service has successfully logged in to the authentication server. If the user name of the operating system has not changed, it is considered that the OOBE service has not logged in to the authentication server.

[0114] At this time, the opportunity for file recovery is met when the user name of the operating system has changed, or when the OOBE service successfully logs in to the authentication server.

[0115] In the embodiments of the present application, on the one hand, the operating system and the OOBE service in the operating system are often not open source, and the real-time interaction process and interaction results between the operating system, the OOBE service and the authentication server, such as whether the account is successfully logged in, are difficult to be known by the outside world. On the other hand, when the operating system is started for the first time, in order to ensure that system resources can be accessed normally, the operating system will automatically create a temporary user account, such as defaultuser0. If the OOBE service successfully logs in to the online account, the user account of the operating system will change, and the changed user account can be associated with the logged in online account, for example, the changed user account can be Microsoft. That is, after the OOBE service successfully logs in to the online account, the user name of the operating system will change. On the third hand, during the entire process of the electronic device being in the OOBE stage, there will usually be multiple restarts, that is, there will be multiple login events, but the login event caused by the restart will not change the user name of the operating system.

[0116] Taking the above three aspects into consideration, the electronic device uses the computer manager to indirectly judge the connection status between the OOBE service and the authentication server, and then determines whether to modify the network configuration file to speed up the network connection based on the connection status. In the case of modifying the network configuration file, the computer manager indirectly judges whether the OOBE service has successfully logged into the authentication server, so as to ensure that the network configuration file is restored in time when the OOBE service has successfully logged into the authentication server. On the one hand, it can ensure that the electronic device successfully logs into the online account during the OOBE stage, thereby successfully activating the new machine; on the other hand, the modified network configuration file can be restored in time during the OOBE stage to ensure that the modification during the OOBE stage will not affect the operating system environment during the normal operation of the operating system; on the other hand, the computer manager determines whether the OOBE service has successfully logged into the online account by monitoring the changes in the user name, with high accuracy and low computational complexity. The electronic device can restore the network configuration file in a timely and accurate manner with low computational complexity, which helps to ensure the overall performance of the electronic device.

[0117] In some optional implementations, the electronic device may also perform operations such as indirectly determining the connection status between OOBE and the authentication server, monitoring changes in the operating system user name, etc., through other software programs other than the computer manager, such as a third-party program. That is, the operations mentioned in the embodiments of the present application to be performed by the computer manager are not limited to being implemented by the computer manager. In some application scenarios, they may also be implemented by other software programs.

[0118] The following describes the usage scenarios of the embodiments of the present application:

[0119] The embodiments of the present application may be applicable to a scenario where an electronic device cannot successfully log into an online account of the operating system during the OOBE phase, or cannot log into an authentication server, resulting in a failure to successfully activate the new device.

[0120] The network configuration method provided in the embodiment of the present application can be applied to a new electronic device pre-installed with an operating system. The electronic device can be a personal computer (Personal Computer), such as a tablet computer, a laptop computer, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), etc. It can also be other devices such as vehicle-mounted devices, and the embodiment of the present application is not limited to this.

[0121] In order to better understand the embodiments of the present application, Figure 2A and Figure 2B The structure of the electronic device according to the embodiment of the present application is introduced.

[0122] Figure 2A A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0123] Take the electronic device as a PC as an example, Figure 2A As shown, the PC may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna, a sensor module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a button 180, a display 190, and the like.

[0124] The processor 110 may include one or more processing units, for example, the processor 110 may include a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an image signal processor (ISP), a neural-network processing unit (NPU), a video codec, a modem, and / or a baseband processor, etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors.

[0125] Among them, the CPU is the final execution unit for information processing and program running, and its main tasks include processing instructions, executing operations, controlling time and processing data. The CPU may include a controller, an arithmetic unit, a cache memory, and a bus for connecting these components. The controller is the nerve center and command center of the PC. The controller can generate operation control signals based on instruction opcodes and timing signals to complete the control of fetching and executing instructions. The arithmetic unit refers to a component that performs various arithmetic and logical operations. The cache memory can store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the cache memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.

[0126] GPU, also known as display core, visual processor or display chip, is a microprocessor for graphics and image processing. GPU connects display 190, AP and CPU. GPU can be used to perform complex mathematical and geometric calculations, floating point operations, parallel calculations, and can also be used for graphics rendering. GPU reduces the graphics card's dependence on the CPU, especially in 3D graphics processing. GPU uses core technologies such as cubic environment material mapping and vertex blending, so GPU performs some of the work originally done by the CPU.

[0127] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the PC. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function.

[0128] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the PC by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application (Application, APP) required for at least one function, such as a computer manager APP. The data storage area can store various configuration files, such as the Hosts file of the Windows system. The data storage area can also store data created during the use of the PC, such as a temporary user name of the operating system. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device and / or a universal flash memory (Universal Flash Storage, UFS), etc.

[0129] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the PC, can also be used to transfer data between the PC and peripheral devices, can also be used to connect headphones to play audio through the headphones. The USB interface 130 can also be used to connect other electronic devices, such as a wired mouse, a wireless mouse, and a speaker.

[0130] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the PC. While the charging management module 140 is charging the battery 142, it can also power the PC through the power management module 141.

[0131] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status. In some embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0132] The embodiments of the present application involve two power supply modes: alternating current (AC) power supply and direct current (DC) power supply. Among them, AC power supply means that the charger is connected to the AC power supply provided by the municipality, and after the power conversion, the processor 110, the internal memory 121, the external memory, the display 190 and the wireless communication module 160 are powered by the charging management module 140 and the power management module 141. DC power supply means that the charger is disconnected from the AC power supply provided by the municipality, and the processor 110, the internal memory 121, the external memory, the display 190 and the wireless communication module 160 are powered by the battery 142 and the power management module 141.

[0133] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied on the PC. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0134] The PC can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the AP, etc. For example, during the OOBE process, voice is played to prompt the user to perform corresponding setting operations, and voice commands input by the user are received.

[0135] The key 180 may be a mechanical key (such as a physical keyboard) or a touch key. For example, during the OOBE process, the PC may receive a user input to the key 180 and generate a key signal input related to the user settings of the PC.

[0136] The display 190 is used to display images, videos, etc. For example, during the OOBE process, the display 190 may display the following Figure 1The interface shown. The display 190 may include a signal processing module and a display panel. The signal processing module may periodically report a tearing effect (TE) signal to the CPU / GPU driver to trigger the CPU / GPU to render the user interface (UI). For example, the display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the PC may include 1 or N displays 190, where N is a positive integer greater than 1.

[0137] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Windows system of the layered architecture as an example to illustrate the software structure of the electronic device.

[0138] Figure 2B It is a block diagram of the hardware layer and the software structure on the processor provided on the electronic device of the embodiment of the present application. Specifically, the processor can interact with the chip provided on the hardware layer. Optionally, the processor can be provided on the SOC. Among them, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Windows system is divided into four layers, namely, the application layer, the operating system (OS) layer, the hardware abstraction layer (HAL) and the hardware layer from top to bottom. The application layer may include a series of application packages.

[0139] The application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. The application package can also include inter-process communication service (or IPC service), out-of-box experience service (or OOBE service) and computer manager (or PC manager).

[0140] PC Butler is used to manage the system. During the OOBE stage, PC Butler can indirectly monitor whether the OOBE service has successfully logged into the online account. If it is determined that the OOBE service has not logged into the online account, PC Butler can modify the network configuration file in the operating system and monitor the login events of the operating system in real time through the IPC service. When a login event is monitored, PC Butler can determine whether the OOBE service has successfully logged into the authentication server by the changes in the user name of the operating system. If OOBE successfully logs in to the authentication server, PC Butler can restore the modified network configuration file in time, specifically to the state before the modification. In this way, it can be ensured that the electronic device can successfully log in to the online account during the OOBE stage without affecting the existing operating system environment, thereby successfully activating the new machine.

[0141] The OS layer includes various drivers, such as the mouse driver and the touch driver. Specifically, the mouse driver is used to process mouse events, and the touch driver is used to process touch events. The mouse driver and the touch driver interact with the HAL layer through the OS layer's Human Interface Devices (HID) driver, and interact with the application layer through the Windows API interface. Among them, the HID driver is used to drive human interface devices (such as mouse devices and touchpad devices).

[0142] HAL is a kernel-state module that can hide various hardware-related details, such as I / O interfaces, interrupt controllers, and multi-processor communication mechanisms, and provide a unified service interface for different hardware platforms running Windows, achieving portability on multiple hardware platforms. It should be noted that in order to maintain the portability of Windows, Windows internal components and user-written device drivers do not directly access the hardware, but call routines in HAL.

[0143] The hardware layer includes various hardware devices, including various sensors and the corresponding driver chips of various sensors. For example, the hardware layer includes: touchpad and the corresponding touchpad chip (Touch IC), force sensor (ForceSensor) and the corresponding force chip (Force IC), linear resonant actuator (Linear Resonant Actuator, LRA, also known as motor vibrator) and the corresponding tactile chip (Haptic IC, also known as motor chip). Among them, the touch sensor is set on the touchpad.

[0144] The following example uses the Windows operating system and a Microsoft account as the online account to be logged in. Figure 3 and Figure 2BThe network configuration method provided in the embodiment of the present application is described. Figure 3 A flowchart of a network configuration method provided in an embodiment of the present application.

[0145] Figure 3 In the example, the electronic device may include Windows system, PC manager and IPC service. OOBE service is a service provided by the operating system. OOBE service, IPC service and PC manager are located in Figure 2B The application layer in Figure 3 , the network configuration method provided in the embodiment of the present application may include the following steps S301 to S316. It is understandable that the above-mentioned network configuration method may include all the steps in steps S301 to S316, or may only include some of the steps. It is understandable that the steps in the network configuration method can be arbitrarily combined without conflict. As an optional embodiment of the present application, the network configuration method may be a scheme that only includes steps S301 to S308. As another optional embodiment of the present application, the network configuration method may also be a scheme that only includes steps S307 to S308.

[0146] S301, Windows system starts.

[0147] S302, PC Manager starts.

[0148] Among them, Computer Manager is the security software that comes with electronic devices when they leave the factory, which is used to protect electronic devices from malware, viruses, hacker attacks and other security threats.

[0149] S303, IPC service starts.

[0150] It should be noted that when the electronic device is turned on, the Windows system, computer manager and IPC service in the electronic device will be started along with the electronic device. The Windows system, computer manager and IPC service can be started at the same time or at different times. The present embodiment of the application does not specifically limit the order in which the Windows system, computer manager and IPC service are started. That is, the present embodiment of the application does not specifically limit the execution order of steps S301-S303.

[0151] S304, when the Windows system determines that this startup is the first startup, it starts the OOBE service and creates a temporary user account.

[0152] Here, the process from the start of the OOBE service to the end of its operation can be called the OOBE process or the OOBE stage.

[0153] The name or identifier of a temporary user account may also be referred to as a temporary user name. A temporary user name is a user name of a temporarily created user account.

[0154] It should be pointed out that when the Windows system is started for the first time, a temporary user account will be created, for example, defaultuser0. This temporary user account is used to help complete the initial setup during the OOBE phase. Once the setup is completed and the actual user account is created, the temporary user account will be deleted.

[0155] S305, PC Manager checks whether the Windows system is currently in the OOBE stage.

[0156] In practice, each time the computer manager is started, it can send a query message to the Windows system to query the Windows system whether it is currently in the OOBE stage. It can be understood that the specific content of the query message is not limited in the embodiment of the present application.

[0157] S306, the Windows system replies whether it is currently in the OOBE stage.

[0158] Here, when receiving the query information from the computer manager, the Windows system can send a reply message to the computer manager, and reply whether the current phase is in the OOBE phase through the reply message.

[0159] For example, when the Windows system starts the OOBE service, the Windows system can send a first message to the computer manager, wherein the first message indicates that the computer is currently in the OOBE stage. Conversely, when the Windows system does not start the OOBE service, the Windows system can send a second message to the computer manager, wherein the second message indicates that the computer is not currently in the OOBE stage.

[0160] It is understandable that the embodiments of the present application do not limit the specific content of the first information and the second information. As an example, the first information may be "true" and the second information may be "false". As another example, the first information may be "1" and the second information may be "0".

[0161] In actual applications, when the electronic device is started for the first time, the Windows system will reply to the computer manager that it is currently in the OOBE stage, for example, replying to the computer manager with the first message, and reply to the computer manager that it is not in the OOBE stage for each startup after the first startup, for example, replying to the computer manager with the second message.

[0162] It should be noted that after the computer manager is started, it can determine whether the electronic device is in the OOBE stage by executing the above-mentioned S305 and S306 operations.

[0163] In some optional implementations, since the OOBE service is running, the process information of the OOBE service can be found from the running process list, so the computer manager can determine whether the OOBE is running by analyzing the process list, thereby determining whether the electronic device is in the OOBE stage. Specifically, if the OOBE process is in the process list, the computer manager can determine that the electronic device is in the OOBE stage, and conversely, if the OOBE process does not appear in the process list, the computer manager can determine that the electronic device is not in the OOBE stage.

[0164] S307, when the electronic device is in the OOBE stage, the computer manager sends a connection request to the authentication server.

[0165] The authentication server is a server provided by Microsoft Corporation, and the authentication server is used to authenticate the Microsoft account. The connection request is used to request to establish a connection with the authentication server. The embodiment of the present application does not specifically limit the content of the connection request.

[0166] Here, PC Manager can send a connection request to the authentication server according to the address of the authentication server.

[0167] In some application scenarios, the address of the authentication server can be pre-configured in the computer manager, so that the computer manager can directly obtain the address of the authentication server. In other application scenarios, the computer manager can also obtain the address of the authentication server from the Hosts file in the Windows system. It can be understood that the embodiment of the present application does not specifically limit the way in which the computer manager obtains the address of the authentication server.

[0168] S308, the computer manager determines whether the connection fails based on whether a response message is received from the authentication server.

[0169] Here, since the authentication server can return a response message to the computer manager in response to the connection request when receiving the connection request, when the computer manager receives the response message, it means that the computer manager is successfully connected to the authentication server. On the contrary, when the computer manager does not receive the response message, it means that the computer manager fails to connect to the authentication server. In practice, the above-mentioned computer manager does not receive the response message, which usually means that the computer manager does not receive the response message within a certain pre-set time period, such as 5 seconds.

[0170] It should be pointed out that if the computer manager cannot receive a response message from the authentication server, it means that the computer manager cannot connect to the authentication server and the current network speed is not fast enough. At this time, the computer manager can assume that the OOBE service cannot connect to the authentication server either.

[0171] S309, when the computer manager fails to connect to the authentication server, it modifies the Hosts file in the Windows system.

[0172] The Hosts file is a network configuration file of the Windows system. As an example, the computer manager can modify the content X1 recorded in the Hosts file to content X2, wherein the content X1 indicates that the communication channel between the electronic device and the authentication server is the first transmission channel, and the content X2 indicates that the communication channel between the electronic device and the authentication server is the second transmission channel.

[0173] Here, the main reason why PC Manager and OOBE service cannot connect to the authentication server is that the authentication server is overseas. It takes a long time to connect to the authentication server, and it is easy to fail due to connection timeout. In order to shorten the network connection time, PC Manager can speed up the network transmission speed between the electronic device in the OOBE stage and the authentication server by modifying the Hosts file.

[0174] It is understandable that the authentication server is overseas is only an example scenario. In some optional embodiments, the network configuration method of the present application can also be applied to the situation where the distance between the electronic device and the authentication server is very far (specifically, the distance between the electronic device and the authentication server exceeds a preset distance threshold). That is, in the case where the distance between the electronic device and the authentication server is very far, the transmission channel between the electronic device and the authentication server can be changed by modifying the Hosts file in the operating system of the electronic device to ensure that the electronic device successfully logs in to the authentication server, thereby ensuring that the electronic device is normally activated in the OOBE stage.

[0175] In practice, the computer manager can modify the Hosts file to switch the communication channel between the electronic device and the authentication server to a faster communication channel, thereby speeding up the network transmission speed between the electronic device in the OOBE stage and the authentication server.

[0176] In actual applications, the computer manager can write pre-set configuration items into the Hosts file through the stability plug-in in the computer manager, so that the OOBE service can access the authentication server based on the modified Hosts file. Among them, the pre-set configuration items can be set in combination with the actual access situation or path. For example, when the function of the pre-set configuration items is to instruct the OOBE service to access the authentication server via the second transmission channel, the pre-set configuration items need to describe the information related to the second transmission channel. For further example, if the pre-set configuration items are A and B, when the computer manager modifies the Hosts file, A and B can be directly written into the Hosts file, for example, written to the end of the Hosts file.

[0177] Optionally, the second transmission channel passes through a second server, and the second server is point-to-point connected to the first server. At this time, the pre-set configuration item may involve the IP address of the second server. The second server and the electronic device are located in the same physical area, for example, in the same country. It should be noted that when the second transmission channel passes through the second server, the electronic device is connected to the authentication server through the second server, that is, the electronic device is connected to the second server, and the second server is connected to the authentication server, and the electronic device and the authentication server are indirectly connected.

[0178] It should be pointed out that the point-to-point connection between two servers means that a direct, point-to-point communication connection is established between the two servers, rather than communicating through other intermediate nodes in the network. The point-to-point connection method can achieve efficient and secure data transmission, and can reduce delays and interference in the communication process. Therefore, the point-to-point connection between the first server and the second server can greatly improve the network transmission speed between the electronic device and the first server, thereby ensuring that the electronic device can successfully connect to the first server (or authentication server), which can also ensure that the electronic device can be activated normally during the OOBE stage.

[0179] In the embodiment of the present application, the configuration items can be set in a manner disclosed in the relevant technology to switch the transmission channel between the OOBE service and the authentication server from one transmission channel to another transmission channel, for example, from the original first transmission channel to the aforementioned second transmission channel. The embodiment of the present application does not specifically limit how to set the configuration items.

[0180] It is understandable that when the computer manager receives the response message returned by the authentication server, it will not trigger the execution of the above-mentioned operations S309 to S316.

[0181] S310, PC Manager obtains the user name from the Windows system.

[0182] The user name is the name or identifier of a user account in the Windows system.

[0183] Here, for the convenience of description, the user name acquired in step S310 may be recorded as the first user name.

[0184] In practice, the computer manager can obtain a registry from the Windows system when it is started. The registry records the user name used by the Windows system at the last startup. If there is no user name in the registry, it means that this startup is the first startup. At the first startup, the computer manager can obtain a user name from the Windows system, and the user name obtained is a temporary user name created by the Windows system in step 304.

[0185] After the computer manager obtains the user name, the obtained user name can be written into the registry, that is, the above temporary user name obtained at the first startup can be written into the registry.

[0186] It should be pointed out that when the computer manager does not record the user name in the registry, obtaining the user name from the Windows system can further ensure that the network configuration related operations of the embodiment of the present application are executed when the electronic device is started for the first time.

[0187] It is understandable that in some application scenarios, PC Manager may also obtain the user name from the Windows system when the connection with the authentication server fails.

[0188] S311, when the computer manager fails to connect to the authentication server, it subscribes to the login event from the IPC service.

[0189] The login event refers to an event triggered when a user successfully logs in on the operating system.

[0190] Here, the computer manager can subscribe to login events to the IPC service in a manner disclosed in the relevant technology, and the embodiments of the present application do not make specific limitations.

[0191] It should be pointed out that during the entire process of the electronic device being in the OOBE stage, there are usually multiple restarts, that is, there are multiple login events, but the login events caused by the restart will not change the user name of the Windows system.

[0192] S312, PC Manager receives an event message from the IPC service.

[0193] Among them, the above event message is a message indicating that a login event has occurred. The embodiment of the present application does not limit the specific content of the event message. The event message of the login event can have other names, for example, it can be named as a session switching message. It can be understood that the embodiment of the present application does not specifically limit the naming of the event message of the login event.

[0194] Here, in the case of a login event, the IPC service can send an event message of the login event to the computer manager that has subscribed to the login event.

[0195] S313, when receiving the event message, the computer manager obtains the user name from the Windows system.

[0196] Here, PC Manager can obtain the current user name from the Windows system when receiving the event message sent by the IPC service.

[0197] For the convenience of description, the user name acquired in step S313 may be referred to as the second user name.

[0198] It is understandable that the computer manager can obtain the user name currently logged in to the Windows system from the Windows system through the methods disclosed in the relevant technology. The embodiment of the present application does not specifically limit how to obtain the user name from the Windows system.

[0199] S314, the computer manager compares the two obtained user names to determine whether the user name has changed.

[0200] Here, the electronic device may compare the first user name obtained in step S310 with the second user name obtained in step S313 for consistency to determine whether the user name of the Windows system has changed in the OOBE stage.

[0201] In practice, after obtaining the second user name, the computer manager can compare the second user name with the user name currently recorded in the registry, that is, the aforementioned temporary user name. If the two are the same, it means that the OOBE service has not successfully logged into the authentication server. If the two are different, it means that the OOBE service has successfully logged into the authentication server.

[0202] Optionally, if the second user name is different from the user name currently recorded in the registry, Computer Manager can replace the user name currently recorded in the registry with the second user name, that is, replace the aforementioned temporary user name. After the replacement, the second user name is recorded in the registry.

[0203] S315, when the user names obtained twice are different, the computer manager restores the Hosts file.

[0204] Restoring the Hosts file refers to restoring the modified Hosts file to the state before the modification. For example, if in the above step S309, the process of modifying the Hosts file by the computer manager is: modifying the content X1 recorded in the Hosts file to the content X2. Then the process of restoring the Hosts file in step S315 is: restoring the content X2 recorded in the Hosts file to the content X1.

[0205] In practice, the operations of modifying and restoring Hosts files are usually performed by the stability plug-in in Computer Manager.

[0206] In practice, if in the above step S309, the process of modifying the Hosts file by the computer manager is: writing the preset configuration items into the Hosts file, then the process of restoring the Hosts file in step S315 is: deleting the configuration items written when modifying the Hosts file from the Hosts file, so that the Hosts file is restored to the state before the modification. For further example, if the computer manager writes A and B into the Hosts file when modifying the Hosts file, then when restoring the Hosts file in step S315, it only needs to delete A and B from the Hosts file.

[0207] It should be noted that the computer manager can restore the modified Hosts file by the method disclosed in the relevant technology. The embodiment of the present application does not specifically limit how to restore the Hosts file.

[0208] It should be noted that after the computer manager restores the Hosts file, the network connection between the electronic device and the authentication server may be disconnected. Since the electronic device only needs to log in to the authentication server once during the OOBE process, disconnecting after logging in will not affect subsequent OOBE operations. In other words, the solution of the embodiment of the present application can ensure that the electronic device is normally activated during the OOBE process, and the solution has good stability.

[0209] S316, the computer device cancels the subscription login event to the IPC service.

[0210] Here, after restoring the Hosts file, the computer manager can unsubscribe from the login event to the IPC service in a manner disclosed in the relevant technology, and the embodiments of the present application do not make specific limitations.

[0211] Combination Figure 3 It can be found that the network configuration method provided in the embodiment of the present application can have the following effects:

[0212] 1. When the OOBE service fails to establish a network connection with the authentication server, the electronic device can modify the Hosts file to speed up the network transmission speed between the electronic device and the authentication server to ensure that the electronic device can successfully log in to the Microsoft account during the OOBE stage, thereby successfully activating the new device.

[0213] 2. Electronic devices can restore the modified Hosts file in time during the OOBE stage to ensure that the modifications made during the OOBE stage will not affect the operating system environment during normal operation of the operating system.

[0214] 3. PC Manager determines whether the OOBE service has successfully logged into the Microsoft account by monitoring changes in the user name. It has high accuracy and low computational complexity. Electronic devices can restore the Hosts file in a timely and accurate manner with low computational complexity, which helps to ensure the overall performance of electronic devices.

[0215] Figure 3 It is a combination Figure 2B The network configuration method is described by taking the specific software architecture of as an example, but the present application is not limited thereto.

[0216] The following further combines Figure 4 The network configuration method of the embodiment of the present application is explained. Figure 4 Another flowchart of the network configuration method provided in an embodiment of the present application. Figure 4 In the embodiment, the execution subject of the network configuration method can be an electronic device, and there is no specific limitation on the internal modules.

[0217] Figure 4 The method flow shown includes at least the following steps:

[0218] S401, the electronic device enters the OOBE stage.

[0219] Here, when the electronic device is started for the first time, the operating system of the electronic device starts the OOBE service, and the electronic device enters the OOBE stage.

[0220] S402, the electronic device records the current temporary user name.

[0221] Among them, the user name obtained by the electronic device in step S402 is the aforementioned first user name.

[0222] Here, the electronic device may record the user name created and used when the operating system is first started, that is, the aforementioned temporary user name.

[0223] S403, the electronic device determines whether it has successfully logged into the authentication server.

[0224] Here, if the electronic device fails to log in to the authentication server, the operation of step S404 can be performed, and if the electronic device successfully logs in to the authentication server, step S411 is performed, that is, the execution of the network configuration method is terminated.

[0225] Here, the electronic device can indirectly determine whether it is currently logged in to the authentication server by sending a connection request to the authentication server through the computer manager. The specific judgment process is referred to the aforementioned step S307 and step S308, which will not be repeated here.

[0226] S404: When the electronic device determines that the login to the authentication server fails, the electronic device modifies the Hosts file of the operating system.

[0227] S405, the electronic device subscribes to the IPC service message.

[0228] The above-mentioned subscription to the IPC service message is a subscription to a login event.

[0229] In practice, the electronic device subscribes to the login event from the IPC service through the computer manager. When the login event occurs, the IPC service can send the corresponding event message to the computer manager.

[0230] S406, the electronic device waits for a login event.

[0231] S407, when the electronic device detects a login event, it queries the operating system for the latest current user name.

[0232] Among them, the user name obtained by the electronic device in step S407 is the aforementioned second user name.

[0233] S408, the electronic device determines whether the user name of the operating system has changed.

[0234] Here, if the user name of the operating system changes, that is, the first user name is different from the second user name, the electronic device can perform the operation of step S409. If the user name of the operating system does not change, that is, the first user name is the same as the second user name, it means that the currently detected login event may be caused by the restart of the electronic device. At this time, the electronic device can perform step S406 and continue to wait for the login event.

[0235] S409, the electronic device restores the Hosts file.

[0236] S410, the electronic device cancels subscription to the IPC service message.

[0237] S411, the electronic device ends the process of the network configuration method.

[0238] The operation details, principles and beneficial effects of steps S401 to S411 can all be referred to in the above Figure 3 The relevant descriptions of the corresponding embodiments are not repeated here.

[0239] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0240] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0241] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0242] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0243] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions and should not be understood as indicating or implying relative importance. It should also be understood that although the terms "first", "second", etc. are used in the text to describe various elements in some embodiments of the present application, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element.

[0244] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0245] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0246] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0247] An embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned method embodiments.

[0248] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0249] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0250] Those of ordinary skill 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 depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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 this application.

[0251] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0252] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A network configuration method, It is characterized in that The method comprises: When the electronic device is in the unboxing experience stage, detecting the connection status between the electronic device and the first server, the connection status including connection failure or connection success, and the first server is used to authenticate the identity of the electronic device; When the connection condition is a connection failure, modifying the network configuration file, wherein the modifying the network configuration file includes: modifying a first transmission channel between the electronic device and the first server to a second transmission channel, wherein a transmission speed of the second transmission channel is greater than a transmission speed of the first transmission channel; Acquire a first user name of an operating system in the electronic device, where the first user name is a temporary user name created by the operating system when the electronic device enters the unboxing experience stage; When a login event is detected, obtaining a second user name of the operating system; When the first user name is different from the second user name, the network configuration file is restored so that the electronic device can operate normally in the original operating system environment after the unboxing experience stage, and the restoring of the network configuration file includes: modifying the second transmission channel between the electronic device and the first server to the first transmission channel; the first user name is different from the second user name, indicating that the electronic device successfully logs into the online account of the operating system during the unboxing experience stage.

2. The network configuration method according to claim 1, It is characterized in that The second transmission channel includes a second server, and the second server is point-to-point connected to the first server.

3. The network configuration method according to claim 1, It is characterized in that The detecting the connection status between the electronic device and the first server includes: Sending a connection request to the first server; In the case where no response message to the connection request is received from the first server, it is determined that the connection between the electronic device and the first server fails.

4. The network configuration method according to claim 3, It is characterized in that The detecting the connection status between the electronic device and the first server also includes: When a response message from the first server to the connection request is received, it is determined that the electronic device is successfully connected to the first server.

5. The network configuration method according to claim 1, It is characterized in that The obtaining of a first user name of an operating system in the electronic device includes: When the electronic device is started, detecting whether a user name is recorded in the registration table; When the user name is not recorded in the registry, the user name currently used by the operating system is obtained, and the obtained user name is determined as the first user name.

6. The network configuration method according to claim 5, It is characterized in that When a login event is detected, obtaining a second user name of the operating system includes: When a login event is detected, a user name currently used by the operating system is obtained, and the obtained user name is determined as the second user name.

7. The network configuration method according to claim 1, It is characterized in that Before acquiring the second user name of the operating system when a login event is detected, the method further includes: The electronic device subscribes to a login event from an inter-process communication service via a computer manager; Wherein, when a login event is detected, obtaining a second user name of the operating system includes: The computer manager obtains the second user name of the operating system when receiving the first event message sent by the inter-process communication service, wherein the first event message indicates that a login event is detected.

8. The network configuration method according to claim 7, It is characterized in that After restoring the network configuration file, the method further includes: The electronic device cancels the subscription to the login event from the inter-process communication service through the computer manager.

9. The network configuration method according to any one of claims 1 to 8, It is characterized in that The electronic device determines, through the computer manager, whether the electronic device is in the unboxing experience stage; The computer manager determines whether the electronic device is in the unboxing experience stage, including: Sending query information to the operating system, where the query information is used to query whether the current stage is the unboxing experience stage; Receiving reply information returned by the operating system, wherein the reply information includes first information or second information, the first information indicates that the system is currently in the unboxing experience stage, and the second information indicates that the system is not currently in the unboxing experience stage; Determine whether the electronic device is in the unboxing experience stage according to the reply information.

10. An electronic device, It is characterized in that The electronic device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the network configuration method according to any one of claims 1 to 9 is implemented.

11. A chip system comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, It is characterized in that The processor is configured to execute the computer program to implement the network configuration method according to any one of claims 1 to 9.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device executes the network configuration method according to any one of claims 1 to 9.