CN112035180A - Automatic instance loading method and device, electronic equipment and storage medium - Google Patents

Automatic instance loading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112035180A
CN112035180A CN202010846095.4A CN202010846095A CN112035180A CN 112035180 A CN112035180 A CN 112035180A CN 202010846095 A CN202010846095 A CN 202010846095A CN 112035180 A CN112035180 A CN 112035180A
Authority
CN
China
Prior art keywords
module
dependency relationship
declaration
instance
functional
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
CN202010846095.4A
Other languages
Chinese (zh)
Inventor
王亮
张志华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Urban Network Neighbor Information Technology Co Ltd
Original Assignee
Beijing Urban Network Neighbor Information 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 Beijing Urban Network Neighbor Information Technology Co Ltd filed Critical Beijing Urban Network Neighbor Information Technology Co Ltd
Priority to CN202010846095.4A priority Critical patent/CN112035180A/en
Publication of CN112035180A publication Critical patent/CN112035180A/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 invention provides an automatic instance loading method and device, electronic equipment and storage equipment, and relates to the technical field of software development. The method comprises the following steps: determining a dependency corresponding to a functional module in a target application; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the relationship, wherein the storage position of the module instance is associated with the relationship. Therefore, the problems of complex software development and high system coupling degree caused by the fact that the dependency relationship of the business modules cannot be managed in the related technology can be solved.

Description

Automatic instance loading method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of software development, in particular to an automatic instance loading method and device, electronic equipment and a storage medium.
Background
In a mainstream JavaScript web frame (JS web frame, such as koa, express and the like), in order to ensure the simplification and high efficiency of a frame core, other dependence management modes are not introduced outside the node _ modules. While node _ modules are more heavily focused on managing external dependencies than on business modules.
In the process of implementing the invention, the applicant finds that at least the following problems exist in the related art:
in the development process of software, the dependency relationship of the service module cannot be managed, and further, the resources of the module of the software cannot be uniformly managed, so that the development of the software is complicated, and the subsequent maintenance is not facilitated.
In order to solve the above problems, no effective technical means has been proposed. .
Disclosure of Invention
The embodiment of the invention provides an automatic instance loading method and device, electronic equipment and a storage medium, and aims to solve the problems that the dependency relationship of a service module cannot be managed in the related art, so that software development is complicated, and the system coupling degree is high.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an automated instance loading method, where the method includes: determining a dependency corresponding to a functional module in a target application; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship.
Further, before determining the dependency corresponding to the functional module in the target application, the method further includes: and adding a declaration mark and a dependency relationship mark in a class corresponding to the functional module, wherein the declaration mark is used for indicating that the functional module is a depended module, and the dependency relationship mark is used for indicating the dependency relationship of the functional module.
Further, before instantiating the functional module, the method further includes: when the target application is started, acquiring the statement and the dependency relationship of the functional module; judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating the dependency relationship with the functional modules are effective; when the declaration format of the declaration does not conform to the preset declaration format or other functional modules forming the dependency relationship with the functional modules are invalid, performing exception prompt; and instantiating the functional module under the condition that the declaration format of the declaration conforms to a preset declaration format and other functional modules forming the dependency relationship with the functional module are effective.
Further, storing the module instance in a preset database according to the dependency relationship includes: determining a key code value corresponding to the dependency relationship; and storing the module instance into the preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
Further, after storing the module instance in a preset database according to the dependency relationship, the method includes: and under the condition that the module to which the application program interface called by the target application currently belongs does not comprise the statement, continuing to execute the current business of the target application. And under the condition that the module to which the application program interface currently called by the target application belongs comprises the statement, calling a module instance corresponding to the module in the preset database based on the dependency relationship corresponding to the module.
In a second aspect, an embodiment of the present invention further provides an automated instance loading apparatus, including: the determining unit is used for determining the dependency corresponding to the functional module in the target application; the processing unit is used for instantiating the functional module to obtain a module instance corresponding to the functional module; and the storage unit is used for storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship.
Further, still include: the system comprises a declaration unit and a dependency relationship flag, wherein the declaration flag is used for indicating that a functional module is a depended module, and the dependency relationship flag is used for indicating the dependency relationship of the functional module.
Further, still include: an obtaining unit, configured to obtain the declaration and the dependency relationship of the functional module when the target application is started; the judging unit is used for judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating the dependency relationship with the functional modules are effective or not; the prompting unit is used for performing exception prompting under the condition that the declaration format of the declaration does not conform to the preset declaration format or other functional modules forming the dependency relationship with the functional module are invalid; the processing unit is further configured to instantiate the functional module under the condition that the declaration format of the declaration conforms to a preset declaration format and other functional modules forming the dependency relationship with the functional module are valid.
Further, the storage unit includes: the first storage module is used for determining a key value corresponding to the dependency relationship; and the second storage module is used for storing the module instance into the preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
Further, still include: and the first execution unit is used for continuously executing the current service of the target application under the condition that the module to which the application program interface called by the target application currently belongs does not comprise the statement. And the second execution unit is used for calling a module instance corresponding to the module in the preset database based on the dependency relationship corresponding to the module under the condition that the module to which the application program interface currently called by the target application belongs comprises the statement.
In a third aspect, an embodiment of the present invention additionally provides an electronic device, including: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the automated instance loading method as described in the preceding first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the automated instance loading method according to the first aspect.
In the embodiment of the invention, the dependency corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship. The management of the dependency relationship of the functional modules can be realized, so that the unified management of module instance resources is realized, the software development complexity is simplified, and the system coupling degree of the software is reduced. The problems that the dependency relationship of the service modules cannot be managed in the related technology, software development is complicated, and the system coupling degree is high are solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings 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 following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without inventive labor.
FIG. 1 is a flow chart of the steps of an automated instance loading method in an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of a method for loading an automated instance according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a cheating detection apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure of an electronic device in the embodiment of the present 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
In introducing the method for loading an automation instance provided by the embodiment of the present invention, first, a dependency relationship between modules in a project is described:
in the related art, in order to improve development efficiency, a module of an existing large project is generally divided, so that a plurality of developers work separately and cooperate to complete a large and striking development. Because each divided module is a component of the large project, the modules are matched with each other to ensure the normal work of the large project. As described above, a plurality of modules divided from a project often have a certain dependency relationship therebetween.
In a software engineering object model, a dependency relationship generally describes a semantic connection relationship between two model elements (class, use case, instance), where one model element is independent and the other model element is not independent, it depends on the independent model element, and if the independent model element changes, the model element dependent on it will be affected.
For example: a class uses objects of another class as parameters for operations, a class uses objects of another class as its data members, a class sends messages to another class, etc., there are dependencies between such two classes. In the class diagram, two classes of dependency relationship may be connected by a line with an arrow, the arrow points to an independent class, and a class label may be added to the line to specify the type of dependency, and the like.
Therefore, in the present invention, the above dependency relationship may refer to that the module a directly or indirectly refers to or contains the module B in the item, and it may be said that the item has a relationship that the module a depends on the module B.
Referring to FIG. 1, a flowchart illustrating steps of an automated instance loading method in an embodiment of the invention is shown.
Step 101, determining a dependency corresponding to a functional module in a target application.
Specifically, after the target application is started, the dependency corresponding to the functional module is dynamically acquired during running through a reflection mechanism. The dependency relationship of the functional module includes a dependency relationship corresponding to the functional module and other functional modules.
It should be noted that, in this embodiment, the function module is a module in a project, can provide a corresponding application program interface, and is not limited to only a service module having a certain type of function. In the process of encoding the item to which the target application belongs, declaring a class corresponding to a module in the item and declaring a dependency relationship, for example, adding an import tag in front of the class.
Step 102, instantiating the function module to obtain a module instance corresponding to the function module.
And 103, storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance corresponds to the dependency relationship.
Specifically, in this embodiment, a function module with a declaration is instantiated through a target application, a module instance corresponding to the function module is obtained after the function module is instantiated, and then the module instance is stored according to a dependency relationship, where the module instance may also be a module object corresponding to the function module. And taking the dependency corresponding to the module as a key, and taking the module instance as a value to store in a preset database ResourceMap. The dependency relationship of the functional module in the preset database ResourceMap and the module instance are in a mapping relationship, and the module instance corresponding to the functional module can be inquired and obtained in the ResourceMap through the key of the dependency relationship.
It should be noted that, with the above embodiment, the dependency relationship corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance corresponds to the dependency relationship. The management of the dependency relationship of the functional modules can be realized, so that the unified management of module instance resources is realized, the software development complexity is simplified, and the system coupling degree of the software is reduced. The problems that the dependency relationship of the service modules cannot be managed in the related technology, software development is complicated, and the system coupling degree is high are solved.
As an optional technical solution in this embodiment, before determining the dependency relationship corresponding to the functional module in the target application, the method further includes, but is not limited to: and adding a declaration mark and a dependency relationship mark in a class corresponding to the functional module, wherein the declaration mark is used for indicating that the functional module is a depended module, and the dependency relationship mark is used for indicating the dependency relationship of the functional module.
Specifically, in this embodiment, a function module is declared quickly by a declaration decorator in the item encoder, or a function module is declared by a high-order function, and the declaration flag is used to indicate that the function module is a dependeble module, which may also be referred to as an applicable module; and then declaring the dependency relationship by a declaration mark, wherein the dependency relationship is quickly declared through a citation decorator in the project encoder or through a high-order function. Further, in the process of encoding the item to which the target application belongs, declaring a class in the item, for example, adding an import tag in front of the class or adding a Tip tag to the function module. In addition, the objects or the instances corresponding to the function modules in the preset database are initialized.
As an optional technical solution in this embodiment, before instantiating the functional module, the method further includes, but is not limited to: when the target application is started, acquiring the statement and the dependency relationship of the functional module; judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating dependency relationship with the functional modules are effective; when the declared statement format does not conform to the preset statement format or other functional modules forming a dependency relationship with the functional module are invalid, performing exception prompt; and instantiating the functional module under the condition that the declared declaration format conforms to the preset declaration format and other functional modules forming the dependency relationship with the functional module are effective.
Specifically, after the functional module with the declaration tag and the dependency relationship tag is obtained, the declaration format of the declaration of the functional module is checked, and whether the declaration format meets the preset declaration format is judged. Matching other functional modules in the dependency relationship of the functional modules with the actual functional modules of the application, and if the other functional modules cannot be matched, determining that invalid other functional modules exist, and performing exception prompt; and if the matching is successful, instantiating the functional module and performing a storage process of the module instance of the functional module.
As an optional technical solution in this embodiment, the module instance is stored in a preset database according to the dependency relationship, which includes but is not limited to: determining a key code value corresponding to the dependency relationship; and storing the module instance into a preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
Specifically, the function module is instantiated to obtain a module instance or a module instance of the function module. And then, taking the dependency relationship of the functional module as an index, wherein the value of the index is a key code value corresponding to the dependency relationship. And storing the module instance into a preset database according to the position corresponding to the key code value. The key values include codes of dependency relationships and codes of other function modules, for example, when the dependency relationship between the function module a and the function module B is a reference relationship, the code corresponding to the function module a is a10, the code corresponding to the function module B is B10, and the code of the reference relationship is F, the key value is a10B10F, and the storage locations of the instances of the function modules may be associated together based on the key value of a10B 10F.
In one example, the key value is a Hash key value in a Hash Table (Hash Table), the database is a ResourceMap, and the dependency relationship of the function module is taken as a key, and the module object or the module instance of the function module is saved in the ResourceMap object as a ResourceMap median value.
In a preferred technical solution, the module instance is stored in a manner of nesting other databases in a preset database, for example, a first ResourceMap is established based on the function module a, where a corresponding second ResourceMap is established in the first ResourceMap based on a dependency relationship, and the second ResourceMap is used to store other function modules corresponding to a certain type of dependency relationship of the function module a, for example, other function modules in a quoting ResourceMap, all of which form a quoting relationship with the function module.
As an optional technical solution in this embodiment, after storing the module instance in the preset database according to the dependency relationship, the method includes: and under the condition that the module to which the application program interface called by the target application currently belongs does not comprise the statement, continuing to execute the current business of the target application. And under the condition that the module to which the application program interface called currently by the target application belongs comprises a statement, calling the module instance corresponding to the module in a preset database based on the dependency relationship corresponding to the module.
Specifically, in this embodiment, when an Application Programming Interface (API) provided by the target function module needs to be called in the process of executing the service logic by the target Application, a call request is generated, where the call request is used to call a module instance or a module object corresponding to the target function module, so as to request to call the API corresponding to the target function module, and then, based on the key code value corresponding to the dependency relationship, the corresponding module instance or module object is called in the preset database based on the key code value.
Preferably, in the embodiment, in the application execution process, it is determined whether a function module corresponding to the API called by the application includes a statement of a dependency relationship, that is, whether the application needs to refer to a module instance in the preset database. And if the functional module does not contain the statement, continuing to execute the current business of the target application based on the business logic of the application. And if the functional module contains the statement of the dependency relationship, calling the module instance stored in the preset database based on the dependency relationship of the target application.
In one example, when the target application executes the service logic, for example, when a certain request is processed, and when the API provided by another function module needs to be used for performing the service logic operation, the target application accesses the module instance corresponding to the function module from the ResourceMap object through the key corresponding to the dependency relationship, so that the API provided by the function module is used to realize quick access to the function module, and the performance of the target application is improved.
According to the embodiment of the invention, the dependency corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship. Unified management of module instance resources can be achieved.
On the other hand, the dependency relationship between the abstract function modules of the embodiment realizes the loose coupling of the target application. The function module (relying party) which is depended on (such as a reference relation) is not influenced when being changed, and the relying party does not need to modify any code.
On the other hand, the embodiment can realize quick access to the module instance corresponding to the functional module based on the dependency relationship, thereby avoiding the overhead of repeatedly instantiating the module and effectively improving the performance of the application.
In addition, whether the function module corresponding to the API called by the target application contains the statement or not is judged, so that the influence of resource configuration and system service on the application service is shielded, and each module in the application is concentrated on realizing the service logic corresponding to the module.
Example two
The embodiment of the invention provides an automatic instance loading method.
Referring to fig. 2, fig. 2 is a flowchart illustrating specific steps of an automated instance loading method according to an embodiment of the present invention, which may specifically include the following steps:
step 201, declaring the function module.
Specifically, the function module is declared quickly through a declaration decorator, or the module is declared through a high-order function; the dependencies are declared quickly by a reference decorator or by a higher order function. It should be noted that the declaration of the functional module includes declaration dependencies.
Step 202, loading the function module, and obtaining the declaration and dependency relationship of the function module.
Specifically, after the application is started, the declaration and the dependency relationship of the functional module are dynamically acquired during the application running through a reflection mechanism, and a ResourceMap object is initialized.
Step 203, judging whether the declaration and the dependency relationship of the functional module meet the preset conditions.
Specifically, after obtaining the declaration and the dependent function modules, the loader of the application checks whether the declaration format in the declaration of the function modules conforms to the preset declaration format, and whether other function modules in the dependency relationship are matched with the function modules in the application one by one. If not, jumping to step 204; if so, go to step 205.
And step 204, throwing the abnormity to carry out abnormity prompting.
Step 205, instantiating the function module and storing the module instance corresponding to the function module.
Specifically, the declaration format of the function module conforms to the preset declaration format, and the module is instantiated under the condition that other function modules in the dependency relationship are all valid, so that a corresponding module instance is obtained. And taking the dependency relationship as a key, and saving the module instance as a value in a ResourceMap object.
And step 206, judging whether a module corresponding to the API called by the application has a statement.
Specifically, if not, go to step 207; if so, go to step 208.
Step 207, the current service of the application is continuously executed.
The module instance is accessed based on the dependency, step 208.
Specifically, the application directly accesses the module instance corresponding to the key in the ResourceMap from the key in the ResourceMap through the key of the dependency relationship, so as to use the API provided by the function module.
Through the embodiment, the dependency corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship.
Through the embodiment, the dependency corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship. The management of the dependency relationship of the functional modules can be realized, so that the unified management of module instance resources is realized, the software development complexity is simplified, and the system coupling degree of the software is reduced. The problems that the dependency relationship of the service modules cannot be managed in the related technology, software development is complicated, and the system coupling degree is high are solved.
EXAMPLE III
An automated instance loading apparatus provided by an embodiment of the present invention is described in detail.
Referring to fig. 3, a schematic structural diagram of an automated case loading apparatus according to an embodiment of the present invention is shown. The device may specifically comprise the following structure:
1) a determining unit 30, configured to determine a dependency relationship corresponding to a functional module in a target application;
2) the processing unit 32 is configured to instantiate the functional module to obtain a module instance corresponding to the functional module;
3) the storage unit 34 is configured to store the module instance into a preset database according to the dependency relationship, where a storage location of the module instance is associated with the dependency relationship.
Optionally, in this embodiment, the method further includes:
1) the system comprises a declaration unit and a dependency relationship flag, wherein the declaration flag is used for indicating that a functional module is a depended module, and the dependency relationship flag is used for indicating the dependency relationship of the functional module.
Optionally, in this embodiment, the method further includes:
1) an obtaining unit, configured to obtain the declaration and the dependency relationship of the functional module when the target application is started;
2) the judging unit is used for judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating the dependency relationship with the functional modules are effective or not;
3) the prompting unit is used for performing exception prompting under the condition that the declaration format of the declaration does not conform to the preset declaration format or other functional modules forming the dependency relationship with the functional module are invalid;
4) the processing unit 32 is further configured to instantiate the functional module under the condition that the declaration format of the declaration conforms to a preset declaration format and other functional modules forming the dependency relationship with the functional module are valid.
Optionally, in this embodiment, the storage unit 34 includes:
1) the first storage module is used for determining a key value corresponding to the dependency relationship;
2) and the second storage module is used for storing the module instance into the preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
Optionally, in this embodiment, the method further includes:
1) and the first execution unit is used for continuously executing the current service of the target application under the condition that the module to which the application program interface called by the target application currently belongs does not comprise the statement.
2) And the second execution unit is used for calling a module instance corresponding to the module in the preset database based on the dependency relationship corresponding to the module under the condition that the module to which the application program interface currently called by the target application belongs comprises the statement.
Through the embodiment, the dependency corresponding to the functional module in the target application is determined; instantiating the functional module to obtain a module instance corresponding to the functional module; and storing the module instance into a preset database according to the relationship, wherein the storage position of the module instance is associated with the relationship. The problems that the dependency relationship of the service modules cannot be managed in the related technology, software development is complicated, and the system coupling degree is high are solved.
Example four
Fig. 4 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.
Referring to fig. 4, the electronic device 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power supply 411. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 410; in addition, the uplink data is transmitted to the base station. Typically, radio unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio unit 401 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 402, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output related to a specific function performed by the electronic apparatus 400 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive audio or video signals. The input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphic processor 4041 may be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound, and may be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 401 in case of the phone call mode.
The electronic device 400 also includes at least one sensor 405, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 4061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 4061 and/or the backlight when the electronic apparatus 400 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 405 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 406 is used to display information input by the user or information provided to the user. The Display unit 406 may include a Display panel 4061, and the Display panel 4061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 407 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 407 includes a touch panel 4071 and other input devices 4072. Touch panel 4071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 4071 using a finger, a stylus, or any suitable object or attachment). The touch panel 4071 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 410, receives a command from the processor 410, and executes the command. In addition, the touch panel 4071 can be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 4071, the user input unit 407 may include other input devices 4072. Specifically, the other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 4071 can be overlaid on the display panel 4061, and when the touch panel 4071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Although in fig. 4, the touch panel 4071 and the display panel 4061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 4071 and the display panel 4061 may be integrated to implement the input and output functions of the electronic device, and the implementation is not limited herein.
The interface unit 408 is an interface for connecting an external device to the electronic apparatus 400. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 400 or may be used to transmit data between the electronic apparatus 400 and an external device.
The memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 409 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 410 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 409 and calling data stored in the memory 409, thereby performing overall monitoring of the electronic device. Processor 410 may include one or more processing units; preferably, the processor 410 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The electronic device 400 may further include a power supply 411 (e.g., a battery) for supplying power to various components, and preferably, the power supply 411 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 400 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, including: the processor 410, the memory 409, and a computer program stored in the memory 409 and capable of running on the processor 410, where the computer program, when executed by the processor 410, implements each process of the above-described embodiment of the automatic instance loading method, and can achieve the same technical effect, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above embodiment of the automatic instance loading method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. An automated instance loading method, the method comprising:
determining a dependency corresponding to a functional module in a target application;
instantiating the functional module to obtain a module instance corresponding to the functional module;
and storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship.
2. The method of claim 1, before determining the dependency corresponding to the functional module in the target application, further comprising:
adding a declaration mark and a dependency relationship mark in a class corresponding to the functional module,
the declaration mark is used for indicating that the functional module is a depended module, and the dependency relationship mark is used for indicating the dependency relationship of the functional module.
3. The method of claim 2, further comprising, prior to instantiating the functional module:
when the target application is started, acquiring the statement and the dependency relationship of the functional module;
judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating the dependency relationship with the functional modules are effective;
when the declaration format of the declaration does not conform to the preset declaration format or other functional modules forming the dependency relationship with the functional modules are invalid, performing exception prompt;
and instantiating the functional module under the condition that the declaration format of the declaration conforms to a preset declaration format and other functional modules forming the dependency relationship with the functional module are effective.
4. The method of claim 3, wherein storing the module instance in a predetermined database according to the dependency comprises:
determining a key code value corresponding to the dependency relationship;
and storing the module instance into the preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
5. The method of claim 2, after storing the module instance in a preset database according to the dependency relationship, comprising:
under the condition that a module to which an application program interface called by the target application currently belongs does not comprise the statement, continuing to execute the current business of the target application;
and under the condition that the module to which the application program interface currently called by the target application belongs comprises the statement, calling a module instance corresponding to the module in the preset database based on the dependency relationship corresponding to the module.
6. An automated instance loading apparatus, the apparatus comprising:
the determining unit is used for determining the dependency corresponding to the functional module in the target application;
the processing unit is used for instantiating the functional module to obtain a module instance corresponding to the functional module;
and the storage unit is used for storing the module instance into a preset database according to the dependency relationship, wherein the storage position of the module instance is associated with the dependency relationship.
7. The apparatus of claim 6, further comprising:
a declaration unit, configured to add a declaration flag and a dependency relationship flag in a class corresponding to a function module before determining a dependency relationship corresponding to the function module in a target application,
the declaration mark is used for indicating that the functional module is a depended module, and the dependency relationship mark is used for indicating the dependency relationship of the functional module.
8. The apparatus of claim 7, further comprising:
an obtaining unit, configured to obtain the declaration and the dependency relationship of the functional module when the target application is started;
the judging unit is used for judging whether the declaration format of the declaration conforms to a preset declaration format and whether other functional modules generating the dependency relationship with the functional modules are effective or not;
the prompting unit is used for performing exception prompting under the condition that the declaration format of the declaration does not conform to the preset declaration format or other functional modules forming the dependency relationship with the functional module are invalid;
the processing unit is further configured to instantiate the functional module under the condition that the declaration format of the declaration conforms to a preset declaration format and other functional modules forming the dependency relationship with the functional module are valid.
9. The apparatus of claim 8, wherein the storage unit comprises:
the first storage module is used for determining a key value corresponding to the dependency relationship;
and the second storage module is used for storing the module instance into the preset database according to the key value, wherein the storage position of the module instance is associated with the key value.
10. The apparatus of claim 7, further comprising:
a first execution unit, configured to continue to execute the current service of the target application when a module to which an application program interface currently called by the target application belongs does not include the declaration;
and the second execution unit is used for calling a module instance corresponding to the module in the preset database based on the dependency relationship corresponding to the module under the condition that the module to which the application program interface currently called by the target application belongs comprises the statement.
11. An electronic device, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the automated instance loading method of any of claims 1 to 5.
12. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the automated instance loading method according to one of claims 1 to 5.
CN202010846095.4A 2020-08-19 2020-08-19 Automatic instance loading method and device, electronic equipment and storage medium Pending CN112035180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010846095.4A CN112035180A (en) 2020-08-19 2020-08-19 Automatic instance loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010846095.4A CN112035180A (en) 2020-08-19 2020-08-19 Automatic instance loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112035180A true CN112035180A (en) 2020-12-04

