CN111221593A - Dynamic loading method and device - Google Patents

Dynamic loading method and device Download PDF

Info

Publication number
CN111221593A
CN111221593A CN201911418902.6A CN201911418902A CN111221593A CN 111221593 A CN111221593 A CN 111221593A CN 201911418902 A CN201911418902 A CN 201911418902A CN 111221593 A CN111221593 A CN 111221593A
Authority
CN
China
Prior art keywords
determining
environment
identifier
system environment
electronic device
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
CN201911418902.6A
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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201911418902.6A priority Critical patent/CN111221593A/en
Publication of CN111221593A publication Critical patent/CN111221593A/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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

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 application discloses a dynamic loading method and a dynamic loading device. After an application program is started in electronic equipment, determining a current system environment loaded by the electronic equipment; determining a target service component which is required to be used by the application program in the current system environment in different service components which are required to be used by the application program in different system environments respectively; and loading the target service component in the application program. Through the application, the application programs which can run in each system environment do not need to be developed respectively, the application programs of versions which correspond to different system environments do not need to be developed respectively, and in the application, no matter there are several system environments, only one application program needs to be developed, so that the workload of technicians can be reduced, the labor cost is reduced, and the maintenance cost during the maintenance of the application programs is reduced.

Description

Dynamic loading method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a dynamic loading method and apparatus.
Background
Currently, many companies provide data services to a large number of users by using a backend server, and technicians of the companies need to develop an application program applied to the backend server and then provide the data services to the large number of users based on the application program.
In the process of developing the application, a plurality of stages are required, for example, a development stage before the application is online, a gray scale stage before the application is online, and a stage after the application is online.
The application program needs to be run in an online-down system environment in different stages, for example, in a development stage before the application program is online, the application program needs to be run in an online-down system environment in a grayscale stage before the application program is online, the application program needs to be run in a sandbox system environment in an online stage, and the application program needs to be run in an online-up system environment in an online stage, and then, in order to maintain an application program of the same version as that of the application program after the application program is online, a technician can test the application program online, and the online application program can be run in a stable system environment (an offline test environment).
However, when different applications are run in different system environments, service components in the applications that the applications need to use are different, for example, the sentinel fuse component and the AuthBindCheck component are not used in the applications that run in the offline system environment and the stable system environment.
Therefore, for the same application program, a technician needs to develop application programs that can run in respective system environments, that is, there are several system environments, and several versions of the application program need to be developed, which results in a large workload of the technician, high labor cost, and high maintenance cost when maintaining multiple versions of the application program.
Disclosure of Invention
In order to solve the above technical problem, the present application shows a dynamic loading method and apparatus.
In a first aspect, the present application shows a dynamic loading method applied to an electronic device, where the method includes:
after an application program is started in electronic equipment, determining a current system environment loaded by the electronic equipment;
determining a target service component which is required to be used by the application program in the current system environment in different service components which are required to be used by the application program in different system environments respectively;
and loading the target service component in the application program.
In an optional implementation, the method further includes:
acquiring an environment identifier of the current system environment;
initializing the environment identification in the business computer code of the application.
In an optional implementation manner, the determining the current system environment embarked on the electronic device includes:
acquiring a current communication identifier of the electronic equipment;
and determining the current system environment according to the communication identifier.
In an optional implementation manner, the determining the current system environment according to the communication identifier includes:
determining an environment identifier corresponding to the current communication identifier in a first corresponding relation between the communication identifier of the electronic equipment and an environment identifier of a system environment carried by the electronic equipment;
and determining the current system environment according to the environment identifier.
In an optional implementation manner, the current communication identifier of the electronic device includes a current IP address of the electronic device;
the first corresponding relationship includes: a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment;
wherein the determining the current system environment according to the communication identifier comprises:
determining the current IP address of the electronic equipment in the second corresponding relation;
determining an environment identifier corresponding to the current IP address in the second corresponding relation;
and determining the current system environment according to the environment identifier.
In an optional implementation manner, the determining the current system environment in which the electronic device is located includes:
and determining the current system environment according to the identifier in the preset file of the electronic equipment.
In an optional implementation manner, the determining, among different service components that the application program needs to use in different system environments respectively, a target service component that the application program needs to use in the current system environment includes:
acquiring an environment identifier of the current system environment;
and searching a service component corresponding to the environment identifier in a third corresponding relation between the environment identifier of the system environment and the service component required to be used by the application program, and taking the service component as the target service component.
In a second aspect, the present application shows a dynamic loading apparatus applied to an electronic device, the apparatus including:
the electronic equipment comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining the current system environment loaded by the electronic equipment after an application program is started in the electronic equipment;
the second determining module is used for determining a target service component which is required to be used by the application program in the current system environment in different service components which are required to be used by the application program in different system environments respectively;
and the loading module is used for loading the target service component in the application program.
In an optional implementation, the apparatus further comprises:
the acquisition module is used for acquiring the environment identifier of the current system environment;
an initialization module for initializing the environment identification in the business computer code of the application.
In an optional implementation manner, the first determining module includes:
the first acquisition unit is used for acquiring a current communication identifier of the electronic equipment;
a first determining unit, configured to determine the current system environment according to the communication identifier.
In an optional implementation manner, the first determining unit includes:
the first determining subunit is used for determining an environment identifier corresponding to the current communication identifier in a first corresponding relationship between the communication identifier of the electronic equipment and an environment identifier of a system environment carried by the electronic equipment;
and the second determining subunit is used for determining the current system environment according to the environment identifier.
In an optional implementation manner, the current communication identifier of the electronic device includes a current IP address of the electronic device;
the first corresponding relationship includes: a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment;
wherein the first determination unit includes:
a third determining subunit, configured to determine, in the second correspondence, a current IP address of the electronic device;
a fourth determining subunit, configured to determine, in the second correspondence, an environment identifier corresponding to the current IP address;
and the fifth determining subunit is used for determining the current system environment according to the environment identifier.
In an optional implementation manner, the first determining module includes:
and the second determining unit is used for determining the current system environment according to the identifier in the preset file of the electronic equipment.
In an optional implementation manner, the second determining module includes:
a second obtaining unit, configured to obtain an environment identifier of the current system environment;
and the searching unit is used for searching the service component corresponding to the environment identifier in a third corresponding relation between the environment identifier of the system environment and the service component required to be used by the application program, and taking the service component as the target service component.
In a third aspect, the present application shows an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the dynamic loading method of the first aspect.
In a fourth aspect, the present application illustrates a non-transitory computer-readable storage medium having instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the dynamic loading method of the first aspect.
In a fifth aspect, the present application shows a computer program product, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the dynamic loading method according to the first aspect.
The technical scheme provided by the application can comprise the following beneficial effects:
according to the application, which service components need to be used when the same application runs in which system environments can be determined in advance, so that only one application can be developed, the application does not include the service components, or at least does not include service components distinguished in different system environments, the application can be reused in different system environments, after the application is started in the electronic device, the service components need to be used by the application can be determined according to the current system environment carried by the electronic device, and then the service components need to be used are loaded in the application in real time, so that the service components need to be used in the current system environment can be loaded in the application, and the service components need not be used in the current system environment.
Therefore, through the application, the application programs which can run in each system environment do not need to be developed respectively, the application programs of versions which correspond to different system environments do not need to be developed respectively, and in the application, no matter there are several system environments, only one application program needs to be developed, so that the workload of technicians can be reduced, the labor cost is reduced, and the maintenance cost during the maintenance of the application programs is reduced.
Drawings
FIG. 1 is a flow chart of the steps of a dynamic loading method of the present application;
FIG. 2 is a block diagram of a dynamic loading apparatus according to the present application;
FIG. 3 is a block diagram of an electronic device shown in the present application;
fig. 4 is a block diagram of an electronic device shown in the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
Referring to fig. 1, a flowchart illustrating steps of a dynamic loading method according to the present application is shown, where the method is applied to an electronic device, and the method may specifically include the following steps:
in step S101, after an application is started in the electronic device, a current system environment installed in the electronic device is determined;
in this application, the system environment includes an offline system environment, a sandbox environment, an online system environment, a stable system environment (offline test environment), and the like, and of course, other system environments may be included according to actual needs, which is not limited in this application.
In one embodiment of the present application, the electronic device has a communication identifier, and the communication identifier includes an IP (Internet Protocol) address of the electronic device, a MAC (Media Access Control) address of the electronic device, an account number of a technician who logs in to the electronic device, and the like.
The communication identifier of the electronic device is related to a system environment mounted on the electronic device. For example, when different system environments are loaded on the electronic device, the communication identifiers that can be used by the electronic device are different. Therefore, the system environment mounted on the electronic equipment can be uniquely determined according to the communication identifier of the electronic equipment.
For example, a current communication identifier of the electronic device may be obtained, where the current communication identifier of the electronic device is stored in a specific directory in the electronic device, and therefore, the current communication identifier of the electronic device may be obtained from the specific directory, and then the current system environment may be determined according to the current communication identifier of the electronic device.
For example, in the present application, for any system environment, a communication identifier that can be used by the electronic device in the system environment may be determined in advance, and then the communication identifier that can be used by the electronic device in the system environment and the environment identifier of the system environment form a corresponding table entry, and are stored in a first corresponding relationship between the communication identifier of the electronic device and the environment identifier of the system environment mounted on the electronic device. The above-described operations are performed for each of the other system environments as well.
In this way, in the present application, when determining the current system environment according to the current communication identifier of the electronic device, the environment identifier corresponding to the current communication identifier of the electronic device may be determined in the first corresponding relationship between the communication identifier of the electronic device and the environment identifier of the system environment mounted on the electronic device, and then the current system environment mounted on the electronic device may be determined according to the environment identifier.
In one example, the current communication identification of the electronic device includes a current IP address of the electronic device; as such, the first correspondence may include: and a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment.
For example, in the present application, for any system environment, an IP address field that can be used by the electronic device in the system environment may be determined in advance, and then the IP address field that can be used in the system environment and the environment identifier of the system environment form a corresponding table entry, and are stored in a second corresponding relationship between the IP address field of the electronic device and the environment identifier of the system environment mounted on the electronic device. The above-described operations are performed for each of the other system environments as well.
In this way, when determining the current system environment mounted on the electronic device according to the communication identifier of the electronic device, the method may include: and determining the IP address field of the current IP address of the electronic equipment in a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment, then determining the environment identifier corresponding to the IP address field in the second corresponding relation, and then determining the current system environment carried by the electronic equipment according to the environment identifier.
In another embodiment of the present application, the electronic device may be one, the electronic device stores system files of a plurality of system environments, the electronic device may be configured to mount any one of the plurality of system environments, and when an application needs to be used in any one of the system environments, the electronic device may first mount the system environment and then start the application on the electronic device. When the system environment is loaded in the electronic device, a technician can input an environment identifier of the system environment on the electronic device, then the electronic device receives the environment identifier of the system environment input by the technician, can acquire a system file of the system environment according to the environment identifier, and runs the system file on the electronic device, so that the system environment is loaded in the electronic device, and after the system environment is loaded in the electronic device, the environment identifier can be stored in a preset file in the electronic device to identify which system environment is currently loaded in the electronic device.
In an embodiment of the present application, the electronic device may be multiple electronic devices, different system environments are already installed on different electronic devices, and an environment identifier of the installed system environment is stored in a preset file in each electronic device. When it is necessary to use an application in any system environment, the application may be started in the electronic device in which the system environment is installed. And the preset file in each electronic device stores the environment identifier of the system environment carried by each electronic device, so as to identify which system environment is carried by each electronic device.
Therefore, in the present application, the current system environment may be determined according to an identifier in a preset file of the electronic device, for example, the identifier in the preset file of the electronic device is obtained, where the identifier is an environment identifier, and then the system environment corresponding to the environment identifier may be used as the current system environment of the electronic device.
In step S102, in different service components that the application program needs to use in different system environments, a target service component that the application program needs to use in the current system environment is determined;
in the application, for any one system environment, a service component that needs to be used by an application program when the application program is run in the system environment can be determined in advance in a plurality of service components, then a corresponding entry is formed by an environment identifier of the system environment and the service component that needs to be used by the application program when the application program is run in the system environment, and the corresponding entry is stored in a third corresponding relationship between the environment identifier of the system environment and the service component that needs to be used by the application program. The above-described operations are performed for each of the other system environments as well.
Thus, in the present application, the environment identifier of the current system environment may be obtained, for example, the environment identifier of the current system environment is obtained through at least two ways in step S101, then the service component corresponding to the environment identifier of the current system environment may be searched in the third corresponding relationship between the environment identifier of the system environment and the service component that needs to be used by the application program, and the service component may be used as the target service component that needs to be used by the application program in the current system environment, and then step S103 is executed.
In step S103, the target service component is loaded in the application.
In the present application, the application program has some other function modules besides the service component, the function modules also need to be reused in different system environments, and the function modules sometimes need to call the loaded service component, so as to make the function modules in the application program definitely call which function modules, the environment identifier of the current system environment may be obtained, and the environment identifier is initialized in the business computer code of the application program, for example, multiple environment enumerations may be defined in the business computer code of the application program in advance as global variables. Thus, in the present application, the global variable of multi-environment enumeration may be assigned and assigned as the environment identifier of the current system environment, thereby initializing the environment identifier in the business computer code of the application program. The service computer code includes codes of these functional modules, and the like. Thus, the service computer code can determine which function modules can be invoked based on the environment identifier, thereby sequentially executing the service.
According to the application, which service components need to be used when the same application runs in which system environments can be determined in advance, so that only one application can be developed, the application does not include the service components, or at least does not include service components distinguished in different system environments, the application can be reused in different system environments, after the application is started in the electronic device, the service components need to be used by the application can be determined according to the current system environment carried by the electronic device, and then the service components need to be used are loaded in the application in real time, so that the service components need to be used in the current system environment can be loaded in the application, and the service components need not be used in the current system environment.
Therefore, through the application, the application programs which can run in each system environment do not need to be developed respectively, the application programs of versions which correspond to different system environments do not need to be developed respectively, and in the application, no matter there are several system environments, only one application program needs to be developed, so that the workload of technicians can be reduced, the labor cost is reduced, and the maintenance cost during the maintenance of the application programs is reduced.
It is noted that, for simplicity of explanation, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are exemplary and that no action is necessarily required in this application.
Referring to fig. 2, a block diagram of a dynamic loading apparatus according to the present application is shown, where the apparatus may specifically include the following modules:
the system comprises a first determining module 11, a second determining module, a first processing module and a second processing module, wherein the first determining module is used for determining the current system environment loaded by the electronic equipment after an application program is started in the electronic equipment;
a second determining module 12, configured to determine, in different service components that the application program needs to use in different system environments respectively, a target service component that the application program needs to use in the current system environment;
and the loading module 13 is configured to load the target service component in the application program.
In an optional implementation, the apparatus further comprises:
the acquisition module is used for acquiring the environment identifier of the current system environment;
an initialization module for initializing the environment identification in the business computer code of the application.
In an optional implementation manner, the first determining module includes:
the first acquisition unit is used for acquiring a current communication identifier of the electronic equipment;
a first determining unit, configured to determine the current system environment according to the communication identifier.
In an optional implementation manner, the first determining unit includes:
the first determining subunit is used for determining an environment identifier corresponding to the current communication identifier in a first corresponding relationship between the communication identifier of the electronic equipment and an environment identifier of a system environment carried by the electronic equipment;
and the second determining subunit is used for determining the current system environment according to the environment identifier.
In an optional implementation manner, the current communication identifier of the electronic device includes a current IP address of the electronic device;
the first corresponding relationship includes: a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment;
wherein the first determination unit includes:
a third determining subunit, configured to determine, in the second correspondence, a current IP address of the electronic device;
a fourth determining subunit, configured to determine, in the second correspondence, an environment identifier corresponding to the current IP address;
and the fifth determining subunit is used for determining the current system environment according to the environment identifier.
In an optional implementation manner, the first determining module includes:
and the second determining unit is used for determining the current system environment according to the identifier in the preset file of the electronic equipment.
In an optional implementation manner, the second determining module includes:
a second obtaining unit, configured to obtain an environment identifier of the current system environment;
and the searching unit is used for searching the service component corresponding to the environment identifier in a third corresponding relation between the environment identifier of the system environment and the service component required to be used by the application program, and taking the service component as the target service component.
According to the application, which service components need to be used when the same application runs in which system environments can be determined in advance, so that only one application can be developed, the application does not include the service components, or at least does not include service components distinguished in different system environments, the application can be reused in different system environments, after the application is started in the electronic device, the service components need to be used by the application can be determined according to the current system environment carried by the electronic device, and then the service components need to be used are loaded in the application in real time, so that the service components need to be used in the current system environment can be loaded in the application, and the service components need not be used in the current system environment.
Therefore, through the application, the application programs which can run in each system environment do not need to be developed respectively, the application programs of versions which correspond to different system environments do not need to be developed respectively, and in the application, no matter there are several system environments, only one application program needs to be developed, so that the workload of technicians can be reduced, the labor cost is reduced, and the maintenance cost during the maintenance of the application programs is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Fig. 3 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 3, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, images, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the electronic device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 4 is a block diagram of an electronic device 1900 shown in the present application. For example, the electronic device 1900 may be provided as a server.
Referring to fig. 4, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable dynamic loading terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable dynamic loading terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable dynamic loading terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable dynamic loading terminal device to cause a series of operational steps to be performed on the computer or other programmable terminal device to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is given to a dynamic loading method and apparatus provided by the present application, and a specific example is applied in the detailed description to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (16)

