Device configuration method, device, storage medium and program product
By obtaining the target region ID and adjusting the configuration file after the router is started, the high cost and long cycle problems in the router customization business are solved, unified development and flexible configuration are achieved, and production and testing costs are reduced.
Patent Information
- Application Number
- CN202410686105.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-05-29
AI Technical Summary
In the existing technology, the customized business model of routers leads to high product costs, heavy workload, long testing cycle, long production cycle and high cost of replacement between provinces and cities, which cannot meet personalized needs.
After the electronic device is started, the software module is started according to the default configuration file, and the target area identifier is obtained from the server. The configuration of the software module is adjusted using the target configuration file to achieve the functional requirements of the target area, reducing rework and repeated development.
This enables flexible meeting of regional needs with one software version, reduces costs, shortens testing cycles and production time, and reduces manpower input and rework costs.
Smart Images

Figure CN120750754A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a device configuration method, device, storage medium, and program product. Background Art
[0002] Routers are widely used across various industries. Each carrier, province, and city may have unique router configuration requirements. To address this, carriers often request product customization from router manufacturers. Currently, the basic customization model typically includes group customization, provincial customization, and municipal customization. For each province or city with additional customization requirements beyond the group version, manufacturers must develop and produce their own products, resulting in higher product costs. Summary of the Invention
[0003] This application provides a device configuration method, device, storage medium, and program product that can reduce the cost of electronic devices. The technical solution is as follows:
[0004] In a first aspect, a device configuration method is provided. The method is applied to an electronic device. The electronic device includes multiple software modules. In the method, after the electronic device is booted, at least one of the multiple software modules is booted according to a default configuration file, where the default configuration file includes configuration information for each of the multiple software modules. Subsequently, a target region identifier corresponding to the electronic device is obtained from a server. Based on the target region identifier, a target configuration file is obtained from a stored correspondence between region identifiers and configuration files. Finally, the configurations of the multiple software modules are adjusted according to the target configuration file.
[0005] Each software module in the multiple software modules corresponds to one or more configuration items.
[0006] The configuration information of a software module includes the enabled state and configuration parameters of the configuration items corresponding to the software module. The enabled state indicates whether the configuration item corresponding to the software module is enabled. If the enabled state is "no," i.e., if the enabled state indicates that the configuration item is not enabled, the corresponding configuration parameters are empty. If the enabled state is "yes," i.e., if the enabled state indicates that the configuration item is enabled, the corresponding configuration parameters are the configuration parameters of each configuration item corresponding to the software module. The configuration parameters of a configuration item are the specific data used to configure the configuration item.
[0007] The target configuration file is a configuration file corresponding to the target region identifier, that is, a configuration file for the region identified by the target region identifier. The target configuration file may include configuration information of each software module in at least one software module among the multiple software modules in the electronic device.
[0008] In this application, after the electronic device is started, at least one of the multiple software modules can be started with a default configuration. The target region identifier corresponding to the electronic device is then obtained from a server. The configurations of the multiple software modules are then adjusted based on the target configuration file corresponding to the target region identifier to implement the functions required by the region identified by the target region identifier. This allows for flexible implementation of the functions required by various regions based on a single software version, reducing the cost of the electronic device while ensuring 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 may be: for configuration information of any software module included in the default configuration file, if the enabled state in the configuration information of the software module is disabled, then the software module is not started; if the enabled state 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.
[0010] For example, the operation of starting the software module according to the configuration parameters in the configuration information of the software module may be: when starting the software module, the configuration parameters are passed to the software module as input parameters. After starting, the software module can be configured accordingly according to the configuration parameters to implement the corresponding functions.
[0011] In the present application, after the electronic device is started, at least one software module among the multiple software modules is first started with a default configuration, thereby ensuring that the electronic device can operate normally after starting.
[0012] In a possible implementation, the operation of obtaining the target region identifier corresponding to the electronic device from the server may include: sending a region identifier obtaining request to the server, the region identifier obtaining 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 identification of the electronic device and the identification of the region where the electronic device is allowed to be used in the server based on the region where the electronic device is allowed to be used (such as the region to which the electronic device needs to be shipped).
[0014] For example, the device identifier of the electronic device may be the SN of the electronic device, and the region where the electronic device is allowed to be used may be a province. Then, the region identifier corresponding to the SN of the electronic device (ie, the target region identifier) may be a province code.
[0015] In the present application, the electronic device can quickly obtain the target area identification corresponding to the electronic device from the server when in use, and implement corresponding configuration accordingly.
[0016] In addition, for manufacturers, when shipping requirements change, such as shipping an electronic device originally destined for region A to region B, they only need to change the region ID corresponding to the device ID of the electronic device stored in the server from the ID of region A to the ID of region B, and then directly ship the electronic device to region B. After that, when the electronic device is used, it can obtain the ID of region B from the server and implement the configuration required by region B accordingly. In this way, compared to the solution in the related art that requires rework of the product when shipping requirements change, this application only needs to modify the corresponding relationship stored in the server when shipping requirements change, which can greatly reduce costs.
[0017] In one possible implementation, the operation of adjusting the configuration of the multiple software modules according to the target configuration file may be: obtaining one or more difference configuration information from the target configuration file according to the difference between the target configuration file and the default configuration file; for any one of the one or more difference configuration information, adjusting the configuration of the software module corresponding to the difference configuration information according to the difference configuration information.
[0018] Optionally, based on the difference 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: comparing 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 regarded as a difference configuration information.
[0019] Optionally, the operation of adjusting the configuration of the software module corresponding to the difference configuration information according to the difference configuration information may be: if the enable state in the difference configuration information is disabled, shutting down the software module corresponding to the difference configuration information; if the enable state in the difference configuration information is enabled, starting the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information if the software module corresponding to the difference configuration information is not enabled; and adjusting 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 corresponding to the difference configuration information is enabled.
[0020] In this application, the multiple software modules can be dynamically configured based on the difference in configuration information between the target configuration file and the default configuration file. In this way, the functions required by the region corresponding to the target configuration file can be enabled without restarting the electronic device, thereby improving configuration efficiency and reducing power consumption.
[0021] In a possible implementation, after obtaining the target region identifier corresponding to the electronic device from the server, the target region identifier may be stored. In addition, after adjusting the configurations of the multiple software modules according to the target configuration file, an operation configuration file may be generated based on the configurations of the multiple software modules.
[0022] It should be noted that each time the configurations of the multiple modules change, a running configuration file can be regenerated based on the configurations of the multiple software modules, and the latest running configuration file generated will overwrite the previously generated running configuration file.
[0023] In a possible implementation, the method further includes: deleting the stored target region identifier and the operation configuration file in response to a received factory reset instruction; and restarting the electronic device.
[0024] In one possible implementation, after the electronic device is started, the operation of starting at least one of the multiple software modules according to the default configuration file may be: after the electronic device is started, starting at least one of the multiple software modules according to the default configuration file in the absence of an operating configuration file.
[0025] For example, when there is no running configuration file when the electronic device is started for the first time, or when there is no running configuration file after the electronic device is restored to factory settings, at least one software module among the multiple software modules is started according to the default configuration file.
[0026] After the electronic device is started, at least one software module among the multiple software modules is started according to the running configuration file if there is one.
[0027] For example, when the electronic device restarts in response to the received restart instruction and there is a previously generated operation configuration file in the electronic device, at least one software module among the multiple software modules can be started preferentially according to the operation configuration file.
[0028] In a possible implementation, the operation of obtaining the target region identifier corresponding to the electronic device from the server may be: obtaining the target region identifier from the server when the target region identifier is not stored.
[0029] For example, when the target region identifier does not exist when the electronic device is first started, or when the target region identifier does not exist after the electronic device is restored to factory settings, the target region identifier is obtained from the server so that corresponding configuration can be performed accordingly to implement the functions required by the region identified by the target region identifier.
[0030] In the case where the target region identifier has been stored, it can be determined that the configuration has been completed.
[0031] In the case where the target region identifier has been stored, if the electronic device restarts in response to a received restart instruction, the electronic device has obtained the target region identifier before the electronic device restarts, and has performed corresponding configuration based on it to obtain an operation configuration file. Then, after the electronic device restarts this time, after starting the corresponding software module according to the operation configuration file, the function required by the region identified by the target region identifier has been realized. Therefore, in the case where the target region identifier has been stored, it can be determined that the configuration has been completed.
[0032] In a second aspect, 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, which is used to implement the device configuration method described in the first aspect.
[0033] In a third aspect, 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, the computer program code comprising computer instructions, the one or more processors calling the computer instructions so that the electronic device executes the device configuration method provided in the first aspect above.
[0034] In a fourth aspect, a chip system is provided, which is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the electronic device to execute the device configuration method provided in the first aspect above.
[0035] In a fifth aspect, a computer-readable storage medium is provided, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes the device configuration method provided in the first aspect.
[0036] In a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the device configuration method provided in the first aspect.
[0037] The technical effects obtained by the above-mentioned second, third, fourth, fifth and sixth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a schematic diagram of a unified software version provided in an embodiment of the present application;
[0039] Figure 2This is a schematic diagram illustrating the difference between a provincial and municipal version in a related art provided in an embodiment of the present application and a unified version in the present application;
[0040] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0041] Figure 4 is a schematic diagram of a software system of an electronic device provided in an embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of the process from development to use of a router provided in an embodiment of the present application;
[0043] Figure 6 This is a flow chart of a device configuration method provided by an embodiment of the present application;
[0044] Figure 7 is a flowchart of another device configuration method provided by an embodiment of the present application;
[0045] Figure 8 is a flowchart of another device configuration method provided by an embodiment of the present application;
[0046] Figure 9 It is a structural diagram of a device configuration apparatus provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate 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.
[0048] It should be understood that when used in the specification and appended claims of this application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their collections. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0049] It should be understood that the "one or more" mentioned in this application refers to one, two or more, and the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B. The "and / or" in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0050] To facilitate the clear description of the technical solutions of this application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or order of execution, and the words "first" and "second" do not necessarily mean different.
[0051] The phrases "one embodiment" or "some embodiments" described in this application mean that the specific features, structures, or characteristics described in the embodiment are included in one or more embodiments of the application. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in 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 the present application are described below.
[0053] Routers are widely used across various industries. Each carrier, province, and city may have unique router configuration requirements. To address this, carriers may request product customization from router manufacturers. Currently, the basic models for customization typically include group customization, provincial customization, and municipal customization.
[0054] 1. Group Customization: Manufacturers complete product development and submit their products for testing according to the requirements of a group (e.g., a carrier's research institute). Testing refers to submitting the product to the group for testing. Once the product passes group acceptance, the group adds the product model to a whitelist of products, which includes those the group allows to be purchased.
[0055] 2. Provincial Customization: Carriers' provincial subsidiaries typically propose new customization requirements based on the specific circumstances of each province and conduct bidding and selection based on the product whitelist provided by the group. Manufacturers must develop upgraded customization requirements based on the group version of their product. Once the provincial version is delivered and accepted, the corresponding product model will be included in the provincial whitelist.
[0056] 3. Municipal customization: Similar to provincial customization, some municipal companies of operators will also have additional customization requirements. Therefore, manufacturers need to follow a similar process to provincial customization and develop upgraded customization requirements based on the provincial version of the product. After the municipal version is delivered and accepted, the corresponding product model can be included in the municipal whitelist.
[0057] For the sake of convenience, provincial customization and municipal customization will be collectively referred to as provincial and municipal customization below.
[0058] Only after completing the aforementioned product customization can manufacturers ship to the corresponding provinces and cities. This means that completing group customization isn't enough for shipments. Manufacturers must complete the development, acceptance, and whitelisting of upgraded customization requirements based on the needs of each province and city before shipment can be met. Therefore, manufacturers currently need to develop and produce individual products for each province and city that has additional customization requirements beyond the group version.
[0059] In this case, for a certain model of product, there may be many provinces and cities that provide separate customization.
[0060] For example, the operator's group customization needs include 198 requirements, and on this basis, the additional provincial and municipal customization needs also include 268 requirements.
[0061] Among them, the basic requirements may include: one or more configurations of: provincial code preset, artificial operating system network (AOS-NET) plug-in version, home broadband optimization, etc.
[0062] Among them, special requirements may include: one or more configurations of Easymesh, Internet Protocol version 6 (IPv6), working mode, emergency mode (EM), WEB, dynamic host configuration protocol host name (DHCPNAME), domain name system (DNS), interactive network television (IPTV), scheduled restart, wireless fidelity (Wi-Fi), roaming, version number, network lock, new frequency band, etc.
[0063] For example, the requirements for group customization and provincial and municipal customization may be shown in Table 1 below, wherein CMEI in Table 1 below refers to CM engineer interface, which is an interface for configuring and managing cable modems (CMs).
[0064] Table 1
[0065]
[0066] The embodiment of the present application only uses Table 1 above as an example to illustrate the requirements for product customization, and Table 1 above does not limit the embodiment of the present application.
[0067] As can be seen from the above, during the product customization process, there will be many versions due to group customization and provincial and municipal customization, 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 results in a heavy workload; on the other hand, each provincial and municipal version needs to be maintained separately, which results in a heavy workload.
[0069] 2. Long testing cycles and high manpower investment: Each provincial and municipal version requires independent internal testing, preventing incremental testing across the entire product. This results in long internal testing cycles. Furthermore, for the same parts in each provincial and municipal version, repeated execution of long-term stability, redline, and upgrade test cases results in wasted manpower. Furthermore, long internal testing cycles can prevent products from responding to market demands in a timely manner, potentially leading to missed market opportunities.
[0070] 3. Long delivery cycle between provinces and cities: Each provincial and municipal version needs to be produced separately, and the production cycle is long, which may not meet the provincial and municipal delivery requirements.
[0071] 4. The cost of exchanging goods between provinces and cities is high: When the delivery requirements of provinces and cities change, for example, if customized products from Province A need to be shipped to Province B, the customized products from Province A can only be reworked to make the products meet the customization requirements of Province B, and the rework cost is generally high.
[0072] To address the above issues, the present application provides a solution that unifies multiple provincial and municipal versions into a single version. That is, all customization requirements can be developed and implemented on a single version, allowing customization projects in multiple provinces and cities to be delivered using a single version. Furthermore, the customization requirements for each province and city are implemented through configuration files. When the product is actually used, the corresponding configuration file can be automatically loaded based on the shipping province and city, enabling the corresponding requirements to take effect and achieve normal use.
[0073] In this case, since the manufacturer only needs to develop a single version, unified delivery and maintenance can be achieved, reducing workload. Furthermore, during internal testing of this version, the manufacturer can perform incremental testing, eliminating the need to repeat certain test cases. This shortens the testing cycle and saves manpower. Furthermore, the manufacturer can also implement centralized production, reducing delivery cycles. In this case, since the product version shipped to each province and city is the same, rework is not required when exchanging products between provinces and cities, reducing costs.
[0074] The following is a detailed explanation of the unification process of the provincial and municipal versions.
[0075] In the related art, different software versions are developed for different provincial-level customizations or municipal-level customizations.
[0076] For example, Province A's customization requirements include configuration 11, configuration 21, configuration 31, and configuration 41. Province A's software version A includes software modules 1, 2, 3, and 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] Province B's customization requirements include: Configuration 11, Configuration 21, Configuration 32, and Configuration 42. Province B's software version B includes software modules 1, 2, 5, and 6. 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] Province C's customization requirements include: Configuration 11, Configuration 21, Configuration 31, Configuration 41, Configuration 51, and Configuration 61. Province C's software version C includes software modules 1, 2, 3, 4, 7, and 8. 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 can be seen that in the related art, for the customization requirements of Province A, Province B, and Province C, three different software versions need to be developed respectively, namely software version A, software version B, and software version C. In this case, the three software versions also need to be tested during internal testing, and three software versions of products also need to be produced during production.
[0080] To this end, in the embodiment of the present application, multiple software versions are unified into one software version, that is, all customization requirements are implemented through one software version, so that unified development, unified testing and unified production can be achieved.
[0081] Continuing with the above example, assume that configuration 11 is "Province Code: On", configuration 21 is "IPv6: On", configuration 31 is "EM: On", configuration 32 is "EM: Off", configuration 41 is "Working Mode: Bridge Mode", configuration 42 is "Working Mode: Routing Mode / DHCP", configuration 51 is "Cloud Roaming: On", and configuration 61 is "Network Lock: 3.0 Requirement".
[0082] It can be seen that the configuration item corresponding to configuration 11 is "Provincial Code", and the configuration parameter corresponding to configuration 11 is "Provincial Code: On". The configuration item corresponding to configuration 21 is "IPv6", and the configuration parameter corresponding to configuration 21 is "IPv6: On". The configuration items corresponding to configuration 31 and configuration 32 are both "EM", among which the configuration parameter corresponding to configuration 31 is "EM: On", and the configuration parameter corresponding to configuration 32 is "EM: Off". The configuration items corresponding to configuration 41 and configuration 42 are both "Working Mode", among which the configuration parameter corresponding to configuration 41 is "Working Mode: Bridge Mode", and the configuration parameter corresponding to configuration 42 is "Working Mode: Routing Mode / DHCP". The configuration item corresponding to configuration 51 is "Cloud Roaming", and the configuration parameter corresponding to configuration 51 is "Cloud Roaming: On". The configuration item corresponding to configuration 61 is "Lock Network", and the configuration parameter corresponding to configuration 61 is "Lock Network: 3.0 Requirements".
[0083] Then the unified software version developed in the embodiment of the present application 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 "Province Code", and the configuration parameter used by software module a is "Province Code: On", 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: On", 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: On" or "EM: Off", that is, the configuration of software module c is configuration 31 or configuration 32, and can switch 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, and can switch 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: On", that is, the configuration of software module e is configuration 51. The configuration item corresponding to the software module f is “lock network”, and the configuration parameter used by the software module f is “lock network: 3.0 requirements”, that is, the configuration of the software module f is configuration 61.
[0085] For this software version, set the default configuration file, configuration file A corresponding to Province A, configuration file B corresponding to Province B, and configuration file C corresponding to Province C. The software version can be configured according to the configuration files corresponding to each province to meet the customized requirements of each province.
[0086] The default configuration file includes configuration information for each of the software modules in the software version. The configuration information for a software module includes the enabled state and configuration parameters of the configuration item corresponding to the software module. The enabled state indicates whether the configuration item is enabled. If the enabled state is "No," indicating that the configuration item is not enabled, the corresponding configuration parameters are empty. If the enabled state is "Yes," indicating that the configuration item is enabled, the corresponding configuration parameters are the configuration parameters of the configuration item, that is, the specific data used to configure the configuration item.
[0087] Continuing with the above example, the customization requirements of Province A, Province B, and Province C all include configuration 11 corresponding to the configuration item "Provincial Code" and configuration 12 corresponding to the configuration item "IPv6", and the customization requirements of Province A, Province B, and Province C all include the configuration item "EM" and the configuration item "Working Mode", while the customization requirements of Province C also additionally include the configuration items "Cloud Roaming" and "Network Lock".
[0088] Accordingly, the default configuration file includes that the enabled status of the configuration information of software module a is "yes" and the configuration parameter is "provincial code: on", the enabled status of the configuration information of software module b is "yes" and the configuration parameter is "IPv6: on", the enabled status of the configuration information of software module c is "yes" and the configuration parameter is "EM: on", the enabled status of the configuration information of software module d is "yes" and the configuration parameter is "working mode: bridge mode", the enabled status of the configuration information of software module e is "no" and the configuration parameter is "empty", and the enabled status of the configuration information of software module f is "no" and the configuration parameter is "empty".
[0089] Since the customization requirements for Provinces A, B, and C all include Configuration 11 and Configuration 12, the configurations of Software Modules A and B do not need to be adjusted. In this case, Configuration File A for Province A, Configuration File B for Province B, and Configuration File C for Province C do not need to include the configuration information for Software Modules A and B.
[0090] Among them, the configuration file A corresponding to Province A includes the configuration information of software module c and the configuration information of software module d. The enabling status in the configuration information of software module c is "yes" and the configuration parameter is "EM: on", and the enabling status in the configuration information 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 the configuration information of software module c and the configuration information of software module d. The enabled status in the configuration information of software module c is "Yes" and the configuration parameter is "EM: Off", and the enabled status in the configuration information 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 the configuration information of software module c, the configuration information of software module d, the configuration information of software module e and the configuration information of software module f. The enabling status in the configuration information of software module c is "yes" and the configuration parameter is "EM: on", the enabling status in the configuration information of software module d is "yes" and the configuration parameter is "working mode: bridge mode", the enabling status in the configuration information of software module e is "yes" and the configuration parameter is "cloud roaming: on", and the enabling status in the configuration information of software module f is "yes" and the configuration parameter is "network lock: 3.0 requirement".
[0093] Optionally, any software module in the software version may correspond to one configuration item or multiple configuration items. If a software module corresponds to multiple configuration items, the multiple configuration items corresponding to the software module may all be enabled or none of them may be enabled. In this case, the configuration information of the software module may include an enablement status and configuration parameters. The enablement status may indicate whether the multiple configuration items corresponding to the software module are all enabled or none of them are enabled. If the enablement status is "no", the corresponding configuration parameters are empty; if the enablement status is "yes", the corresponding configuration parameters may include the configuration parameters of each of the multiple configuration items corresponding to the software module.
[0094] The software version in the embodiment of the present application includes multiple software modules, each of the multiple software modules corresponds to one or more configuration items, and all configuration items corresponding to the multiple software modules as a whole are all configuration items corresponding to the group's customization requirements and all provincial and municipal customization requirements.
[0095] For example, after learning the group customization requirements and the customization requirements of all provinces and cities, technicians can generate a configuration template based on the group customization requirements and the customization requirements of all provinces and cities. The configuration template includes multiple configuration items, which are all configuration items related to the group customization requirements and the customization requirements of each province and city. The configuration information corresponding to each of the multiple configuration items in the configuration template can be set.
[0096] Afterwards, the configuration information corresponding to the configuration items in the configuration template can be set manually by technicians or automatically by the device according to the group customization requirements and the customization requirements of all provinces and cities to obtain the default configuration file and the configuration files corresponding to each province and city.
[0097] In this way, the function configurations defined in the software versions of all provinces and cities in the related art are transformed into configuration files corresponding to each province and city. For example, the function configurations defined in the software versions of provinces and cities can be the function configurations defined in the datamodel.xml file. The configuration files corresponding to provinces and cities can be the defaultcfg.xml file.
[0098] It should be noted that if Figure 1 As shown, the unified software version provided in the embodiment of the present application includes multiple software modules and configuration files corresponding to each province and city.
[0099] And as Figure 2 As shown, in the related art, it is necessary to develop N provincial and municipal versions, and then send each provincial and municipal version to each province and city separately. In the embodiment of the present application, only one unified version needs to be developed and the configuration files corresponding to each province and city need to be written. This version can be sent to N provinces and cities in a unified manner. The investment in customization for N provinces and cities in the related art, that is, the investment in version development, version testing and production line production, is much greater than that in the embodiment of the present application.
[0100] The software versions provided in the embodiments of this application can be applied to electronic devices. For example, the electronic devices can be devices with operator customization requirements, provincial and municipal customization requirements, and / or other regional customization requirements. For example, the electronic devices can be routers, switches, cameras, etc., which are not limited in the embodiments of this application.
[0101] Figure 3 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. 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), etc.), an application-specific integrated circuit (ASIC), or may be 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 pathway for transmitting information between the aforementioned components.
[0104] The memory 303 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compact disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is 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] The communication interface 304 uses any device such as a transceiver to communicate 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 an embodiment, the processor 301 may include one or more CPUs, such as Figure 3 CPU0 and CPU1 are shown in the figure.
[0107] In a specific implementation, as an embodiment, the electronic device may include multiple processors, such as Figure 3 301 and processor 305 are shown in FIG. Each of these processors can be a single-core processor or a multi-core processor. A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0108] The memory 303 is used to store the program code 310 for executing the solution of the present application, and the processor 301 is used to execute the program code 310 stored in the memory 303. The electronic device can implement the device configuration method provided in the following embodiments through the processor 301 and the program code 310 in the memory 303.
[0109] It is understandable that the above Figure 3The structures illustrated in the embodiments do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0110] Next, the software system of the electronic device will be described.
[0111] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, which is not limited in the present embodiment. The present embodiment takes a layered architecture as an example to exemplify the software system of the electronic device.
[0112] Figure 4 Schematic diagram of a software system of an electronic device provided in an embodiment of the present application. Figure 4 The layered architecture divides software into several layers, each with a clear role and division of labor. 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. Figure 4 As shown, the application layer may include multiple software modules, each of the multiple software modules corresponds to one or more configuration items, and each software module is used to implement the configuration of the one or more configuration items corresponding to it.
[0114] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. 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 a default configuration file and a configuration file corresponding to each region in multiple regions (such as provinces and cities).
[0115] Optionally, the default configuration file and the configuration files corresponding to each of the multiple regions may be stored in a memory of the hardware layer of the electronic device. The configuration change module may read the default configuration file and the configuration files corresponding to each region from the memory.
[0116] It is understandable that the above Figure 4The structure illustrated in the embodiment does not constitute a specific limitation on the software system of the electronic device. In other embodiments of the present application, the electronic device may include more or fewer software layers than shown in the figure. For example, the electronic device may also include a system layer, a kernel layer, etc., which is not limited in the embodiments of the present application.
[0117] It should be noted that the embodiments of the present application do not particularly limit the specific structure of the execution subject of the device configuration method. As long as the code recording the device configuration method provided by the embodiments of the present application can be run to perform processing according to the device configuration method provided by the embodiments of the present application. For example, the execution subject of the device configuration method provided by the embodiments of the present 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 to the electronic device, such as a chip.
[0118] The following uses a router as an example to illustrate the process from research and development to use of the router in the embodiment of the present application.
[0119] like Figure 5 As shown, after R&D personnel develop a unified software version, the production line can produce products using this software version, and then these products can be shipped to various provinces and cities. Specifically, the 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 the serial number (SN)) and the province code.
[0120] Municipal distributors can distribute products (i.e., routers) to installation and maintenance personnel. After installing the router, the installation and maintenance personnel can start the router. When the router starts, the device configuration method provided in the embodiment of the present application can be executed to implement the corresponding province configuration. For example, the router can first start with the default configuration, and then query the corresponding province code from the server based on its own device identification. After obtaining the province code returned by the server, it switches to the corresponding province configuration according to the configuration file corresponding to the province code. The specific operation is described in the following embodiment.
[0121] The device configuration method provided in the embodiment of the present application is explained in detail below.
[0122] Figure 6 This is a flow chart of a device configuration method provided by an embodiment of the present application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 6 The flowchart shown is used to illustrate the configuration process when the electronic device is started for the first time. Figure 6 , the method comprises the following steps:
[0123] Step 601: The electronic device starts up in response to the received start-up instruction.
[0124] The startup instruction is used to instruct the electronic device to start up. For example, the startup instruction can be triggered by the user. For example, the user can trigger the startup instruction by pressing the power button (also known as the power button or the on / off button) of the electronic device. Of course, the startup instruction can also be triggered by other means, which is not limited in the embodiments of the present application.
[0125] The electronic device may start the configuration change module when starting up.
[0126] For example, after receiving a startup command, the electronic device can run a boot loader, which can perform hardware initialization. After completing hardware initialization, the kernel can be started. After the kernel starts, it performs a series of initialization operations, such as setting up cache and memory, loading drivers, mounting the root file system, initializing input and output, etc., and then starts the operating system. When the operating system starts, the configuration change module is activated. After the operating system starts, the electronic device successfully starts.
[0127] Step 602: After the electronic device is started, the configuration change module starts at least one software module among the plurality of software modules according to a default configuration file.
[0128] The default configuration file includes configuration information of each software module in the plurality of software modules. Any software module in the plurality of software modules corresponds to one or more configuration items.
[0129] The configuration information of a software module includes the enabled state and configuration parameters.
[0130] The enable state is used to indicate whether all configuration items corresponding to the software module are enabled. For example, the enable state can be enable, indicating whether the configuration item is enabled. Its value can be 0 or 1, indicating disable and enable respectively. That is, if the value of enable is 1, it means that the configuration item is enabled; if the value of enable is 0, it means that the configuration item is not enabled (i.e., disabled).
[0131] If the enabled state indicates that all configuration items corresponding to the software module are enabled, the corresponding configuration parameters may include configuration parameters for each of all configuration items corresponding to the software module, where the configuration parameters of a configuration item are specific data used to configure the configuration item. If the enabled state indicates that all configuration items corresponding to the software module are not enabled, the corresponding configuration parameters are empty.
[0132] In some embodiments, the operation of step 602 may be: after the electronic device is started, for the configuration information of 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 not enabled, the configuration change module does not start the software module.
[0133] For example, the configuration change module may start the software module based on the configuration parameters in the configuration information of the software module by passing the configuration parameters as input parameters to the software module when starting the software module. After starting, the software module may be configured accordingly based on the configuration parameters to implement the corresponding function.
[0134] In an embodiment of the present application, after the electronic device is started, the configuration change module first starts at least one software module among the multiple software modules with a default configuration, thereby ensuring that the electronic device can operate normally after starting.
[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 running configuration file based on the configuration of each of the multiple software modules. Furthermore, the configuration change module can store the running configuration file in a memory at the hardware layer, and the configuration change module can read the running configuration file from the memory when needed.
[0136] The running configuration file may indicate the current configuration of the electronic device. The running 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 started, it may be determined that the enabled state in the configuration information of the software module in the running configuration file is disabled, and the configuration parameters of the configuration information of the software module in the running configuration file are empty; if the software module is currently started, it may be determined that the enabled state in the configuration information of the software module in the running configuration file is enabled, and the configuration parameters in the configuration information of the software module in the running configuration file are 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 allowed to be used. The region described in the embodiment of the present application may be a province, city or other geographical area, etc., and the embodiment of the present application does not limit this.
[0139] In some embodiments, the operation of step 603 can be: the configuration change module sends a region identification acquisition request to the server, and the region identification acquisition request carries the device identification of the electronic device; after the server receives the region identification acquisition request, it obtains the region identification corresponding to the device identification as the target region identification, and sends the target region identification to the electronic device; the configuration change module receives the target region identification.
[0140] It should be noted that when the electronic device leaves the factory, the technician may pre-store the correspondence between the device identifier of the electronic device and the identifier of the region where the electronic device is allowed to be used in the server based on the region where the electronic device is allowed to be used (such as the region to which the electronic device needs to be shipped). For example, the device identifier of the electronic device may be the SN of the electronic device, and the region where the electronic device is allowed to be used may be a province. In this case, the region identifier corresponding to the SN of the electronic device (i.e., the target region identifier) may be a province code.
[0141] In this case, the electronic device can quickly obtain the target area identifier corresponding to the electronic device from the server when in use, and implement corresponding configuration accordingly.
[0142] In addition, for manufacturers, when shipping requirements change, such as shipping 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 in the server from the identifier of region A to the identifier of region B, and then directly ship the electronic device to region B. Afterwards, when the electronic device is used, it can obtain the identifier of region B from the server and implement the configuration required by region B accordingly. In this way, compared to the solution in the related art that requires rework of the product when shipping requirements change, the embodiment of the present application only needs to modify the corresponding relationship stored in the server when shipping requirements change, which can greatly reduce costs.
[0143] Step 604: The configuration change module stores the target region identifier.
[0144] For example, the configuration change module may store the target region identifier in a memory of the hardware layer.
[0145] Step 605: The configuration change module obtains the target configuration file from the stored correspondence between the region identifier and the configuration file according to the target region identifier.
[0146] The target configuration file is a configuration file corresponding to the target region identifier, that is, a configuration file for the region identified by the target region identifier. The target configuration file may include configuration information of each software module in at least one software module among the multiple software modules in the electronic device.
[0147] The electronic device may pre-store a correspondence between region identifiers and configuration files. The correspondence may include multiple region identifiers and multiple configuration files corresponding to the multiple region identifiers. The configuration file corresponding to a region identifier is the configuration file for the region identified by the region identifier, and is used to implement the functions required by the region.
[0148] Step 606: The configuration change module adjusts the configurations of the multiple software modules according to the target configuration file.
[0149] In an embodiment of the present application, after the electronic device is started, the configuration change module can first start at least one of the multiple software modules with the 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 based on the target configuration file corresponding to the target region identifier to implement the functions required by the region identified by the target region identifier. In this way, the functions required by different regions can be flexibly implemented based on a single software version, reducing the cost of the electronic device while ensuring normal use.
[0150] In some embodiments, the operation of step 606 may be: the configuration change module obtains one or more difference configuration information from the target configuration file based on the difference between the target configuration file and the default configuration file; for any one of the one or more difference configuration information, adjusts the configuration of the software module corresponding to the difference configuration information according to the difference configuration information.
[0151] Optionally, the operation of the configuration change module obtaining one or more difference configuration information from the target configuration file based on the difference between the target configuration file and the default configuration file can be: the configuration change module compares 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 regarded as a difference configuration information.
[0152] Optionally, the configuration change module may adjust the configuration of the software module corresponding to the difference configuration information based on the difference configuration information as follows: if the enabled state in the difference configuration information is disabled, the configuration change module may disable the software module corresponding to the difference configuration information; if the enabled state in the difference configuration information is enabled, the configuration change module may start the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information if the software module corresponding to the difference configuration information is not enabled; and if the software module corresponding to the difference configuration information is already enabled, the configuration change module may adjust the configuration of the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information.
[0153] For example, the configuration change module may start the software module corresponding to the difference configuration information based on the configuration parameters in the difference configuration information. When starting the software module, the configuration change module may pass the configuration parameters in the difference configuration information as input parameters to the software module. After starting, the software module may be configured accordingly based on the configuration parameters to implement the corresponding function.
[0154] For example, the configuration change module may adjust the configuration of the software module corresponding to the difference configuration information according to the configuration parameters in the difference configuration information by: the configuration change module transmits the configuration parameters in the difference configuration information to the software module, and the software module changes its own configuration according to the configuration parameters to implement the new function.
[0155] It should be noted that in the embodiments of the present application, the multiple software modules can be dynamically configured based on the configuration differences between the target configuration file and the default configuration file. In this way, the functions required by 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 running configuration file according to the configurations of the multiple software modules.
[0157] The operation of the configuration change module generating the running configuration file according to the configuration of the multiple software modules has been described above and will not be repeated here.
[0158] It should be noted that each time the configurations of the multiple modules change, the configuration change module may regenerate a running configuration file based on the configurations of the multiple software modules, and the latest running configuration file generated will overwrite the previously generated running configuration file.
[0159] Figure 7 This is a flow chart of a device configuration method provided by an embodiment of the present application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 7 The flowchart shown is used to illustrate the configuration process when the electronic device is restarted. Figure 7 , the method comprises the following steps:
[0160] Step 701: The electronic device restarts in response to a received restart instruction.
[0161] The restart instruction is used to instruct the electronic device to restart. For example, the restart instruction can be triggered by the user. For example, the user can trigger the restart instruction by long pressing the power button of the electronic device. Of course, the restart instruction can also be triggered by other means, which is not limited in the embodiments of the present application.
[0162] The electronic device may start the configuration change module when starting up.
[0163] For example, when an electronic device starts up, it may run a boot loader, which performs hardware initialization and then boots the kernel. After the kernel boots up, it performs a series of initialization operations, such as setting up cache and memory, loading drivers, mounting the root file system, and initializing input and output. It then boots up the operating system, and the configuration change module starts when the operating system boots up. Once the operating system boots up, the electronic device successfully boots up.
[0164] Step 702: After the electronic device is started, the configuration change module starts at least one software module among the plurality of software modules according to the operation configuration file.
[0165] After the electronic device is started, the configuration change module does not exist in the case of running configuration files, as described above. Figure 6 In step 601 of the embodiment, there is no running configuration file when the electronic device is started for the first time. In this case, at least one software module among the multiple software modules is started according to the default configuration file. The specific operation can refer to the above step 602 and will not be repeated here.
[0166] After the electronic device is started, the configuration change module, if there is a running configuration file, such as Figure 7 In step 701 of the embodiment, when the electronic device is restarted, there is an operation configuration file. In this case, at least one software module among the multiple software modules is started according to the operation configuration file.
[0167] In some embodiments, the operation of step 702 may be: after the electronic device is started, for the configuration information of 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 not enabled, the configuration change module does not start the software module.
[0168] In some embodiments, after the configuration change module starts at least one software module among the multiple software modules according to the running configuration file, it may further regenerate the running configuration file according to the configuration of each software module among the multiple software modules.
[0169] Furthermore, after step 702, the configuration change module determines that the configuration is completed if the target region identifier has been stored.
[0170] When the configuration change module does not store the target region identifier, as in the 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 perform corresponding configuration accordingly. The specific operations can refer to the above steps 603 to 607 and will not be repeated here.
[0171] When the configuration change module has stored the target region identifier, such as Figure 7 In step 701 of the embodiment, when the electronic device is restarted, the electronic device has obtained the target region identifier before the electronic device is restarted, and has performed corresponding configuration based on it to obtain an operating configuration file. Then in step 702, after the electronic device is restarted this time, the corresponding software module is started according to the operating configuration file, and the function required by the region identified by the target region identifier has been realized. Therefore, when 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 flow chart of a device configuration method provided by an embodiment of the present application. The method is applied to an electronic device, which includes a configuration change module and multiple software modules. Figure 8 The flowchart shown is used to illustrate the configuration process when the electronic device is restored to factory settings. Figure 8 , the method comprises the following steps:
[0173] Step 801: The electronic device deletes the stored target region identifier and operation configuration file in response to the received factory reset instruction.
[0174] The factory reset instruction is used to instruct the electronic device to restore its factory settings, i.e., restore the default settings. For example, the factory reset instruction can be triggered by a user. For example, the user can trigger the factory reset instruction by long pressing the reset button of the electronic device. Of course, the factory reset instruction can also be triggered by other means, which is not limited in the embodiments of the present application.
[0175] Since the factory settings need to be restored, the electronic device needs to delete the target region identifier and the operation configuration file previously stored during the operation of the electronic device.
[0176] Step 802: The electronic device is restarted.
[0177] The electronic device may start the configuration change module when starting up.
[0178] For example, when an electronic device starts up, it may run a boot loader, which performs hardware initialization and then boots the kernel. After the kernel boots up, it performs a series of initialization operations, such as setting up cache and memory, loading drivers, mounting the root file system, and initializing input and output. It then boots up the operating system, and the configuration change module starts when the operating system boots up. Once the operating system boots up, the electronic device successfully boots up.
[0179] Step 803: After the electronic device is started, the configuration change module starts at least one software module among the multiple software modules according to the default configuration file.
[0180] Since the electronic device deleted the stored running configuration file when receiving the factory setting restoration instruction, the electronic device starts at least one software module among the multiple software modules according to the default configuration file after the electronic device is restarted this time.
[0181] Step 804: The configuration change module obtains the target region identifier corresponding to the electronic device from the server.
[0182] Since the electronic device deleted the stored target region identifier when receiving the factory reset instruction, the electronic device obtains the target region identifier from the server after the electronic device is restarted this time, and subsequently performs corresponding configuration based on the target region identifier.
[0183] Step 805: The configuration change module stores the target region identifier.
[0184] Step 806: The configuration change module obtains the target configuration file from the stored correspondence between the region identifier and the configuration file according to the target region identifier.
[0185] Step 807: The configuration change module adjusts the configurations of the multiple software modules according to the target configuration file.
[0186] Step 808: The configuration change module generates a running configuration file according to the configurations of the multiple software modules.
[0187] The operations of step 803 to step 808 are similar to the operations of step 602 to step 607 above, and will not be described in detail in this embodiment of the present application.
[0188] In an embodiment of the present application, when the electronic device is restored to factory settings, it can re-acquire the target region identifier corresponding to the electronic device from the server, and then adjust the configurations of the multiple software modules according to the target configuration file corresponding to the target region identifier to implement the functions required by the region identified by the target region identifier. In this way, when the electronic device is restored to factory settings, it can still be guaranteed to implement the functions required by the region for which it is allowed to be used, ensuring normal use of the electronic device.
[0189] It is understandable that the above Figure 6 Examples to Figure 8 In the embodiment, the operations performed by the configuration change module are performed by the electronic device. In other embodiments of the present 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 the structure of a device configuration apparatus provided in an embodiment of the present application. The apparatus can be implemented as part or all of an electronic device by software, hardware, or a combination of both. The electronic device can be the above Figure 3 and Figure 4 The electronic device described in the embodiment. 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 software module 902 among the multiple software modules 902 according to a default configuration file after the electronic device is started, where the default configuration file includes configuration information for each software module 902 among the multiple software modules 902; obtain a target region identifier corresponding to the electronic device from a server; obtain a target configuration file from a stored correspondence between the region identifier and the configuration file based on the target region identifier; and adjust the configuration of the multiple software modules 902 according to the target configuration file.
[0192] In an embodiment of the present application, after the electronic device is started, the configuration change module can first start at least one of the multiple software modules with the 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 based on the target configuration file corresponding to the target region identifier to implement the functions required by the region identified by the target region identifier. In this way, the functions required by different regions can be flexibly implemented based on a single software version, reducing the cost of the electronic device while ensuring normal use.
[0193] It should be noted that: when configuring the device, the device configuration device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example. In actual applications, the above-mentioned 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 may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The above integrated units may be implemented in the form of hardware or software functional units. In addition, the specific names of the functional units and modules are only for the purpose of distinguishing them from each other 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 processes and technical effects brought about by the units and modules in the above embodiments can be found in the method embodiment part and will not be repeated here.
[0196] 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 this application.
[0197] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0198] An 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.
[0199] An embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned various method embodiments.
[0200] The present application also provides a chip system, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.
[0201] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL) etc.) or wireless (such as: infrared, wireless, microwave etc.) mode. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (eg, a digital versatile disc (DVD), etc.), or a semiconductor medium (eg, a solid state disk (SSD), etc.).
[0202] The above are optional embodiments provided for this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the technical scope disclosed in this application should be included in the scope of protection of this application.
Claims
1. A device configuration method, characterized in that: Applied to an electronic device, the electronic device includes multiple software modules, and the method includes: After the electronic device is started, starting at least one software module among the multiple software modules according to a default configuration file, wherein the default configuration file includes configuration information of each software module among the multiple software modules; Obtaining a target region identifier corresponding to the electronic device from a server; According to the target region identifier, obtaining a target configuration file from a stored correspondence between the region identifier and the configuration file; The configurations of the multiple software modules are adjusted according to the target configuration file.
2. The method according to claim 1, wherein The configuration information of the software module includes an enabling state and configuration parameters, and the enabling state is used to indicate whether a configuration item corresponding to the software module is enabled.
3. The method according to claim 2, wherein The starting at least one software module among the plurality of software modules according to the default configuration file comprises: For configuration information of any software module included in the default configuration file, if the enabling state in the configuration information of the software module is disabled, the software module is not started; If the activation state in the configuration information of the software module is activation, the software module is activated 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 adjusting the configurations of the plurality of software modules according to the target configuration file includes: Acquire one or more difference configuration information from the target configuration file according to the difference between the target configuration file and the default configuration file; For any one piece of the one or more difference configuration information, the configuration of the software module corresponding to the difference configuration information is adjusted according to the difference configuration information.
5. The method according to claim 4, wherein The configuration information of the software module includes an activation state and configuration parameters, wherein the activation state is used to indicate whether a configuration item corresponding to the software module is activated; The adjusting, according to the difference configuration information, the configuration of the software module corresponding to the difference configuration information includes: If the enabled state in the difference configuration information is disabled, shutting down the software module corresponding to the difference configuration information; If the enabling status in the difference configuration information is enabled, then when the software module corresponding to the difference configuration information is not started, the software module corresponding to the difference configuration information is started according to the configuration parameters in the difference configuration information; when the software module corresponding to the difference configuration information is already started, the configuration of the software module corresponding to the difference configuration information is 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: After obtaining the target region identifier corresponding to the electronic device from the server, the method further includes: storing the target region identifier; After adjusting the configurations of the plurality of software modules according to the target configuration file, the method further includes: An operation configuration file is generated according to the configurations of the multiple software modules.
7. The method according to claim 6, wherein After the electronic device is started, starting at least one software module among the multiple software modules according to a default configuration file includes: After the electronic device is started, at least one software module among the plurality of software modules is started according to the default configuration file when the running configuration file does not exist.
8. The method according to claim 7, wherein The method further comprises: After the electronic device is started, at least one software module among the plurality of software modules is started according to the running configuration file if the running configuration file exists.
9. The method according to claim 6, wherein The acquiring, from the server, a target region identifier corresponding to the electronic device, includes: The target region identifier is obtained from the server if the target region identifier is not stored.
10. The method according to any one of claims 6 to 9, characterized in that: The method further comprises: In response to the received factory reset instruction, deleting the stored target region identifier and the operation configuration file; Restart the electronic device.
11. The method according to any one of claims 1 to 10, characterized in that: The acquiring, from the server, a target region identifier corresponding to the electronic device, includes: Sending a region identification acquisition request to the server, wherein the region identification acquisition request carries the device identification of the electronic device; Receive the target region identifier sent by the server.
12. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium comprises instructions, which, when executed on an electronic device, cause the electronic device to perform the method according to any one of claims 1 to 11.
14. A computer program product, characterized in that When the computer program product is run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for dynamically configuring application program
CN107168726A
Software configuration method, electronic equipment and storage medium
CN113094087A
Software permission configuration method and device, computer equipment and storage medium
CN116975894A
Software configuration method and device and electronic equipment
CN117675561A
Electronic device and method for loading configuration files using the same
US20110264903A1