CN116107654A - Program starting method and device, electronic equipment and storage medium - Google Patents

Program starting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116107654A
CN116107654A CN202211572700.9A CN202211572700A CN116107654A CN 116107654 A CN116107654 A CN 116107654A CN 202211572700 A CN202211572700 A CN 202211572700A CN 116107654 A CN116107654 A CN 116107654A
Authority
CN
China
Prior art keywords
program
capacity
configuration file
exchange partition
acquiring
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
CN202211572700.9A
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.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec 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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202211572700.9A priority Critical patent/CN116107654A/en
Publication of CN116107654A publication Critical patent/CN116107654A/en
Pending legal-status Critical Current

Links

Images

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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a program starting method, a program starting device, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to a starting signal of a program to acquire a configuration file; acquiring equipment parameters of current equipment; acquiring corresponding exchange partition capacity from the configuration file according to the equipment parameters; creating a switching partition according to the capacity of the switching partition; the procedure is started. The embodiment can automatically create the exchange partition with the capacity suitable for the program when the program runs.

Description

Program starting method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of memory management technologies, and in particular, to an order operation method, an apparatus, an electronic device, and a storage medium.
Background
With the rapid development of technology, the processor has better performance and faster processing speed; the number of programs which can support simultaneous operation in processing performance is increased, the number of messages which need to be processed and cached in the network equipment in operation is increased, and the number of memories which need to be increased. Therefore, the memory in a system is also very valuable, and as time goes by, the version of memory that may run the year by the previous year becomes very intense, but the larger memory cannot be directly replaced for the user. The space of the external storage disk is often in units of T, so it is necessary to simulate the memory using a part of the disk, and a technique of converting a part of the disk into the simulated memory is called creating a swap file.
In the prior art, two methods for creating the exchange file exist, namely, the first method is to create the exchange partition, the second method is to create the exchange file, the two forms are generally created by calling a system instruction by a staff, the size of the created exchange partition is fixed, and the operation flexibility is not high.
Disclosure of Invention
An object of an embodiment of the present application is to provide a program starting method, apparatus, electronic device, and storage medium, capable of automatically creating a swap partition of a capacity adapted to a program when the program is running.
In a first aspect, an embodiment of the present application provides a program starting method, including:
responding to a starting signal of a program to acquire a configuration file;
acquiring equipment parameters of current equipment;
acquiring corresponding exchange partition capacity from the configuration file according to the equipment parameters;
creating a switching partition according to the capacity of the switching partition;
the procedure is started.
In the implementation process, when the program is about to be started, acquiring a configuration file and equipment parameters of the current equipment, acquiring the capacity of the exchange partition matched with the equipment parameters of the current equipment in the configuration file according to the equipment parameters, and creating the exchange partition according to the capacity of the exchange partition. Based on the embodiment, the capacity of the exchange partition matched with the current equipment parameters can be created, so that the memory occupied by the exchange partition is avoided, and the influence of the too small exchange partition on the running of the program is avoided.
Further, the step of obtaining the corresponding exchange partition capacity in the configuration file according to the device parameter includes:
acquiring the type of the program;
and acquiring the corresponding exchange partition capacity from the configuration file according to the equipment parameters and the type of the program.
In the implementation process, the resources required by different programs are different, the belonging type of the program is acquired, and the corresponding capacity of the exchange partition is acquired in the configuration file according to the belonging type of the equipment parameter program, so that the capacity of the created exchange partition is more matched with the application program, and the maximum utilization of the memory area is realized.
Further, before the step of obtaining the configuration file in response to the start signal of the program, the method includes:
acquiring the running conditions of a plurality of programs under different equipment parameters;
determining the exchange partition capacity of the programs under different equipment parameters according to the running conditions;
the configuration file is generated according to the programs, the different equipment parameters and the exchange partition capacity of the programs under the different equipment parameters.
In the implementation process, by acquiring the running conditions of a plurality of programs under different equipment parameters, the exchange partition capacity required by the different programs when the equipment with different equipment parameters runs can be further judged. Based on the embodiment, the creation of the exchange partition for program customization is realized.
Further, the device parameters include: the device type and the number of CPUs of the device;
the step of obtaining the corresponding exchange partition capacity in the configuration file according to the equipment parameters and the type of the program comprises the following steps:
and determining the capacity of the exchange partition according to the type of the equipment, the number of the CPUs of the equipment and the type of the program.
In the implementation process, the type of the device determines the mode of device memory management, the number of the CPUs of the device determines the data processing speed of the device, the type of the program determines the size of data to be processed by the program and the number of the CPUs to be occupied, and the capacity of the exchange partition is determined according to the type of the device, the number of the CPUs of the device and the type of the program, so that the capacity of the exchange partition, the program and the device are adapted to each other, and the maximum utilization of the device memory is realized.
Further, the step of acquiring the running condition of the plurality of programs under different device parameters includes:
acquiring the corresponding computer resource utilization rate of a plurality of different programs when running on equipment with different equipment parameters;
the step of determining the exchange partition capacity of the programs under different equipment parameters according to the running conditions comprises the following steps:
and determining the exchange partition capacity of the programs under different equipment parameters according to the utilization rate of the computer resources.
In the implementation process, the resource utilization rate describes whether the memory and the processor of the current equipment can meet the normal running of the program to a certain extent, so that the capacity of the exchange partition of a plurality of programs under different equipment parameters can be determined according to the computer resource utilization rate, and the exchange partition with different capacities can be customized for the programs.
Further, the method further comprises: and deleting the exchange partition in response to an end signal of the program.
In the implementation process, when the program operation is finished, the exchange partition is deleted, so that the memory can be released, the equipment can use the memory for storing data of other programs or systems, the problem of insufficient memory caused by the fact that the exchange partition is not deleted in time after being created in the prior art is solved, and the maximum utilization of the memory is realized.
Further, the step of obtaining the corresponding exchange partition capacity in the configuration file according to the device parameters and the type of the program comprises the following steps:
invoking a script to enable the script to read the configuration file row by row, and matching the device parameters of the current device, the type of the program, the CPU number of the current device and the device parameters, the program and the CPU number of each row in the configuration file;
and if the matching is successful, acquiring the capacity of the switching partition matched with the current equipment.
In the implementation process, the steps are scripted, the configuration file is read row by row through the script, the equipment parameters of the current equipment and the type of the program are compared with each item of data in the configuration file row by row, when the equipment parameters of the current equipment, the type of the program, the CPU number of the current equipment and the data of a certain row in the configuration file are completely matched, the exchange partition capacity corresponding to the changed row is obtained, and the exchange partition is created according to the exchange partition capacity. Based on the above embodiment, the comparison process is scripted, and the speed of acquiring the capacity of the exchange partition is improved.
In a second aspect, an embodiment of the present application provides a program starting apparatus, including:
the response module is used for responding to a starting signal of the program and acquiring a configuration file;
the device parameter acquisition module is used for acquiring the device parameters of the current device;
the exchange partition capacity acquisition module is used for acquiring corresponding exchange partition capacity from the configuration file according to the equipment parameters;
the creation module is used for creating the exchange partition according to the exchange partition capacity;
and the starting module is used for starting the program.
In the implementation process, when the program is about to be started, the response module acquires the configuration file, the equipment parameter acquisition module acquires the equipment parameter of the current equipment, the exchange partition capacity acquisition module acquires the exchange partition capacity matched with the equipment parameter of the current equipment in the configuration file according to the equipment parameter, and the creation module creates the exchange partition according to the exchange partition capacity. Based on the embodiment, the capacity of the exchange partition matched with the current equipment parameters can be created, so that the memory occupied by the exchange partition is avoided, and the influence of the too small exchange partition on the running of the program is avoided.
In a third aspect, an electronic device provided in an embodiment of the present application includes: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the computer program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having instructions stored thereon, which when executed on a computer, cause the computer to perform the method according to any of the first aspects.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the techniques disclosed herein.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related 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 a program starting method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a program starting device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
With the rapid development of technology, the processor has better performance and faster processing speed; the number of programs which can support simultaneous operation in processing performance is increased, the number of messages which need to be processed and cached in the network equipment in operation is increased, and the number of memories which need to be increased. Therefore, the memory in a system is also very valuable, and as time goes by, the version of memory that may run the year by the previous year becomes very intense, but the larger memory cannot be directly replaced for the user. The space of the external storage disk is often in units of T, so it is necessary to simulate the memory using a part of the disk, and a technique of converting a part of the disk into the simulated memory is called creating a swap file.
In the prior art, two methods for creating the exchange file exist, namely, the first method is to create the exchange partition, the second method is to create the exchange file, the two forms are generally created by calling a system instruction by a staff, the size of the created exchange partition is fixed, and the operation flexibility is not high. In view of the foregoing, embodiments of the present application provide a program starting method, apparatus, electronic device, and computer-readable storage medium
Example 1
The embodiment of the application provides a program starting method, which comprises the following steps:
s101: responding to a starting signal of a program to acquire a configuration file;
the configuration file can be obtained from a cloud server and other devices through a network, or can be obtained from the memory of the method execution device. The format of the configuration file may be json format or other formats, which are not specifically limited in the embodiments of the present application.
S102: acquiring equipment parameters of current equipment;
the present apparatus refers to an apparatus that runs a program, and is not necessarily an apparatus that performs the present method.
S103: acquiring corresponding exchange partition capacity in a configuration file according to the equipment parameters;
s104: creating a switching partition according to the capacity of the switching partition;
s105: the procedure is started.
The gateway device receives a new task, which is to start a traffic message filter program, the memory of the gateway device is low, and the traffic message filter program has high requirement on the running memory during running. Before starting the flow message screening program, the gateway device firstly requests the configuration file from the cloud server, takes the device parameter as an index, acquires the exchange partition capacity required by the device parameter from the configuration file, creates an exchange partition according to the exchange partition capacity, and finally starts the program.
When the program is about to be started, acquiring a configuration file and equipment parameters of the current equipment, acquiring the capacity of the exchange partition matched with the equipment parameters of the current equipment in the configuration file according to the equipment parameters, and creating the exchange partition according to the capacity of the exchange partition. Based on the embodiment, the capacity of the exchange partition matched with the current equipment parameters can be created, so that the memory occupied by the exchange partition is avoided, and the influence of the too small exchange partition on the running of the program is avoided.
In one possible implementation, S103 includes: acquiring the type of the program; and acquiring the corresponding exchange partition capacity from the configuration file according to the equipment parameters and the type of the program.
The types to which the program belongs may include: database type programs, network service type programs, and the embodiments of the present application do not limit the types to which they belong.
The resources required by different programs are different, the type of the program is acquired, the corresponding capacity of the exchange partition is acquired in the configuration file according to the type of the equipment parameter program, the capacity of the created exchange partition can be more matched with the application program, and the maximum utilization of the memory area is realized.
In one possible embodiment, S101 is preceded by first obtaining the running conditions of the plurality of programs under different device parameters; determining the exchange partition capacity of a plurality of programs under different equipment parameters according to the running condition; the configuration file is generated according to the plurality of programs, the plurality of different device parameters, and the swap partition capacity of the plurality of programs under the different device parameters.
For example, a plurality of programs are prepared, each program is respectively run on a plurality of devices, and the running condition of the program on each tool can be observed by calling the system observation tool. The operation conditions herein include, but are not limited to, utilization of resources, a stuck condition, a reaction time for generating output information when inputting information, data that can be processed per minute, and the like.
The plurality of programs may be various types of programs including, but not limited to, database programs, web message screening programs, web service tools, system service tools, and the like; there may be a plurality of programs, and the plurality of programs may include the same kind of programs, such as: SQL database, oracle database, web service tool.
In the implementation process, by acquiring the running conditions of a plurality of programs under different equipment parameters, the exchange partition capacity required by the different programs when the equipment with different equipment parameters runs can be further judged. Based on the embodiment, the creation of the exchange partition for program customization is realized.
In one possible implementation, the device parameters include: the step of obtaining the corresponding exchange partition capacity in the configuration file according to the equipment parameters and the belonging type of the program, wherein the step comprises the following steps of: and determining the capacity of the exchange partition according to the type of the equipment, the number of the CPUs of the equipment and the type of the program.
The configuration file may be configured in advance, and each row of the configuration file includes a device type, a CPU number of the device, a program type, and a corresponding swap partition capacity. For example, when the type of the network forwarding device is a type, the number of CPUs is 2, the service to be implemented is to save the message, and the program to be executed corresponding to the service is a database program, the corresponding switch partition capacity is 30MB, for example, when the type of the network forwarding device is B type, the number of CPUs is 2, and the program to be executed is a network forwarding service, the corresponding switch partition capacity is 3MB.
In the implementation process, the type of the device determines the mode of device memory management, the number of the CPUs of the device determines the data processing speed of the device, the type of the program determines the size of data to be processed by the program and the number of the CPUs to be occupied, and the capacity of the exchange partition is determined according to the type of the device, the number of the CPUs of the device and the type of the program, so that the capacity of the exchange partition, the program and the device are adapted to each other, and the maximum utilization of the device memory is realized.
In a possible embodiment, the step of obtaining the running condition of the plurality of programs under different device parameters includes: acquiring the corresponding computer resource utilization rate of a plurality of different programs when running on equipment with different equipment parameters; a step of determining the capacity of the switch partition of the plurality of programs under different device parameters according to the running condition, comprising: the capacity of the switch partition of the plurality of programs under different device parameters is determined according to the utilization of the computer resources.
Computer resource utilization includes, but is not limited to, CPU utilization, memory occupancy, and the like. The method of determining the capacity of the swap partition of the plurality of programs under different device parameters according to the computer resource utilization may be determined based on a preset interval. And setting different utilization rate intervals for different exchange partition capacities, and determining the utilization rate interval in which the utilization rate of a plurality of programs running on equipment with different equipment parameters is located, so that the capacity corresponding to the utilization rate interval is used as the capacity of the exchange partition.
For example, 3 utilization intervals (70-80), (80-85), and (90-95) are preset, the corresponding capacities are respectively 4MB, 8MB, and 16MB, a network service program is run on a first device with device parameters of A, CPU and number 4, the utilization ratio occupied by the network service program is found to be 75, and when the program is determined to run on a device with device parameters of A, CPU and number 4, a 4MB swap partition is created before starting.
In addition, when the current device is a network forwarding device, the running program is a network service program or a firewall policy program, etc., the capacity of the switch partition can be determined according to the number of messages processed by the network forwarding device per unit time.
It should be noted that the capacity of the switch partition is not necessarily 0. Setting a threshold value may be implemented, and when the computer resource utilization is less than a certain threshold value, it is indicated that the machine is currently running the program without any problem, and it is not necessary to establish a corresponding swap partition for the program.
In the implementation process, the resource utilization rate describes whether the memory and the processor of the current equipment can meet the normal running of the program to a certain extent, so that the capacity of the exchange partition of a plurality of programs under different equipment parameters can be determined according to the computer resource utilization rate, and the exchange partition with different capacities can be customized for the programs.
In one possible embodiment, the method further comprises: in response to an end signal of the program, the swap partition is deleted.
The end signal here may be an end signal of one or more threads corresponding to the program, or an end signal of a process corresponding to the program. This is not particularly limited in this application.
In the prior art, the deletion of the exchange partition is created by a worker through a command, and the worker deletes the exchange partition through the command, so that the flexibility is poor. In the implementation, when the program operation is finished, the exchange partition is deleted, so that the memory can be released, the device can use the memory to store data of other programs or systems, the problem of insufficient memory caused by the fact that the exchange partition is not deleted in time after being created in the prior art is solved, and the maximum utilization of the memory is realized.
In a possible implementation manner, the step of obtaining the corresponding exchange partition capacity in the configuration file according to the device parameter and the type of the program includes:
calling a script to enable the script to read configuration files line by line, and matching the equipment parameters of the current equipment, the type of the program, the CPU number of the current equipment and the equipment parameters, the program and the CPU number of each line in the configuration files; and if the matching is successful, acquiring the capacity of the exchange partition matched with the current equipment.
Further, creating the exchange partition, deleting the exchange partition, and realizing script may be adopted.
Taking the Linux system as an example, the configuration file swap. Conf is as follows:
VD:T2E:4C:process:mysqld:1
TVD:T2E:4C:process:ngtoslogd:1
TVD:T2E:4C:process:update:2
TVD:T2E:8C:process:mysqld:1
TVD:T2E:8C:process:ngtoslogd:2
TVD:T2E:8C:process:update:4
wherein the first item represents a device type, the second item represents a device subtype, and the third item is the number of CPUs; the process represents the process name, the fourth item represents the process name or the program name, and the fifth item represents the size of a swap partition, the capacity of a block swap partition being 4MB in units of blocks.
The script is:
while read line
do
Do_check$line
done</etc/do_swap.conf
the script corresponding to the Do_check function is:
function Do_check(){
input_oem=`echo$1|awk-F‘:’‘{print$1}’`
input_type=`echo$1|awk–F‘:’‘{print$2}’
input_core=`echo$1|awk–F’:’‘{print$3}’``
input_process=`echo$1|awk–F’:’‘{print$4}’``
input_size=`echo$1|awk–F’:’‘{print$5}’``
if[$oem==$input_oem&&$device==$input_type&&$input_core==$core];then
do_swap$input_size
fi
}
taking Linux system as an example, parameters of a current device are in a device configuration file/tos/etc/option, idpoem=tvd represents a device type, and BOARDTYPE=T2E represents a subtype.
function Do_get_device_info(){
oem=`grep IDPOEM/tos/etc/option|awk-F'=”{print$2}'`
device=`grep BOARDTYPE/tos/etc/option|awk-F'=”{print$2}'`
core=`cat/proc/cpuinfo|grep processor|wc-l`
}
In the implementation process, the steps are scripted, the configuration file is read row by row through the script, the equipment parameters of the current equipment and the type of the program belong to, the CPU number of the current equipment is compared with each item of data in the configuration file row by row, when the equipment parameters of the current equipment, the type of the program, the CPU number of the current equipment and the data of one row in the configuration file are completely matched, the capacity of the exchange partition corresponding to the line change is obtained, and the exchange partition is created according to the capacity of the exchange partition. Based on the above embodiment, the comparison process is scripted, and the speed of acquiring the capacity of the exchange partition is improved.
Example 2
The embodiment of the application provides a program starting device, which comprises:
the response module 1 is used for responding to a starting signal of a program and acquiring a configuration file;
the device parameter acquisition module 2 is used for acquiring the device parameters of the current device;
the exchange partition capacity acquisition module 3 is used for acquiring the corresponding exchange partition capacity in the configuration file according to the equipment parameters;
a creating module 4, configured to create a switch partition according to the switch partition capacity;
a starting module 5 for starting the program.
In a possible implementation, the exchange partition capacity acquisition module 3 is further configured to acquire the type of the program;
and acquiring the corresponding exchange partition capacity from the configuration file according to the equipment parameters and the type of the program.
In a possible embodiment, the apparatus further comprises: the generating module is used for acquiring the running conditions of a plurality of programs under different equipment parameters;
determining the exchange partition capacity of a plurality of programs under different equipment parameters according to the running condition;
the configuration file is generated according to the plurality of programs, the plurality of different device parameters, and the swap partition capacity of the plurality of programs under the different device parameters.
In one possible implementation, the device parameters include: the device type and the number of CPUs of the device;
the exchange partition capacity acquisition module 3 is further configured to determine the exchange partition capacity according to the device type, the number of CPUs of the device, and the type to which the program belongs.
In a possible implementation manner, the generating module is further configured to obtain computer resource utilization rates corresponding to a plurality of different programs when running on devices with different device parameters; the capacity of the switch partition of the plurality of programs under different device parameters is determined according to the utilization of the computer resources.
In a possible embodiment, the apparatus further comprises: and the deleting module is used for deleting the exchange partition in response to the ending signal of the program.
In a possible implementation manner, the swap partition capacity obtaining module 3 is further configured to call a script, so that the script reads the configuration file line by line, and matches the device parameters of the current device, the majority type of the program, the number of CPUs of the current device, and the device parameters, the program, and the number of CPUs of each line in the configuration file;
and if the matching is successful, acquiring the capacity of the exchange partition matched with the current equipment.
The application further provides an electronic device, please refer to fig. 3, and fig. 3 is a block diagram of an electronic device according to an embodiment of the application. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. Wherein the communication bus 34 is used to enable direct connection communication of these components. The communication interface 32 of the electronic device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.
The processor 31 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. The general purpose processor may be a microprocessor or the processor 31 may be any conventional processor or the like.
The Memory 33 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 33 has stored therein computer readable instructions which, when executed by the processor 31, can cause the electronic device to perform the steps involved in the above-described method embodiments.
Optionally, the electronic device may further include a storage controller, an input-output unit.
The memory 33, the memory controller, the processor 31, the peripheral interface, and the input/output unit are electrically connected directly or indirectly to each other, so as to realize data transmission or interaction. For example, the components may be electrically coupled to each other via one or more communication buses 34. The processor 31 is arranged to execute executable modules stored in the memory 33, such as software functional modules or computer programs comprised by the electronic device.
The input-output unit is used for providing the user with the creation task and creating the starting selectable period or the preset execution time for the task so as to realize the interaction between the user and the server. The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
It will be appreciated that the configuration shown in fig. 3 is merely illustrative, and that the electronic device may also include more or fewer components than shown in fig. 3, or have a different configuration than shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof.
The embodiment of the application further provides a computer readable storage medium, on which instructions are stored, and when the instructions run on a computer, the computer program is executed by a processor to implement the method of the method embodiment, so that repetition is avoided, and no further description is given here.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored on a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above is only an example of the present application, and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.

