Device configuration methods, devices, storage media and software products

By unifying the software version in routers and adjusting module configurations using target configuration files, the problems of high cost and long cycle in router customization services are solved, enabling flexible multi-regional configuration and low-cost production.

CN120750754BActive Publication Date: 2026-05-26HONOR DEVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-05-29
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In the existing technology, the customized business model of routers results in high product development costs, long testing cycles, long production cycles and long delivery cycles, which cannot meet the personalized needs of different regions, and the rework cost is high when delivery requirements change.

Method used

By implementing a unified software version in the router, the target configuration file can be obtained using the default configuration file and the target region identifier, and the configuration of the software modules can be dynamically adjusted to reduce redundant development and testing, and support flexible configuration for multiple regions.

Benefits of technology

This allows for the fulfillment of customization needs across multiple regions with a single software version, reducing development and production costs, shortening testing cycles, and minimizing shipping time and rework costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750754B_ABST
    Figure CN120750754B_ABST
Patent Text Reader

Abstract

This application discloses a device configuration method, device, storage medium, and program product, belonging to the field of computer technology. The method includes: after the electronic device starts up, first starting at least one software module among multiple software modules in the electronic device with a default configuration; then obtaining a target region identifier corresponding to the electronic device from a server; and subsequently adjusting the configuration of the multiple software modules according to a target configuration file corresponding to the target region identifier to achieve the functions required by the region identified by the target region identifier. This application can flexibly implement the functions required by various regions based on a single software version, reducing the cost of the electronic device while ensuring its normal operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a device configuration method, device, storage medium, and program product. Background Technology

[0002] Routers are widely used across various industries. Different telecom operators and provinces / cities may have varying requirements for router configurations. Therefore, operators often commission router manufacturers to customize products. Currently, the basic models for customization typically include group-level customization, provincial-level customization, and city-level customization. For each province / city with additional customization needs beyond the group-level version, manufacturers need to develop and produce products separately, resulting in higher costs. Summary of the Invention

[0003] This application provides a device configuration method, device, storage medium, and program product, which can reduce the cost of electronic devices. The technical solution is as follows:

[0004] Firstly, a device configuration method is provided. This method is applied to an electronic device, which includes multiple software modules. In this method, after the electronic device starts, at least one of the multiple software modules is started according to a default configuration file, which includes configuration information for each of the multiple software modules. Then, a target region identifier corresponding to the electronic device is obtained from a server, and a target configuration file is obtained from a stored mapping between region identifiers and configuration files based on the target region identifier. Finally, the configuration of the multiple software modules is adjusted according to the target configuration file.

[0005] Each of these multiple software modules corresponds to one or more configuration items.

[0006] The configuration information of a software module includes the enable status and configuration parameters of the configuration items corresponding to the software module. The enable status indicates whether the configuration items corresponding to the software module are enabled; if the enable status is "No", that is, if the enable status indicates that the configuration items are not enabled, the corresponding configuration parameters are empty; if the enable status is "Yes", that is, if the enable status indicates that the configuration items are enabled, the corresponding configuration parameters are the configuration parameters of each configuration item corresponding to the software module, and the configuration parameters of a configuration item are the specific data used to configure the configuration item.

[0007] The target configuration file is the configuration file corresponding to the target region identifier; that is, it is the configuration file for the region identified by the target region identifier. The target configuration file may include the configuration information of each software module in at least one of the multiple software modules in the electronic device.

[0008] In this application, after the electronic device starts up, at least one of the multiple software modules can be started with a default configuration. Then, the target region identifier corresponding to the electronic device is obtained from the server. Subsequently, the configuration of the multiple software modules is adjusted according to the target configuration file corresponding to the target region identifier to achieve the functions required by the region identified by the target region identifier. In this way, the functions required by various regions can be flexibly implemented on the basis of a single software version, reducing the cost of the electronic device while ensuring its normal operation.

[0009] In one possible implementation, the operation of starting at least one of the multiple software modules according to the default configuration file can be as follows: for the configuration information of any software module included in the default configuration file, if the enabling status of the software module in the configuration information is disabled, then the software module is not started; if the enabling status of the software module in the configuration information is enabled, then the software module is started according to the configuration parameters in the configuration information of the software module.

[0010] For example, starting the software module based on the configuration parameters in its configuration information can be done by passing the configuration parameters as input parameters to the software module when it is started. After starting, the software module can then perform corresponding configurations based on these parameters to achieve the desired functionality.

[0011] In this application, after the electronic device is started, at least one of the multiple software modules is started with the default configuration, thereby ensuring that the electronic device can operate normally after startup.

[0012] In one possible implementation, the operation of obtaining the target region identifier corresponding to the electronic device from the server can be: sending a region identifier retrieval request to the server, the region identifier retrieval request carrying the device identifier of the electronic device; and receiving the target region identifier sent by the server.

[0013] It should be noted that when the electronic device leaves the factory, technicians can pre-store the correspondence between the device identifier of the electronic device and the identifier of the region where the electronic device is permitted to be used (such as the region where the electronic device needs to be shipped) in the server.

[0014] For example, the device identifier of the electronic device can be the SN of the electronic device, and the region that the electronic device is allowed to use can be a certain province. Then the region identifier (i.e. the target region identifier) ​​corresponding to the SN of the electronic device can be the province code.

[0015] In this application, the electronic device can quickly obtain the target region identifier corresponding to the electronic device from the server when in use, and implement the corresponding configuration accordingly.

[0016] Furthermore, for manufacturers, when shipping requirements change, such as changing an electronic device originally destined for region A to region B, they only need to change the region identifier corresponding to the device identifier of the electronic device stored on the server from the region A identifier to the region B identifier, and then the electronic device can be directly shipped to region B. Afterwards, when the electronic device is in use, it can obtain the region B identifier from the server and implement the configuration required by region B accordingly. Thus, compared to related technologies that require rework of the product when shipping requirements change, this application only requires modifying the corresponding relationship stored on the server, thereby significantly reducing costs.

[0017] In one possible implementation, the operation of adjusting the configuration of the multiple software modules according to the target configuration file can be as follows: based on the differences between the target configuration file and the default configuration file, obtain one or more difference configuration information from the target configuration file; for any one of the difference configuration information, adjust the configuration of the software module corresponding to the difference configuration information according to the difference configuration information.

[0018] Optionally, based on the differences between the target configuration file and the default configuration file, the operation of obtaining one or more difference configuration information from the target configuration file can be as follows: compare the target configuration file with the default configuration file, and for the configuration information of any software module included in the target configuration file, if the configuration information of the software module in the target configuration file is different from the configuration information of the software module in the default configuration file, then the configuration information of the software module in the target configuration file is taken as difference configuration information.

[0019] Optionally, adjusting the configuration of the software module corresponding to the difference configuration information based on the difference configuration information can be done as follows: if the enabling status in the difference configuration information is disabled, then the software module corresponding to the difference configuration information is disabled. If the enabling status in the difference configuration information is enabled, then if the software module corresponding to the difference configuration information is not started, then the software module corresponding to the difference configuration information is started according to the configuration parameters in the difference configuration information; if the software module corresponding to the difference configuration information is started, then the configuration of the software module corresponding to the difference configuration information is adjusted according to the configuration parameters in the difference configuration information.

[0020] In this application, multiple software modules can be dynamically configured based on the differences between the target configuration file and the default configuration file. This allows the required functions for the region corresponding to the target configuration file to take effect without restarting the electronic device, thereby improving configuration efficiency and reducing power consumption.

[0021] In one possible implementation, after obtaining the target region identifier corresponding to the electronic device from the server, the target region identifier can also be stored. Furthermore, after adjusting the configuration of the multiple software modules according to the target configuration file, a runtime configuration file can be generated based on the configuration of the multiple software modules.

[0022] It should be noted that each time the configuration of these multiple modules changes, a new runtime configuration file can be generated based on the configuration of these multiple software modules. The newly generated runtime configuration file will overwrite the previously generated runtime configuration file.

[0023] In one possible implementation, the method further includes: in response to a received factory reset command, deleting the stored target region identifier and the runtime configuration file; and restarting the electronic device.

[0024] In one possible implementation, after the electronic device starts up, the operation of starting at least one of the multiple software modules according to the default configuration file can be: after the electronic device starts up, starting at least one of the multiple software modules according to the default configuration file in the absence of a running configuration file.

[0025] For example, if there is no running configuration file when the electronic device is first started, or if there is no running configuration file after the electronic device is restored to factory settings, at least one of the multiple software modules will be started according to the default configuration file.

[0026] After the electronic device is started, at least one of the multiple software modules is started according to the running configuration file if a running configuration file exists.

[0027] For example, if the electronic device restarts in response to a received restart command and there is a previously generated runtime configuration file in the electronic device, then at least one of the multiple software modules can be started first based on the runtime configuration file.

[0028] In one possible implementation, the operation of obtaining the target region identifier corresponding to the electronic device from the server can be: obtaining the target region identifier from the server if the target region identifier is not stored.

[0029] For example, if the target region identifier is not present when the electronic device is first started, or if the target region identifier is not present after the electronic device is restored to factory settings, the target region identifier is obtained from the server so that the corresponding configuration can be performed accordingly to realize the functions required by the region identified by the target region identifier.

[0030] If the target region identifier has been stored, it can be confirmed that the configuration has been completed.

[0031] If the target region identifier has been stored, and the electronic device restarts in response to a received restart command, the electronic device has already obtained the target region identifier before restarting and has made corresponding configurations to obtain a running configuration file. After the electronic device restarts this time, it has already implemented the functions required by the region identified by the target region identifier by starting the corresponding software module according to the running configuration file. Therefore, if the target region identifier has been stored, it can be determined that the configuration has been completed.

[0032] Secondly, a device configuration apparatus is provided, which has the function of implementing the device configuration method described in the first aspect. The device configuration apparatus includes at least one module for implementing the device configuration method provided in the first aspect.

[0033] Thirdly, an electronic device is provided, comprising: one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the device configuration method provided in the first aspect.

[0034] Fourthly, a chip system is provided for use in an electronic device, the chip system including one or more processors for invoking computer instructions to cause the electronic device to execute the device configuration method provided in the first aspect.

[0035] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the device configuration method provided in the first aspect.

[0036] In a sixth aspect, a computer program product is provided that, when the computer program product is run on an electronic device, causes the electronic device to execute the device configuration method provided in the first aspect.

[0037] The technical effects achieved by the second, third, fourth, fifth, and sixth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of a unified software version provided in an embodiment of this application;

[0039] Figure 2This is a schematic diagram illustrating the difference between a provincial / municipal version in a related technology provided in an embodiment of this application and a unified version in this application;

[0040] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0041] Figure 4 This is a schematic diagram of a software system for an electronic device provided in an embodiment of this application;

[0042] Figure 5 This is a schematic diagram illustrating the process of a router from research and development to use, as provided in an embodiment of this application.

[0043] Figure 6 This is a flowchart of a device configuration method provided in an embodiment of this application;

[0044] Figure 7 This is a flowchart of another device configuration method provided in an embodiment of this application;

[0045] Figure 8 This is a flowchart of another device configuration method provided in an embodiment of this application;

[0046] Figure 9 This is a schematic diagram of the structure of a device configuration apparatus provided in an embodiment of this application. Detailed Implementation

[0047] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.

[0048] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0049] It should be understood that "one or more" as mentioned in this application refers to one, two, or more, and "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0050] To facilitate a clear description of the technical solutions of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.

[0051] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0052] The application scenarios involved in the embodiments of this application are described below.

[0053] Routers are widely used across various industries. Different telecom operators and even different provinces and cities may have varying requirements for router configurations. Therefore, operators may commission router manufacturers to customize products. Currently, the basic models for customization typically include group-level customization, provincial-level customization, and city-level customization.

