CN116594698A - System control method, device and readable storage medium - Google Patents

System control method, device and readable storage medium Download PDF

Info

Publication number
CN116594698A
CN116594698A CN202310476547.8A CN202310476547A CN116594698A CN 116594698 A CN116594698 A CN 116594698A CN 202310476547 A CN202310476547 A CN 202310476547A CN 116594698 A CN116594698 A CN 116594698A
Authority
CN
China
Prior art keywords
operating system
limitation
activation
state
kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310476547.8A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nfs China Software Co ltd
Original Assignee
Nfs China Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nfs China Software Co ltd filed Critical Nfs China Software Co ltd
Priority to CN202310476547.8A priority Critical patent/CN116594698A/en
Publication of CN116594698A publication Critical patent/CN116594698A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2147Locking files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a system control method, a system control device and a readable storage medium. The method is applied to the electronic equipment, an operating system is installed in the electronic equipment, an evaluation activation lock is preset in a kernel of the operating system, and the method comprises the following steps: detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system; if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation. The embodiment of the application can ensure the basic operation function of the operating system and protect the safety of evaluating the activation lock under the condition that the operating system is not activated due to expiration.

Description

System control method, device and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a system control method, apparatus, and readable storage medium.
Background
Existing operating system and application software activation programs typically exist as user-mode programs that, after activation, allow a user to legally use the operating system and application software.
Operating systems and applications often have a trial period during which they can be used normally, and when not activated after the trial period has ended, they cannot be used further, or the functions used are limited.
For application software, if not activated, the application software program may be exited directly. For the operating system, the operating system is the basis for the running of the whole device, and if the operating system cannot be used or has limited functions because of being not activated, the running of the whole device is influenced; the operating system also stores a large amount of user programs and file materials, which may cause great loss to the user if the operating system suddenly stops. Further, in this case, even if the user wants to activate the operating system, the activation operation may not be performed because the operating system cannot be used or the function is limited. Moreover, since the activation program usually exists in a user mode program, the activation program is easily cracked, and the security is difficult to ensure.
Disclosure of Invention
The embodiment of the application provides a system control method, a device and a readable storage medium, which can ensure the basic operation function of an operating system and protect the safety of evaluating an activation lock under the condition that the operating system is not activated due to expiration.
In a first aspect, an embodiment of the present application discloses a system control method, which is applied to an electronic device, where an operating system is installed on the electronic device, and an evaluation activation lock is preset in a kernel of the operating system, where the method includes:
detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system;
if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
In a second aspect, an embodiment of the present application discloses a system control device, which is applied to an electronic device, where an operating system is installed in the electronic device, and an evaluation activation lock is preset in a kernel of the operating system, where the device includes:
the state detection module is used for detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system;
the resource limiting module is used for controlling the operating system to enter a hardware resource limiting mode by the evaluation activation lock if the activation state of the operating system is detected to be an inactive state due to expiration; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
In a third aspect, embodiments of the present application disclose an apparatus for system control, comprising a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing a system control method as described in one or more of the foregoing.
In a fourth aspect, embodiments of the present application disclose a readable storage medium having instructions stored thereon that, when executed by one or more processors of an apparatus, cause the apparatus to perform a system control method as described in one or more of the preceding.
The embodiment of the application has the following advantages:
in the embodiment of the application, an evaluation activation lock is preset in an operating system kernel of the electronic equipment, and in the starting process of the operating system, the activation state of the operating system is detected through the evaluation activation lock; if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation. All the three modes with limited hardware resources do not affect the basic operation of the operating system, but only affect the performance of the operating system. When the active state of the operating system is the due inactive state, the embodiment of the application only limits the performance of the operating system, but not the functions of the operating system, so that the condition that the operating system cannot run can be avoided, and a user can still effectively use the operating system, thereby performing operations such as activation or data management. In addition, since the evaluation activation lock works in the kernel mode, the control of the evaluation activation lock on the hardware resources available to the operating system is performed in the starting stage of the operating system, so that the user cannot modify the evaluation activation lock, and the security of the evaluation activation lock can be ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of the steps of an embodiment of a system control method of the present application;
FIG. 2 is a schematic diagram of an operating system boot flow diagram of the present application;
FIG. 3 is a flow chart of an operating system scheduling CPU in a first embodiment of the application;
FIG. 4 is a flow chart of the memory allocation of the operating system according to the present application;
FIG. 5 is a flow chart of an operating system identifying a storage peripheral device according to the present application;
FIG. 6 is a block diagram of an embodiment of a system control device of the present application;
FIG. 7 is a block diagram of an apparatus 800 for system control of the present application;
fig. 8 is a schematic diagram of a server in some embodiments of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, the term "and/or" as used in the specification and claims to describe an association of associated objects means that there may be three relationships, e.g., a and/or B, may mean: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The term "plurality" in embodiments of the present application means two or more, and other adjectives are similar.
Referring to fig. 1, there is shown a flowchart of steps of an embodiment of a system control method of the present application, where the method is applied to an electronic device, and the electronic device installs an operating system, and an evaluation activation lock is preset in a kernel of the operating system, where the method may include the following steps:
Step 101, detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system;
102, if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
The system control method of the embodiment of the application can be applied to the electronic equipment provided with the operating system. The electronic device includes, but is not limited to, any of the following: a server, a smart phone, a recording pen, a tablet computer, an electronic book reader, an MP3 (dynamic video expert compression standard audio plane 3,Moving Picture Experts Group Audio Layer III) player, an MP4 (dynamic video expert compression standard audio plane 4,Moving Picture Experts Group Audio Layer IV) player, a laptop, a car-mounted computer, a desktop computer, a set-top box, a smart television, a wearable device, and the like.
The operating system installed in the electronic device may be a Linux operating system, and the type of the Linux operating system is not limited in the embodiment of the present application, for example, the Linux operating system may include, but is not limited to, any one of Debian, ubuntu (wu Ban Tu), centOS (Community Enterprise Operating System ), UOS (unified desktop operating system), kylin operating system, square-de operating system, and the like.
In the embodiment of the application, an evaluation activation lock is preset in the kernel of the operating system of the electronic equipment, and the evaluation activation lock is a code segment built in the kernel, namely, the processing flow of the kernel is modified in the embodiment of the application.
In the embodiment of the application, the evaluation activation lock works in the kernel of the operating system and is used for detecting the activation state of the operating system, controlling the hardware resources accessible to the operating system according to the activation state of the operating system, and limiting the hardware resources available to the operating system so that the operating system which is not activated due to expiration can only call the limited hardware resources, but can ensure the basic running function of the operating system.
In implementations, the active state of the operating system may include one of a trial period state, an activated state, and an expired inactive state. The trial period state refers to that the trial period of the operating system has not ended yet, and the use of the operating system is not limited at all. The activated state means that the operating system has completed activation registration, and can be used legally, and the use of the operating system is not limited at all. The expired inactive state refers to a state in which the trial period of the operating system has ended, but the operating system has not completed the active registration, and in this state, the operating system can only call limited hardware resources, but can guarantee basic running functions of the operating system.
In practical applications, the operating system kernel may schedule, allocate, and use hardware resources of the electronic device. According to the embodiment of the application, the lock is activated through the evaluation built in the kernel, the usable hardware resources of the operating system such as CPU, memory, peripheral equipment and the like are limited to a certain extent, and on the premise of not affecting the basic operation function of the operating system, the operating system which is not activated for a long time is limited in scheduling, distributing and using the hardware resources, and a part of performance is lost.
The hardware resource limitation may include, but is not limited to, at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation. Wherein, CPU scheduling limitation refers to limiting the number of CPU cores that an operating system can load. Memory allocation limitation refers to limiting the amount of memory that the operating system can allocate for each application. The limitation of peripheral use refers to limiting the types of inserted storage peripherals that can be identified by the operating system.
All the three modes with limited hardware resources do not affect the basic operation of the operating system, but only affect the performance of the operating system. When the active state of the operating system is the due inactive state, the embodiment of the application only limits the performance of the operating system, but not the functions of the operating system, so that the condition that the operating system cannot run can be avoided, and a user can still effectively use the operating system, thereby performing operations such as activating or data management on the operating system. In addition, since the evaluation activation lock works in the kernel mode, the control of the evaluation activation lock on the hardware resources available to the operating system is performed in the starting stage of the operating system, so that a user cannot modify the evaluation activation lock, the security of the evaluation activation lock can be ensured, and the evaluation activation lock can be prevented from being cracked.
In implementations, an evaluation activation lock may be included in an officially provided operating system kernel upgrade package. After upgrading the operating system, the evaluation boot lock may be built into the kernel of the operating system.
The evaluation activation lock of the embodiment of the application works in the kernel of the operating system, can be loaded first before the operating system is loaded and operated, works in the bottom layer of the operating system, and cannot be modified and unloaded in the operating system. The control function of the evaluation activation lock after the kernel is loaded has been enabled and cannot be modified any more. In addition, the embodiment of the application tightly binds the kernel and the operating system, and in the stage of boot loading (BootLoader) of the operating system, whether the related files of the kernel change or not can be checked through the evaluation activation lock, and if the related files of the kernel change is detected, the boot operating system can be refused to be loaded, so that the modification or replacement operation of the kernel by a user is prevented, and the safety of the kernel is protected. The kernel related files are, for example, kernel files, module files in the kernel, configuration files of the kernel, etc.
Further, the embodiment of the application can carry out integrity check on the kernel through the signature checking function of the kernel so as to prevent the user from modifying or replacing the kernel. Specifically, after the kernel is compiled, a hash value can be bound, if a built-in evaluation activation lock or a kernel related file is modified, the hash value is changed, so that signature verification of the kernel is invalid, and a system cannot be started. For example, in a secure boot environment or some high security environment, the BIOS (Basic Input Output System ) has signature verification functionality on the kernel of the operating system.
Further, the embodiment of the application can verify the kernel through the authentication certificate of the kernel so as to prevent the user from modifying or replacing the kernel. Specifically, after the kernel is compiled, the kernel file may be signed with an x.509 certificate, or a signature of a national cryptographic standard may be used, and the signature may be checked in the booting process of the operating system, and if the signature is inconsistent with a check value in the signature, the signature check fails, so that the operating system is prohibited from being started.
In an optional embodiment of the present application, if the hardware resource limitation is limited by CPU scheduling, the controlling the operating system to enter the hardware resource limitation mode may include: and controlling the operating system to enter a single-core working mode, wherein the single-core working mode means that the operating system loads only one CPU core.
In the starting process of the operating system, the embodiment of the application detects the activation state of the operating system through the evaluation activation lock; and if the activation state of the operating system is detected to be the inactive state due to expiration, the evaluation activation lock controls the operating system to enter a single-core working mode. The single-core working mode means that the operating system only loads one CPU core, so that the CPU scheduling of the operating system is limited. When the embodiment of the application detects that the activation state of the operating system is the due inactive state, the number of the CPU cores available to the operating system is reduced to a single core, and all programs can only use one CPU core, so that the normal operation of the operating system can be ensured, but the capability of the operating system for processing data is reduced, and the speed of the operating system for processing data is slow. The restriction on CPU scheduling may be released after the user activates the operating system. If the activation state of the operating system is detected to be the trial period state or the activated state, the CPU scheduling is not limited, and all CPU cores available for the operating system can be normally loaded.
In the embodiment of the application, in the starting process of the operating system, the activation state of the operating system is detected through the preset evaluation activation lock in the kernel, if the activation state of the operating system is detected to be the due non-activation state, the number of CPU cores available for the operating system is reduced to be a single core, the operating system is controlled to enter a single core working mode, the performance of the operating system is reduced, and the normal running of the operating system can be ensured.
The embodiment of the application does not limit the specific mode for controlling the operating system to enter the single-core working mode. Alternatively, embodiments of the present application provide the following two ways.
The first mode, the controlling the operating system to enter the single-core working mode may include: and in the starting process of the operating system, modifying the number of available CPU cores acquired by the kernel to be 1, so that the operating system only loads one CPU core. The loaded CPU core defaults to CPU0.
The second mode, controlling the operating system to enter a single-core working mode, may include: in the starting process of the operating system, the operating system loads all available CPU cores; and removing all loaded CPU cores except the first CPU core through a hot plug function under the condition that the activation state of the operating system is detected to be an inactive state due to expiration.
In practical applications, the flow of operating system boot is generally as follows: powering on, and automatically loading a BIOS program (or UEFI); the BIOS program sequentially performs initialization operation of the CPU, the memory and the bus peripheral, and updates the hardware information successfully initialized to obtain a hardware state information table; then a first starting device is found, and an operating system kernel is loaded; the kernel configures the system through the hardware information obtained from the hardware state information table, wherein the configured information comprises the number of available CPU cores, main frequency, supported functions, the size of the memory, the physical address of the memory, the connection state and the position of the peripheral equipment, and finally the configuration information is mapped to the operating system for initialization.
The embodiment of the application modifies the starting flow of the operating system, increases the detection control operation of the evaluation activation lock, and limits the available hardware resources of the operating system under the condition that the evaluation activation lock detects that the activation state of the operating system is the due unactivated state. Here, the number of CPU cores that the operating system can load is limited.
In an optional embodiment of the present application, the number of available CPU cores acquired by the modification kernel is 1, so that the operating system loads only one CPU core, which may include:
After the kernel reads the hardware information in the hardware state information table, generating a custom data structure body according to the read hardware information; the custom data structure is used as system configuration information when initializing an operating system;
the number of available CPU cores is set to 1 in the custom data structure.
In the first mode, the present application modifies the flow of the kernel obtaining the hardware information from the hardware state information table, and modifies the number of available CPU cores in the hardware information obtained by the kernel to 1. Specifically, the hardware state information table is stored in a BIOS memory mapping area after the boot, and the hardware state information table is in a read-only form. After the hardware information in the hardware state information table is read by the kernel, the embodiment of the application can generate the custom data structure body according to the read hardware information, wherein the number of the available CPU cores in the custom data structure body is set to be 1, namely, the number of the available CPU cores originally recorded in the hardware state information table is modified to be 1. The custom data structure is system configuration information used when initializing an operating system, and the embodiment of the application uses the custom data structure to carry out system configuration when initializing the operating system. Thus, the operating system sees that the number of available CPU cores is 1 through the custom data structure at initialization, so only one CPU core is loaded. If the activation state of the operating system is detected to be a trial period state or an activated state, the rest available CPU cores in the hardware state information table can be loaded through a hot plug function.
In the second mode, during the starting process of the operating system, the operating system may load all available CPU cores in the hardware state information table, and then remove all loaded CPU cores except the first CPU core through a hot plug function when detecting that the active state of the operating system is an inactive state due. The first CPU core is CPU0.
The cpu_hot plug function means that the CPU core can be hot removed or hot added without powering off the system and without cutting off the power. In ARM (Advanced RISC Machine, advanced reduced instruction set machine) architecture, CPU0 is boot CPU, cannot be turned off, and other CPU cores besides CPU0 can be thermally removed. The evaluation activation lock in the embodiment of the application can control the number of the CPU cores loaded by the operating system through the CPU_Hotplug according to the activation state of the operating system.
Referring to FIG. 2, a schematic diagram of an operating system boot flow is shown in accordance with an embodiment of the present application. The flow shown in fig. 2 includes the following steps: powering on the electronic equipment; loading a BIOS program; the BIOS program sequentially performs the operations of initializing the CPU, initializing the memory and initializing the bus peripheral, and obtains a hardware state information table according to the hardware information of successful initialization, wherein the hardware state information table contains the number information of available CPU cores (namely, the number of the CPU contained in the electronic equipment). At this time, the embodiment of the application increases the detection control flow for evaluating the activation lock, and if the activation lock is evaluated to detect that the activation state of the operating system is the expired inactive state, the number of the loaded CPU cores of the operating system is controlled to be 1 by the CPU_Hotplug function. That is, in the case where the active state of the operating system is the expired inactive state, the kernel does not acquire the number of available CPU cores information from the hardware state information table, but notifies the kernel that the number of available CPU cores is 1 by the evaluation activation lock. Thus, the operating system only loads one CPU core when loading the kernel. And finally, loading the file system to finish the starting of the operating system. It should be noted that, if the evaluation activation lock detects that the activation state of the operating system is the trial period state or the activated state, the kernel may directly read the number information of the available CPU cores from the hardware state information table, so that the operating system loads all the available CPU cores.
Referring to fig. 3, a flow chart of an operating system scheduling CPU according to a first embodiment of the present application is shown. The flow shown in fig. 3 is the flow after the hardware status information table is acquired in fig. 2. The flow shown in fig. 3 includes the following steps: reading the quantity information (16) of available CPU cores recorded in a hardware state information table; setting nr_cpus=1, nr_cpus is used to set the total number of CPUS that the Linux operating system can load; the kernel acquires the number of available CPU cores by reading the nr_cpus, and since the value of nr_cpus is 1, the operating system loads only one CPU core (CPU 0). Then evaluating the activation state of the activation lock detection operating system, and if the activation state is detected to be the trial period state or the activated state, loading the rest 15 available CPU cores (CPU 1-CPU 15) through a CPU_Hotplug function, wherein 16 CPU cores are available at the moment; if an expired inactive state is detected, the remaining available CPU cores are not loaded, at which point only a single CPU core is available.
In the embodiment of the application, the operating system does not use a hardware state information table after being started, but maintains the system configuration of the operating system in the current state in the memory, and the system configuration can be dynamically set through a hot plug function, so that the CPU core is removed or added.
In practice, ulimit is a command in the operating system by which a user can modify the number of CPU cores available to the operating system. In order to prevent the operating system from manually modifying the number of available CPU cores through the command in the state of being inactive due, the embodiment of the application can set the calling interface of the command to be disabled when detecting that the active state of the operating system is the state of being inactive due, so that the user cannot call the command to manually modify the number of available CPU cores. When the activation state of the operating system is detected to be a trial period or an activated state, a calling interface of the command is set to be available, so that a user can call the command to manually modify the number of available CPU cores.
In an optional embodiment of the present application, the limiting of the hardware resource is limited by memory allocation, and the controlling the operating system to enter the hardware resource limiting mode may include: setting the size of the memory which can be allocated to each application program by the operating system as a preset value; and if the application program requesting to allocate the memory with the size exceeding the preset value is detected, the application program is exited.
The embodiment of the application does not limit the magnitude of the preset value. The preset value may be, for example, 100M.
According to the embodiment of the application, the size of the memory which can be allocated to each application program is limited, so that an operating system can run basic application programs, the daily operation of a user is met, and larger application programs cannot be run. If an application program needs to request a memory space exceeding the preset value (such as 100M), the application program is actively killed by the operating system, i.e. the application program is directly exited. This restriction may be released during the trial period or in an activated state, and the application may use the full allocatable memory.
For example, if the browser is opened to browse a website and 20M to 30M of memory is needed, the browser can normally operate when three or less pages are opened simultaneously, but if 4 pages are opened simultaneously, the memory size required by the browser exceeds 100M, which causes the browser program to automatically exit.
The method for setting the size of the memory which can be allocated to each application program is not limited in the embodiment of the application. Optionally, the embodiment of the present application may modify a preset parameter (max memory size) through a preset interface (such as a call interface of an ulimit command) provided by an operating system, so as to set the size of memory that can be allocated for each application program.
The ulimit command can control a total index of system performance, and the aim of controlling the system performance can be achieved by adjusting various parameters of the ulimit. The ulimit command contains a preset parameter (max memory size) that indicates the maximum memory size in kb. The embodiment of the application can achieve the purpose of limiting the size of the memory which can be allocated to each application program by calling the ulimit command to modify the value of the preset parameter (max memory size).
In the Linux system, memory allocation of a process is not limited when a default system is initialized, and the value of the max memory size is unlimited. When the evaluation activation lock detects that the activation state of the operating system is an out-of-date inactive state, the value of the preset parameter max memory size is set to be the preset value by calling the ulimi command, for example, max memory size=102400 is set, wherein 102400 kbytes are 100 mbytes; max memory size=102400 means that the memory size allocatable per application is 100M at maximum. That is, no matter how large the system is, the maximum memory that each application can use is 100M. If a program calls a memory greater than 100M, the system will actively kill the program and prompt for error information.
Further, in the embodiment of the present application, when the active state of the operating system is detected to be the inactive state due to expiration, the call interface of the command (ulimit command) is set to be disabled, so that the user cannot manually modify the value of the preset parameter max memory size by calling the command. When the activation state of the operating system is detected to be a trial period or an activated state, a calling interface of the command is set to be available, so that a user can manually modify the value of the preset parameter max memory size by calling the command.
Referring to fig. 4, a flow chart of memory allocation of an operating system according to an embodiment of the application is shown. The flow shown in fig. 4 includes the following steps: when receiving a request of an application program for applying for a memory, the operating system triggers a detection control flow for evaluating an activation lock; evaluating an activation lock to detect the activation state of the operating system, and if the activation state of the operating system is detected to be a use state or an activated state, executing the original memory allocation flow without limiting the applicable memory size of the application program; if the active state of the operating system is detected to be an inactive state due, the application program is limited to apply for 100M of the memory. In the operation of the operating system, the memory size occupied by the application program is monitored in real time, and if the memory occupied by the application program is larger than 100M, the application program is actively killed.
In the embodiment of the application, the judging flow for evaluating the activation lock is added in the process of distributing the memory to the application program by the operating system, and the size of the applicable memory space of the application program is limited, so that the process requiring the memory size exceeding the preset value is triggered to kill the process in the operation of the operating system. Preferably, the preset value may be set to a size within 100M, which may guarantee normal use of the basic operation, but will not function properly for larger software, such as a large number of text, graphic operations, database software, etc. This limitation may be released during the trial period or in an activated state.
In an optional embodiment of the present application, the hardware resource limitation is peripheral usage limitation, and the controlling the operating system to enter the hardware resource limitation mode may include: the operating system is controlled to be identifiable to a storage peripheral inserted before a preset time point after the operating system is started up, and to be unidentifiable to a storage peripheral inserted after the preset time point.
The limitation of the external use refers to limiting the hot plug function of the USB (Universal Serial Bus ) device. In the peripheral use limited mode, the inserted USB device can be normally identified in the boot stage (e.g., before a preset time point after the operating system is booted), but the newly inserted USB device cannot be identified in the system use (e.g., after the preset time point), and at this time, if the newly inserted USB device needs to be used, the operating system must be restarted. This limitation may be released during the trial period or in an activated state.
According to the embodiment of the application, through the limited mode of peripheral use, USB equipment such as a printer, a keyboard, a mouse and the like which are inserted on the equipment for a long time can be normally identified, but newly inserted USB equipment (such as a storage peripheral) can not be normally identified in the running process after the system is started, and can be normally identified only after the operating system is restarted, so that the complexity and difficulty of using the storage peripheral by a user are increased.
In an optional embodiment of the present application, the preset time point includes a time point corresponding to a preset time period after the operating system is started successfully. The length of the preset time period is not limited in the embodiment of the application, and the preset time period is 1 minute by way of example.
When the activation state of the operating system is detected to be an out-of-date inactive state, judging the starting time is increased, and if the preset time period (such as 1 minute) is exceeded after the operating system is successfully started, the newly inserted storage peripheral is not identified. The preset time period (e.g., 1 minute) is a time reserved for the operating system to boot, and exceeding the time point can ensure that the operating system has completed booting. The storage peripheral device that has been plugged into the USB port before this point in time can be identified and the drive loaded normally, whereas the newly plugged storage peripheral device will not be identified beyond this point in time, and can only be used normally by restarting the operating system or activating the operating system.
The method for setting the peripheral equipment to use the limited mode is not limited. Optionally, the embodiment of the application realizes setting the peripheral use limited mode by modifying the flow of identifying the USB device by the USB Core (USB Core). When the USB Core identifies the type of the USB device, an evaluation activation lock is added to control whether the device type can be identified normally, so that the newly connected device can be prevented from using the USB device in the mode. The USB Core may provide APIs to support USB device drivers and drivers for the USB host controller. USB is classified into a USB host and a USB device. For example, a USB mouse is inserted into a computer, the computer is a USB host, and the mouse is a USB device.
The USB device is plugged into the USB port of the USB host, and is actually plugged into a built-in USB hub (USB device hub) from the system level, and the USB hub can be used to detect connection and disconnection of the USB device. Enumerating the USB hub device refers to a process that after the USB host detects that the USB device is connected through the USB hub, the USB host communicates with the USB device to negotiate and exchange information, so that the USB Core can determine the type of the USB device according to the information, and further load a suitable driver for the USB device, so that the USB device is in an available state, and an upper layer application can access the USB device.
Taking xHCI (eXtensible Host Controller Interface, an extensible host controller interface) as an example, after a storage peripheral is inserted into a USB host, triggering to enumerate operations of a USB hub device, identifying the type of the inserted storage peripheral by a USB Core, and selecting an appropriate driver (such as a USB-storage driver) by the USB Core according to the identified type, so that a SCSI layer (Small Computer System Interface, a small computer system interface) driver can be normally loaded, so that an upper layer application can access the storage peripheral through the SCSI layer. The usb-storage driver exists in a kernel module mode in the linux system, such as usb-storage.
The embodiment of the application limits the usable peripheral devices by modifying the process of identifying the type of the inserted storage peripheral device by the USB Core. Specifically, before the USB Core recognizes the type of the inserted storage peripheral, a detection operation of evaluating the activation lock is added, and if the evaluation activation lock detects that the activation state of the operating system is an expired inactive state and the operating system has been started for more than 1 minute, the type of the newly inserted storage peripheral is modified, so that the USB Core can be prevented from loading a driver (such as a USB-storage driver) of the newly inserted storage peripheral, and the operating system cannot normally use the newly inserted storage peripheral.
The USB Core identifies the type of the inserted storage peripheral, that is, the USB Core identifies the class id of the inserted storage peripheral, if the class id=08h, it may be determined that the inserted storage peripheral is a USB device, and then an appropriate USB-storage driver may be loaded on the USB device. If the evaluate activation lock detects that the active state of the operating system is an out-of-date inactive state and the operating system has been booted for more than 1 minute, then the classID of the newly inserted storage peripheral is set to ffh, which represents the vendor custom type. Because the USB Core recognizes that the device type of the newly inserted storage peripheral is the manufacturer custom type instead of the USB device, the USB Core does not load the USB-storage drive for the newly inserted storage peripheral any more, and therefore the purpose of limiting the use of the USB storage device can be achieved.
Referring to FIG. 5, a flow chart of an operating system identifying a storage peripheral device according to an embodiment of the application is shown. The flow shown in fig. 5 includes the following steps: the USB host is connected with the USB equipment; initializing xHCI; enumerating USB hub devices; invoking a USB Core; detecting the activation state of the operating system by evaluating the activation lock, if the activation state of the operating system is detected to be an expired inactive state, judging whether the operating system is started successfully for more than 1 minute, if the operating system is started successfully for more than 1 minute, loading a USB-storage driver is not possible, and the operating system is not possible to identify and use the connected USB device; if the time does not exceed 1 minute, the USB-storage driver is normally loaded, and then the SCSI layer driver is normally loaded, and the operating system can identify and use the connected USB device. If the activation state of the operating system is detected to be the trial period state or the activated state, the USB-storage driver is normally loaded, and then the SCSI layer driver is normally loaded, and the operating system can identify and use the connected USB device.
It should be noted that, in fig. 5, xHCI is taken as an example, the embodiment of the present application is not limited to USB device support of the xHCI interface, and all interface interfaces required to call the USB Core can be supported.
In an alternative embodiment of the present application, the method may further include: identifying an initiator of an operation request for modifying hardware resource access data of the operating system when the operation request is received; and if the initiator of the operation request is identified as the user side, rejecting the operation request.
The request for modifying the hardware resource access data of the operating system includes, but is not limited to: a request to add a CPU core by a cpu_hotplug function and/or a request to modify a max memory size parameter by an ulimit command.
In summary, in the embodiment of the application, an evaluation activation lock is preset in an operating system kernel of the electronic device, and in the starting process of the operating system, the activation state of the operating system is detected through the evaluation activation lock; if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation. All the three modes with limited hardware resources do not affect the basic operation of the operating system, but only affect the performance of the operating system. When the active state of the operating system is the due inactive state, the embodiment of the application only limits the performance of the operating system, but not the functions of the operating system, so that the condition that the operating system cannot run can be avoided, and a user can still effectively use the operating system, thereby performing operations such as activation or data management. In addition, since the evaluation activation lock works in the kernel mode, the control of the evaluation activation lock on the hardware resources available to the operating system is performed in the starting stage of the operating system, so that the user cannot modify the evaluation activation lock, and the security of the evaluation activation lock can be ensured.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the application.
Referring to fig. 6, there is shown a block diagram of an embodiment of a system control apparatus of the present application, the apparatus being applied to an electronic device, the electronic device being installed with an operating system, a kernel of the operating system being preset with an evaluation activation lock, the evaluation activation lock may include:
a state detection module 601, configured to detect, during a process of starting the operating system, an activation state of the operating system through the evaluation activation lock;
a resource limitation module 602, configured to, if it is detected that the active state of the operating system is an expired inactive state, control the operating system to enter a hardware resource limitation mode by using the evaluation activation lock; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
Optionally, the hardware resource is limited by CPU scheduling, and the resource limiting module is specifically configured to control the operating system to enter a single-core working mode, where the single-core working mode refers to that the operating system loads only one CPU core.
Optionally, the resource limiting module is specifically configured to modify, in the operating system startup process, the number of available CPU cores acquired by the kernel to be 1, so that the operating system loads only one CPU core.
Optionally, the resource limiting module specifically includes:
the structure body generation sub-module is used for generating a custom data structure body according to the read hardware information after the kernel reads the hardware information in the hardware state information table; the custom data structure is used as system configuration information when initializing an operating system;
and the quantity setting sub-module is used for setting the quantity of the available CPU cores to be 1 in the custom data structure body.
Optionally, the resource limiting module is specifically configured to load all available CPU cores by the operating system during the starting process of the operating system; and removing all loaded CPU cores except the first CPU core through a hot plug function under the condition that the activation state of the operating system is detected to be an inactive state due to expiration.
Optionally, the hardware resource is limited to memory allocation, and the resource limiting module is specifically configured to set a size of memory that can be allocated to each application program by the operating system to be a preset value; and if the application program requesting to allocate the memory with the size exceeding the preset value is detected, the application program is exited.
Optionally, the hardware resource is limited to be limited to peripheral use, and the resource limiting module is specifically configured to control the operating system to be identifiable to a storage peripheral inserted before a preset time point after the operating system is started, and not to be identifiable to a storage peripheral inserted after the preset time point.
Optionally, the preset time point includes a time point corresponding to a preset time period after the operating system is started successfully.
Optionally, the apparatus further comprises:
a request receiving module, configured to identify an initiator of an operation request when the operation request for modifying hardware resource access data of the operating system is received;
and the request rejecting module is used for rejecting the operation request if the initiator of the operation request is identified as the user side.
In the embodiment of the application, an evaluation activation lock is preset in an operating system kernel of the electronic equipment, and in the starting process of the operating system, the activation state of the operating system is detected through the evaluation activation lock; if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation. All the three modes with limited hardware resources do not affect the basic operation of the operating system, but only affect the performance of the operating system. When the active state of the operating system is the due inactive state, the embodiment of the application only limits the performance of the operating system, but not the functions of the operating system, so that the condition that the operating system cannot run can be avoided, and a user can still effectively use the operating system, thereby performing operations such as activation or data management. In addition, since the evaluation activation lock works in the kernel mode, the control of the evaluation activation lock on the hardware resources available to the operating system is performed in the starting stage of the operating system, so that the user cannot modify the evaluation activation lock, and the security of the evaluation activation lock can be ensured.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Embodiments of the present application provide an apparatus for system control, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, including for performing the system control method described in one or more embodiments above.
Fig. 7 is a block diagram illustrating an apparatus 800 for system control, according to an example embodiment. For example, apparatus 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 7, apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the apparatus 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 806 provides power to the various components of the device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen between the device 800 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice information processing mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the apparatus 800. For example, the sensor assembly 814 may detect the on/off state of the device 800, the relative positioning of the components, such as the display and keypad of the apparatus 800, the sensor assembly 814 may also search for a change in position of the apparatus 800 or one component of the apparatus 800, the presence or absence of user contact with the apparatus 800, the orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices, either in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of apparatus 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 8 is a schematic diagram of a server in some embodiments of the application. The server 1900 may vary considerably in configuration or performance and may include one or more central processing units (central processing units, CPU) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) that store applications 1942 or data 1944. Wherein the memory 1932 and storage medium 1930 may be transitory or persistent. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instruction operations on a server. Still further, a central processor 1922 may be provided in communication with a storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input/output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, and the like.
A non-transitory computer readable storage medium, which when executed by a processor of an apparatus (server or terminal), enables the apparatus to perform the system control method shown in fig. 1.
A non-transitory computer readable storage medium, when executed by a processor of an apparatus (server or terminal), enables the apparatus to perform the foregoing description of the system control method in the corresponding embodiment of fig. 1, and thus, a detailed description thereof will not be provided herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments according to the present application, reference is made to the description of the method embodiments according to the present application.
In addition, it should be noted that: embodiments of the present application also provide a computer program product or computer program that may include computer instructions that may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the description of the system control method in the embodiment corresponding to fig. 1, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments according to the present application, reference is made to the description of the method embodiments according to the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the application are intended to be included within the scope of the application.
The foregoing has outlined a detailed description of a system control method, a system control device and a readable storage medium, wherein specific examples are provided herein to illustrate the principles and embodiments of the present application, and the above examples are provided to assist in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A system control method, which is applied to an electronic device, wherein the electronic device is provided with an operating system, and an evaluation activation lock is preset in a kernel of the operating system, the method comprises:
detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system;
if the activation state of the operating system is detected to be an inactive state due to expiration, the evaluation activation lock controls the operating system to enter a hardware resource limited mode; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
2. The method of claim 1, wherein the hardware resource limitation is a CPU scheduling limitation, and wherein the controlling the operating system to enter a hardware resource limitation mode comprises:
and controlling the operating system to enter a single-core working mode, wherein the single-core working mode means that the operating system loads only one CPU core.
3. The method of claim 2, wherein controlling the operating system to enter a single-core mode of operation comprises:
in the starting process of the operating system, modifying the number of available CPU cores acquired by a kernel to be 1, so that the operating system only loads one CPU core;
Or alternatively, the process may be performed,
in the starting process of the operating system, the operating system loads all available CPU cores;
and removing all loaded CPU cores except the first CPU core through a hot plug function under the condition that the activation state of the operating system is detected to be an inactive state due to expiration.
4. The method of claim 3, wherein the number of available CPU cores acquired by the modified kernel is 1 such that the operating system loads only one CPU core, comprising:
after the kernel reads the hardware information in the hardware state information table, generating a custom data structure body according to the read hardware information; the custom data structure is used as system configuration information when initializing an operating system;
the number of available CPU cores is set to 1 in the custom data structure.
5. The method of claim 1, wherein the hardware resource limitation is memory allocation limitation, and the controlling the operating system to enter a hardware resource limitation mode comprises:
setting the size of the memory which can be allocated to each application program by the operating system as a preset value;
and if the application program requesting to allocate the memory with the size exceeding the preset value is detected, the application program is exited.
6. The method of claim 1, wherein the hardware resource limitation is peripheral usage limitation, and wherein the controlling the operating system to enter a hardware resource limitation mode comprises:
controlling the operating system to be identifiable to a storage peripheral inserted before a preset time point after the operating system is started, and not to be identifiable to a storage peripheral inserted after the preset time point;
the preset time point comprises a time point corresponding to a preset time period after the operating system is started successfully.
7. The method according to claim 1, wherein the method further comprises:
identifying an initiator of an operation request for modifying hardware resource access data of the operating system when the operation request is received;
and if the initiator of the operation request is identified as the user side, rejecting the operation request.
8. A system control device, which is characterized in that the system control device is applied to an electronic device, the electronic device is provided with an operating system, an evaluation activation lock is preset in a kernel of the operating system, and the evaluation activation lock comprises:
the state detection module is used for detecting the activation state of the operating system through the evaluation activation lock in the process of starting the operating system;
The resource limiting module is used for controlling the operating system to enter a hardware resource limiting mode by the evaluation activation lock if the activation state of the operating system is detected to be an inactive state due to expiration; the hardware resource limitation includes at least one of a CPU scheduling limitation, a memory allocation limitation, and a peripheral usage limitation.
9. An apparatus for system control, comprising a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising instructions for performing the system control method of any of claims 1-7.
10. A readable storage medium having instructions stored thereon, which when executed by one or more processors of an apparatus, cause the apparatus to perform the system control method of any of claims 1 to 7.
CN202310476547.8A 2023-04-27 2023-04-27 System control method, device and readable storage medium Pending CN116594698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310476547.8A CN116594698A (en) 2023-04-27 2023-04-27 System control method, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310476547.8A CN116594698A (en) 2023-04-27 2023-04-27 System control method, device and readable storage medium