Claims (10)

1. A program starting method, characterized by comprising:
responding to a starting signal of a program to acquire a configuration file;
acquiring equipment parameters of current equipment;
acquiring corresponding exchange partition capacity from the configuration file according to the equipment parameters;
creating a switching partition according to the capacity of the switching partition;
the procedure is started.
2. The program starting method according to claim 1, wherein the step of obtaining the corresponding swap partition capacity in the configuration file according to the device parameters comprises:
acquiring the type of the program;
and acquiring the corresponding exchange partition capacity from the configuration file according to the equipment parameters and the type of the program.
3. The program starting method according to claim 2, wherein before the step of acquiring the configuration file in response to the start signal of the program, comprising:
acquiring the running conditions of a plurality of programs under different equipment parameters;
determining the exchange partition capacity of the programs under different equipment parameters according to the running conditions;
and generating the configuration file according to the programs, the different equipment parameters and the exchange partition capacity of the programs under the different equipment parameters.
4. The program starting method according to claim 2, wherein the device parameters include: the device type and the number of CPUs of the device;
the step of obtaining the corresponding exchange partition capacity in the configuration file according to the equipment parameters and the type of the program comprises the following steps:
and determining the capacity of the exchange partition according to the type of the equipment, the number of the CPUs of the equipment and the type of the program.
5. A program starting method according to claim 3, wherein the step of acquiring the running conditions of the plurality of programs under different device parameters comprises:
acquiring the corresponding computer resource utilization rate of a plurality of different programs when running on equipment with different equipment parameters;
the step of determining the exchange partition capacity of the programs under different equipment parameters according to the running conditions comprises the following steps:
and determining the exchange partition capacity of the programs under different equipment parameters according to the utilization rate of the computer resources.
6. The program starting method according to claim 1, characterized in that the method further comprises: and deleting the exchange partition in response to an end signal of the program.
7. The method according to claim 2, wherein the step of obtaining the corresponding exchange partition capacity in the configuration file according to the device parameter and the type of the program comprises:
invoking a script to enable the script to read the configuration file row by row, and matching the device parameters of the current device, the majority type of the program, the CPU number of the current device and the device parameters, the program and the CPU number of each row in the configuration file;
and if the matching is successful, acquiring the capacity of the switching partition matched with the current equipment.
8. A program starting apparatus, comprising:
the response module is used for responding to a starting signal of the program and acquiring a configuration file;
the device parameter acquisition module is used for acquiring the device parameters of the current device;
the exchange partition capacity acquisition module is used for acquiring corresponding exchange partition capacity from the configuration file according to the equipment parameters;
the creation module is used for creating the exchange partition according to the exchange partition capacity;
and the starting module is used for starting the program.
9. An electronic device, comprising: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1-7 when the computer program is executed.
10. A computer readable storage medium having instructions stored thereon which, when run on a computer, cause the computer to perform the method of any of claims 1-7.
CN202211572700.9A 2022-12-08 2022-12-08 Program starting method and device, electronic equipment and storage medium Pending CN116107654A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211572700.9A CN116107654A (en) 2022-12-08 2022-12-08 Program starting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211572700.9A CN116107654A (en) 2022-12-08 2022-12-08 Program starting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116107654A true CN116107654A (en) 2023-05-12