[0054] 1. Customized for a Group: Manufacturers develop products according to the requirements of a group (such as a telecom operator's research institute) and submit them for testing. Testing approval means submitting the product to the group for testing. After the product passes group acceptance, the group adds the product model to its whitelist, which includes product models that the group is authorized to purchase.

[0055] 2. Provincial Customization: Provincial branches of telecom operators typically submit new customization requests based on the actual situation in their respective provinces and conduct bidding and selection processes according to the product whitelist provided by the group. Manufacturers need to develop upgrades and customizations based on the group version of the product. Once the provincial version is completed, delivered, and accepted, the corresponding product model can be added to the provincial whitelist.

[0056] 3. City-level customization: Similar to provincial-level customization, some city-level branches of operators may also have additional customization requirements. Therefore, manufacturers need to follow a similar process to provincial-level customization, develop upgrade and customization requirements based on the provincial version of the product. After the city-level version is delivered and accepted, the corresponding product model can be included in the city-level whitelist.

[0057] For ease of description, provincial-level customization and municipal-level customization will be collectively referred to as provincial and municipal customization below.

[0058] Manufacturers can only ship products to the corresponding provinces and cities after completing the aforementioned product customization. In other words, completing the group-wide customization is not enough for manufacturers to ship; they must also complete the development, acceptance, and inclusion in the whitelist for the upgraded customization requirements of each province and city before shipping can be fulfilled. Therefore, currently, for each province and city with additional customization needs beyond the group version, manufacturers need to develop and produce products separately.

[0059] In this situation, for a particular product model, there may be many provinces and cities that customize it individually.

[0060] For example, the operator's group customization requirements include 198 requirements, and on this basis, the additional provincial and municipal customization requirements include 268 requirements.

[0061] The basic requirements may include one or more of the following: provincial code pre-configuration, AOS-NET plugin version, and home broadband optimization.

[0062] Special requirements may include one or more of the following: EasySh, Internet Protocol version 6 (IPv6), operating mode, emergency mode (EM), WEB, dynamic host configuration protocol host name (DHCPNAME), domain name system (DNS), Internet Protocol television (IPTV), scheduled restart, wireless fidelity (Wi-Fi), roaming, version number, network locking, and adding frequency bands.

[0063] For example, the requirements for group customization and provincial / municipal customization can be shown in Table 1 below. In Table 1, CMEI refers to the CM engineer interface, which is used to configure and manage the cable modem (CM).

[0064] Table 1

[0065]

[0066] The embodiments of this application are merely illustrative examples of the requirements for product customization as shown in Table 1 above, and Table 1 above does not constitute a limitation on the embodiments of this application.

[0067] As can be seen from the above, during the product customization process, due to group customization and provincial / municipal customization, there will be many versions, which will lead to the following problems:

[0068] 1. Heavy workload: On the one hand, each provincial and municipal version needs to be delivered separately, which involves a heavy workload; on the other hand, each provincial and municipal version needs to be maintained separately, which involves a heavy workload.

[0069] 2. Long testing cycles and high manpower investment: Each provincial / municipal version requires separate internal testing, making incremental testing impossible and resulting in long internal testing cycles. Furthermore, the same test cases (such as stability tests, red line tests, and upgrade tests) are repeatedly executed for identical parts in each provincial / municipal version, leading to wasted manpower. Additionally, long internal testing cycles may cause the product to fail to respond to market demands in a timely manner, thus missing market access opportunities.

[0070] 3. Long delivery cycle for each province and city: Each province and city version needs to be produced separately, which has a long production cycle and may not be able to meet the delivery requirements of each province and city.

[0071] 4. High cost of exchanging goods between provinces and cities: When the shipping requirements of a province or city change, such as needing to send customized products from province A to province B, the customized products from province A can only be reworked to meet the customization requirements of province B, and the rework cost is generally high.

[0072] To address the aforementioned issues, this application provides a solution for unifying multiple provincial and municipal versions into a single version. Specifically, all customization requirements are developed and implemented on a single version, allowing for the delivery of customized projects across multiple provinces and municipalities using a single version. Furthermore, the customization requirements for each province and municipality are implemented through configuration files. During actual product use, the corresponding configuration file is automatically loaded based on the shipping province or municipality to ensure that the corresponding requirements take effect and enable normal operation.

[0073] In this scenario, since the manufacturer only needs to develop one version, unified delivery and maintenance can be implemented, reducing workload. Furthermore, when conducting internal testing of this version, the manufacturer can perform incremental testing without repeating certain test cases, thus shortening the testing cycle and saving manpower. Additionally, the manufacturer can implement unified production, reducing delivery time. Because the product version shipped to various provinces and cities is consistent, rework is unnecessary when exchanging goods in different provinces or cities, thereby reducing costs.

[0074] The following is a detailed explanation of the process for unifying the versions in various provinces and cities.

[0075] In related technologies, different software versions are developed for different provincial or municipal customizations.

[0076] For example, the customization requirements for Province A include: Configuration 11, Configuration 21, Configuration 31, and Configuration 41. Software version A for Province A includes Software Module 1, Software Module 2, Software Module 3, and Software Module 4. Software Module 1 implements Configuration 11, Software Module 2 implements Configuration 21, Software Module 3 implements Configuration 31, and Software Module 4 implements Configuration 41.

[0077] The customization requirements for Province B include: Configuration 11, Configuration 21, Configuration 32, and Configuration 42. Software version B for Province B includes Software Module 1, Software Module 2, Software Module 5, and Software Module 6. Specifically, Software Module 1 implements Configuration 11, Software Module 2 implements Configuration 21, Software Module 5 implements Configuration 32, and Software Module 6 implements Configuration 42.

[0078] The customization requirements for Province C include: Configuration 11, Configuration 21, Configuration 31, Configuration 41, Configuration 51, and Configuration 61. Software version C for Province C includes Software Module 1, Software Module 2, Software Module 3, Software Module 4, Software Module 7, and Software Module 8. Specifically, Software Module 1 implements Configuration 11, Software Module 2 implements Configuration 21, Software Module 3 implements Configuration 31, Software Module 4 implements Configuration 41, Software Module 7 implements Configuration 51, and Software Module 8 implements Configuration 61.

[0079] It is known that the relevant technologies require the development of three different software versions for the customization needs of provinces A, B, and C: software version A, software version B, and software version C. In this case, internal testing and production of the three software versions will also require testing all three versions.

[0080] Therefore, in this embodiment of the application, multiple software versions are unified into one software version, that is, all customization requirements are met through one software version, thus enabling unified development, unified testing and unified production.

[0081] Continuing with the above example, assume that configuration 11 is "Provincial Code: Enabled", configuration 21 is "IPv6: Enabled", configuration 31 is "EM: Enabled", configuration 32 is "EM: Disabled", configuration 41 is "Working Mode: Bridge Mode", configuration 42 is "Working Mode: Router Mode / DHCP", configuration 51 is "Cloud Roaming: Enabled", and configuration 61 is "Network Lockout: 3.0 Requirement".

[0082] It can be seen that the configuration item corresponding to Configuration 11 is "Province Code", and the configuration parameter corresponding to Configuration 11 is "Province Code: Enabled". The configuration item corresponding to Configuration 21 is "IPv6", and the configuration parameter corresponding to Configuration 21 is "IPv6: Enabled". The configuration items corresponding to Configurations 31 and 32 are both "EM", with the configuration parameter corresponding to Configuration 31 being "EM: Enabled" and the configuration parameter corresponding to Configuration 32 being "EM: Disabled". The configuration items corresponding to Configurations 41 and 42 are both "Working Mode", with the configuration parameter corresponding to Configuration 41 being "Working Mode: Bridge Mode" and the configuration parameter corresponding to Configuration 42 being "Working Mode: Router Mode / DHCP". The configuration item corresponding to Configuration 51 is "Cloud Roaming", and the configuration parameter corresponding to Configuration 51 is "Cloud Roaming: Enabled". The configuration item corresponding to Configuration 61 is "Network Locking", and the configuration parameter corresponding to Configuration 61 is "Network Locking: 3.0 Requirement".

[0083] Therefore, the unified software version developed in this application embodiment may include software module a, software module b, software module c, software module d, software module e, and software module f.

[0084] Among them, the configuration item corresponding to software module a is "Provincial Code", and the configuration parameter used by software module a is "Provincial Code: Enabled", that is, the configuration of software module a is configuration 11. The configuration item corresponding to software module b is "IPv6", and the configuration parameter used by software module b is "IPv6: Enabled", that is, the configuration of software module b is configuration 21. The configuration item corresponding to software module c is "EM", and the configuration parameter used by software module c is "EM: Enabled" or "EM: Disabled", that is, the configuration of software module c is configuration 31 or configuration 32, which can be switched between the two. The configuration item corresponding to software module d is "Working Mode", and the configuration parameter used by software module d is "Working Mode: Bridge Mode" or "Working Mode: Routing Mode / DHCP", that is, the configuration of software module d can be configuration 41 or configuration 42, which can be switched between the two. The configuration item corresponding to software module e is "Cloud Roaming", and the configuration parameter used by software module e is "Cloud Roaming: Enabled", that is, the configuration of software module e is configuration 51. The configuration item corresponding to software module f is "lock network", and the configuration parameter used by software module f is "lock network: 3.0 requirements", that is, the configuration of software module f is configuration 61.

[0085] For this software version, a default configuration file, configuration file A for province A, configuration file B for province B, and configuration file C for province C are set. Based on the configuration files for each province, the software version can be configured to meet the customized needs of each province.

[0086] The default configuration file includes configuration information for each software module in the software version. The configuration information for a software module includes the enable status and configuration parameters of the corresponding configuration item. The enable status indicates whether the configuration item is enabled; if the enable status is "No," meaning the configuration item is not enabled, the corresponding configuration parameters are empty; if the enable status is "Yes," meaning the configuration item is enabled, the corresponding configuration parameters are the specific data used to configure the configuration item.

[0087] Continuing with the above example, the customization requirements for provinces A, B, and C all include configuration 11 corresponding to the configuration item "province code" and configuration 12 corresponding to the configuration item "IPv6". Furthermore, the customization requirements for provinces A, B, and C all include the configuration item "EM" and the configuration item "working mode". However, the customization requirements for province C also include the configuration items "cloud roaming" and "network locking".

[0088] Accordingly, the default configuration file includes the following software modules: a) with the enabled status set to "Yes" and the configuration parameter set to "Provincial Code: Enabled"; b with the enabled status set to "Yes" and the configuration parameter set to "IPv6: Enabled"; c with the enabled status set to "Yes" and the configuration parameter set to "EM: Enabled"; d with the enabled status set to "Yes" and the configuration parameter set to "Working Mode: Bridge Mode"; e with the enabled status set to "No" and the configuration parameter set to "Empty"; and f with the enabled status set to "No" and the configuration parameter set to "Empty".

