CN110727477A - Component loading method and device, computer equipment and storage medium - Google Patents

Component loading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110727477A
CN110727477A CN201910968817.0A CN201910968817A CN110727477A CN 110727477 A CN110727477 A CN 110727477A CN 201910968817 A CN201910968817 A CN 201910968817A CN 110727477 A CN110727477 A CN 110727477A
Authority
CN
China
Prior art keywords
component
loaded
application
configuration
sample
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.)
Granted
Application number
CN201910968817.0A
Other languages
Chinese (zh)
Other versions
CN110727477B (en
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.)
Tibet Canyu Lunzhu Technology Co ltd
Original Assignee
Lujiazui Shanghai International Financial Assets Market Ltd By Share 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 Lujiazui Shanghai International Financial Assets Market Ltd By Share Ltd filed Critical Lujiazui Shanghai International Financial Assets Market Ltd By Share Ltd
Priority to CN201910968817.0A priority Critical patent/CN110727477B/en
Publication of CN110727477A publication Critical patent/CN110727477A/en
Application granted granted Critical
Publication of CN110727477B publication Critical patent/CN110727477B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/64Retargetable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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/44536Selecting among different versions
    • G06F9/44542Retargetable

Abstract

The present application relates to the field of development, and in particular, to a component loading method and apparatus, a computer device, and a storage medium. The method comprises the following steps: receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction; detecting whether an application comprises a component to be loaded; when the application comprises a component to be loaded, intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application; identifying the component type according to the target position, and acquiring a component to be loaded corresponding to the component type from a preset storage address; and loading the component to be loaded to the target position, and continuing the starting operation of the application. By adopting the method, the development and upgrading efficiency of the assembly can be improved.

Description

