CN114995899A - Program running method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114995899A
CN114995899A CN202210531215.0A CN202210531215A CN114995899A CN 114995899 A CN114995899 A CN 114995899A CN 202210531215 A CN202210531215 A CN 202210531215A CN 114995899 A CN114995899 A CN 114995899A
Authority
CN
China
Prior art keywords
target
application program
target model
target application
memory
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
CN202210531215.0A
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.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent Technology 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 Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN202210531215.0A priority Critical patent/CN114995899A/en
Publication of CN114995899A publication Critical patent/CN114995899A/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
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a program running method and device, electronic equipment and a storage medium, wherein the program running method comprises the following steps: receiving preset operation of a target application program; judging whether a target model required by the running of a target application program exists or not; and responding to the target model required by the running of the existing target application program, and running the target application program based on the existing target model. By the scheme, the resource occupation of the execution equipment can be reduced.

Description

Program running method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a program running method and apparatus, an electronic device, and a storage medium.
Background
Compared with a high-computing-capacity edge server and an X86 server with abundant system resources, the system resources and computing capacity of the embedded terminal are very limited, such as system disk space, memory, a CPU and the like. Generally, more applications cannot be deployed in the embedded terminal, so how to deploy more applications in the embedded terminal with limited system resources is a technical problem to be solved urgently.
Disclosure of Invention
The application at least provides a program running method and device, electronic equipment and a storage medium.
The application provides a program running method, which comprises the following steps: receiving preset operation of a target application program; judging whether a target model required by the operation of the target application program exists or not; and responding to the target model required by the running of the existing target application program, and running the target application program based on the existing target model.
Therefore, after the target model required by the target application program running exists, the target application program can be directly run by using the existing target model, and the resource occupation of the execution device can be reduced.
The preset operation is a starting operation, and whether a target model required by the running of a target application program exists or not is judged, and the method comprises the following steps: judging whether a target model required by the operation of a target application program is downloaded to a storage space; and determining that the target model required by the target application program to run exists in response to the target model being downloaded to the storage space.
Therefore, by directly using the downloaded object model to run the object application program in the case where the downloaded object model already exists in the storage space, repeated downloading is not required, so that the resource occupation of the storage space of the execution device can be reduced.
Before receiving the preset operation of the target application program, the method further comprises the following steps: receiving installation operation of a target application program; downloading a program installation package of the target application program in response to the installation operation; installing a target application program based on the program installation package; before determining whether an object model required for the operation of the object application program exists, the method further comprises: and analyzing the configuration file in the program installation package to determine the target model.
Therefore, by separating the target model required by the running of the application program from the program installation package, the target model is not downloaded temporarily when the application program is installed, and the dynamic deployment of the target model when the target application program is run is realized.
The preset operation is a starting operation, and whether a target model required by the running of a target application program exists or not is judged, and the method comprises the following steps: judging whether a target model required by the running of a target application program is loaded to a memory; determining that the target model required by the target application program exists in response to the target model being loaded into the memory; in response to an existing target application running a desired target model, running the target application based on the existing target model, comprising: and in response to the target model required by the target application program being loaded to the memory, running the target application program based on the target model loaded to the memory.
Therefore, after the starting operation of the target application program is received, the target application program is directly operated by using the target model loaded to the memory under the condition that the target model is loaded to the memory, the target model does not need to be repeatedly loaded to the memory, and the resource occupation of the memory is reduced.
The method for judging whether the target model required by the operation of the target application program is loaded to the memory comprises the following steps: inquiring a preset form, wherein the preset form comprises a plurality of identifiers of application programs in a starting state and identifiers of target models required by running of the application programs; and responding to the identifier corresponding to the target model in the preset form, and determining that the target model required by the target application program is loaded to the memory.
Therefore, all the target models which are loaded into the memory can be determined by inquiring the preset form.
Wherein, in response to the target model required by the target application program having been loaded to the memory, the target application program is run based on the target model loaded to the memory, including: acquiring a physical address of a target model in a memory; mapping the physical address to a virtual address of the target application; the target model is invoked to run the target application based on the virtual address.
Therefore, by mapping the physical address of the target model loaded into the memory into the virtual address of the target application program, the target application program can be operated based on the target model.
Wherein, the method further comprises: loading the target model into the memory in response to the target model not being loaded into the memory; writing the identification of the target model and the identification of the target application program into a preset form as a group of data; and/or after determining that the target model required by the target application program is loaded to the memory in response to the identifier corresponding to the target model existing in the preset form, the method further includes: and writing the identification of the target model and the identification of the target application program as a group of data into a preset form.
Therefore, the representation of the target model and the identification of the target application program are written into the preset form as a group of data, so that the target model which is loaded into the memory can be conveniently inquired when other subsequent application programs are started.
The application provides a program running device, including: the receiving module is used for receiving preset operation of the target application program; the judging module is used for judging whether a target model required by the operation of the target application program exists or not; and the operation module is used for operating the target application program based on the existing target model.
The application provides an electronic device, which comprises a memory and a processor, wherein the processor is used for executing program instructions stored in the memory so as to realize the program running method.
The present application provides a computer-readable storage medium having stored thereon program instructions which, when executed by a processor, implement the program execution method described above.
According to the scheme, after the target model required by the running of the target application program exists, the target application program can be directly run by using the existing target model, and the resource occupation of the execution equipment can be reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a method for operating a program according to the present application;
fig. 2 is a first flowchart illustrating step S12 according to an embodiment of the program running method of the present application;
fig. 3 is a second flowchart illustrating step S12 according to an embodiment of the program running method of the present application;
FIG. 4 is another schematic flow chart diagram illustrating an embodiment of a method for operating a program according to the present application;
FIG. 5 is a further flowchart of an embodiment of a method of operating a program of the present application;
FIG. 6 is a schematic structural diagram of an embodiment of a program execution device according to the present application
FIG. 7 is a schematic structural diagram of an embodiment of an electronic device of the present application;
FIG. 8 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The embodiments of the present application will be described in detail below with reference to the drawings.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The term "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
The execution subject of the program execution method may be a program execution device, for example, the program execution device may be a terminal device or a server or other processing device. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementations, the program execution method may be implemented by a processor calling computer readable instructions stored in a memory.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an embodiment of a program running method according to the present application.
Specifically, the method may include the steps of:
step S11: and receiving preset operation of the target application program.
The execution main body of the program running method provided by the embodiment of the disclosure may be an intelligent terminal, a server, and the like, for example, may be an embedded terminal. Compared with a high-computing-capacity edge server and an X86 server with abundant system resources, the embedded terminal has very limited system resources and computing capacity, such as system disk space, internal memory, CPU and the like. Generally, under the condition that a plurality of application programs are installed on an embedded terminal, the disk space of a terminal system often becomes a bottleneck because the model of the algorithm is large and occupies a large disk space. The program running method provided by the embodiment of the disclosure can reduce the models stored in the execution equipment, and further reduce the storage pressure of the execution equipment.
The target application may be any application. Illustratively, the target application may be an application applied in the field of smart security and smart city, for example, an application capable of face recognition and an application capable of face detection. The preset operation on the target application may be a start operation, an install operation, or the like.
Step S12: and judging whether a target model required by the target application program to run already exists.
Wherein the target model may be an algorithmic model or a neural network model, or the target model may be a combination of an algorithmic model and a neural network model. Illustratively, the Neural Network model may be DNN (Deep Neural Networks), CNN (Convolutional Neural Networks), LSTM (Long Short Term Memory Networks), residual Neural Networks, and the like. The target model required by the running of one target application program can comprise one or more than one target model. For example, if the target application is capable of implementing one function, the target model required for the target application to run may include one, and if the target application is capable of implementing a plurality of different functions, the target model required for the target application to run may be plural. The number of target models required for the target application to run is not specified here. Illustratively, the target application is an application capable of target recognition, and the target model required by the target application to run comprises a target recognition model; alternatively, the target application is an application capable of target segmentation, and the target model required for the target application to run includes the target segmentation model.
The target model required by the running of the existing target application program can be the target model existing in the disk space of the execution device or the target model loaded in the memory during the starting process of the target application program. In the case where there are a plurality of target models required for the target application to run, the determination result in step S12 may be that there is already a part of the target models required for the target application to run.
If the determination result in step S12 is that there is a target model required for the target application to run, step S13 is executed.
Step S13: the target application is run based on the existing target model.
In some disclosed embodiments, the step S11 may be to receive a start operation on the target application, the step S12 may be to determine whether a target model required for running the target application has been downloaded in a storage space of the execution device, and if the determination result of the step S12 is present, the target model in the storage space may be directly loaded to the memory to run the target application, and the target model value storage space does not need to be downloaded again, so that the occupation of the storage space is reduced.
In some disclosed embodiments, the step S11 may be to receive a start operation on the target application, the step S12 may be to determine whether a target model required for running the target application already exists in the memory, and if the determination result of the step S12 is that the target model required for running the target application already exists, the target application is run by directly using the target model loaded into the memory without loading the target model into the memory again, so that occupation of the memory by repeated target models is reduced. In this case, if the determination result in step S12 is that the loaded target model exists in the memory, step S13 may be directly executed. The direct execution means that a time interval between the execution of step S12 and the execution of step S13 is less than a preset time interval.
In some disclosed embodiments, there may be a time interval between step S13 and step S12, i.e., step S13 may not be performed immediately after step S12 is performed. For example, step S11 may be receiving an installation operation of the target application, and step S12 is determining whether the target model required for running the target application already exists in the disk space, and in general, after receiving the installation operation of the target application, only the installation of the target application may be performed, and after the installation of the target application is successful, the target application is started after receiving a start instruction for the target application again, and if the disk space already exists in the target model, the target application is run based on the existing target model, and if the disk space does not exist in the target model, the target model may be downloaded to the storage space based on the start instruction, and then the downloaded target model is loaded to the memory to run the target application. However, the time interval between the reception of the installation operation of the target application and the reception of the launch operation of the target application may be controlled by the user, so there may be an unknown time interval between the steps S12 and S13.
According to the scheme, after the target model required by the running of the target application program exists, the existing target model can be directly used for running the target application program, and the resource occupation of the execution equipment can be reduced.
In other disclosed embodiments, in the case that the target model required for the target application to run does not exist as a result of the determination in step S12, step S14 is performed.
Step S14: and acquiring a target model required by the running of the target application program, and running the target application program based on the acquired target model.
In some disclosed embodiments, in the case that the step S12 is to determine whether the target model required for the target application to run has been downloaded in the storage space of the execution device, the step S14 may acquire the target model required for the target application to run by downloading the target model to the storage space.
In some disclosed embodiments, in the case that it is determined in step S12 that the target model required for the operation of the target application program already exists in the memory, the step S14 may load the target model into the memory in a manner of obtaining the target model required for the operation of the target application program.
In some disclosed embodiments, the preset operation is a start operation, and before executing step S11, the following steps may be further executed:
an installation operation for a target application is received. Then, in response to the installation operation, the program installation package of the target application program is downloaded. Then, the target application is installed based on the program installation package. Wherein the downloaded program installation package does not include the target model. Specifically, the object cloud storage splits the algorithm model of the application and other content into two relatively independent objects, and stores the other content to the application repository and the algorithm model to the algorithm model repository. The execution device can connect to a private cloud or a public cloud environment. Specifically, the application service end sends an installation instruction of the target application to the execution device by calling an API interface of the execution device. And after receiving the installation instruction, the execution device determines that the installation operation of the target application program is received. Then, the execution device sends a downloading request to a warehouse for storing the program installation package not containing the algorithm model, and receives the program installation package not containing the algorithm model issued by the warehouse.
Before the step S12 is executed, the program running method may further include the steps of: and analyzing the configuration file in the program installation package to determine the target model. In other words, the execution device can know which algorithm models the target application needs to rely on for operation through the configuration file in the installation package.
For example, if the determination result in the step S12 is that the target model does not exist in the storage space, the specific execution step in the step S14 may be that the execution device calls the cloud storage interface to obtain the target model. As described above, the target model required by the target application running may include a plurality of target models, and as a result of the determination in step S12, a part of the target model may exist in the storage space, and step S14 may call the cloud storage interface to obtain another part of the target model that does not exist in the storage space.
By separating the target model required by the application program operation from the program installation package, the target model is not downloaded when the application program is installed, and the dynamic deployment of the target model when the target application program is operated is realized.
In some disclosed embodiments, the preset operation is a start operation. Referring to fig. 2, fig. 2 is a first flowchart illustrating step S12 according to an embodiment of the program execution method of the present application. As shown in fig. 2, the step S12 may include the following steps:
step S121: and judging whether the target model required by the running of the target application program is downloaded to the storage space.
The storage space may specifically be a disk space of the execution device. In other disclosed embodiments, the memory space may be a database that is called when the target application is run. The specific form of the storage space is not specifically limited herein. If the determination result in step S121 is that the target model has been downloaded to the storage space, step S122 is executed. If the determination result in step S121 is that the target model is not downloaded to the storage space, step S123 is executed.
Step S122: and determining the existing target model required by the target application program to run.
Wherein the models required for the different applications to run may be the same. Assuming that the target model required by the application program and the target model required by the application program exist the same model as the installed application program or the started application program, and the same model is downloaded to the storage space before, the target model required by the running of the target application program is determined to exist.
Step S123: it is determined that there is no target model required for the target application to run.
For example, if the determination result in step S121 is that the target model does not exist in the storage space, the specific execution step in step S14 may be that the execution device calls the cloud storage interface to obtain the target model. As described above, the target model required by the target application running may include a plurality of target models, and as a result of the determination in step S12, a part of the target model may exist in the storage space, and step S14 may call the cloud storage interface to obtain another part of the target model that does not exist in the storage space. Or after calling the cloud storage interface to obtain all the target models, deleting the repeated partial target models.
In the case that it is determined in step S121 whether the target model required for the operation of the target application program is downloaded to the storage space, if the determination result in step S121 is that the target model is downloaded to the storage space, step S13 may specifically include: and running the target application program by using the target model downloaded into the storage space. By the mode, sharing of the model among different application programs can be realized, so that waste of storage space caused by repeated downloading of the same model is reduced, namely, the storage space is optimized by reducing redundant models in the storage space.
By directly using the downloaded target model to run the target application program under the condition that the downloaded target model exists in the storage space, repeated downloading is not needed, and the resource occupation of the storage space of the execution equipment can be reduced.
In some application scenarios, under the condition that the execution device can be connected with a public cloud or a private cloud environment, the execution device receives an application program installation request of an authorized service party, first, an installation package of an application program is downloaded to an application program warehouse at the cloud end according to application program information in the request, after the downloading is completed, the installation of the application program is started, before the installation, the authorization information of the application program needs to be checked, so that the legality and integrity of the application program are verified, after the verification is successful, which algorithm models the application program depends on are analyzed through related configuration files of the application program, and the dependent model information and the corresponding application program names are recorded to an algorithm model management module. The model management module is used for managing the states of all models in the execution equipment. After the application program is installed, a business side issues a task corresponding to the application program through an API (application programming interface) to start the application program, after a promoter process of the application program is established, firstly, which algorithm models need to be downloaded by the application program are analyzed according to a configuration file of the application program, then, whether the models are downloaded already in a database is inquired, if other application programs are downloaded already, the algorithm model files are shared among the application programs, and the models do not need to be downloaded from an algorithm model warehouse at the cloud side. Generally, the algorithm model usually occupies a disk space of about tens of mega to hundreds of mega, which is not small resource occupation for embedded equipment with limited disk space. If the model is not downloaded, downloading the model from an algorithm model warehouse in the cloud to a model directory, storing the downloaded information of the model and the stored information in the model directory into a database, and marking the model as being downloaded.
Besides the model management module, the execution device can also comprise an application program process management module, an application program authorization module, a database module and a task management module. The application program process management module is used for managing process information of the application program in the starting state, for example, managing the process state information of the application program. The model management module is used for managing models required by the running of all application programs and states of the models, such as whether the models are downloaded or not, whether the models are loaded into the memory or not, physical addresses of the models recorded into the memory and the like. The application management module is mainly used for managing the configuration information and other contents of each application. The application program authorization module is used for verifying the validity of the application program. The database module is mainly used for managing the database. The task management module is mainly used for receiving tasks issued by the service end and managing the tasks which are being executed, executed or to be executed.
In some disclosed embodiments, the preset operation may also be a start operation, please refer to fig. 3, and fig. 3 is a second flowchart illustrating step S12 according to an embodiment of the program running method of the present application. As shown in fig. 3, the step S12 may include the following steps:
step S124: and judging whether the target model required by the running of the target application program is loaded to the memory.
In step S124, the manner of determining whether the target model required by the target application program is loaded into the memory may be: and querying a preset form. The preset form comprises the identifications of a plurality of application programs in a starting state and the identification of a target model required by the running of each application program. The identification of the object model required for the running of each application here refers to the identification of the object model required for the running of the application in the startup state. The preset form can be stored in a preset database or in a disk space. All target models which are loaded into the memory can be determined by inquiring the preset form.
If the determination result in step S124 is that the target model required for the operation of the target application program is loaded into the memory, step S125 is executed. If the determination result in step S124 is that the target model required for the target application program to run is not loaded into the memory, step S126 is performed.
Step S125: and determining the existing target model required by the target application program to run.
Step S126: it is determined that there is no target model required for the target application to run.
If the determination result in the step S124 is that the target model required for the operation of the target application program is loaded into the memory, the step S13 may include the following steps: and running the target application program based on the target model loaded to the memory. If the determination result in the step S124 is that the target model required by the target application program is not loaded into the memory, the step S14 may include the following steps: and loading the target model into the memory, and running the target application program based on the target model loaded into the memory. As described above, the target application includes a plurality of target models, wherein if the determination result in the step S124 is that the part of the target model required for the target application to run is not loaded into the memory, then the step S14 includes loading the part of the target model that is not loaded into the memory, and the step S13 includes running the target application based on the part of the target model that is loaded into the memory and the part of the target model that is loaded into the memory during the step S14.
After the starting operation of the target application program is received, the target application program is directly operated by using the target model loaded to the memory under the condition that the target model is loaded to the memory, the target model does not need to be repeatedly loaded to the memory, and the resource occupation of the memory is reduced.
In some disclosed embodiments, in response to the target model required by the target application program having been loaded into the memory, the manner of running the target application program based on the target model loaded into the memory may be:
and acquiring the physical address of the target model in the memory. The method for obtaining the physical address of the target model in the memory may be as follows: and acquiring the physical address of the corresponding algorithm model from the model management module through IPC process communication. The physical address is then mapped to a virtual address of the target application. The target model is then invoked to run the target application based on the virtual address. When the physical address is mapped to the virtual address of the target application program, the physical address of the target model in the memory is mapped to a continuous section of virtual address in the virtual address of the target application program. The target application program can be operated based on the target model by mapping the physical address of the target model loaded to the memory in the memory to the virtual address of the target application program.
After the target application program is executed based on the target model loaded to the memory in response to the target model required by the target application program having been loaded to the memory, the program execution method may further include:
and writing the identification of the target model and the identification of the target application program as a group of data into a preset form. Specifically, after the physical address of the target model in the memory is mapped to the virtual address of the target application program, the identifier of the target model and the identifier of the target reference program are written into a preset form as a group of data, so that when other application programs are started next time, whether the target model required by the operation of other application programs is loaded into the memory or not is conveniently and subsequently judged.
In some disclosed implementations, after the step S14 is executed, the target model is loaded into the memory, and the target application is executed based on the target model loaded into the memory, the following steps may be further executed: and writing the identification of the target model and the identification of the target application program as a group of data into a preset form. The representation of the target model and the identification of the target application program are written into the preset form as a group of data, so that the target model which is loaded into the memory can be conveniently inquired when other subsequent application programs are started.
Specifically, in response to that the target model required by the target application program is not loaded into the memory, the manner of loading the target model into the memory may be: and loading the target model into a continuous physical memory, and converting into a physical memory address according to the linux system process pagemap file. And then, sending information such as the physical address of the target model in the memory, the identification of the target application program and the like to the model management module so as to be convenient for inquiring when other application programs are started subsequently. By the method, the physical memory space of the same target model can be shared among different application programs, and compared with the method that the algorithm models of all the application programs are loaded into the memory, the method reduces the waste of the physical memory.
In some disclosed embodiments, the starting of the application program is executed by the subprocess and is decoupled from the main process of the execution device, so that the stability of the system core service of the execution device is improved, and the paralysis of the core service caused by the abnormality of the negative power program is avoided. When the service end issues a plurality of tasks, the starting and the running of different application programs can also be strongly decoupled, and the different application programs are not influenced mutually, so that the stability of the whole execution equipment system is improved.
For better understanding, please refer to fig. 4 for the sub-process of step S12 shown in fig. 3, and fig. 4 is another schematic flow chart of an embodiment of the program execution method of the present application. As shown in fig. 4, the program execution method may include the steps of:
step S21: and receiving a starting operation of the application program.
The manner of receiving the start operation of the application program is as described above, and is not described herein again.
Step S22: and establishing an application program promoter process.
Step S23: and judging whether the target model required by the running of the target application program is loaded to the memory.
If the determination result in the step S23 is that the target model required for the operation of the target application program is loaded into the memory, the step S24 is executed, otherwise, the step S28 is executed.
Step S24: and through IPC process communication, the physical memory address of the target model is obtained from the main service model management module.
For a way of obtaining the physical memory address of the target model from the main service model management module through IPC process communication, please refer to the above description, which is not described herein again.
Step S25: and mapping the physical memory address of the target model into a virtual address of a target application program starting subprocess.
The way of mapping the physical memory address of the target model to the virtual address of the target application program promoter process is as described above, and is not described herein again.
Step S26: and writing the identification of the target model and the identification of the target application program as a group of data into a preset form.
The way of writing the identifier of the target model and the identifier of the target application as a set of data into the preset form is as described above, and details are not repeated here.
Step S27: and completing the loading of the target model.
Step S28: and loading the target model to the memory, and converting the target model into a physical memory address according to the Linux system process pagemap file.
The manner of loading the target model into the memory and converting the target model into the physical memory address according to the Linux system process pagemap file is as described above, and details are not described here.
Step S29: and sending the information such as the physical address of the target model in the memory, the identification of the target application program and the like to the model management module.
The manner of sending the information such as the physical address of the target model in the memory and the identifier of the target application program to the model management module is as described above, and details are not described here.
Step S30: and writing the identification of the target model and the identification of the target application program as a group of data into a preset form.
The way of writing the identifier of the target model and the identifier of the target application as a group of data into the preset form is as described above, and is not described herein again.
Step S31: and finishing the starting of the target application program.
According to the scheme, after the starting operation of the target application program is received, the target application program is directly operated by using the target model loaded to the memory under the condition that the target model is loaded to the memory, the target model does not need to be repeatedly loaded to the memory, and the resource occupation of the memory is reduced.
In some disclosed embodiments, after the target model required for the target application to run is downloaded to the storage space and the target model is loaded to the memory, it is determined that the target model required for the target application to run already exists.
Referring to fig. 5, fig. 5 is a schematic flow chart of an embodiment of a program running method according to the present application. As shown in fig. 5, the program execution method further includes the steps of:
step S41: an installation request for a target application is received.
The manner of receiving the installation request for the target application is as described above, and is not described herein again.
Step S42: a program installation package is downloaded that does not contain the target model.
The manner of downloading the program installation package not including the target model is as described above, and is not described herein again. After downloading the program installation package not containing the target model, the target application program is installed based on the program installation package.
Step S43: and analyzing the configuration file in the program installation package, and determining a target model required by the operation of the target application program.
The manner of analyzing the configuration file in the program installation package and determining the target model required by the operation of the target application program is as described above, and is not described herein again.
Step S44: and receiving a starting operation of the target application program.
The manner of receiving the start operation of the target application program is as described above, and is not described herein again.
Step S45: and judging whether the target model required by the running of the target application program is loaded to the memory.
If the determination result in the step S45 is that the target model required for the operation of the target application program has been loaded into the memory, go to step S46, and no go to step S47.
Step S46: and running the target application program based on the target model loaded to the memory.
The manner of running the target application program based on the target model loaded into the memory is as described above, and is not described herein again.
Step S47: and judging whether the target model required by the running of the target application program is downloaded to the storage space.
If the determination result in the step S47 is that the target model required for the operation of the target application program is not downloaded to the storage space, the step S48 is executed, otherwise, the step S49 is executed.
Step S48: and downloading the target model to the storage space.
The manner of downloading the object model to the storage space is as described above, and is not described herein again.
Step S49: and loading the target model to a memory, and running the target application program based on the target model.
The manner of loading the target model into the memory and running the target application program based on the target model is as described above, and is not described herein again.
According to the scheme, after the starting operation of the target application program is received, the target application program is directly operated by using the target model loaded to the memory under the condition that the target model is loaded to the memory, the target model does not need to be repeatedly loaded to the memory, and the resource occupation of the memory is reduced.
In addition, by directly using the downloaded target model to run the target application program under the condition that the downloaded target model exists in the storage space, repeated downloading is not needed, so that the resource occupation of the storage space of the execution device can be reduced.
In some application scenes, the embedded terminal is provided with a plurality of application programs, when the same model exists among the application programs, the same algorithm model is shared among the application programs through the scheme, and compared with the traditional method, the occupation of the disk space resource of the repeated model can be reduced.
In addition, when the embedded terminal runs a plurality of application programs and the same model exists among the application programs, the scheme can enable the application program processes to share the memory of the common model, avoid the same model from loading the system memory for a plurality of times, and reduce the occupation of memory resources.
In addition, the application program and the algorithm model are installed and deployed in a decoupling mode, the corresponding algorithm model cannot be installed and deployed when the application program is installed, and the corresponding model can be downloaded to the terminal device from the algorithm model warehouse at the cloud end only when the application program runs.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of a program running apparatus according to the present application. The program execution device 60 includes a receiving module 61, a judging module 62, and an executing module 63. The receiving module is used for receiving preset operation of the target application program; the judging module is used for judging whether a target model required by the running of the target application program exists or not; and the operation module is used for operating the target application program based on the existing target model.
According to the scheme, after the target model required by the running of the target application program exists, the target application program can be directly run by using the existing target model, and the resource occupation of the execution equipment can be reduced.
In some disclosed embodiments, the preset operation is a start operation, and the determining module 62 determines whether there is an object model required by the object application to run, including: judging whether a target model required by the operation of a target application program is downloaded to a storage space; and determining that the target model required by the target application program to run exists in response to the target model being downloaded to the storage space.
According to the scheme, the downloaded target model is directly used for running the target application program under the condition that the downloaded target model exists in the storage space, repeated downloading is not needed, and therefore resource occupation of the storage space of the execution equipment can be reduced.
In some disclosed embodiments, before receiving the preset operation on the target application, the receiving module 61 further includes: receiving installation operation of a target application program; downloading a program installation package of the target application program in response to the installation operation; installing the target application program based on the program installation package; before determining whether there is an object model required for the object application to run, the receiving module 61 is further configured to: and analyzing the configuration file in the program installation package to determine the target model.
According to the scheme, the target model required by the running of the application program is separated from the program installation package, so that the target model is not downloaded temporarily when the application program is installed, and the dynamic deployment of the target model when the target application program is run is realized.
In some disclosed embodiments, the preset operation is a start operation, and the determining module 62 determines whether there is an object model required by the object application to run, including: judging whether a target model required by the running of a target application program is loaded to a memory; determining that a target model required by a target application program exists in response to the target model being loaded into the memory; the running module 63, in response to the existing target application running the required target model, runs the target application based on the existing target model, and includes: and in response to the target model required by the target application program being loaded to the memory, running the target application program based on the target model loaded to the memory.
According to the scheme, after the starting operation of the target application program is received, the target application program is directly operated by using the target model loaded to the memory under the condition that the target model is loaded to the memory, the target model does not need to be repeatedly loaded to the memory, and the resource occupation of the memory is reduced.
In some disclosed embodiments, the determining module 62 determines whether the target model required by the target application program to run has been loaded into the memory, including: inquiring a preset form, wherein the preset form comprises a plurality of identifiers of application programs in a starting state and identifiers of target models required by running of the application programs; and responding to the mark corresponding to the target model in the preset form, and determining that the target model required by the target application program is loaded to the memory.
According to the scheme, all the target models which are loaded into the memory can be determined by inquiring the preset form.
In some disclosed embodiments, the running module 63, in response to the target model required by the target application being loaded into the memory, runs the target application based on the target model loaded into the memory, and includes: acquiring a physical address of a target model in a memory; mapping the physical address to a virtual address of the target application; the target model is invoked to run the target application based on the virtual address.
According to the scheme, the physical address of the target model loaded to the memory in the memory is mapped to the virtual address of the target application program, so that the target application program can be operated based on the target model.
In some disclosed embodiments, the operation module 63 is further configured to: loading the target model into the memory in response to the target model not being loaded into the memory; writing the identification of the target model and the identification of the target application program into a preset form as a group of data; and/or after determining that the target model required by the target application program has been loaded into the memory in response to the identifier corresponding to the target model existing in the preset form, the running module 63 is further configured to: and writing the identification of the target model and the identification of the target application program as a group of data into a preset form.
According to the scheme, the representation of the target model and the identification of the target application program are written into the preset form as a group of data, so that the target model which is loaded into the memory can be conveniently inquired when other subsequent application programs are started.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an embodiment of an electronic device according to the present application. The electronic device 70 includes a memory 71 and a processor 72, and the processor 72 is configured to execute program instructions stored in the memory 71 to implement the program execution method provided by the program execution method embodiment.
In one particular implementation scenario, the electronic device 70 may include, but is not limited to: the electronic device 70 may further include a mobile device such as a notebook computer, a tablet computer, and the like, which is not limited herein.
In particular, the processor 72 is configured to control itself and the memory 71 to implement the steps in any of the above-described program execution method embodiments. The processor 72 may also be referred to as a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip having signal processing capabilities. The Processor 72 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Additionally, the processor 72 may be collectively implemented by an integrated circuit chip.
According to the scheme, after the target model required by the running of the target application program exists, the target application program can be directly run by using the existing target model, and the resource occupation of the execution equipment can be reduced.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to the present application. The computer readable storage medium 80 stores program instructions 81, and the program instructions 81 are used for implementing the steps in any one of the above-described program execution method embodiments when executed by the processor.
According to the scheme, after the target model required by the running of the target application program exists, the target application program can be directly run by using the existing target model, and the resource occupation of the execution equipment can be reduced.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and for specific implementation, reference may be made to the description of the above method embodiments, and for brevity, details are not described here again.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is only one type of logical division, and other divisions may be implemented in practice, for example, the unit or component may be combined or integrated with another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (10)

1. A program execution method, comprising:
receiving preset operation of a target application program;
judging whether a target model required by the operation of the target application program exists or not;
and responding to the existing target model required by the target application program to run, and running the target application program based on the existing target model.
2. The method according to claim 1, wherein the preset operation is a start operation, and the determining whether a target model required by the target application to run already exists comprises:
judging whether a target model required by the operation of the target application program is downloaded to a storage space;
in response to the target model having been downloaded to the storage space, it is determined that there already exists a target model required for the target application to run.
3. The method of claim 2, wherein prior to receiving the default operation for the target application, the method further comprises:
receiving an installation operation of the target application program;
downloading a program installation package of the target application program in response to the installation operation;
installing the target application program based on the program installation package;
before the determining whether the target model required by the target application program to run already exists, the method further includes:
and analyzing the configuration file in the program installation package to determine the target model.
4. The method of claim 1, wherein the preset operation is a start operation, and the determining whether a target model required for the target application to run already exists comprises:
judging whether a target model required by the operation of the target application program is loaded to a memory;
determining that a target model required by the target application program exists in response to the target model being loaded to the memory;
the running of the target application program based on the existing target model in response to the existing target model required by the running of the target application program comprises the following steps:
and in response to the target model required by the target application program being loaded to the memory, running the target application program based on the target model loaded to the memory.
5. The method of claim 4, wherein determining whether the target model required for the target application to run is loaded to memory comprises:
inquiring a preset form, wherein the preset form comprises identifications of a plurality of application programs in a starting state and identifications of target models required by running of the application programs;
and responding to the identifier corresponding to the target model in the preset form, and determining that the target model required by the target application program is loaded to the memory.
6. The method of claim 4, wherein the running the target application based on the target model loaded into the memory in response to the target model required by the target application having been loaded into the memory comprises:
acquiring a physical address of the target model in a memory;
mapping the physical address to a virtual address of the target application;
calling the target model based on the virtual address to run the target application.
7. The method of claim 5 or 6, further comprising:
in response to the target model not being loaded into memory, loading the target model into memory;
writing the identification of the target model and the identification of the target application program into the preset form as a group of data;
and/or after the identifier corresponding to the target model exists in the preset form and the target model required by the target application program is determined to be loaded to the memory, the method further comprises:
and writing the identification of the target model and the identification of the target application program into the preset form as a group of data.
8. A program execution device characterized by comprising:
the receiving module is used for receiving preset operation of the target application program;
the judging module is used for judging whether a target model required by the operation of the target application program exists or not;
and the operation module is used for operating the target application program based on the existing target model.
9. An electronic device comprising a memory and a processor for executing program instructions stored in the memory to implement the method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon program instructions, which when executed by a processor implement the method of any of claims 1 to 7.
CN202210531215.0A 2022-05-16 2022-05-16 Program running method and device, electronic equipment and storage medium Pending CN114995899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210531215.0A CN114995899A (en) 2022-05-16 2022-05-16 Program running method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210531215.0A CN114995899A (en) 2022-05-16 2022-05-16 Program running method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114995899A true CN114995899A (en) 2022-09-02