[0089] Since the customization requirements for provinces A, B, and C all include configurations 11 and 12, the configurations of software modules a and b do not need to be adjusted. In this case, the configuration files A for province A, B for province B, and C for province C do not need to include the configuration information for software modules a and b.

[0090] In the configuration file A corresponding to Province A, there are configuration information for software module c and software module d. The enabled status of software module c is "yes" and the configuration parameter is "EM: enabled". The enabled status of software module d is "yes" and the configuration parameter is "working mode: bridge mode".

[0091] The configuration file B corresponding to Province B includes configuration information for software module c and software module d. The enabled status of software module c is "Yes" and the configuration parameter is "EM: Off". The enabled status of software module d is "Yes" and the configuration parameter is "Working mode: Routing mode / DHCP".

[0092] The configuration file C corresponding to Province C includes configuration information for software module c, software module d, software module e, and software module f. The enabled status of software module c is "Yes" and the configuration parameter is "EM: Enabled". The enabled status of software module d is "Yes" and the configuration parameter is "Working Mode: Bridge Mode". The enabled status of software module e is "Yes" and the configuration parameter is "Cloud Roaming: Enabled". The enabled status of software module f is "Yes" and the configuration parameter is "Network Locking: 3.0 Requirement".

[0093] Optionally, any software module in this software version can correspond to one configuration item or multiple configuration items. If a software module corresponds to multiple configuration items, all of these configuration items can be enabled or disabled. In this case, the configuration information of the software module can include its enable status and configuration parameters. The enable status indicates whether all of the configuration items corresponding to the software module are enabled or disabled. If the enable status is "No," the corresponding configuration parameters are empty; if the enable status is "Yes," the corresponding configuration parameters can include the configuration parameters of each of the multiple configuration items corresponding to the software module.

[0094] The software version in this application embodiment includes multiple software modules. Each software module corresponds to one or more configuration items. All configuration items corresponding to the multiple software modules as a whole are all configuration items corresponding to the group's customized requirements and all provincial and municipal customized requirements.

[0095] For example, after obtaining the group's customization requirements and the customization requirements of all provinces and cities, technical personnel can generate a configuration template based on these requirements. This configuration template includes multiple configuration items, which are all configuration items related to the group's customization requirements and the customization requirements of each province and city. The configuration information corresponding to each of these multiple configuration items can be set.

[0096] Afterwards, technicians can manually or the equipment can automatically set the configuration information corresponding to the configuration items in the configuration template according to the group's customized needs and the customized needs of all provinces and cities, so as to obtain the default configuration file and the configuration files corresponding to each province and city.

[0097] In this way, the functional configurations defined in the software versions of all provinces and cities in the relevant technology are transformed into configuration files corresponding to each province and city. For example, the functional configurations defined in the software versions of provinces and cities can be the functional configurations defined in the datamodel.xml file. The configuration file corresponding to each province and city can be the defaultcfg.xml file.

[0098] It should be noted that, as Figure 1 As shown, the unified software version provided in this application embodiment includes multiple software modules, as well as configuration files corresponding to each province and city.

[0099] And such Figure 2 As shown, related technologies require the development of N provincial / municipal versions, which are then distributed to their respective provinces / municipalities. In this embodiment, only one unified version needs to be developed and written into the corresponding configuration files for each province / municipality; this version can then be distributed uniformly to all N provinces / municipalities. The customized investment required for N provinces / municipalities in related technologies—that is, the investment in version development, version testing, and production lines—is significantly greater than that in this embodiment.

[0100] The software version provided in this application can be applied to electronic devices. For example, the electronic device may have operator-customized requirements, provincial / municipal-customized requirements, and / or other regional-customized requirements. For instance, the electronic device may be a router, switch, camera, etc., and this application does not limit this to any particular type.

[0101] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 3 The electronic device includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.

[0102] The processor 301 may be a microprocessor (including a central processing unit (CPU) or the like), an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present application.

[0103] The communication bus 302 may include a path for transmitting information between the aforementioned components.

[0104] The memory 303 may be a read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), optical disc (including compact disc read-only memory (CD-ROM), compressed optical disc, laser disc, digital versatile optical disc, Blu-ray disc, etc.), magnetic disk storage medium, or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

[0105] Communication interface 304 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.

[0106] In a specific implementation, as one example, processor 301 may include one or more CPUs, such as Figure 3 CPU0 and CPU1 are shown in the diagram.

[0107] In a specific implementation, as one example, the electronic device may include multiple processors, such as... Figure 3 The processors 301 and 305 are shown. Each of these processors may be a single-core processor or a multi-core processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0108] The memory 303 stores program code 310 for executing the scheme of this application, and the processor 301 executes the program code 310 stored in the memory 303. This electronic device can implement the device configuration method provided in the embodiments below through the processor 301 and the program code 310 in the memory 303.

[0109] Understandably, the above text Figure 3The illustrated structures do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0110] The software system of the electronic device will be described next.

[0111] The software system of this electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, and this application embodiment does not limit this. This application embodiment takes a layered architecture as an example to illustrate the software system of the electronic device.

[0112] Figure 4 This is a schematic diagram of a software system for an electronic device provided in an embodiment of this application. See also... Figure 4 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the software system of the electronic device may include an application layer and an application framework layer.

[0113] The application layer can include a series of applications. For example... Figure 4 As shown, the application layer may include multiple software modules, each of which corresponds to one or more configuration items, and each software module is used to implement the configuration of its corresponding one or more configuration items.

[0114] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 4 As shown, the application framework layer may include a configuration change module, which is used to configure the multiple software modules according to the default configuration file and the configuration file corresponding to each region (such as provinces and cities).

[0115] Optionally, the default configuration file and the configuration files for each of the multiple regions can be stored in the hardware layer memory of the electronic device. The configuration change module can read the default configuration file and the configuration files for each region from this memory.

[0116] Understandably, the above text Figure 4The structures illustrated in the embodiments do not constitute a specific limitation on the software system of the electronic device. In other embodiments of this application, the electronic device may include more or fewer software layers than illustrated; for example, the electronic device may also include a system layer, a kernel layer, etc., and the embodiments of this application do not limit this.

[0117] It should be noted that the embodiments of this application do not specifically limit the specific structure of the execution subject of the device configuration method. As long as the code containing the device configuration method provided in the embodiments of this application is run, the processing can be performed according to the device configuration method provided in the embodiments of this application. For example, the execution subject of the device configuration method provided in the embodiments of this application can be a functional module in an electronic device that can call and execute a program, or it can be a processing device applied in an electronic device, such as a chip.

[0118] The following uses the electronic device as a router as an example to illustrate the process of router development and use in this application embodiment.

[0119] like Figure 5 As shown, after the R&D personnel develop a unified software version, the production line can produce products using that software version. These products can then be shipped to various provinces and cities. Specifically, products can be allocated to the corresponding provinces first, and then the provincial distributors can ship the products to the cities. It should be noted that the provinces to which each product is to be shipped are pre-set, and the server can pre-store the correspondence between each product's device identifier (including but not limited to serial number (SN) and province code).

[0120] City-level distributors can distribute the product (i.e., the router) to installation and maintenance personnel. After installing the router, the personnel can start it. Upon startup, the router can execute the device configuration method provided in this embodiment to implement the corresponding province configuration. For example, the router can first start with the default configuration, then query the corresponding province code from the server based on its own device identifier. After obtaining the province code returned by the server, it switches to the corresponding province configuration according to the configuration file corresponding to that province code. Specific operations are described in the embodiments below.

[0121] The device configuration method provided in the embodiments of this application will be explained in detail below.

[0122] Figure 6 This is a flowchart illustrating a device configuration method provided in an embodiment of this application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 6 The flowchart shown illustrates the configuration process during the initial startup of this electronic device. See also... Figure 6 The method includes the following steps:

[0123] Step 601: The electronic device starts up in response to the received start command.

[0124] A startup command is used to instruct the electronic device to start. For example, the startup command can be triggered by a user. For instance, a user can trigger the startup command by pressing the power button (also known as the power switch or on / off switch) of the electronic device. Of course, the startup command can also be triggered in other ways, and this embodiment of the application does not limit this.

[0125] Electronic devices can activate the configuration change module upon startup.

[0126] For example, after receiving a boot command, an electronic device can run a bootloader. This bootloader performs hardware initialization, and after initialization, it can start the kernel. Once the kernel starts, it executes a series of initialization operations, such as setting up caches and memory, loading drivers, mounting the root file system, and initializing input / output. Afterward, the operating system starts, and the configuration change module is activated during operating system startup. Once the operating system starts, the electronic device has successfully booted.

[0127] Step 602: After the electronic device is started, the configuration change module starts at least one of the multiple software modules according to the default configuration file.

[0128] This default configuration file contains configuration information for each of the multiple software modules. Each of these software modules corresponds to one or more configuration items.

[0129] The configuration information of a software module includes its enabled status and configuration parameters.

[0130] This enable status indicates whether all configuration items corresponding to the software module are enabled. For example, the enable status can be "enable," indicating whether the configuration item is enabled. Its value can be 0 or 1, representing disabled and enabled respectively. That is, if the value of "enable" is 1, it means the configuration item is enabled; if the value of "enable" is 0, it means the configuration item is not enabled (i.e., disabled).

[0131] If the enabled status indicates that all configuration items corresponding to the software module are enabled, the corresponding configuration parameters can include the configuration parameters of each configuration item among all configuration items corresponding to the software module. The configuration parameters of a configuration item are the specific data used to configure that configuration item. If the enabled status indicates that all configuration items corresponding to the software module are not enabled, the corresponding configuration parameters are empty.

[0132] In some embodiments, step 602 may be performed as follows: after the electronic device is started, for any software module included in the default configuration file, if the enable status in the configuration information of the software module is enabled, the configuration change module starts the software module according to the configuration parameters in the configuration information of the software module; if the enable status in the configuration information of the software module is disabled, the configuration change module does not start the software module.

[0133] For example, the operation of the configuration change module to start the software module based on the configuration parameters in the software module's configuration information can be as follows: when starting the software module, the configuration change module passes the configuration parameters as input parameters to the software module. After starting, the software module can perform corresponding configurations according to the configuration parameters to achieve the corresponding functions.

[0134] In this embodiment of the application, after the electronic device is started, the configuration change module first starts at least one of the multiple software modules with the default configuration, thereby ensuring that the electronic device can operate normally after startup.

[0135] In some embodiments, after the configuration change module starts at least one of the multiple software modules according to the default configuration file, it can also generate a runtime configuration file according to the configuration of each of the multiple software modules. Furthermore, the configuration change module can store the runtime configuration file in the hardware layer's memory, and can read the runtime configuration file from the memory when needed.

[0136] This runtime configuration file indicates the current configuration of the electronic device. The runtime configuration file includes configuration information for each of the multiple software modules. Specifically, for any one of the multiple software modules, if the software module is not currently running, its activation status in the runtime configuration file is determined to be disabled, and its configuration parameters are determined to be empty; if the software module is currently running, its activation status in the runtime configuration file is determined to be enabled, and its configuration parameters are determined to be parameters related to the current configuration of the software module.

[0137] Step 603: The configuration change module obtains the target region identifier corresponding to the electronic device from the server.

[0138] The target region identifier corresponding to the electronic device refers to the identifier of the region where the electronic device is permitted to be used. The region mentioned in this application embodiment can be a province, city, or other geographical area, etc., and this application embodiment does not limit this.

[0139] In some embodiments, step 603 may be as follows: the configuration change module sends a region identifier acquisition request to the server, the region identifier acquisition request carrying the device identifier of the electronic device; after receiving the region identifier acquisition request, the server acquires the region identifier corresponding to the device identifier as the target region identifier and sends the target region identifier to the electronic device; the configuration change module receives the target region identifier.

[0140] It should be noted that when the electronic device leaves the factory, technicians can pre-store the mapping between the device identifier and the identifier of the region to which the electronic device is permitted to be used (such as the region to which the electronic device needs to be shipped) in the server. For example, the device identifier of the electronic device can be the serial number (SN) of the electronic device, and the region to which the electronic device is permitted to be used can be a certain province. Then, the region identifier (i.e., the target region identifier) ​​corresponding to the serial number of the electronic device can be the province code.

[0141] In this case, the electronic device can quickly obtain the target region identifier corresponding to the electronic device from the server when in use, and implement the corresponding configuration accordingly.

[0142] Furthermore, for manufacturers, when shipping requirements change, such as changing an electronic device originally destined for region A to region B, they only need to change the region identifier corresponding to the device identifier of the electronic device stored on the server from the region A identifier to the region B identifier, and then the electronic device can be directly shipped to region B. Afterwards, when the electronic device is in use, it can obtain the region B identifier from the server and implement the configuration required by region B accordingly. Thus, compared to related technologies where product rework is required when shipping requirements change, this embodiment only requires modifying the corresponding relationship stored on the server, thereby significantly reducing costs.

[0143] Step 604: Configure the module to store the target region identifier.

[0144] For example, the configuration change module can store the target region identifier in the hardware layer's memory.

[0145] Step 605: The configuration change module retrieves the target configuration file from the stored correspondence between the target region identifier and the configuration file, based on the target region identifier.

[0146] The target configuration file is the configuration file corresponding to the target region identifier; that is, it is the configuration file for the region identified by the target region identifier. The target configuration file may include the configuration information of each software module in at least one of the multiple software modules in the electronic device.

[0147] The electronic device can pre-store the mapping relationship between region identifiers and configuration files. This mapping relationship can include multiple region identifiers and multiple configuration files that correspond one-to-one with each region identifier. The configuration file corresponding to a region identifier is the configuration file for the region identified by that region identifier, and is used to implement the functions required by that region.

[0148] Step 606: The configuration change module adjusts the configuration of the multiple software modules according to the target configuration file.

[0149] In this embodiment, after the electronic device starts up, the configuration change module can first start at least one of the multiple software modules with a default configuration, then obtain the target region identifier corresponding to the electronic device from the server, and then adjust the configuration of the multiple software modules according to the target configuration file corresponding to the target region identifier to achieve the functions required by the region identified by the target region identifier. In this way, the functions required by various regions can be flexibly implemented on the basis of a single software version, reducing the cost of the electronic device while ensuring its normal operation.

[0150] In some embodiments, step 606 may be performed as follows: the configuration change module obtains one or more difference configuration information from the target configuration file based on the differences between the target configuration file and the default configuration file; for any one of the difference configuration information, the configuration of the software module corresponding to the difference configuration information is adjusted according to the difference configuration information.

[0151] Optionally, the configuration change module can obtain one or more difference configuration information from the target configuration file based on the differences between the target configuration file and the default configuration file. This operation can be as follows: The configuration change module compares the target configuration file with the default configuration file. For the configuration information of any software module included in the target configuration file, if the configuration information of the software module in the target configuration file is different from the configuration information of the software module in the default configuration file, then the configuration information of the software module in the target configuration file is taken as difference configuration information.