1. A dynamic loading method is applied to an electronic device, and the method comprises the following steps:
after an application program is started in electronic equipment, determining a current system environment loaded by the electronic equipment;
determining a target service component which is required to be used by the application program in the current system environment in different service components which are required to be used by the application program in different system environments respectively;
and loading the target service component in the application program.
2. The method of claim 1, further comprising:
acquiring an environment identifier of the current system environment;
initializing the environment identification in the business computer code of the application.
3. The method of claim 1, wherein the determining the current system environment hosted by the electronic device comprises:
acquiring a current communication identifier of the electronic equipment;
and determining the current system environment according to the communication identifier.
4. The method of claim 3, wherein said determining the current system environment based on the communication identifier comprises:
determining an environment identifier corresponding to the current communication identifier in a first corresponding relation between the communication identifier of the electronic equipment and an environment identifier of a system environment carried by the electronic equipment;
and determining the current system environment according to the environment identifier.
5. The method of claim 4, wherein the current communication identification of the electronic device comprises a current internet protocol, IP, address of the electronic device;
the first corresponding relationship includes: a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment;
wherein the determining the current system environment according to the communication identifier comprises:
determining the current IP address of the electronic equipment in the second corresponding relation;
determining an environment identifier corresponding to the current IP address in the second corresponding relation;
and determining the current system environment according to the environment identifier.
6. The method of claim 1, wherein determining the current system environment in which the electronic device is located comprises:
and determining the current system environment according to the identifier in the preset file of the electronic equipment.
7. The method according to claim 1, wherein the determining the target service component that the application needs to use in the current system environment, among the different service components that the application needs to use in different system environments respectively, comprises:
acquiring an environment identifier of the current system environment;
and searching a service component corresponding to the environment identifier in a third corresponding relation between the environment identifier of the system environment and the service component required to be used by the application program, and taking the service component as the target service component.
8. A dynamic loading device applied to an electronic device, the device comprising:
the electronic equipment comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining the current system environment loaded by the electronic equipment after an application program is started in the electronic equipment;
the second determining module is used for determining a target service component which is required to be used by the application program in the current system environment in different service components which are required to be used by the application program in different system environments respectively;
and the loading module is used for loading the target service component in the application program.
9. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring the environment identifier of the current system environment;
an initialization module for initializing the environment identification in the business computer code of the application.
10. The apparatus of claim 8, wherein the first determining module comprises:
the first acquisition unit is used for acquiring a current communication identifier of the electronic equipment;
a first determining unit, configured to determine the current system environment according to the communication identifier.
11. The apparatus of claim 10, wherein the first determining unit comprises:
the first determining subunit is used for determining an environment identifier corresponding to the current communication identifier in a first corresponding relationship between the communication identifier of the electronic equipment and an environment identifier of a system environment carried by the electronic equipment;
and the second determining subunit is used for determining the current system environment according to the environment identifier.
12. The apparatus of claim 11, wherein the current communication identification of the electronic device comprises a current internet protocol, IP, address of the electronic device;
the first corresponding relationship includes: a second corresponding relation between the IP address field of the electronic equipment and the environment identifier of the system environment carried by the electronic equipment;
wherein the first determination unit includes:
a third determining subunit, configured to determine, in the second correspondence, a current IP address of the electronic device;
a fourth determining subunit, configured to determine, in the second correspondence, an environment identifier corresponding to the current IP address;
and the fifth determining subunit is used for determining the current system environment according to the environment identifier.
13. The apparatus of claim 8, wherein the first determining module comprises:
and the second determining unit is used for determining the current system environment according to the identifier in the preset file of the electronic equipment.
14. The apparatus of claim 8, wherein the second determining module comprises:
a second obtaining unit, configured to obtain an environment identifier of the current system environment;
and the searching unit is used for searching the service component corresponding to the environment identifier in a third corresponding relation between the environment identifier of the system environment and the service component required to be used by the application program, and taking the service component as the target service component.
15. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the dynamic loading method of any of claims 1-7.
16. A non-transitory computer readable storage medium, instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the dynamic loading method of any of claims 1-7.
CN201911418902.6A 2019-12-31 2019-12-31 Dynamic loading method and device Pending CN111221593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911418902.6A CN111221593A (en) 2019-12-31 2019-12-31 Dynamic loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911418902.6A CN111221593A (en) 2019-12-31 2019-12-31 Dynamic loading method and device