Family

ID=73580249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010846095.4A Pending CN112035180A (en) 2020-08-19 2020-08-19 Automatic instance loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112035180A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022134717A1 (en) * 2020-12-24 2022-06-30 完美世界(北京)软件科技发展有限公司 Data-driven system function loading method, device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1416057A (en) * 2001-10-31 2003-05-07 精工爱普生株式会社 Dynamic Java loading for applied program execution
US20030101445A1 (en) * 2001-10-31 2003-05-29 Seiko Epson Corporation Dynamic class packaging
CN101393528A (en) * 2008-10-30 2009-03-25 上海交通大学 Method and system for determining instance object conversion order in dynamic update of software
CN109558139A (en) * 2018-11-21 2019-04-02 北京城市网邻信息技术有限公司 Marker method, device, computer equipment and the storage medium of component dependencies
CN111045717A (en) * 2019-11-05 2020-04-21 北京奇艺世纪科技有限公司 Method and device for acquiring project dependency package, computer equipment and storage medium
CN111176802A (en) * 2019-07-26 2020-05-19 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1416057A (en) * 2001-10-31 2003-05-07 精工爱普生株式会社 Dynamic Java loading for applied program execution
US20030101445A1 (en) * 2001-10-31 2003-05-29 Seiko Epson Corporation Dynamic class packaging
CN101393528A (en) * 2008-10-30 2009-03-25 上海交通大学 Method and system for determining instance object conversion order in dynamic update of software
CN109558139A (en) * 2018-11-21 2019-04-02 北京城市网邻信息技术有限公司 Marker method, device, computer equipment and the storage medium of component dependencies
CN111176802A (en) * 2019-07-26 2020-05-19 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and storage medium
CN111045717A (en) * 2019-11-05 2020-04-21 北京奇艺世纪科技有限公司 Method and device for acquiring project dependency package, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KHALID BELHAJJAME .ETAL32: "Using a suite of ontologies for preserving workflow-centric research objects", SCIENCE DIRECT, vol. 32, 11 February 2015 (2015-02-11) *
张智慧: "多层模型在嵌入式软件开发中的应用研究", 计算机时代, no. 04, 31 May 2017 (2017-05-31) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022134717A1 (en) * 2020-12-24 2022-06-30 完美世界(北京)软件科技发展有限公司 Data-driven system function loading method, device, and storage medium