[0152] Optionally, the configuration change module can adjust the configuration of the software module corresponding to the difference configuration information based on the difference configuration information as follows: if the enabling status in the difference configuration information is disabled, the configuration change module disables the software module corresponding to the difference configuration information. If the enabling status in the difference configuration information is enabled, the configuration change module starts the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information if the software module is not started, and adjusts the configuration of the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information if the software module is started.

[0153] For example, the operation of the configuration change module to start the software module corresponding to the difference configuration information based on the configuration parameters in the difference configuration information can be as follows: when starting the software module, the configuration change module passes the configuration parameters in the difference configuration information as input parameters to the software module. After starting, the software module can perform corresponding configurations according to the configuration parameters to achieve the corresponding functions.

[0154] For example, the operation of the configuration change module adjusting the configuration of the software module corresponding to the difference configuration information based on the configuration parameters in the difference configuration information can be as follows: the configuration change module passes the configuration parameters in the difference configuration information to the software module. The software module then changes its own configuration according to the configuration parameters to implement the new function.

[0155] It should be noted that, in this embodiment, the multiple software modules can be dynamically configured based on the differences between the target configuration file and the default configuration file. In this way, the required functions for the region corresponding to the target configuration file can be enabled without restarting the electronic device, thereby improving configuration efficiency and reducing power consumption.

[0156] Step 607: The configuration change module generates a runtime configuration file based on the configuration of the multiple software modules.

[0157] The process of generating runtime configuration files based on the configurations of these multiple software modules has been explained above and will not be repeated here.

[0158] It should be noted that whenever the configuration of these multiple modules changes, the module whose configuration has changed can regenerate the runtime configuration file based on the configuration of these multiple software modules. The latest generated runtime configuration file will overwrite the previously generated runtime configuration file.

[0159] Figure 7 This is a flowchart illustrating a device configuration method provided in an embodiment of this application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 7 The flowchart shown illustrates the configuration process during the restart of this electronic device. See also... Figure 7 The method includes the following steps:

[0160] Step 701: The electronic device restarts in response to the received restart command.

[0161] A restart command is used to instruct the electronic device to restart. For example, the restart command can be triggered by a user. For instance, a user can trigger the restart command by pressing and holding the power button on the electronic device. Of course, the restart command can also be triggered in other ways, and this embodiment of the application does not limit this method.

[0162] Electronic devices can activate the configuration change module upon startup.

[0163] For example, when an electronic device boots up, a bootloader can run, which performs hardware initialization. After hardware initialization is complete, the kernel can start. Once the kernel starts, it performs a series of initialization operations, such as setting up caches and memory, loading drivers, mounting the root file system, and initializing input / output. Afterward, the operating system starts, and the configuration change module is activated during the operating system startup. Once the operating system starts, the electronic device boots successfully.

[0164] Step 702: After the electronic device is started, the configuration change module starts at least one of the multiple software modules according to the running configuration file.

[0165] The configuration change module, after the electronic device starts up, will, in the absence of a running configuration file, as described above. Figure 6 In step 601 of the embodiment, there is no running configuration file when the electronic device is first started. In this case, at least one of the multiple software modules is started according to the default configuration file. The specific operation can be referred to step 602 above, and will not be repeated here.

[0166] After the electronic device starts up, if a running configuration file exists, the configuration change module will, if so, change the configuration file. Figure 7 In step 701 of the embodiment, a running configuration file exists when the electronic device restarts. In this case, at least one of the multiple software modules is started according to the running configuration file.

[0167] In some embodiments, step 702 may be performed as follows: after the electronic device is started, for any software module included in the running configuration file, if the enable status in the configuration information of the software module is enabled, the configuration change module starts the software module according to the configuration parameters in the configuration information of the software module; if the enable status in the configuration information of the software module is disabled, the configuration change module does not start the software module.

[0168] In some embodiments, after the configuration change module starts at least one of the plurality of software modules according to the running configuration file, it can also regenerate the running configuration file according to the configuration of each of the plurality of software modules.

[0169] Furthermore, after step 702, the configuration change module determines that the configuration has been completed if the target region identifier has been stored.

[0170] If the configuration change module does not store the target region identifier, as described above... Figure 6In step 601 of the embodiment, the target region identifier is not stored when the electronic device is first started. In this case, it is necessary to obtain the target region identifier from the server and make corresponding configurations accordingly. For specific operations, please refer to steps 603 to 607 above, which will not be repeated here.

[0171] If the configuration change module has already stored the target region identifier, such as in Figure 7 In step 701 of the embodiment, if the electronic device restarts, the electronic device has already obtained the target region identifier before restarting and has made corresponding configurations to obtain the running configuration file. Then, in step 702, after the electronic device restarts this time, the corresponding software module is started according to the running configuration file, and the function required by the region identified by the target region identifier has been realized. Therefore, if the configuration change module has stored the target region identifier, it can be determined that the configuration has been completed.

[0172] Figure 8 This is a flowchart illustrating a device configuration method provided in an embodiment of this application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 8 The flowchart shown illustrates the configuration process when this electronic device is restored to factory settings. See also... Figure 8 The method includes the following steps:

[0173] Step 801: In response to the received factory reset command, the electronic device deletes the stored target region identifier and running configuration file.

[0174] The factory reset command is used to instruct the electronic device to be restored to its factory settings, i.e., to restore the default settings. For example, this factory reset command can be triggered by the user. For instance, the user can trigger the factory reset command by pressing and holding the reset button on the electronic device. Of course, the factory reset command can also be triggered in other ways, and this embodiment of the application does not limit this.

[0175] Because a factory reset is required, the electronic device needs to have its target region identifier and running configuration file previously stored during its operation deleted.

[0176] Step 802: The electronic device restarts.

[0177] Electronic devices can activate the configuration change module upon startup.

[0178] For example, when an electronic device boots up, a bootloader can run, which performs hardware initialization. After hardware initialization is complete, the kernel can start. Once the kernel starts, it performs a series of initialization operations, such as setting up caches and memory, loading drivers, mounting the root file system, and initializing input / output. Afterward, the operating system starts, and the configuration change module is activated during the operating system startup. Once the operating system starts, the electronic device boots successfully.

[0179] Step 803: After the electronic device is started, the configuration change module starts at least one of the multiple software modules according to the default configuration file.

[0180] Because the electronic device deleted the stored running configuration file when it received the factory reset command, the electronic device will start at least one of the multiple software modules according to the default configuration file after this restart.

[0181] Step 804: The configuration change module obtains the target region identifier corresponding to the electronic device from the server.

[0182] Because the electronic device deleted the stored target region identifier when it received the factory reset command, the electronic device retrieves the target region identifier from the server after this restart and performs corresponding configuration accordingly.

[0183] Step 805: Configure the module to store the target region identifier.

[0184] Step 806: The configuration change module retrieves the target configuration file from the stored correspondence between the target region identifier and the configuration file, based on the target region identifier.

[0185] Step 807: The configuration change module adjusts the configuration of the multiple software modules according to the target configuration file.

[0186] Step 808: The configuration change module generates a runtime configuration file based on the configuration of the multiple software modules.

[0187] The operations of steps 803 to 808 are similar to those of steps 602 to 607 described above, and will not be repeated in this embodiment.

[0188] In this embodiment, when the electronic device is restored to factory settings, it can re-obtain the target region identifier corresponding to the electronic device from the server. Then, based on the target configuration file corresponding to the target region identifier, it adjusts the configuration of the multiple software modules to achieve the functions required by the region identified by the target region identifier. Thus, even when the electronic device is restored to factory settings, it can still ensure that it performs the functions required by the region it is permitted to use, guaranteeing the normal operation of the electronic device.

[0189] Understandably, the above text Figure 6 Examples to Figure 8 In this embodiment, the operations performed by the configuration change module are performed by the electronic device itself. In other embodiments of this application, the operations performed by the configuration change module can also be performed by other modules in the electronic device. For example, the operations performed by the configuration change module can be assigned to different functional modules as needed.

[0190] Figure 9 This is a schematic diagram of a device configuration apparatus provided in an embodiment of this application. The apparatus can be implemented as part or all of an electronic device by software, hardware, or a combination of both. This electronic device can be as described above. Figure 3 and Figure 4 The electronic device described in the embodiments. See also Figure 9 The device includes a configuration change module 901 and multiple software modules 902.

[0191] The configuration change module 901 is used to start at least one of the multiple software modules 902 according to the default configuration file after the electronic device is started, the default configuration file includes the configuration information of each of the multiple software modules 902; obtain the target region identifier corresponding to the electronic device from the server; obtain the target configuration file from the stored correspondence between region identifiers and configuration files according to the target region identifier; and adjust the configuration of the multiple software modules 902 according to the target configuration file.

[0192] In this embodiment, after the electronic device starts up, the configuration change module can first start at least one of the multiple software modules with a default configuration, then obtain the target region identifier corresponding to the electronic device from the server, and then adjust the configuration of the multiple software modules according to the target configuration file corresponding to the target region identifier to achieve the functions required by the region identified by the target region identifier. In this way, the functions required by various regions can be flexibly implemented on the basis of a single software version, reducing the cost of the electronic device while ensuring its normal operation.

[0193] It should be noted that the device configuration device provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0194] The functional units and modules in the above embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the embodiments of this application.

[0195] The device configuration apparatus and device configuration method embodiments provided in the above embodiments belong to the same concept. The specific working process and technical effects of the units and modules in the above embodiments can be found in the method embodiment section, and will not be repeated here.

[0196] It should be understood that the sequence number of each step in the above embodiments does not imply 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 this application.

[0197] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0198] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.

[0199] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0200] This application also provides a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps of any method embodiment of this application. The chip system can be a single chip or a chip module composed of multiple chips.

[0201] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic cable, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave) means. The computer-readable storage medium can be any available medium accessible to a computer, or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes, etc.), optical media (such as Digital Versatile Discs (DVDs), etc.) or semiconductor media (such as Solid State Disks (SSDs), etc.).

[0202] The above-described embodiments are optional embodiments provided by this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A device configuration method, characterized in that, Applied to an electronic device, the electronic device comprising multiple software modules, the method includes: After the electronic device is first started, in the absence of a running configuration file, at least one of the plurality of software modules is started according to a default configuration file, wherein the default configuration file includes the configuration information of each of the plurality of software modules; If the target region identifier is not stored, the target region identifier corresponding to the electronic device is obtained from the server and stored. The target region identifier is the identifier of the region that the electronic device is allowed to use. Based on the target region identifier, the target configuration file is obtained from the stored correspondence between region identifiers and configuration files; Adjust the configuration of the multiple software modules according to the target configuration file; The runtime configuration file is generated based on the configuration of the multiple software modules; After the electronic device restarts, if the running configuration file exists, at least one of the plurality of software modules is started according to the running configuration file.

2. The method as described in claim 1, characterized in that, The configuration information of the software module includes the activation status and configuration parameters. The activation status is used to indicate whether the configuration items corresponding to the software module are enabled.

3. The method as described in claim 2, characterized in that, The step of starting at least one of the multiple software modules according to the default configuration file includes: If the enabled status of any software module included in the default configuration file is disabled, then the software module will not be started. If the enabled status in the configuration information of the software module is enabled, then the software module is started according to the configuration parameters in the configuration information of the software module.

4. The method according to any one of claims 1 to 3, characterized in that, The step of adjusting the configuration of the multiple software modules according to the target configuration file includes: Based on the differences between the target configuration file and the default configuration file, obtain one or more difference configuration information from the target configuration file; For any one of the one or more differential configuration information, adjust the configuration of the software module corresponding to the differential configuration information according to the differential configuration information.

5. The method as described in claim 4, characterized in that, The configuration information of the software module includes the activation status and configuration parameters. The activation status is used to indicate whether the configuration items corresponding to the software module are enabled. The step of adjusting the configuration of the software module corresponding to the difference configuration information according to the difference configuration information includes: If the enable status in the difference configuration information is disabled, then the software module corresponding to the difference configuration information is turned off; If the enable status in the difference configuration information is enabled, then if the software module corresponding to the difference configuration information is not started, the software module corresponding to the difference configuration information will be started according to the configuration parameters in the difference configuration information; if the software module corresponding to the difference configuration information is started, the configuration of the software module corresponding to the difference configuration information will be adjusted according to the configuration parameters in the difference configuration information.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In response to the received factory reset command, the stored target region identifier and the running configuration file are deleted; Restart the electronic device.

7. The method as described in any one of claims 1 to 6, characterized in that, The step of obtaining the target region identifier corresponding to the electronic device from the server includes: Send a region identifier acquisition request to the server, wherein the region identifier acquisition request carries the device identifier of the electronic device; Receive the target region identifier sent by the server.

8. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 7.