Family

ID=86253501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211572700.9A Pending CN116107654A (en) 2022-12-08 2022-12-08 Program starting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116107654A (en)

Similar Documents

Publication Publication Date Title
CN107896162B (en) Deployment method and device of monitoring system, computer equipment and storage medium
CN110119306B (en) Method, device and equipment for balancing automatic scheduling of jobs and storage medium
CN107566214B (en) Performance test method and device
CN111858007A (en) Task scheduling method and device based on message middleware
CN108733545B (en) Pressure testing method and device
CN114676205A (en) Event information processing method and device
CN108520401B (en) User list management method, device, platform and storage medium
CN113065779A (en) Data processing method and device and electronic equipment
CN112559565A (en) Abnormity detection method, system and device
CN112559127A (en) Virtual machine creation method, device, host and storage medium
CN117151669A (en) Reminding method and device based on workflow engine execution time and electronic equipment
CN111126604A (en) Model training method, device, server and storage medium
CN116107654A (en) Program starting method and device, electronic equipment and storage medium
CN111124382A (en) Attribute assignment method and device in Java and server
US20090083747A1 (en) Method for managing application programs by utilizing redundancy and load balance
CN115499514A (en) Data storage service access method, computing device and computer storage medium
CN111080250B (en) Flow backspacing compensation method and device, storage medium and electronic equipment
CN112148513B (en) Method, device and storage medium for dumping single-point service data
CN113626869A (en) Data processing method, system, electronic device and storage medium
CN111600771A (en) Network resource detection system and method
CN111694628A (en) Page display method based on application program thread and related equipment
CN110891029A (en) Flow control method and device for home network and flow controller
CN112579189A (en) Configuration file updating method and device
CN112748980B (en) Message pushing method, device, equipment and computer readable storage medium
CN115185639B (en) Method and system for realizing virtualized API (application program interface)

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