Similar Documents

Publication Publication Date Title
CN110752980B (en) Message sending method and electronic equipment
CN107580147B (en) Management method of notification message and mobile terminal
CN109857494B (en) Message prompting method and terminal equipment
CN109857297B (en) Information processing method and terminal equipment
CN112379976A (en) Event processing method and device, mobile terminal and storage medium
CN111030917B (en) Message display method and electronic equipment
CN111931102A (en) Method, device and system for constructing page
CN111090489A (en) Information control method and electronic equipment
CN108009031B (en) Application program control method and mobile terminal
CN112231144A (en) Data processing method and device and electronic equipment
CN110012152B (en) Interface display method and terminal equipment
CN109815349B (en) Information acquisition method and terminal equipment
CN106919458B (en) Method and device for Hook target kernel function
CN111131607A (en) Information sharing method, electronic equipment and computer readable storage medium
CN111273955A (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN108089935B (en) Application program management method and mobile terminal
CN106339391B (en) Webpage display method and terminal equipment
CN109145598B (en) Virus detection method and device for script file, terminal and storage medium
CN111130995B (en) Image control method, electronic device, and storage medium
CN111200648B (en) Service calling method, device, terminal equipment and storage medium
CN112596980A (en) ios performance collection method and device, mobile terminal and computer readable storage medium
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN109828702B (en) Interface display method and terminal equipment
CN112035180A (en) Automatic instance loading method and device, electronic equipment and storage medium
CN108491225B (en) Update package generation method and mobile terminal

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