Publications (1)

Publication Number Publication Date
CN111221593A true CN111221593A (en) 2020-06-02

Family

ID=70832815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911418902.6A Pending CN111221593A (en) 2019-12-31 2019-12-31 Dynamic loading method and device

Country Status (1)

Country Link
CN (1) CN111221593A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434196A (en) * 2021-06-29 2021-09-24 北京房江湖科技有限公司 Method and device for managing application program
CN113468064A (en) * 2021-07-19 2021-10-01 京东科技控股股份有限公司 Gray scale testing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008134914A (en) * 2006-11-29 2008-06-12 Nippon Telegr & Teleph Corp <Ntt> Composite service providing system and method
CN106990960A (en) * 2017-03-28 2017-07-28 阿里巴巴集团控股有限公司 Code dispositions method and device
CN107168726A (en) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 A kind of method and apparatus of dynamic configuration application program
CN110413288A (en) * 2019-07-31 2019-11-05 新华三大数据技术有限公司 Using dispositions method, device, server and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008134914A (en) * 2006-11-29 2008-06-12 Nippon Telegr & Teleph Corp <Ntt> Composite service providing system and method
CN106990960A (en) * 2017-03-28 2017-07-28 阿里巴巴集团控股有限公司 Code dispositions method and device
CN107168726A (en) * 2017-03-30 2017-09-15 武汉斗鱼网络科技有限公司 A kind of method and apparatus of dynamic configuration application program
CN110413288A (en) * 2019-07-31 2019-11-05 新华三大数据技术有限公司 Using dispositions method, device, server and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434196A (en) * 2021-06-29 2021-09-24 北京房江湖科技有限公司 Method and device for managing application program
CN113468064A (en) * 2021-07-19 2021-10-01 京东科技控股股份有限公司 Gray scale testing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108764003B (en) Picture identification method and device
CN109814942B (en) Parameter processing method and device
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN111190710A (en) Task allocation method and device
CN111221593A (en) Dynamic loading method and device
CN108737588B (en) Domain name resolution method and device
CN110221813B (en) Application data connection establishment method and device, storage medium and electronic equipment
CN110213062B (en) Method and device for processing message
CN111695064A (en) Embedded point loading method and device
CN110457084B (en) Loading method and device
CN106354595B (en) Mobile terminal, hardware component state detection method and device
CN110989987B (en) Portal webpage generation method and device, client, server and storage medium
CN110689377B (en) Data detection method and device and electronic equipment
CN107193622B (en) Code compiling processing method and device and terminal
CN113407879A (en) Data reporting method, device and readable medium
CN111597106A (en) Point burying management method and device
CN105892832B (en) Method and device for displaying display information
CN112214252A (en) Information expansion method and device and electronic equipment
CN110995767B (en) Request processing method and device
CN110928595A (en) Permission operation method and device
CN107992333B (en) Theme acquisition method and device
CN107463414B (en) Application installation method and device
CN114020504B (en) Data processing method and device, electronic equipment and storage medium
CN114416218B (en) Data processing method and device, electronic equipment and storage medium
CN111596949B (en) Method and device for developing application program

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