Publications (1)

Publication Number Publication Date
CN116594698A true CN116594698A (en) 2023-08-15

Family

ID=87594703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310476547.8A Pending CN116594698A (en) 2023-04-27 2023-04-27 System control method, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN116594698A (en)

Similar Documents

Publication Publication Date Title
EP3479243B1 (en) Fault-tolerant variable region repaving during firmware over the air update
CN106293507B (en) Electronic device with external memory and method of operating the same
JP6627180B2 (en) Techniques for improved hybrid sleep power management
CN109964227B (en) Method and terminal for updating SELinux security policy
US10185553B2 (en) Fault-tolerant variable region repaving during firmware over the air update
CN110457894B (en) root authority distribution method and device, storage medium and terminal equipment
US20170031692A1 (en) Method for managing device and electronic device supporting the same
US10929523B2 (en) Electronic device and method for managing data in electronic device
CN109271211B (en) Method, device, equipment and medium for separating application program
KR102337990B1 (en) Electronic Device Using Token for Setting Permission
US20130086372A1 (en) Information processing apparatus and boot control method
US11671379B1 (en) System and method for subscription management using dynamically composed management entities
KR102297383B1 (en) Processing Secure Data
US10516699B2 (en) Electronic device and method for suggesting response manual in occurrence of denial
US20170078269A1 (en) Method for managing application and electronic device supporting the same
KR20200042798A (en) Method for controlling the execution of different operating systems, electronic device and storage medium therefor
US9513928B2 (en) Method of operating multiple operating systems and the electronic device thereof
US11604656B2 (en) Method and apparatus for managing application
CN107316197B (en) Payment protection method, mobile terminal and computer readable storage medium
CN114175026A (en) Application monitoring method and device, storage medium and electronic equipment
CN116594698A (en) System control method, device and readable storage medium
CN111008375B (en) Data protection method and device
US11080075B2 (en) Data threshold notification
CN113961246A (en) Permission configuration method and device on micro control chip and storage medium
CN117492776A (en) Application installation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination