On-off control method, system and device for functional modules in operating system

Manage the switch information of operating system function modules through unified configuration files, generate Java and native layer interface files, realize synchronous adjustment of function module status, solve the problems of cumbersome operation and limited use, and provide flexible and widely applicable function module control method.

CN118585260APending Publication Date: 2024-09-03WEILAI MOBILE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310198204.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-02
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The switch control operation of functional modules in the existing operating system is cumbersome and affected by the startup of PackageManager, which limits the usage rights and cannot meet the needs of various scenarios.

Method used

By generating configuration files, including switch information of all functional modules to be controlled, generating Java layer and native layer interface files, storing initial switch status values, receiving switch status setting instructions, synchronizing Java layer and native layer interface files, and directly adjusting functions The switch status of the module.

Benefits of technology

It simplifies the switch management of functional modules, avoids the influence of PackageManager, provides a wider scope of application and flexibility, and improves the convenience and consistency of control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585260A
    Figure CN118585260A
Patent Text Reader

Abstract

The invention relates to the technical field of operating systems, particularly provides a switch control method, system and control device for functional modules in an operating system, and aims to solve the technical problems that an existing operating system is tedious in switch control operation for different functions and limited in use scene. In order to achieve the purpose, the on-off control method for the functional modules in the operating system comprises the steps that a configuration file is generated, and the configuration file comprises on-off information of all the to-be-controlled functional modules; generating a java layer interface file and a native layer interface file of the to-be-controlled function module based on the configuration file; storing a set of initial switch state values of all the to-be-controlled functional modules; receiving an on-off state setting instruction for any function module to be controlled, and realizing synchronization of the java layer interface file and the native layer interface file based on the set; and adjusting the on-off state of any functional module to be controlled through the java layer interface file and the native layer interface file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of operating systems, and specifically provides a switch control method, system and control device for a functional module in an operating system. Background Art

[0002] In the development process of existing operating systems, such as Android systems, different functions may need to be turned on or off under different circumstances. In the prior art, the system needs to define a specific and unique function module string to describe the switches of different functions. If the corresponding function module is to be turned on, the corresponding string must be added to the XML file, or an XML file with the corresponding string defined must be added separately. The PackageManager program package manager parses the corresponding string to turn on the corresponding function module.

[0003] This function switch control method is not only cumbersome to operate, but also affected by the startup of PackageManager, limiting the usage rights in many scenarios. Accordingly, a new function module switch control method is needed in the art to solve the above problems. Summary of the invention

[0004] In order to overcome the above-mentioned defects, the present invention is proposed to provide a solution or at least partially solve the technical problems in the prior art that the switch control operation of the system for different functions is cumbersome and the usage scenarios are limited.

[0005] In a first aspect, the present invention provides a method for controlling a switch of a functional module in an operating system, comprising the steps of:

[0006] Generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled;

[0007] Generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file;

[0008] Storing the set of initial switch state values ​​of all the functional modules to be controlled;

[0009] receiving a switch state setting instruction for any function module to be controlled, and realizing synchronization of the Java layer interface file and the native layer interface file based on the collection;

[0010] The switch state of any functional module to be controlled is adjusted through the Java layer interface file and the native layer interface file.

[0011] In a technical solution of the switch control method of the functional module in the above operating system, the step of generating the Java layer interface file and the native layer interface file of the functional module to be controlled based on the configuration file includes:

[0012] During the compilation phase, the switch information in the configuration file is parsed to generate the Java layer interface file and the native layer interface file.

[0013] In a technical solution of the switch control method of the functional module in the above operating system, the receiving of the switch state setting instruction for any functional module to be controlled, and the synchronization of the Java layer interface file and the native layer interface file based on the collection include:

[0014] Receiving a switch state setting instruction for any function module to be controlled, and changing the first static variable of the Java layer interface file;

[0015] Based on the first static variable, the second static variable of the native layer interface file is updated through JNI.

[0016] In a technical solution of the switch control method of the functional module in the above operating system, the updating of the second static variable of the native layer interface file through JNI based on the first static variable includes:

[0017] Based on the first static variable, changing the current switch state value of any functional module to be controlled through JNI;

[0018] The second static variable of the native layer interface file is updated based on the changed current switch state value.

[0019] In a technical solution of the switch control method of the functional module in the above operating system, the changing of the first static variable of the Java layer interface file includes:

[0020] Configure the function setting method of the java layer interface file;

[0021] The first static variable of the Java layer interface file is changed according to the function setting method.

[0022] In a technical solution of the switch control method of the functional module in the above operating system, the set of initial switch state values ​​of all the functional modules to be controlled is stored, including:

[0023] By using bit operation, the initial switch state values ​​of all the functional modules to be controlled are recorded in the attribute value.

[0024] In a technical solution of the switch control method of the functional module in the above operating system, the switch state of any functional module to be controlled is adjusted through the Java layer interface file and the native layer interface file, including:

[0025] A method for obtaining a first function of any function module to be controlled configured in the Java layer;

[0026] Parsing the switch information through the first function acquisition method and controlling the switch state of any to-be-controlled function module in the Java layer; and / or

[0027] A method for obtaining a second function of any function module to be controlled configured in the native layer;

[0028] The switch information is parsed through the second function acquisition method and the switch state of any function module to be controlled in the native layer is controlled.

[0029] In a technical solution of the switch control method of the functional module in the above operating system, the switch information includes a function identifier and an initial switch state value, the function identifier is used to distinguish the corresponding functional module, and the initial switch state value is used to characterize the initial switch state of the corresponding functional module.

[0030] In a second aspect, the present invention provides a switch control system for a functional module in an operating system, comprising:

[0031] A first generating unit, configured to generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled;

[0032] A second generating unit, configured to generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file;

[0033] A storage unit, used to store a set of initial switch state values ​​of all the functional modules to be controlled;

[0034] A processing unit, configured to receive a switch state setting instruction for any function module to be controlled, and synchronize the Java layer interface file with the native layer interface file based on the set;

[0035] An execution unit is used to adjust the switch state of any function module to be controlled through the Java layer interface file and the native layer interface file.

[0036] In a third aspect, a control device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the switch control method of the functional module in the operating system described in any of the technical solutions of the switch control method of the functional module in the above-mentioned operating system.

[0037] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, wherein the program codes are suitable for being loaded and run by a processor to execute the method for controlling a switch of a functional module in an operating system as described in any one of the technical solutions of the method for controlling a switch of a functional module in an operating system.

[0038] Solution 1. A method for controlling a switch of a functional module in an operating system, characterized in that it comprises the steps of:

[0039] Generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled;

[0040] Generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file;

[0041] Storing the set of initial switch state values ​​of all the functional modules to be controlled;

[0042] receiving a switch state setting instruction for any function module to be controlled, and realizing synchronization of the Java layer interface file and the native layer interface file based on the collection;

[0043] The switch state of any functional module to be controlled is adjusted through the Java layer interface file and the native layer interface file.

[0044] Solution 2. The control method according to Solution 1 is characterized in that the step of generating the Java layer interface file and the native layer interface file of the functional module to be controlled based on the configuration file comprises:

[0045] During the compilation phase, the switch information in the configuration file is parsed to generate the Java layer interface file and the native layer interface file.

[0046] Solution 3. The control method according to Solution 1 is characterized in that the receiving of the switch state setting instruction for any functional module to be controlled and the synchronization of the Java layer interface file and the native layer interface file based on the collection include:

[0047] Receiving a switch state setting instruction for any function module to be controlled, and changing the first static variable of the Java layer interface file;

[0048] Based on the first static variable, the second static variable of the native layer interface file is updated through JNI.

[0049] Solution 4. The control method according to Solution 3 is characterized in that the updating of the second static variable of the native layer interface file through JNI based on the first static variable comprises:

[0050] Based on the first static variable, changing the current switch state value of any functional module to be controlled through JNI;

[0051] The second static variable of the native layer interface file is updated based on the changed current switch state value.

[0052] Solution 5. The control method according to Solution 3 is characterized in that the changing of the first static variable of the Java layer interface file comprises:

[0053] Configure the function setting method of the java layer interface file;

[0054] The first static variable of the Java layer interface file is changed according to the function setting method.

[0055] Solution 6. The control method according to any one of solutions 1 to 5, characterized in that the set of initial switch state values ​​of all the functional modules to be controlled is stored, comprising:

[0056] By using bit operation, the initial switch state values ​​of all the functional modules to be controlled are recorded in the attribute value.

[0057] Solution 7. The control method according to Solution 1 is characterized in that the step of adjusting the switch state of any functional module to be controlled through the Java layer interface file and the native layer interface file comprises:

[0058] A method for obtaining a first function of any function module to be controlled configured in the Java layer;

[0059] Parsing the switch information through the first function acquisition method and controlling the switch state of any to-be-controlled function module in the Java layer; and / or

[0060] A method for obtaining a second function of any function module to be controlled configured in the native layer;

[0061] The switch information is parsed through the second function acquisition method and the switch state of any function module to be controlled in the native layer is controlled.

[0062] Solution 8. A control method according to any one of Solutions 1-7, characterized in that the switch information includes a function identifier and an initial switch state value, the function identifier is used to distinguish the corresponding function module, and the initial switch state value is used to characterize the initial switch state of the corresponding function module.

[0063] Solution 9. A switch control system for a functional module in an operating system, characterized by comprising:

[0064] A first generating unit, configured to generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled;

[0065] A second generating unit, configured to generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file;

[0066] A storage unit, used to store a set of initial switch state values ​​of all the functional modules to be controlled;

[0067] A processing unit, configured to receive a switch state setting instruction for any function module to be controlled, and synchronize the Java layer interface file with the native layer interface file based on the set;

[0068] An execution unit is used to adjust the switch state of any function module to be controlled through the Java layer interface file and the native layer interface file.

[0069] Scheme 10. A control device comprising a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and is characterized in that the program codes are suitable for being loaded and run by the processor to execute a switch control method of a functional module in an operating system described in any one of Schemes 1 to 8.

[0070] Solution 11. A computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute a switch control method of a functional module in an operating system described in any one of Solutions 1 to 8.

[0071] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:

[0072] In the technical solution of the present invention, the switch information of all the functional modules to be controlled in the operating system is unified into a configuration file, which makes it easier to manage the switches of the functional modules. Then, a java layer interface file and a native layer interface file are generated based on the configuration file, and the switch status of the functional modules is directly controlled using the java layer interface file and the native layer interface file. When the switch status of a functional module needs to be changed, the java layer interface file and the native layer interface file are changed synchronously by storing a set of initial switch status values, and they are always consistent to meet the control requirements of the functional modules. The entire control method is simple and flexible, is not affected by the startup of PackageManager, and has a wider scope of application. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:

[0074] Figure 1 is a schematic diagram of a method for controlling a switch of a functional module in an operating system according to an embodiment of the present invention;

[0075] Figure 2 is a schematic flow chart of main steps of a method for controlling a switch of a functional module in an operating system according to an embodiment of the present invention;

[0076] Figure 3 is a flowchart of main steps of step S40 in a method for controlling a switch of a functional module in an operating system according to an embodiment of the present invention;

[0077] Figure 4 It is a schematic diagram of the main structural block diagram of a switch control system of a functional module in an operating system according to an embodiment of the present invention.

[0078] Figure 5 It is a schematic diagram of the main structural block diagram of a control device according to an embodiment of the present invention.

[0079] Reference numerals list :

[0080] 11: first generating unit, 12: second generating unit, 13: storage unit, 14: processing unit, 15: execution unit. DETAILED DESCRIPTION

[0081] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0082] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.

[0083] The directional terms used in this document, such as "front", "front side", "front part", "rear", "rear side" and "rear part", are based on the front-to-back direction of the vehicle after the component is installed on the vehicle. The "longitudinal", "longitudinal" and "longitudinal section" mentioned in this document are based on the front-to-back direction after the component is installed on the vehicle, while "transverse", "transverse" and "cross section" refer to the direction perpendicular to the longitudinal direction.

[0084] At present, based on the native feature mechanism of the operating system, when the system function is switched on and off, it is necessary to define specific unique strings for different functional modules. If the corresponding functional module needs to be turned on, it is necessary to add the corresponding string in the XML file under the system default path system config, or add an XML file defining the corresponding string separately, and then parse the corresponding string through the package manager (PackageManager) to start the corresponding function. The present invention is applied to operating systems such as Android and iOS.

[0085] See attached Figures 1-2 , Figure 1 is a schematic diagram of a method for controlling a switch of a functional module in an operating system according to an embodiment of the present invention; Figure 2 FIG. 1 is a flow chart of the main steps of a method for controlling a switch of a functional module in an operating system according to an embodiment of the present invention. Figure 2 As shown, the method for controlling the switch of a functional module in an operating system in an embodiment of the present invention mainly includes the following steps S10 to S50.

[0086] Step S10: Generate a configuration file, wherein the configuration file includes switch information of all functional modules to be controlled.

[0087] In a specific embodiment, a configuration file is generated according to the switch information of the function module to be controlled. Each function module to be controlled corresponds to a switch information, and the switch information can be a manually set string, number or other identifier that can distinguish different function modules and their switch states. By unifying the switch information of all function modules to be controlled in the operating system into a configuration file, it is more convenient to manage the switches of each function module. The configuration file is feature_config.json.

[0088] Step S20: Generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file.

[0089] In one example, the switch information includes a function identifier and an initial switch state value, wherein the function identifier is used to identify a corresponding function module, and the initial switch state value is used to characterize an initial switch state of the corresponding function module.

[0090] In a specific embodiment, numbers are used as switch information of the functional modules to be controlled. The switch information corresponding to the first functional module is 00010, and the switch information corresponding to the second functional module is 00021. The 0001 and 0002 in the switch information are used to distinguish which functional module it corresponds to. The last 0 and 1 in the switch information are used to determine that the switch state of the first functional module is off, and the switch state of the second functional module is on.

[0091] In one example, the step S20 further includes: in the compilation stage, parsing the switch information in the configuration file to generate the Java layer interface file and the native layer interface file.

[0092] When the operating system is compiled, the switch information in the configuration file is parsed to obtain two interface files applied to the Java layer and the native layer, namely the Java layer interface file FeatureControl.java and the native layer interface file featurecontrol.h. The functional modules and their switch states between the two interface files correspond one to one. To control the switch state of a functional module, the data in the two interface files needs to be changed synchronously.

[0093] Step S30: storing a set of initial switch state values ​​of all the functional modules to be controlled.

[0094] In one example, the step S30 includes: using bit operations to record the initial switch state values ​​of all the functional modules to be controlled in the attribute value.

[0095] In a specific embodiment, a bit operation is performed on the native layer interface file, and all initial switch state values ​​are recorded in the attribute value, and the attribute value is stored in the so library. The length of each attribute value is limited to 92 bytes, each byte is 8 bits, and an initial switch state value is stored in one bit, so each attribute value can store the initial switch state values ​​of 736 control modules.

[0096] Step S40: receiving a switch state setting instruction for any function module to be controlled, and realizing synchronization of the Java layer interface file and the native layer interface file based on the collection.

[0097] Because in order to control the switch state of a functional module, the data in the two interface files need to be changed synchronously. Therefore, when the first static variable changes, the corresponding second static variable in the native layer interface file is synchronously modified through JNI.

[0098] In one example, if Figure 3 As shown, step S40 further includes:

[0099] Step S401: receiving a switch state setting instruction for any function module to be controlled, and changing the first static variable of the Java layer interface file;

[0100] Step S402: Based on the first static variable, change the current switch state value of any functional module to be controlled through JNI;

[0101] Step S403: updating the second static variable of the native layer interface file based on the changed current switch state value.

[0102] Among them, when the configuration file is parsed to generate the Java layer interface file and the native layer interface file, the initial switch state value in the switch information is parsed into the data in the Java layer interface file as the first static variable, and the initial switch state value in the switch information is parsed into the data in the native layer interface file as the second static variable.

