CN115454535A - Application program loading method and device, computer equipment and storage medium - Google Patents

Application program loading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115454535A
CN115454535A CN202211198130.1A CN202211198130A CN115454535A CN 115454535 A CN115454535 A CN 115454535A CN 202211198130 A CN202211198130 A CN 202211198130A CN 115454535 A CN115454535 A CN 115454535A
Authority
CN
China
Prior art keywords
library
loading
program
runtime
target
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
CN202211198130.1A
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.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance 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 China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202211198130.1A priority Critical patent/CN115454535A/en
Publication of CN115454535A publication Critical patent/CN115454535A/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
    • G06F9/4451User profiles; Roaming

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 invention discloses an application program loading method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a program operation instruction, wherein the program operation instruction comprises a target program identifier; judging whether a target application program corresponding to the target program identification meets a library loading condition; if the condition of loading the runtime library is met, loading a basic library file corresponding to the runtime library; after the basic library file is loaded successfully, acquiring target configuration parameters corresponding to the runtime library; loading a time base system file corresponding to the time base based on the target configuration parameters; and after the loading of the library system file is successful, loading the program system file corresponding to the target program identifier. In the scheme, when the target application program meets the library loading condition, the basic library file, the library system file and the program system file are sequentially loaded, namely the runtime library is loaded before the target application program is started, so that the third-party dynamic library depended by the target application program can be ensured to normally operate, and the normal operation of the target application program is ensured.

Description

Application program loading method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for loading an application program, a computer device, and a storage medium.
Background
The current application program starting process needs to load program system files under a root directory, namely, the program system files are stored in the starting program position, and part of functions of the application program depend on a third-party dynamic library in the running process of the application program, so that the third-party dynamic library files need to be loaded when the part of functions of the application program are used. Generally, because the third-party dynamic library file is generally a file temporarily downloaded by a plug-in or in a pre-manufactured package, in order to facilitate business logic management (such as loading or cleaning management) on the third-party dynamic library file, the third-party dynamic library file needs to be stored in a non-root directory, that is, the third-party dynamic library file needs to be stored in a non-boot program position, so that the third-party dynamic library file cannot be loaded in the boot process of the application program.
When the third-party dynamic library loaded by the application program depends on the runtime library and the runtime library is not installed in the operating system, the third-party dynamic library cannot be called due to the fact that the runtime library is not installed in the operating system, so that the application program is reported by mistake and the running of the application program is influenced.
Disclosure of Invention
The embodiment of the invention provides an application program loading method, an application program loading device, computer equipment and a storage medium, and aims to solve the problem that in the running process of the existing application program, part of functions depend on an uninstalled runtime library, so that the application program is reported in error.
An application program loading method, comprising:
acquiring a program running instruction, wherein the program running instruction comprises a target program identifier;
judging whether the target application program corresponding to the target program identification meets a library loading condition;
if the time base loading condition is met, loading a basic base file corresponding to the runtime base;
after the basic library file is loaded successfully, acquiring target configuration parameters corresponding to the runtime library;
loading a runtime library system file corresponding to the runtime library based on the target configuration parameter;
and after the loading of the library system file is successful, loading the program system file corresponding to the target program identifier.
An application loading apparatus comprising:
the program operation instruction acquisition module is used for acquiring a program operation instruction, and the program operation instruction comprises a target program identifier;
the time base loading condition judging module is used for judging whether the target application program corresponding to the target program identification meets the time base loading condition or not;
the basic library file loading module is used for loading the basic library file corresponding to the runtime library if the runtime library loading condition is met;
the target configuration parameter acquisition module is used for acquiring target configuration parameters corresponding to the runtime library after the basic library file is loaded successfully;
the time base system file loading module is used for loading time base system files corresponding to the time base on the basis of the target configuration parameters;
and the program system file loading module is used for loading the program system file corresponding to the target program identifier after the time base system file is successfully loaded.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the application loading method when executing the computer program.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the above-mentioned application loading method.
According to the application program loading method, the application program loading device, the computer equipment and the storage medium, when a program running instruction corresponding to a target application program is received, whether the target application program meets a runtime library loading condition corresponding to a runtime library needs to be judged first, so that the necessity of runtime library loading is ensured; when the condition of loading the runtime library is met, loading a basic library file corresponding to the runtime library first to ensure that the runtime library loaded later can normally run; after loading the basic library file, loading a corresponding time library system file based on the target configuration parameters corresponding to the runtime library to complete the loading operation of the runtime library; and after the library system file is successfully loaded, loading a program system file corresponding to the target program to control the target application program to start running, so that the third-party dynamic library which depends on the target application program can run normally after being loaded in the running process of the target application program, the program error is avoided, and the normal running of the target application program is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of an application loading method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for loading an application program according to an embodiment of the present invention;
FIG. 3 is another flow chart of a method for application loading according to an embodiment of the invention;
FIG. 4 is another flowchart of a method for loading an application according to an embodiment of the invention;
FIG. 5 is a diagram of an application loading device according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a computing device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The application program loading method provided by the embodiment of the invention can be applied to computer equipment, and the computer equipment comprises but is not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable equipment.
In an embodiment, as shown in fig. 1, an application loading method is provided, which is described by taking the computer device in fig. 1 as an example, and includes the following steps:
s101: acquiring a program operation instruction, wherein the program operation instruction comprises a target program identifier;
s102: judging whether a target application program corresponding to the target program identification meets a library loading condition;
s103: if the condition of loading the runtime library is met, loading a basic library file corresponding to the runtime library;
s104: after the basic library file is loaded successfully, acquiring target configuration parameters corresponding to the runtime library;
s105: loading a time base system file corresponding to the time base based on the target configuration parameters;
s106: and after the loading of the time base system file is successful, loading a program system file corresponding to the target program identifier.
The program running instruction refers to an instruction for starting the application program to run. The target program identification is an identification for uniquely identifying the target application program. The target application program is the application program which needs to be started at this time.
As an example, in step S101, the computer device may receive a program running instruction carrying a target program identifier triggered by a user, or receive a program running instruction carrying a target program identifier triggered by a timer, so as to start running of a target application program corresponding to the target program identifier.
The runtime library loading condition is a preset condition for evaluating whether the runtime library needs to be loaded, that is, whether the runtime library needs to be loaded before the target application program is started. A runtime library is a special computer program table used by a compiler to implement built-in functions of a programming language to provide runtime support for the language program, and generally includes basic input/output or memory management support.
As an example, in step S102, after receiving the program running instruction, the computer device may query, based on an object program identifier carried by the program running instruction, a program system file or other files corresponding to the object program identifier, and determine program function information corresponding to the object program identifier; then, whether a preset time base loading condition is met or not is judged based on the program function information corresponding to the target program identification, so that whether the runtime base needs to be loaded before the target application program corresponding to the target program identification is started or not is determined based on the judgment result, and the normal operation of the target application program corresponding to the target program identification is guaranteed.
The base library file corresponding to the runtime library is a system file (such as a DLL file) corresponding to a base library operated by the runtime library, that is, the base library is a premise that the runtime library can normally operate, for example, the base library file corresponding to the runtime library may be, but is not limited to, a ucrtbase. UCRtBase stands for Universal C Runtime Base. DLL uses DLL file extensions, more specifically called DLL file extensions
Figure BDA0003871335100000051
The C Runtime Library file is classified as a Win32 DLL (dynamic Link Library) file
Figure BDA0003871335100000052
Operating System, which was created by Microsoft, is one of the library files of the runtime library.
As an example, in step S103, when the target application satisfies the library-on-time loading condition, the computer device may determine that a base library file corresponding to the library-on-time needs to be preloaded when the target application loading process needs to load the library-on-time, that is, the ucrtbase. Dll library files are used as basic library files of the runtime library, even though the runtime library is stored in the same PATH as the runtime library of the target application program, the runtime library cannot be automatically loaded in the loading process, so that when it is determined that a part of function running processes of the target application program need to LOAD the runtime library, the basic library files corresponding to the runtime library are loaded first, for example, the following computer language uccrtbasemodule = loadlibrary dllpa (), c _ str (), NULL, LOAD _ WITH _ alternate _ SEARCH _ patch _ PATH can be executed; hastrustmodule = loadlibraryeexa (GetDLLPath (). C _ str (), NULL, LOAD _ WITH _ interleaved _ SEARCH _ PATH) to ensure that the runtime library loaded thereafter can function properly.
In this example, when the target application program meets the library loading condition, the computer device may determine that the runtime library needs to be loaded in the target application program loading process, may first determine whether the operating system pre-loads the basic library file corresponding to the runtime library, and if the basic library file corresponding to the runtime library is pre-loaded, directly execute the target configuration parameters corresponding to the runtime library in step S104; if the base library file corresponding to the runtime library is not loaded, step S103 is executed.
The target configuration parameters refer to configuration parameters corresponding to runtime libraries to be loaded by the target application program.
As an example, in step S104, after the base library file corresponding to the runtime library is successfully loaded, that is, under the condition that it is ensured that the subsequently loaded runtime library can normally run, the computer device may obtain the target configuration parameters corresponding to the runtime library input by the user. The target configuration parameters may be understood as parameters which are configured autonomously by a user and are used for enabling the computer device to search the runtime base and load the runtime base according to requirements.
As an example, in step S105, when receiving a target configuration parameter corresponding to the runtime library input by the user, the computer device determines a search path for searching the runtime library according to the target configuration parameter; then, searching and acquiring a time base system file corresponding to the runtime base based on the search path; and then executing the time base system file corresponding to the loaded run-time base so as to achieve the purpose of loading the run-time base.
As an example, in step S106, after the runtime system file corresponding to the runtime library is successfully loaded, that is, after it is confirmed that the runtime library required for the third-party dynamic library depended on by the target application program is successfully loaded, the computer device may load the program system file corresponding to the target application program to control the target application program corresponding to the target program identifier to complete the start operation.
In the application program loading method disclosed in this embodiment, when a program running instruction corresponding to a target application program is received, it is first determined whether the target application program meets a runtime library loading condition corresponding to a runtime library, so as to ensure the necessity of runtime library loading; when the condition of loading the runtime library is met, loading a basic library file corresponding to the runtime library first to ensure that the runtime library loaded later can normally run; after loading the basic library file, loading a corresponding time library system file based on the target configuration parameters corresponding to the runtime library to complete the loading operation of the runtime library; and after the library system file is successfully loaded, loading a program system file corresponding to the target program to control the target application program to start running, so that the third-party dynamic library which depends on the target application program can run normally after being loaded in the running process of the target application program, the program error is avoided, and the normal running of the target application program is ensured.
In an embodiment, as shown in fig. 2, the step S102 of determining whether the target application corresponding to the target program identifier satisfies the library loading condition includes:
s201: determining program function information corresponding to the target program identifier based on the target program identifier, and judging whether the program function information corresponding to the target program identifier contains third-party dependency information;
s202: if the program function information corresponding to the target program identification contains third-party dependency information, judging whether a third-party dynamic library corresponding to the third-party dependency information depends on the runtime library;
s203: if the third-party dynamic library corresponding to the third-party dependency information depends on the runtime library, the runtime library loading condition is met;
s204: and if the program function information corresponding to the target program identification does not contain third-party dependency information, or the third-party dynamic library corresponding to the third-party dependency information does not depend on the runtime library, the runtime library loading condition is not met.
The program function information is related information for enlightening all functions included in the target application program corresponding to the target program identification. The third-party dependent information is information used for identifying the third-party dependent dynamic library in the program function information, and can be a first identifier used for representing the third-party dependent dynamic library.
As an example, in step S201, after receiving the program running instruction, the computer device may query, based on an object program identifier carried in the program running instruction, a program system file or other files corresponding to the object program identifier, and determine program function information corresponding to the object program identifier; then, whether the program function information corresponding to the target program identification contains third-party dependency information is judged. For example, if the program function information includes a first identifier indicating that the third-party dynamic library needs to be relied on, it indicates that the program function information corresponding to the target program identifier includes third-party dependency information; on the contrary, if the program function information does not include the first identifier representing that the third-party dynamic library needs to be relied on, it is indicated that the program function information corresponding to the target program identifier does not include the third-party dependency information.
As an example, in step S202, when the program function information corresponding to the target program identifier includes third-party dependency information, the computer device may determine that at least part of the function operation of the target application program corresponding to the target program identifier needs to depend on the third-party dynamic library, and at this time, it needs to further determine whether the third-party dynamic library that depends on the computer device depends on the runtime library based on the third-party dependency information. For example, if the third-party dependency information includes a second identifier representing the runtime library that needs to be depended on, it is described that the third-party dynamic library corresponding to the third-party dependency information needs to depend on the runtime library; on the contrary, if the third-party dependency information does not include the second identifier representing that the runtime library needs to be depended on, it indicates that the third-party dynamic library corresponding to the third-party dependency information does not need to depend on the runtime library. As another example, the computer device may query whether the third party dynamic library is dependent on the runtime library using the Microsoft provided query tool Dependency Walker.
As an example, in step S203, when the third-party dynamic library corresponding to the third-party dependency information depends on the runtime library, it is described that, in the running process of the target application program, part of the functions of the computer device need to depend on the third-party dynamic library, and the running of the third-party dynamic library needs to depend on the runtime library, at this time, it may be determined that the computer device meets the preset runtime library loading condition. Generally, in order to facilitate service logic management, a third-party dynamic library file is generally stored in a non-root directory (i.e., a non-boot program location), and is not loaded when a target application program is booted, but is loaded when the function of the third-party dynamic library file is triggered, in this case, if an operating system is pre-installed with a runtime library, the third-party dynamic library file can be directly called after the third-party dynamic library is loaded; if the runtime library is not installed in the operating system, after the third-party dynamic library is loaded, the third-party dynamic library cannot be called, so that the target application program reports an error, and therefore the target application program can depend on the third-party dynamic library, and the third-party dynamic library depends on the runtime library and is determined as a preset runtime library loading condition.
As an example, in step S204, when the program function information corresponding to the target program identifier does not include the third party dependent information, the computer device may determine that the third party dynamic library is not required to be loaded during the running process of the target application program, and the possibility of loading the runtime library that the third party dynamic library depends on does not exist, and therefore, may determine that the preset time library loading condition is not satisfied. Or, when the program function information corresponding to the target program identifier includes the third-party dependency information, but the third-party dynamic library corresponding to the third-party dependency information does not depend on the runtime library, the computer device may determine that the third-party dynamic library needs to be loaded during the running process of the target application program, but the running of the third-party dynamic library does not depend on the runtime library, and thus it is not necessary to load the runtime library when the target application program is started, and therefore, it may be determined that the preset runtime library loading condition is not satisfied.
In this embodiment, whether the program function information corresponding to the target program identifier includes third-party dependency information or not is determined, and whether a third-party dynamic library corresponding to the third-party dependency information depends on the runtime library or not is determined, so as to determine whether the target application program depends on the third-party dynamic library, and the third-party dynamic library depends on the runtime library loading condition, thereby ensuring the necessity of runtime library loading.
In one embodiment, the target configuration parameters include temporal library configuration parameters and temporal library paths;
as shown in fig. 3, step S105, namely loading a runtime library system file corresponding to the runtime library based on the target configuration parameter, includes:
s301: judging whether the temporal library configuration parameters contain file loading parameters or not, and judging whether the temporal library path is an absolute path or not;
s302: if the time base configuration parameters comprise file loading parameters and the time base path is an absolute path, searching by adopting a first file searching strategy, and judging whether time base system files corresponding to the runtime base are searched;
s303: if the time base configuration parameters do not contain the file loading parameters or the time base path is not an absolute path, searching by adopting a second file searching strategy, and judging whether time base system files corresponding to the runtime base are searched;
s304: and if the time base system file corresponding to the runtime base is searched, loading the time base system file corresponding to the runtime base.
The time base configuration parameters refer to parameters required to be configured in the process of loading the time base system files corresponding to the runtime base. As an example, the temporal library configuration parameter may be, but is not limited to, a LOAD _ WITH _ ALTERED _ SEARCH _ PATH parameter that may be used to change the SEARCH policy of the temporal library system files that need to be loaded.
The runtime library path refers to a path required to be configured in the process of loading the runtime library system file corresponding to the runtime library. As an example, the temporal library path includes an absolute path and a relative path.
As an example, in step S301, after receiving two target configuration parameters, namely, a runtime configuration parameter and a runtime PATH corresponding to the runtime library, the computer device may determine whether the runtime configuration parameter includes a file loading parameter LOAD _ WITH _ updated _ SEARCH _ PATH necessary for loading the runtime library, and determine whether the runtime PATH lpfiilename is an absolute PATH, so as to determine, according to a determination result, to SEARCH the runtime system file by using a SEARCH PATH determined by a different file SEARCH policy.
As an example, in step S302, when the runtime library configuration parameter includes a file loading parameter LOAD _ width _ updated _ SEARCH _ PATH required for loading the runtime library, and the runtime library PATH lpfimeen is an absolute PATH, the computer device may perform a SEARCH process on other parameters and absolute PATHs in the target configuration parameter except for the file loading parameter LOAD _ width _ updated _ SEARCH _ PATH, by using a first file SEARCH policy set in advance, so as to determine whether a runtime library system file corresponding to the runtime library can be searched. The first file search strategy is a preset file search strategy used under the condition that the temporal library configuration parameters include file loading parameters and the temporal library path is an absolute path. For example, during loading of the runtime library by the windows operating system, when the runtime library configuration parameter includes LOAD _ WITH _ updated _ SEARCH _ PATH and the runtime library PATH lpfirneame is an absolute PATH, the first file SEARCH policy (i.e., the backup file SEARCH policy) determined by the system using the remark part may be used to find the associated executable module that the specified module causes to be loaded, i.e., the runtime library corresponding to the runtime library system file.
As an example, in step S303, in the case that the temporal library configuration parameter does not include the file loading parameter LOAD _ width _ updated _ SEARCH _ PATH necessary for loading the runtime library, or the temporal library PATH lpfimenname is a relative PATH rather than an absolute PATH, the computer device may perform a SEARCH process on the other parameters and relative PATHs in the target configuration parameter except for the file loading parameter LOAD _ width _ updated _ SEARCH _ PATH by using a preset second file SEARCH policy to determine whether the temporal library system file corresponding to the runtime library can be searched. The second file search policy is a preset file search policy used in the case that the temporal library configuration parameter does not include the file loading parameter, or the temporal library path is a relative path. For example, during loading of the runtime library by the windows operating system, when the runtime library configuration parameter does not include LOAD _ WITH _ updated _ SEARCH _ PATH and the runtime library PATH lpfirneame is a relative PATH, the second file SEARCH policy (i.e., the standard file SEARCH policy) determined by the system using the remark section may be used to find the associated executable module that the specified module caused to be loaded, i.e., the runtime library corresponding to the runtime library system file.
As an example, in step S304, after the computer device searches for the runtime library system file corresponding to the runtime library by using different file search policies, the computer device may execute an operation of loading the runtime library system file corresponding to the runtime library, so as to load the runtime library required by the third-party dynamic library depended on by the target application program for running, so as to ensure that the third-party dynamic library depended on by the target application program can run normally after being loaded in the running process of the target application program, thereby avoiding a program error and ensuring normal running of the target application program.
In this embodiment, according to two determination results, that is, whether a time base configuration parameter includes a file loading parameter and whether a time base path is an absolute path, time base system files corresponding to a time base are determined to be searched by using different file search strategies, so as to ensure the acquisition efficiency of the time base system files; after searching the runtime system file corresponding to the runtime library, loading the runtime system file corresponding to the runtime library, that is, loading the runtime library required by the third-party dynamic library depended by the target application program to operate, so as to ensure that the third-party dynamic library depended by the target application program can normally operate after being loaded in the running process of the target application program, avoid program errors, and ensure the normal operation of the target application program.
In an embodiment, in step S302, the searching is performed by using the first file search policy, and determining whether a runtime library system file corresponding to the runtime library is searched, includes:
and judging whether the time base system file corresponding to the runtime base is searched from the process current directory, the DLL file directory, the system directory, the windows directory and the environment variable directory.
As an example, when the computer device searches by using the first file search policy, the search process is as follows: (1) The method includes the steps of obtaining a process current directory by adopting but not limited to a GetCurrentDirectory () function, judging whether the process current directory searches a time base system file corresponding to a runtime base, if the time base system file corresponding to the runtime base is searched, ending a searching process, and otherwise, executing subsequent searching operation. (2) And judging whether the time base system file corresponding to the runtime base is searched from the DLL file directory, if so, ending the searching process, otherwise, executing the subsequent searching operation. (3) And judging whether the time base system file corresponding to the runtime base is searched from the system catalog, if so, ending the searching process, otherwise, executing the subsequent searching operation. (4) And judging whether the time base system file corresponding to the runtime base is searched from the windows directory, if so, ending the searching process, otherwise, executing the subsequent searching operation. (5) And judging whether the time base system file corresponding to the runtime base is searched from the environment variable directory, if so, ending the searching process, otherwise, executing the subsequent searching operation. In this example, when the first file SEARCH policy is used for searching, the library configuration parameter includes a file loading parameter LOAD _ WITH _ updated _ SEARCH _ PATH, and the library system file corresponding to the runtime library can be searched from the DLL file directory based on the file loading parameter.
In an embodiment, the step S303, that is, performing a search by using a second file search policy, and determining whether a runtime library system file corresponding to the runtime library is searched includes:
and judging whether a time base system file corresponding to the runtime base is searched from the current process directory, the system directory, the windows directory and the environment variable directory.
As an example, when the computer device searches by using the first file search policy, the search process is as follows: (1) And acquiring a process current directory by adopting a GetCurrentDirectory () function, judging whether the process current directory searches a time base system file corresponding to the runtime base, ending the searching process if the time base system file corresponding to the runtime base is searched, and otherwise, executing subsequent searching operation. (2) And judging whether the time base system file corresponding to the runtime base is searched from the system catalog, if so, ending the searching process, otherwise, executing the subsequent searching operation. (3) And judging whether the time base system file corresponding to the runtime base is searched from the windows directory, if so, ending the searching process, otherwise, executing the subsequent searching operation. (4) And judging whether the time base system file corresponding to the runtime base is searched from the environment variable directory, if so, ending the searching process, otherwise, executing the subsequent searching operation. In this example, when the second file search strategy is used for searching, the library configuration parameters do not include the file loading parameters, or the library configuration parameters do not include the file loading parameters but specify the relative paths, so that the DLL file directory cannot be used for search and rescue, and therefore, when the second file search strategy is used for searching, the DLL file directory cannot be used for searching, and only other paths can be used for searching, which is beneficial to ensuring feasibility of searching.
In an embodiment, as shown in fig. 4, step S304, namely, loading a runtime library system file corresponding to the runtime library, includes:
s401: acquiring a first storage position corresponding to a time base system file corresponding to a time base, and acquiring a second storage position corresponding to a program system file corresponding to a target program identifier;
s402: and if the first storage position and the second storage position are located under the DLL file directory of the same level, loading the time base system file corresponding to the target program identifier.
The first storage location refers to a storage location of the runtime library system file corresponding to the runtime library in the computer device. The second storage location refers to a storage location of the program system file corresponding to the target program identifier in the computer device.
As an example, in step S401, before loading the runtime library system file corresponding to the runtime library, the computer device needs to first obtain a first storage location corresponding to the runtime library system file corresponding to the runtime library, and obtain a second storage location corresponding to the program system file corresponding to the target program identifier, so as to evaluate whether the computer device is located in the DLL file directory of the same level based on the first storage location and the second storage location.
As an example, in step S402, when the first storage location and the second storage location are located in the peer DLL file directory, the computer device indicates that the runtime library system file and the target program identifier corresponding to the runtime library are located in the peer DLL file directory; the program system files corresponding to the target program identification are generally stored in the starting program position, and the time base system files and the program system files are stored in the DLL file directory of the same level, so that the time base system files corresponding to the runtime base are also stored in the starting program position.
In this embodiment, only when it is ensured that the time base system file corresponding to the runtime base and the program system file corresponding to the target program identifier are stored in the DLL file directory at the same level, that is, the time base system file corresponding to the runtime base is stored at the start program position of the target application program, the time base system file is loaded before the target application program is started, so that it is ensured that a third-party dynamic base on which the runtime base depends is loaded and then normally operates in the operation process of the target application program, thereby avoiding a program error and ensuring normal operation of the target application program.
In an embodiment, after step S401, that is, after acquiring the first storage location corresponding to the runtime system file corresponding to the runtime library and acquiring the second storage location corresponding to the program system file corresponding to the target program identifier, the application program loading method further includes:
and if the first storage position and the second storage position are not located under the DLL file directory of the same level, outputting the information of library loading failure.
In this example, when the first storage location and the second storage location are not located in the DLL file directories at the same level, the computer device indicates that the time library system file corresponding to the runtime library and the program system file corresponding to the target program identifier are not located in the DLL file directories at the same level; because the program system file corresponding to the target program identifier is generally stored in the starting program position, and the runtime system file and the program system file are not stored in the DLL file directories of the same level, it is explained that the runtime system file corresponding to the runtime library is not stored in the starting program position, therefore, when the target application program is controlled to start based on the program running instruction, the runtime system file corresponding to the runtime library cannot be loaded first before the target application program is started, and therefore, information of runtime library loading failure can be output to remind a user, the runtime library which the target application program depends on cannot be loaded when the target application program is started, a third-party dynamic library in the target application program can be relied on, and partial functions of the third-party dynamic library which depends on the runtime library cannot be normally operated.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not limit the implementation process of the embodiments of the present invention in any way.
In an embodiment, an application loading device is provided, and the application loading device corresponds to the application loading method in the above embodiments one to one. As shown in fig. 5, the application loading apparatus includes a program execution instruction obtaining module 501, a temporal library loading condition determining module 502, a base library file loading module 503, a target configuration parameter obtaining module 504, a temporal library system file loading module 505, and a program system file loading module 506. The functional modules are explained in detail as follows:
a program running instruction obtaining module 501, configured to obtain a program running instruction, where the program running instruction includes a target program identifier;
a temporal library loading condition determining module 502, configured to determine whether the target application program corresponding to the target program identifier meets a temporal library loading condition;
a basic library file loading module 503, configured to load a basic library file corresponding to the runtime library if a runtime library loading condition is met;
a target configuration parameter obtaining module 504, configured to obtain a target configuration parameter corresponding to the runtime library after the basic library file is successfully loaded;
a runtime library system file loading module 505, configured to load a runtime library system file corresponding to the runtime library based on the target configuration parameter;
and the program system file loading module 506 is configured to load the program system file corresponding to the target program identifier after the library system file is successfully loaded.
In an embodiment, the temporal library loading condition determining module 502 includes:
the third party dependence information judgment unit is used for determining program function information corresponding to the target program identification based on the target program identification and judging whether the program function information corresponding to the target program identification contains third party dependence information;
the runtime library judging unit is used for judging whether a third-party dynamic library corresponding to the third-party dependency information depends on the runtime library or not if the program function information corresponding to the target program identification contains the third-party dependency information;
the first loading condition judging unit is used for meeting the runtime library loading condition if the third-party dynamic library corresponding to the third-party dependency information depends on the runtime library;
and the second loading condition judging unit is used for not meeting the time base loading condition if the program function information corresponding to the target program identification does not contain the third party dependency information or the third party dynamic base corresponding to the third party dependency information does not depend on the runtime base.
In one embodiment, the target configuration parameters include temporal library configuration parameters and temporal library paths;
the temporal library system file loading module 505 includes:
the parameter path judging unit is used for judging whether the time base configuration parameters contain file loading parameters or not and judging whether the time base path is an absolute path or not;
the first strategy searching unit is used for searching by adopting a first file searching strategy if the time base configuration parameters comprise file loading parameters and the time base path is an absolute path, and judging whether time base system files corresponding to the time base are searched or not;
the second strategy searching unit is used for searching by adopting a second file searching strategy and judging whether a time base system file corresponding to the runtime base is searched or not if the time base configuration parameters do not contain the file loading parameters or the time base path is not an absolute path;
and the time base system file loading unit is used for loading the time base system file corresponding to the runtime base if the time base system file corresponding to the runtime base is searched.
In an embodiment, the first policy searching unit is configured to determine whether a runtime library system file corresponding to the runtime library is searched from a process current directory, a DLL file directory, a system directory, a windows directory, and an environment variable directory.
In an embodiment, the second policy searching unit is configured to determine whether a runtime library system file corresponding to the runtime library is searched from the process current directory, the system directory, the windows directory, and the environment variable directory.
In one embodiment, the temporal library system file loading unit includes:
the storage position acquisition subunit is used for acquiring a first storage position corresponding to a time base system file corresponding to the runtime base and acquiring a second storage position corresponding to a program system file corresponding to the target program identifier;
and the time base system file loading subunit is used for loading the time base system file corresponding to the target program identifier if the first storage position and the second storage position are located in the DLL file directory of the same level.
In an embodiment, the temporal library system file loading unit further includes:
and the loading failure information output subunit is used for outputting the library loading failure information when the first storage position and the second storage position are not positioned in the DLL file directory of the same level.
For specific limitations of the application loading device, reference may be made to the above limitations of the application loading method, which is not described herein again. The various modules in the application loading device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The database of the computer device is used for executing the data adopted or generated in the application program loading method process. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an application loading method.
In an embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the application loading method in the foregoing embodiments is implemented, for example, S101 to S106 shown in fig. 1, or shown in fig. 2 to fig. 4, which is not described herein again to avoid repetition. Alternatively, the functions of each module/unit in the embodiment of the application loading device are realized when the processor executes the computer program, for example, the functions of the program running instruction obtaining module 501, the temporal library loading condition judging module 502, the basic library file loading module 503, the target configuration parameter obtaining module 504, the temporal library system file loading module 505, and the program system file loading module 506 shown in fig. 5, which are not described herein again for avoiding repetition.
In an embodiment, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the application loading method in the foregoing embodiments is implemented, for example, S101 to S106 shown in fig. 1, or shown in fig. 2 to fig. 4, which is not described herein again to avoid repetition. Alternatively, the computer program, when executed by the processor, implements the functions of each module/unit in the embodiment of the application loading apparatus, for example, the functions of the program operation instruction obtaining module 501, the temporal library loading condition determining module 502, the basic library file loading module 503, the target configuration parameter obtaining module 504, the temporal library system file loading module 505, and the program system file loading module 506 shown in fig. 5, and are not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. An application program loading method, comprising:
acquiring a program running instruction, wherein the program running instruction comprises a target program identifier;
judging whether a target application program corresponding to the target program identification meets a library loading condition;
if the time base loading condition is met, loading a basic base file corresponding to the runtime base;
after the basic library file is loaded successfully, acquiring target configuration parameters corresponding to the runtime library;
loading a runtime library system file corresponding to the runtime library based on the target configuration parameter;
and after the loading of the library system file is successful, loading the program system file corresponding to the target program identifier.
2. The application program loading method according to claim 1, wherein the determining whether the target application program corresponding to the target program identifier satisfies a library-on-time loading condition includes:
determining program function information corresponding to the target program identifier based on the target program identifier, and judging whether the program function information corresponding to the target program identifier contains third-party dependence information;
if the program function information corresponding to the target program identification contains third-party dependency information, judging whether a third-party dynamic library corresponding to the third-party dependency information depends on a runtime library;
if the third-party dynamic library corresponding to the third-party dependency information depends on the runtime library, the runtime library loading condition is met;
and if the program function information corresponding to the target program identification does not contain third-party dependency information, or the third-party dynamic library corresponding to the third-party dependency information does not depend on the runtime library, the runtime library loading condition is not met.
3. The application loading method of claim 1, wherein the target configuration parameters comprise temporal library configuration parameters and temporal library paths;
the loading of the runtime library system file corresponding to the runtime library based on the target configuration parameter includes:
judging whether the time base configuration parameters contain file loading parameters or not, and judging whether the time base path is an absolute path or not;
if the time base configuration parameters comprise file loading parameters and the time base path is an absolute path, searching by adopting a first file searching strategy, and judging whether time base system files corresponding to the runtime base are searched;
if the time base configuration parameters do not contain file loading parameters or the time base path is not an absolute path, searching by adopting a second file searching strategy, and judging whether time base system files corresponding to the time base are searched or not;
and if the time base system file corresponding to the runtime base is searched, loading the time base system file corresponding to the runtime base.
4. The application program loading method according to claim 3, wherein the searching by using the first file search policy to determine whether the runtime library system file corresponding to the runtime library is searched comprises:
and judging whether the time base system file corresponding to the runtime base is searched from the process current directory, the DLL file directory, the system directory, the windows directory and the environment variable directory.
5. The application program loading method according to claim 3, wherein the searching by using the second file search policy to determine whether the runtime library system file corresponding to the runtime library is searched comprises:
and judging whether the time base system file corresponding to the runtime base is searched from the process current directory, the system directory, the windows directory and the environment variable directory.
6. The application loading method of claim 1, wherein loading the runtime library system file corresponding to the runtime library comprises:
acquiring a first storage position corresponding to a time base system file corresponding to a time base, and acquiring a second storage position corresponding to a program system file corresponding to the target program identification;
and if the first storage position and the second storage position are located under the DLL file directory of the same level, loading the time base system file corresponding to the target program identifier.
7. The method for loading an application program according to claim 6, wherein after the obtaining a first storage location corresponding to a runtime system file corresponding to a runtime library and a second storage location corresponding to a program system file corresponding to the target program identifier, the method for loading an application program further comprises:
and if the first storage position and the second storage position are not located under the DLL file directory of the same level, outputting library loading failure information.
8. An application loading apparatus, comprising:
the program running instruction acquisition module is used for acquiring a program running instruction, and the program running instruction comprises a target program identifier;
the time base loading condition judging module is used for judging whether the target application program corresponding to the target program identification meets the time base loading condition or not;
the basic library file loading module is used for loading the basic library file corresponding to the runtime library if the runtime library loading condition is met;
the target configuration parameter acquisition module is used for acquiring target configuration parameters corresponding to the runtime library after the basic library file is loaded successfully;
the time base system file loading module is used for loading time base system files corresponding to the time base on the basis of the target configuration parameters;
and the program system file loading module is used for loading the program system file corresponding to the target program identifier after the library system file is successfully loaded.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the application loading method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the application loading method according to any one of claims 1 to 7.
CN202211198130.1A 2022-09-29 2022-09-29 Application program loading method and device, computer equipment and storage medium Pending CN115454535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211198130.1A CN115454535A (en) 2022-09-29 2022-09-29 Application program loading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211198130.1A CN115454535A (en) 2022-09-29 2022-09-29 Application program loading method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115454535A true CN115454535A (en) 2022-12-09