Component loading method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of component loading technologies, and in particular, to a component loading method and apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, application programs are widely applied to terminals such as mobile phones and personal computers, programming technology also becomes one of the current popular technologies, and in programming, components obtained by packaging data and methods are often required to be used for calling so as to realize efficient programming.
The components in the traditional Java application are mainly supported by means of multiplexing of Jar packages and Java classes, however, when the component codes are written by the means, technicians familiar with relevant configuration details are required to repeatedly load and configure the components; when component upgrading or component configuration is met, the characteristics of each component need to be analyzed, corresponding codes need to be changed, and then loading and configuration work is carried out; the traditional component loading method is inconvenient for code management, and reduces the development and upgrade efficiency of the components.
Disclosure of Invention
In view of the above, it is necessary to provide a component loading method, apparatus, computer device and storage medium capable of improving efficiency of development and upgrade of components.
A method of component loading, the method comprising:
receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction;
detecting whether the application comprises a component to be loaded;
when the application comprises a component to be loaded, intercepting a starting operation of the application and positioning a target position of the component to be loaded in the application;
identifying the component type according to the target position, and acquiring a component to be loaded corresponding to the component type from a preset storage address;
and loading the component to be loaded to the target position, and continuing the starting operation of the application.
In an embodiment, the obtaining the component to be loaded corresponding to the component type from the preset storage address includes:
acquiring a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item;
identifying the component configuration items in the component sample, and acquiring parameters corresponding to the component configuration items from an established parameter library;
and configuring the acquired parameters into corresponding component configuration items to obtain the component to be loaded.
In an embodiment, after acquiring the parameter corresponding to the component configuration item from the established parameter library, the method further includes:
when the parameter corresponding to the component configuration item is not included in the parameter library, generating a new parameter request;
and sending the new parameter adding request to a server, so that the server adds the parameters corresponding to the component configuration items in the parameter library.
In one embodiment, before identifying the component configuration item in the component sample, the method further includes:
injecting the component configuration item in the component sample according to a preset injection rule;
the identifying component configuration items in the component sample comprises:
and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
In one embodiment, the injecting the component configuration item in the component sample according to a preset injection rule includes:
acquiring a configuration item to be injected and acquiring a configuration prefix corresponding to the configuration item to be injected;
injecting the configuration prefix in the component sample;
the identifying the injected component configuration item according to the preset identification rule corresponding to the preset injection rule includes:
identifying component configuration items in the component sample according to the configuration prefix.
In one embodiment, after the resuming the starting operation of the application, the method further includes:
receiving a component update notification, wherein the component update notification comprises information of a component to be updated;
and when a hot updating instruction is received, updating the corresponding component according to the information to be updated.
In one embodiment, after detecting whether the application includes a component to be loaded, the method further includes:
and when the application comprises the component to be loaded, continuing the starting operation of the application.
An assembly loading device, the device comprising:
the starting instruction receiving module is used for receiving a starting instruction and triggering the starting operation of the application according to the starting instruction;
the detection module is used for detecting whether the application comprises a component to be loaded;
the intercepting module is used for intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application when the component to be loaded is included in the application;
the component obtaining module is used for identifying the component type according to the target position and obtaining a component to be loaded corresponding to the component type from a preset storage address;
and the component loading module is used for loading the component to be loaded to the target position and continuing the starting operation of the application.
A computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any of the above.
According to the component loading method, the component loading device, the computer equipment and the storage medium, when the terminal starts the application, the step of component loading is automatically triggered, whether the application contains the component to be loaded is detected, if yes, the operation of application starting is intercepted, the component to be loaded meeting the loading requirement is automatically generated according to the set acquisition logic of the component to be loaded, the component to be loaded is loaded to the target position, and the component loading operation in the application is completed. According to the method, through a set of complete component loading logic, the terminal can automatically load the components meeting the loading requirements when the terminal starts the application, and when the components are upgraded, the terminal can also automatically load the upgraded components without analyzing, changing, upgrading and other operations of codes of each component by technicians to realize the loading operation of the components, so that the development and upgrading efficiency of the components can be effectively improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary application scenario of a component loading method in one embodiment;
FIG. 2 is a flow diagram that illustrates a methodology for loading components in one embodiment;
FIG. 3 is a flowchart illustrating step S208 according to an embodiment;
FIG. 4 is a block diagram showing the structure of a component loading apparatus according to an embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The component loading method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 may issue a component sample and parameters of the component to be loaded for the terminal to realize automatic loading of the component, and when the terminal 102 starts a certain application including the component to be loaded, the server 104 acquires the component sample and the parameters of the component to be loaded to generate the component to be loaded for this component loading. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a component loading method is provided, which is described by taking the method as an example applied to the terminal 102 in fig. 1, and includes the following steps:
s202, receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction.
The starting instruction is an instruction triggered by a user to start the frame application, and may be an instruction input by the user through an input device of a terminal such as a mobile phone or a computer, or may be other business.
Specifically, when the terminal receives a start instruction for starting an application, the application is started to run on the terminal.
S204, detecting whether the application contains the component to be loaded.
When an application runs on a terminal according to a starting instruction, whether the application contains a component to be loaded is detected. It may be set that before the application is started, whether the application includes the embedded point of the component to be loaded is traversed, and if the embedded point of the component to be loaded is found, the application includes the component to be loaded.
S206, when the application comprises the component to be loaded, intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application.
And when the application comprises the component to be loaded, the terminal intercepts the starting operation of the application and suspends the starting of the application. When a java Web framework application runs, a Tomcat (a Web application server with an open source code) is usually called, a starting mechanism of the Tomcat includes a self-check mechanism, namely, a lufaxservet container initializer (container interception interface) is loaded, the interface performs some initialization work for providing a third-party component with opportunities, for example, servlets or files are registered, and a step of intercepting application starting can be realized by using the container interception interface.
The component to be loaded is a component which needs to be inserted in the application, the target position is a position where the component to be loaded needs to be loaded in the framework application, when the framework application is generated, a buried point can be inserted at the target position of the component to be loaded in the framework application, and when the application is started, the corresponding component is loaded at the buried point. The target position of the component of the corresponding type can be identified through the component scanning interface for identifying different component types; for example, during the development of a java web framework, a target position of a component to be loaded in a Servlet type is identified through a ServletProvider interface; and identifying the target position of the component to be loaded of the Filter type to be loaded through a Filter provider interface.
And S208, identifying the component type according to the target position, and acquiring the component to be loaded corresponding to the component type from the preset storage address.
The component type is a type obtained by classifying components, and mainly comprises three components in the programming of JAVA web: servlet, Filter and Lister,
the manner of identifying the type of the component to be loaded may include: the first method is as follows: when setting the burial point of the component to be loaded, different burial points can be set according to the type of the component to be loaded. The second method comprises the following steps: when traversing the framework, analyzing the position of the buried point in the framework program to determine the type of the component to be loaded, for example, in a partition of the framework application, a Servlet component in the application is deployed in a certain partition, and when the terminal is located to a target position including the component to be loaded in the partition, the component to be loaded corresponding to the target position is the Servlet type.
After the target position of the component to be loaded and the component type of the component to be loaded are identified, the terminal needs to acquire the component to be loaded, a plurality of components can be constructed firstly during component development, the components can be stored in a preset storage address, and when the component to be loaded in the application is loaded at the terminal, the corresponding component can be acquired from the preset storage address for loading.
S210, loading the component to be loaded to the target position, and continuing the starting operation of the application.
Specifically, after the terminal acquires the component to be loaded, the component to be loaded is loaded into the target position, the loading process of the component is realized, and the application is continuously started and run on the terminal.
According to the component loading method, when the terminal starts the application, the step of component loading is automatically triggered, whether the application contains the component to be loaded is detected, if yes, the operation of application starting is intercepted, the component to be loaded meeting the loading requirement is automatically generated according to the set acquisition logic of the component to be loaded, and the component to be loaded is loaded to the target position, so that the component loading operation in the application is completed. According to the method, through a set of complete component loading logic, the terminal can automatically load the components meeting the loading requirements when the terminal starts the application, and when the components are upgraded, the terminal can also automatically load the upgraded components without analyzing, changing, upgrading and other operations of codes of each component by technicians to realize the loading operation of the components, so that the development and upgrading efficiency of the components can be effectively improved.
In an embodiment, referring to fig. 3, the obtaining of the component to be loaded corresponding to the component type from the preset storage address in step S208 in the component loading method specifically includes the following steps:
s302, obtaining a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item.
The acquisition mode of the component to be loaded is that the terminal acquires a corresponding component sample from the component type issued by the server terminal, and configures the personalized parameter corresponding to the component type to be loaded with the component sample to obtain the component to be loaded. The server side can establish a component sample library management component sample in a preset storage position, for example, a Servlet instance and a Filter instance can be established as the component sample, personalized parameter items in the component sample are null, and the component sample can be stored in the component sample library in a jar packet mode.
The classification may be performed according to the three major components, and a corresponding component sample with a characteristic parameter being null may be set for each classification, for example, a Servlet component sample is set for a Servlet class component, and a Filter component sample is set for a Filter class component. And the realization of the functions of the component samples in different applications can be adjusted by configuring the parameters corresponding to the component configuration items in the component samples.
Optionally, identifying the component configuration item in the obtained component sample by using the parameter discovery interface terminal; such as the listener interface in the spring framework (a software development framework), etc. The component configuration items are parameter items required to be configured individually in the component sample, such as component names, interfaces for component calls and the like.
S304, identifying the component configuration items in the component sample, and acquiring the parameters corresponding to the component configuration items from the established parameter library.
The parameters corresponding to the component to be loaded are component parameters which are pre-configured by the server and are used for the terminal to obtain and configure the component sample, and the parameters can comprise parameters of component names, interface parameters called in the component and the like; when the server pre-configures the parameters corresponding to the component to be loaded, the server may set a correspondence between the parameters and identifiers, such as a function type of the terminal, a framework application installed on the terminal, and the like, a relationship between the parameters and the component sample, and the like, for the terminal to obtain the parameters corresponding to the component to be loaded from the server.
Specifically, the server may establish a parameter library to store all preconfigured parameters, the parameter library may adopt a key-value database, the terminal may access the parameter library, and obtain corresponding parameters from the parameter library according to a component configuration item in the component sample as a key for querying the database.
In addition, the terminal can initialize parameters which do not need to be configured individually, for example, xml contextClass parameters can be directly defined as LufaxXmlWeb applicationContext according to initialization setting.
S306, configuring the acquired parameters into the corresponding component configuration items to obtain the components to be loaded.
Specifically, the terminal adds the acquired parameters to the corresponding position of the component sample to obtain the component to be loaded which needs to be loaded to the target position at this time.
In the above-mentioned example of the spring framework, the configuration of the component configuration item may be implemented by a defined contextclass () function, that is, the parameter corresponding to the parameter in the parentheses is obtained from the parameter library by the contextclass () function, and the corresponding parameter is returned by the function, so as to complete the parameter configuration.
In the above embodiment, after the terminal obtains the component sample, the personalized configuration may be performed on the component configuration item to be configured in the component sample according to the above method.
In an embodiment, after acquiring the parameters corresponding to the component configuration items from the established parameter library in step S304 in the component loading method, the method may further include: when the parameter library does not comprise parameters corresponding to the component configuration items, generating a newly added parameter request; and sending the new parameter adding request to the server, so that the server adds the parameters corresponding to the component configuration items in the parameter library.
The new parameter request is a request which is sent to the server by the terminal and enables the server to increase parameters in the parameter library; the new parameter request can comprise information used for identifying the parameter to be added by the server; for example, the parameters correspond to component samples, component configuration items, framework applications running on the terminal, and the like.
Specifically, when the terminal obtains the parameters corresponding to the component configuration items from the parameter library of the server, if the parameter library does not store the parameters meeting the configuration requirement, the terminal may generate a new parameter request for enabling the server to add corresponding parameters to the parameter library, and after receiving the new configuration request, the server may add the parameters corresponding to the new configuration request to the parameter library after auditing the request.
In the above embodiment, for the parameters not covered in the parameter library, the terminal may trigger the server to add the corresponding parameters in the parameter library through a new parameter adding request, so as to implement the online feedback from the terminal to the server.
In an embodiment, before identifying the component configuration item in the component sample in step S304 in the above component loading method, the method may further include: injecting component configuration items in the component sample according to preset injection rules; step S304 identifies component configuration items in the component sample, which may include: and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
The preset injection rule is a new rule for component configuration which can be discovered by a parameter interface and is injected into the component sample when the server generates the component sample; when the server generates the component sample, the server needs to inject the component configuration item which can be identified by the terminal into the component sample through the preset injection rule. For example, the preset injection rules in the spring framework may include: configuration placeholder injection rules, SPEl (Spring Expression Language) injection rules, and configuration prefix injection rules. When the terminal identifies the injected component configuration item through the parameter discovery interface, the identification rule can be set according to the programming logic corresponding to the preset injection rule, namely the preset identification rule.
For example, configuration placeholder injection rules: defining in the component sample either a < property name ═ maxIdle "Value ═ $ MAX _ IDLE }"/>, or @ Value ("$ { MAX _ IDLE }"); the terminal acquires specific parameter values of the maxIdle from a parameter library to configure the component sample.
SPEl (Spring Expression Language) injection rule: propertylame ═ maxIdle ═ # { MAX _ IDLE } "or @ Value (" # { MAX _ IDLE } "); likewise, MAX _ IDLE is a component configuration item.
Configuring a prefix injection rule: defining a configuration prefix through a config-prefix XML attribute; the configuration prefix + component property name form a component configuration item. And intercepting Spring to create a Bean process corresponding to the configuration prefix injection rule, wherein the injected component configuration item is Bean PropertyName, the Bean is a configuration prefix, the PropertyName is a component attribute name, and if the configuration item of the prefix plus the component attribute name is detected, the component attribute name is a component configuration item.
In the above embodiment, the component configuration item is injected into the component sample according to the preset injection rule, and the terminal identifies the component configuration item according to the preset identification rule corresponding to the preset injection rule.
In an embodiment, the injecting the component configuration item in the component sample according to the preset injection rule in the component loading method may include: acquiring a configuration item to be injected and acquiring a configuration prefix corresponding to the configuration item to be injected; a configuration prefix is injected in the component sample. The step of identifying the injected component configuration item according to a preset identification rule corresponding to the preset injection rule may include: component configuration items in the component sample are identified according to the configuration prefix.
Where the configuration prefix is a prefix used for parameter discovery interface identification, such as a Bean in the example above.
Specifically, when the server injects the component configuration item into the component sample, it preferably injects the component configuration item according to the prefix of the configuration item, that is, the component configuration item is formed in the form of configuration prefix + component attribute name. The terminal may be enabled to directly scan component property names in the component sample to identify component configuration items.
In the above embodiment, a prefix injection manner is adopted, and developers do not need to understand the number and the types of the component configuration items, and only need to understand the prefixes, so that automatic configuration management can be realized, the requirements on the developers are low, and the configuration of operation and maintenance personnel is more reliable.
In an embodiment, after the starting operation of the application in step S210 in the component loading method, the method may further include: receiving a component updating notice, wherein the component updating notice comprises information to be updated; and when a hot updating instruction is received, updating the corresponding component according to the information to be updated.
The component update notification is a message that a configuration item or a component sample and the like in a component are updated after a terminal starts an application; the component update notification is a message which is triggered on the server when a version update occurs to a component sample stored in the server or a parameter in the parameter library is changed, and is used for updating the configured component on the terminal. The component update notification should include information to be updated of the component to be updated, such as the component to be updated and the content of the component update.
The hot update instruction is an instruction for performing a component update operation during the application start process, and may be sent by the server to the terminal, or may be an instruction input by the user and received by the terminal.
Specifically, if the version of the component sample stored in the server is updated or the parameters in the parameter library are changed, the server is triggered to generate a component update notification, the server sends the component update notification to the terminal loaded with the current update component, and after the terminal receives the component update notification, if a user issues a hot update instruction to the terminal, or the server sends the hot update instruction to the terminal, the terminal starts the current component update operation. In addition, if the terminal does not receive the hot update instruction, the update operation of the component can be performed when the terminal starts the application next time.
In the above embodiment, if the server side updates the configuration or version of the component, it may determine whether to trigger the terminal to perform a hot update on the corresponding component according to the priority of the update content or an instruction of the terminal user.
In an embodiment, after the step S204 detects whether the application includes the component to be loaded, the method may further include: and when the application contains the component to be loaded, continuing the starting operation of the application.
Specifically, if it is detected in step S204 that the application does not include a component to be loaded, the application is directly started without intercepting the start of the application.
In this embodiment, an application that does not include a component to be loaded is directly started.
It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a component loading apparatus including: the system comprises a starting instruction receiving module 100, a detecting module 200, an intercepting module 200, a component obtaining module 300 and a component loading module 500, wherein:
the starting instruction receiving module 100 is configured to receive a starting instruction and trigger a starting operation of an application according to the starting instruction.
The detecting module 200 is configured to detect whether an application includes a component to be loaded.
The intercepting module 300 is configured to intercept a starting operation of the application when the application includes a component to be loaded, and locate a target position of the component to be loaded in the application.
The component obtaining module 400 is configured to identify a component type according to the target location, and obtain a component to be loaded corresponding to the component type from a preset storage address.
And the component loading module 500 is configured to load the component to be loaded to the target location, and continue the start operation of the application.
In an embodiment, the component obtaining module 400 in the component loading apparatus may include:
and the component sample acquiring unit is used for acquiring a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item.
And the parameter acquisition unit is used for identifying the component configuration items in the component sample and acquiring the parameters corresponding to the component configuration items from the established parameter library.
And the component configuration unit is used for configuring the acquired parameters into the corresponding component configuration items to obtain the components to be loaded.
In one embodiment, the component loading apparatus may further include:
and the newly added request module is used for generating a newly added parameter request when the parameter corresponding to the component configuration item is not included in the parameter library.
And the parameter adding module is used for sending the parameter adding request to the server so as to enable the server to add the parameters corresponding to the component configuration items in the parameter library.
In one embodiment, the component loading apparatus may further include:
and the configuration item injection module is used for injecting the component configuration items into the component sample according to a preset injection rule.
The parameter obtaining unit may be further configured to: and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
In one embodiment, the configuration item injection module may include:
and the prefix acquisition unit is used for acquiring the configuration item to be injected and acquiring the configuration prefix corresponding to the configuration item to be injected.
And the prefix injection unit is used for injecting the configuration prefix in the component sample.
The parameter obtaining unit may be further configured to: component configuration items in the component sample are identified according to the configuration prefix.
In one embodiment, the component loading apparatus may further include:
and the updating notification receiving module is used for receiving the component updating notification, and the component updating notification comprises the information of the component to be updated.
And the updating module is used for updating the corresponding component according to the information to be updated when the hot updating instruction is received.
In one embodiment, the component loading apparatus may further include:
and the direct starting module is used for continuing the starting operation of the application when the application comprises the component to be loaded.
For specific limitations of the component loading device, reference may be made to the above limitations of the component loading method, which are not described herein again. The modules in the component loading apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a component loading method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program: receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction; detecting whether an application comprises a component to be loaded; when the application comprises a component to be loaded, intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application; identifying the component type according to the target position, and acquiring a component to be loaded corresponding to the component type from a preset storage address; and loading the component to be loaded to the target position, and continuing the starting operation of the application.
In one embodiment, the obtaining of the component to be loaded corresponding to the component type from the preset storage address when the processor executes the computer program includes: acquiring a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item; identifying the component configuration items in the component sample, and acquiring parameters corresponding to the component configuration items from the established parameter library; and configuring the acquired parameters into corresponding component configuration items to obtain the component to be loaded.
In one embodiment, after the processor obtains the parameters corresponding to the component configuration items from the established parameter library when executing the computer program, the method further includes: when the parameter library does not comprise parameters corresponding to the component configuration items, generating a newly added parameter request; and sending the new parameter adding request to the server, so that the server adds the parameters corresponding to the component configuration items in the parameter library.
In one embodiment, the identifying component configuration items in the component sample, as implemented by the processor when executing the computer program, further comprises: injecting component configuration items in the component sample according to preset injection rules; identifying component configuration items in a sample of components implemented by a processor executing a computer program, comprising: and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
In one embodiment, the injecting, by a processor when executing a computer program, a component configuration item in a component sample according to a preset injection rule includes: acquiring a configuration item to be injected and acquiring a configuration prefix corresponding to the configuration item to be injected; injecting a configuration prefix in the component sample; identifying the injected component configuration item according to a preset identification rule corresponding to a preset injection rule, which is implemented when the processor executes the computer program, includes: component configuration items in the component sample are identified according to the configuration prefix.
In one embodiment, after the starting operation of the continuation application implemented when the processor executes the computer program, the method further includes: receiving a component updating notice, wherein the component updating notice comprises information of a component to be updated; and when a hot updating instruction is received, updating the corresponding component according to the information to be updated.
In one embodiment, after the processor detects whether the application includes the component to be loaded when executing the computer program, the method further includes: and when the application contains the component to be loaded, continuing the starting operation of the application.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction; detecting whether an application comprises a component to be loaded; when the application comprises a component to be loaded, intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application; identifying the component type according to the target position, and acquiring a component to be loaded corresponding to the component type from a preset storage address; and loading the component to be loaded to the target position, and continuing the starting operation of the application.
In one embodiment, the obtaining of the component to be loaded corresponding to the component type from the preset storage address, which is implemented when the computer program is executed by the processor, includes: acquiring a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item; identifying the component configuration items in the component sample, and acquiring parameters corresponding to the component configuration items from the established parameter library; and configuring the acquired parameters into corresponding component configuration items to obtain the component to be loaded.
In one embodiment, after the computer program is executed by a processor to obtain parameters corresponding to component configuration items from an established parameter library, the method further includes: when the parameter library does not comprise parameters corresponding to the component configuration items, generating a newly added parameter request; and sending the new parameter adding request to the server, so that the server adds the parameters corresponding to the component configuration items in the parameter library.
In one embodiment, the identifying of component configuration items in the component sample, when performed by the processor, further comprises: injecting component configuration items in the component sample according to preset injection rules; identifying component configuration items in a sample of components implemented by a processor executing a computer program, comprising: and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
In one embodiment, the computer program, when executed by a processor, implements injecting component configuration items in a component sample according to preset injection rules, comprising: acquiring a configuration item to be injected and acquiring a configuration prefix corresponding to the configuration item to be injected; injecting a configuration prefix in the component sample; identifying injected component configuration items according to a preset identification rule corresponding to a preset injection rule, implemented when the computer program is executed by the processor, includes: component configuration items in the component sample are identified according to the configuration prefix.
In one embodiment, the computer program, after being executed by the processor to perform the operation of continuing the launching of the application, further comprises: receiving a component updating notice, wherein the component updating notice comprises information of a component to be updated; and when a hot updating instruction is received, updating the corresponding component according to the information to be updated.
In one embodiment, after the computer program is executed by a processor to detect whether a component to be loaded is included in an application, the method further includes: and when the application contains the component to be loaded, continuing the starting operation of the application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of component loading, the method comprising:
receiving a starting instruction, and triggering the starting operation of the application according to the starting instruction;
detecting whether the application comprises a component to be loaded;
when the application comprises a component to be loaded, intercepting a starting operation of the application and positioning a target position of the component to be loaded in the application;
identifying the component type according to the target position, and acquiring a component to be loaded corresponding to the component type from a preset storage address;
and loading the component to be loaded to the target position, and continuing the starting operation of the application.
2. The method according to claim 1, wherein the obtaining the component to be loaded corresponding to the component type from a preset storage address comprises:
acquiring a component sample corresponding to the component type from a preset storage address, wherein the component sample comprises a component configuration item;
identifying the component configuration items in the component sample, and acquiring parameters corresponding to the component configuration items from an established parameter library;
and configuring the acquired parameters into corresponding component configuration items to obtain the component to be loaded.
3. The method according to claim 2, wherein after the obtaining the parameters corresponding to the component configuration items from the established parameter library, the method further comprises:
when the parameter corresponding to the component configuration item is not included in the parameter library, generating a new parameter request;
and sending the new parameter adding request to a server, so that the server adds the parameters corresponding to the component configuration items in the parameter library.
4. The method of claim 2, wherein prior to identifying component configuration items in the component sample, further comprising:
injecting the component configuration item in the component sample according to a preset injection rule;
the identifying component configuration items in the component sample comprises:
and identifying the injected component configuration items according to a preset identification rule corresponding to the preset injection rule.
5. The method of claim 4, wherein injecting the component configuration item in the component sample according to a preset injection rule comprises:
acquiring a configuration item to be injected and acquiring a configuration prefix corresponding to the configuration item to be injected;
injecting the configuration prefix in the component sample;
the identifying the injected component configuration item according to the preset identification rule corresponding to the preset injection rule includes:
identifying component configuration items in the component sample according to the configuration prefix.
6. The method of claim 1, wherein after the continuing the launching operation of the application, further comprising:
receiving a component update notification, wherein the component update notification comprises information of a component to be updated;
and when a hot updating instruction is received, updating the corresponding component according to the information to be updated.
7. The method according to claim 1, wherein after detecting whether the application includes the component to be loaded, the method further comprises:
and when the application comprises the component to be loaded, continuing the starting operation of the application.
8. An assembly loading apparatus, comprising:
the starting instruction receiving module is used for receiving a starting instruction and triggering the starting operation of the application according to the starting instruction;
the detection module is used for detecting whether the application comprises a component to be loaded;
the intercepting module is used for intercepting the starting operation of the application and positioning the target position of the component to be loaded in the application when the component to be loaded is included in the application;
the component obtaining module is used for identifying the component type according to the target position and obtaining a component to be loaded corresponding to the component type from a preset storage address;
and the component loading module is used for loading the component to be loaded to the target position and continuing the starting operation of the application.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201910968817.0A 2019-10-12 2019-10-12 Component loading method and device, computer equipment and storage medium Active CN110727477B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910968817.0A CN110727477B (en) 2019-10-12 2019-10-12 Component loading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910968817.0A CN110727477B (en) 2019-10-12 2019-10-12 Component loading method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110727477A true CN110727477A (en) 2020-01-24
CN110727477B CN110727477B (en) 2023-03-24