[0103] Since the java layer interface file and the native layer interface file are just two interface files, they cannot directly interact with data. Therefore, the initial switch state value pre-stored in the so library is first synchronously changed through JNI. The initial switch state values ​​of all functional modules to be controlled are stored in an attribute value. The corresponding functional module to be controlled is determined according to the position stored in the attribute value, and then the initial switch state value is changed. Among them, when the functional module is controlled for the first time, the object changed is the initial switch state value in the attribute value. When the system runs for a period of time and after multiple functional module controls, the object changed is the switch value after the last change in the attribute value, that is, the current switch state value. After the switch value in the attribute value is synchronously changed, the native layer interface file directly synchronously modifies the second static variable from the pre-stored attribute value.

[0104] In one example, the step of changing the first static variable of the Java layer interface file in step S401 includes:

[0105] Configure the function setting method of the java layer interface file;

[0106] The first static variable of the Java layer interface file is changed according to the function setting method.

[0107] In a specific embodiment, when the operating system receives an instruction to turn on or off a control module, the control module changes the first static variable corresponding to the corresponding control module in the Java layer interface file. The function setting method is used to parse the switch information preset by humans to help the control module modify the data in the Java layer interface file.

[0108] Step S50: adjusting the switch state of any function module to be controlled through the Java layer interface file and the native layer interface file.

[0109] In one example, the changing the switch state of the functional module through the Java layer interface file and the native layer interface file includes:

[0110] A method for obtaining a first function of any function module to be controlled configured in the Java layer;

[0111] Parsing the switch information through the first function acquisition method and controlling the switch state of any to-be-controlled function module in the Java layer; and / or

[0112] A method for obtaining a second function of any function module to be controlled configured in the native layer;

[0113] The switch information is parsed through the second function acquisition method and the switch state of any function module to be controlled in the native layer is controlled.

[0114] Among them, the functional modules and their switch states between the java layer interface file and the native layer interface file are always consistent. The first static variables and the second static variables in the java layer interface file and the native layer interface file are read respectively through the first function acquisition method and the second function acquisition method to realize the control of the switch states of all functional modules.

[0115] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.

[0116] Furthermore, the present invention also provides a switch control system for a functional module in an operating system, comprising:

[0117] A first generating unit, configured to generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled;

[0118] A second generating unit, configured to generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file;

[0119] A storage unit, used to store a set of initial switch state values ​​of all the functional modules to be controlled;

[0120] A processing unit, configured to receive a switch state setting instruction for any function module to be controlled, and synchronize the Java layer interface file with the native layer interface file based on the set;

[0121] An execution unit is used to adjust the switch state of any function module to be controlled through the Java layer interface file and the native layer interface file.

[0122] See attached Figure 4 , Figure 4 FIG. 1 is a main structural block diagram of a switch control system of a functional module in an operating system according to an embodiment of the present invention. Figure 4As shown, the switch control system of the functional module in the operating system in the embodiment of the present invention mainly includes a first generation unit 11, a second generation unit 12, a storage unit 13, a processing unit 14 and an execution unit 15. In some embodiments, one or more of the first generation unit 11, the second generation unit 12, the storage unit 13, the processing unit 14 and the execution unit 15 can be combined into one module.

[0123] In one implementation, the description of the specific implementation function of the first generation unit 11 can be referred to as described in step S10. The description of the specific implementation function of the second generation unit 12 can be referred to as described in step S20. The description of the specific implementation function of the storage unit 13 can be referred to as described in step S30. The description of the specific implementation function of the processing unit 14 can be referred to as described in step S40. The description of the specific implementation function of the execution unit 15 can be referred to as described in step S50.

[0124] The switch control system of the functional modules in the above operating system is used to execute Figure 2 The embodiment of the switch control method of the functional module in the operating system shown in the figure has similar technical principles, technical problems solved and technical effects produced. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the switch control system of the functional module in the operating system can refer to the contents described in the embodiment of the switch control method of the functional module in the operating system, which will not be repeated here.