Family

ID=83026900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210531215.0A Pending CN114995899A (en) 2022-05-16 2022-05-16 Program running method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114995899A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130238862A1 (en) * 2012-03-09 2013-09-12 International Business Machines Corporation Fast prediction of shared memory access pattern
CN109189496A (en) * 2018-08-03 2019-01-11 平安科技(深圳)有限公司 The dynamic base information acquisition method and device of application program
CN110659047A (en) * 2019-09-16 2020-01-07 Oppo广东移动通信有限公司 Algorithm model updating method and device, electronic equipment and computer readable storage medium
WO2020088681A1 (en) * 2018-11-01 2020-05-07 华为技术有限公司 Management method for model files and terminal device
CN112463268A (en) * 2019-09-06 2021-03-09 北京字节跳动网络技术有限公司 Application data processing method, device, equipment and storage medium
CN113176906A (en) * 2021-04-25 2021-07-27 京东数字科技控股股份有限公司 Model management method, model management device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130238862A1 (en) * 2012-03-09 2013-09-12 International Business Machines Corporation Fast prediction of shared memory access pattern
CN109189496A (en) * 2018-08-03 2019-01-11 平安科技(深圳)有限公司 The dynamic base information acquisition method and device of application program
WO2020088681A1 (en) * 2018-11-01 2020-05-07 华为技术有限公司 Management method for model files and terminal device
CN112463268A (en) * 2019-09-06 2021-03-09 北京字节跳动网络技术有限公司 Application data processing method, device, equipment and storage medium
CN110659047A (en) * 2019-09-16 2020-01-07 Oppo广东移动通信有限公司 Algorithm model updating method and device, electronic equipment and computer readable storage medium
CN113176906A (en) * 2021-04-25 2021-07-27 京东数字科技控股股份有限公司 Model management method, model management device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KEVIN J.GOODMAN: "《 如何开发Windows 95应用程序》", 31 October 1996, 清华大学出版社, pages: 123 - 126 *
ZDAIOT: ""动态链接库和静态链接库"", pages 1 - 8, Retrieved from the Internet <URL:《https://www.zdaiot.com/C/语法/动态链接库和静态链接库/》> *