Family

ID=69220032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910968817.0A Active CN110727477B (en) 2019-10-12 2019-10-12 Component loading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110727477B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220370A (en) * 2021-05-28 2021-08-06 杭州数跑科技有限公司 Method, system, device and storage medium for managing active application based on component
CN113434934A (en) * 2021-06-28 2021-09-24 杭州群核信息技术有限公司 Household layout placing method and device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634682A (en) * 2018-11-29 2019-04-16 恒生电子股份有限公司 The configuration file update method and device of application program
CN109683988A (en) * 2018-12-25 2019-04-26 鼎信信息科技有限责任公司 Micro services start method, apparatus, computer equipment and storage medium
CN110162344A (en) * 2019-04-15 2019-08-23 深圳壹账通智能科技有限公司 A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634682A (en) * 2018-11-29 2019-04-16 恒生电子股份有限公司 The configuration file update method and device of application program
CN109683988A (en) * 2018-12-25 2019-04-26 鼎信信息科技有限责任公司 Micro services start method, apparatus, computer equipment and storage medium
CN110162344A (en) * 2019-04-15 2019-08-23 深圳壹账通智能科技有限公司 A kind of method, apparatus, computer equipment and readable storage medium storing program for executing that current limliting is isolated

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220370A (en) * 2021-05-28 2021-08-06 杭州数跑科技有限公司 Method, system, device and storage medium for managing active application based on component
CN113434934A (en) * 2021-06-28 2021-09-24 杭州群核信息技术有限公司 Household layout placing method and device and storage medium