[0125] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0126] Furthermore, the present invention also provides a control device. Figure 5As shown, in an embodiment of a control device according to the present invention, the control device includes a processor and a storage device, the storage device can be configured to store a program for executing a switch control method of a functional module in an operating system of the above method embodiment, and the processor can be configured to execute the program in the storage device, the program including but not limited to a program for executing a switch control method of a functional module in an operating system of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and for specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.

[0127] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the switch control method of the functional module in the operating system of the above method embodiment, and the program can be loaded and run by the processor to implement the switch control method of the functional module in the above operating system. For ease of explanation, only the part related to the embodiment of the present invention is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.

[0128] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.

[0129] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.

[0130] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for controlling a switch of a functional module in an operating system, It is characterized in that Includes steps: Generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled; Generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file; Storing the set of initial switch state values ​​of all the functional modules to be controlled; receiving a switch state setting instruction for any function module to be controlled, and realizing synchronization of the Java layer interface file and the native layer interface file based on the collection; The switch state of any functional module to be controlled is adjusted through the Java layer interface file and the native layer interface file.

2. The control method according to claim 1, It is characterized in that The step of generating the Java layer interface file and the native layer interface file of the function module to be controlled based on the configuration file includes: During the compilation phase, the switch information in the configuration file is parsed to generate the Java layer interface file and the native layer interface file.

3. The control method according to claim 1, It is characterized in that The receiving a switch state setting instruction for any function module to be controlled, and realizing synchronization of the Java layer interface file and the native layer interface file based on the set, comprises: Receiving a switch state setting instruction for any function module to be controlled, and changing the first static variable of the Java layer interface file; Based on the first static variable, the second static variable of the native layer interface file is updated through JNI.

4. The control method according to claim 3, It is characterized in that The updating, based on the first static variable, of the second static variable of the native layer interface file through JNI includes: Based on the first static variable, changing the current switch state value of any functional module to be controlled through JNI; The second static variable of the native layer interface file is updated based on the changed current switch state value.

5. The control method according to claim 3, It is characterized in that The step of changing the first static variable of the Java layer interface file comprises: Configure the function setting method of the java layer interface file; The first static variable of the Java layer interface file is changed according to the function setting method.

6. The control method according to any one of claims 1 to 5, It is characterized in that The storage of the set of initial switch state values ​​of all the functional modules to be controlled includes: By using bit operation, the initial switch state values ​​of all the functional modules to be controlled are recorded in the attribute value.

7. The control method according to claim 1, It is characterized in that The step of adjusting the switch state of any function module to be controlled by using the Java layer interface file and the native layer interface file includes: A method for obtaining a first function of any function module to be controlled configured in the Java layer; Parsing the switch information through the first function acquisition method and controlling the switch state of any to-be-controlled function module in the Java layer; and / or A method for obtaining a second function of any function module to be controlled configured in the native layer; The switch information is parsed through the second function acquisition method and the switch state of any function module to be controlled in the native layer is controlled.

8. The control method according to any one of claims 1 to 7, It is characterized in that The switch information includes a function identifier and an initial switch state value, wherein the function identifier is used to identify a corresponding function module, and the initial switch state value is used to represent an initial switch state of the corresponding function module.

9. A switch control system for a functional module in an operating system, It is characterized in that include: A first generating unit, configured to generate a configuration file, wherein the configuration file includes switch information of all function modules to be controlled; A second generating unit, configured to generate a Java layer interface file and a native layer interface file of the function module to be controlled based on the configuration file; A storage unit, used to store a set of initial switch state values ​​of all the functional modules to be controlled; A processing unit, configured to receive a switch state setting instruction for any function module to be controlled, and synchronize the Java layer interface file with the native layer interface file based on the set; An execution unit is used to adjust the switch state of any function module to be controlled through the Java layer interface file and the native layer interface file.

10. A control device comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes. It is characterized in that The program code is suitable for being loaded and run by the processor to execute the switch control method of the functional module in the operating system according to any one of claims 1 to 8.