Family

ID=84306241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211198130.1A Pending CN115454535A (en) 2022-09-29 2022-09-29 Application program loading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115454535A (en)

Similar Documents

Publication Publication Date Title
US7664923B2 (en) Method and system for updating software
CN109766124B (en) Service development method, device, computer equipment and storage medium
US7275153B2 (en) Booting and boot code update system using boot strapper code to select between a loader and a duplicate backup loader
CN110471690B (en) Loading method and device for SO file of dynamic link library and storage medium
CN112988183A (en) Program upgrading method and device, electronic equipment and storage medium
CN110618819A (en) Method and device for automatically deploying WINPE system in batches and computer equipment
CN108241516B (en) Embedded system program loading method and device, computer equipment and storage medium
CN113835713A (en) Source code package downloading method and device, computer equipment and storage medium
CN111651304A (en) Software recovery method and device based on double-core intelligent electric meter and computer equipment
CN109189499B (en) Java program management method, java program management device, computer device and storage medium
CN112199109B (en) Firmware upgrading method, device, equipment and medium
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN113094077B (en) System differential upgrading method and device, intelligent terminal and storage medium
CN111176671B (en) Method for automatically and continuously updating system, mobile terminal and storage medium
CN115454535A (en) Application program loading method and device, computer equipment and storage medium
CN115858014A (en) Application program running method, terminal device, medium and computer program product
CN113535206B (en) Multi-version code upgrading method and system
CN114356658A (en) Processing method of firmware upgrading exception, computer equipment and readable storage medium
CN112416446B (en) Linux network starting method and device based on Microsoft deployment system
CN112783866A (en) Data reading method and device, computer equipment and storage medium
CN114077458A (en) Method, device, equipment and storage medium for starting service module in application program
CN112925526B (en) Compiling method, device, equipment and medium based on Leakcanary
CN104216797A (en) Embedded system set value setting system and method and electronic device
CN117130987B (en) Flight control management method for large-scale unmanned aerial vehicle cluster
CN114610415B (en) Program starting method, system, storage medium and electronic equipment

Legal Events

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