Similar Documents

Publication Publication Date Title
US20040123270A1 (en) Method and apparatus for shared libraries on mobile devices
US8271608B2 (en) System and method for a mobile cross-platform software system
CN111367659B (en) Resource management method, equipment and medium for nodes in Kubernetes
CN101755271A (en) Method and apparatus for managing access privilege in cldc osgi environment
CN112948835B (en) Applet risk detection method and device
CN111596967A (en) Application function configuration method, terminal device, server and storage medium
CN114465998B (en) Multi-device file transmission method and device, terminal device and readable storage medium
CN112615747B (en) Method and device for automatically deploying and configuring network equipment
CN107220074A (en) To the access of supporting layer software function, upgrade method and device
CN115378735A (en) Data processing method and device, storage medium and electronic equipment
CN102968321A (en) Application program installation device and application program installation method
CN112738181B (en) Method, device and server for cluster external IP access
CN113010892B (en) Method and device for detecting malicious behavior of small program
CN114995899A (en) Program running method and device, electronic equipment and storage medium
CN116743762A (en) Service registration cluster flow switching method, flow switching device and storage medium
CN111259376A (en) Authority configuration method, device, server and storage medium
CN111475226B (en) Electronic device, micro-service calling method, and computer-readable storage medium
CN112616153B (en) Container processing method, device, computer equipment and storage medium
CN112149951B (en) Risk control method, apparatus, computer device and storage medium
CN114912121A (en) Method for upgrading vehicle-mounted machine firmware, storage medium, mobile terminal and vehicle-mounted machine
CN112130900A (en) User information management method, system, equipment and medium for BMC
CN112148379B (en) User contract unloading method, device and system of alliance chain and storage medium
CN117785228B (en) Application deployment method and device
CN113824795B (en) Communication method, device and system of vehicle end and cloud end
CN111984343B (en) Plug-in resource searching method, device, equipment and readable storage medium

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