Also Published As

Publication number Publication date
CN110727477B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN110008118B (en) Page data testing method and device, computer equipment and storage medium
CN108845812B (en) Plug-in updating method, device, computer equipment and storage medium
CN110290212B (en) Service call recording method, device, computer equipment and storage medium
CN108829477B (en) Interface jump method, device, computer equipment and storage medium
CN110231948B (en) Application program method, device, system, storage medium and computer equipment
CN110866198B (en) Static resource caching method, system, device, computer equipment and storage medium
CN108520059A (en) Loading method, system, computer equipment and the storage medium of the client H5 pages
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
CN107526605B (en) Method and device for realizing application program loading service assembly
CN110633160A (en) Interface calling method and device, computer equipment and storage medium
JP7106001B2 (en) SUB-APPLICATION DEVELOPMENT METHOD, APPARATUS, COMPUTER DEVICE, AND COMPUTER PROGRAM
US8990929B2 (en) Auditing application activities
CN109144487B (en) Method, device, computer equipment and storage medium for developing business of parts
CN110727477B (en) Component loading method and device, computer equipment and storage medium
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
CN109254765B (en) Timing task management method, device, computer equipment and storage medium
CN106681749A (en) Local code patch updating method and device based on Android platform
CN110765394A (en) So file loading method and device, storage medium and terminal equipment
CN111726818A (en) Wireless chip testing method and device, computer equipment and storage medium
CN114118971A (en) Cloud-native-based online development method, device, equipment and storage medium
CN110413292B (en) Light application installation method of application program, mobile terminal and storage medium
CN113835713B (en) Source code packet downloading method, device, computer equipment and storage medium
CN114003432A (en) Parameter checking method and device, computer equipment and storage medium
CN112199151B (en) Application program running method and device
CN110489138B (en) Application updating method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200122

Address after: 200120 floor 15, 1333 Lujiazui Ring Road, free trade Experimental Zone, Pudong New Area, Shanghai

Applicant after: Weikun (Shanghai) Technology Service Co.,Ltd.

Address before: 13th Floor, 1333 Lujiazui Ring Road, Shanghai Free Trade Pilot Area, 200120

Applicant before: SHANGHAI LUJIAZUI INTERNATIONAL FINANCIAL ASSETS TRANSACTION MARKET CO.,LTD.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231218

Address after: No. 3605, 5th Floor, Building 3, Micro World, No. 23 Century Avenue, Liuwu New District, Lhasa, Tibet Autonomous Region, 850000

Patentee after: Tibet Canyu Lunzhu Technology Co.,Ltd.

Address before: 15 / F, 1333 Lujiazui Ring Road, Pudong New Area pilot Free Trade Zone, Shanghai, 200120

Patentee before: Weikun (Shanghai) Technology Service Co.,Ltd.