CN115113898A - Dynamic updating method and device for micro application, computer equipment and storage medium - Google Patents

Dynamic updating method and device for micro application, computer equipment and storage medium Download PDF

Info

Publication number
CN115113898A
CN115113898A CN202210535059.5A CN202210535059A CN115113898A CN 115113898 A CN115113898 A CN 115113898A CN 202210535059 A CN202210535059 A CN 202210535059A CN 115113898 A CN115113898 A CN 115113898A
Authority
CN
China
Prior art keywords
application
micro
target
program
micro application
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
CN202210535059.5A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210535059.5A priority Critical patent/CN115113898A/en
Publication of CN115113898A publication Critical patent/CN115113898A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present application relates to a method, an apparatus, a computer device, a storage medium and a computer program product for dynamic updating of micro applications. The method can be applied to the technical field of Internet and vehicle networking, and the micro application can be a micro application of an application program on a mobile terminal or a vehicle-mounted device, and the method comprises the following steps: detecting a loading event of a target application program in the process of running the target application program; determining the file type and version information of the micro application to be loaded according to the loading event; obtaining a micro application index address based on the version information and the file type; acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version; and loading the micro application resource to the target application program. By adopting the method, the updating efficiency of the micro application can be improved.

Description

Dynamic updating method and device for micro application, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for dynamically updating a micro application, a computer device, a storage medium, and a computer program product.
Background
With the development of computer technology, terminal applications are widely used, and the terminal applications need to be updated frequently in order to repair security holes in the terminal applications or to add new functions in the terminal applications to improve the interactive experience of the terminal applications. In the conventional art, when a new version of an executable program for a terminal application is released, the terminal application is updated as a whole according to the newly released executable program. However, when a certain module in the terminal application is repaired or a new function is added, a new version of the update file needs to be released for the whole terminal application, that is, the whole terminal application needs to be updated to update a part of the modules, which results in low update efficiency.
Disclosure of Invention
In view of the above, it is necessary to provide a dynamic update method, apparatus, computer device, computer readable storage medium and computer program product for micro applications, which can improve update efficiency.
In a first aspect, the present application provides a method for dynamically updating a micro-application. The method comprises the following steps:
detecting a loading event of a target application program in the process of running the target application program;
determining the file type and version information of the micro application to be loaded according to the loading event;
obtaining a micro application index address based on the version information and the file type;
acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and loading the micro application resource to the target application program.
In a second aspect, the present application further provides a dynamic update apparatus for micro applications. The device comprises:
the detection module is used for detecting a loading event of a target application program in the process of running the target application program;
the determining module is used for determining the file type and version information of the micro application to be loaded according to the loading event;
an obtaining module, configured to obtain a micro application index address based on the version information and the file type;
the acquisition module is used for acquiring the micro application resources corresponding to the version information from the application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and the loading module is used for loading the micro application resource to the target application program.
In one embodiment, the determining module is further configured to:
acquiring a micro application scene identifier based on the loading event;
reading micro application configuration information from a configuration platform according to the micro application scene identifier;
and if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application.
In one embodiment, the determining module is further configured to:
extracting a gray object identification set of the micro application from the micro application configuration information;
acquiring a target object identifier registered in the target application program;
and if the gray object identification set contains the target object identification, determining to load the micro application.
In one embodiment, the apparatus further comprises:
the obtaining module is further configured to obtain a target component of the target application program, which has a function consistent with that of the micro application, if it is determined that the micro application is not loaded according to the micro application configuration information;
the loading module is also used for loading the target component consistent with the micro application function to the target application program.
In one embodiment, the determining module is further configured to:
determining a file type of the micro application, and determining version information of the micro application in the micro application configuration information;
the obtaining module is further configured to:
determining an application identifier of the micro application in the micro application configuration information;
and generating a micro application index address based on the version information, the file type and the application identifier.
In one embodiment, the target application is a different end application, including a native application, applet, or a public application; the device further comprises:
the acquisition module is further used for acquiring the environment variable corresponding to the micro application running an updated version in the target application program; acquiring tool packages corresponding to different end application programs according to the environment variables;
the first calling module is used for calling the service program defined in the universal base class based on the toolkit;
and the execution module is used for executing the application service by running the called service program.
In one embodiment, the apparatus further comprises:
the obtaining module is further configured to obtain an environment variable corresponding to the micro application running an updated version in the target application program, and an operation log generated by the micro application running the updated version;
and the reporting module is used for triggering a corresponding log reporting event according to the environment variable so as to report the running log to a log space corresponding to the environment variable through the log reporting event.
In one embodiment, an updated version of the micro-application includes at least one component; the device further comprises:
the second calling module is used for calling the shared interactive program according to the interactive instruction when the assembly receives the interactive instruction;
the processing module is used for processing the interactive instruction through the shared interactive program to obtain a processing result;
and the display module is used for displaying the interactive interface corresponding to the component based on the processing result.
In one embodiment, the loading module is further configured to:
accessing the micro application resource to the target application program through a micro front-end framework;
and analyzing the micro application resource to realize the fusion between the micro application with an updated version and the target application program.
In one embodiment, the loading module is further configured to:
analyzing the micro application resource to obtain analysis data;
rendering the analyzed data to obtain a micro application page;
and displaying the micro application page through the target application program to realize the fusion between the micro application with an updated version and the target application program.
In one embodiment, the apparatus further comprises:
the detection module is also used for detecting a page closing event of the micro application page;
a removal module to remove the micro application resource from the target application in response to the page close event.
In one embodiment, the apparatus further comprises:
the detection module is further used for detecting a communication request which is initiated by an external application and acts on the micro application with the updated version; the micro application of the updated version is isolated from external applications;
the establishing module is used for establishing an application communication channel between the external application and the micro application with an updated version;
and the transmission module is used for transmitting the interactive data between the external application and the micro application with the updated version based on the application communication channel.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
detecting a loading event of a target application program in the process of running the target application program;
determining the file type and version information of the micro application to be loaded according to the loading event;
obtaining a micro application index address based on the version information and the file type;
acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and loading the micro application resource to the target application program.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
detecting a loading event of a target application program in the process of running the target application program;
determining the file type and version information of the micro application to be loaded according to the loading event;
obtaining a micro application index address based on the version information and the file type;
acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and loading the micro application resource to the target application program.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
detecting a loading event of a target application program in the process of running the target application program;
determining the file type and version information of the micro application to be loaded according to the loading event;
obtaining a micro application index address based on the version information and the file type;
acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and loading the micro application resource to the target application program.
According to the method, the device, the computer equipment, the storage medium and the computer program product for dynamically updating the micro application, in the process of running the target application program, the loading event of the target application program is detected, and the file type and the version information of the micro application to be loaded are determined according to the loading event. Therefore, the micro application index address can be obtained based on the version information and the file type, the micro application resource with the updated version corresponding to the version information is obtained from the application platform according to the micro application index address, and then the micro application resource is loaded to the target application program, so that the integration of the micro application and the target application program is realized. Therefore, the terminal can dynamically load the micro application with the updated version to the target application program in the running process of the target application program, fuse the target application program and the micro application, and realize the updating of partial modules in the target application program without releasing the updated version to the target application program and integrally updating the target application program, thereby improving the updating efficiency. Furthermore, the target application program can share the micro application with other application programs in the running period, and the micro application can be reused among application programs of different technical stacks, so that a set of micro application does not need to be developed for each application program, and the module sharing among different application programs is realized. In addition, the target application program can be deconstructed into a plurality of independent micro applications, the coupling degree of the plurality of independent micro applications is low, the micro applications can be developed in parallel, and the development efficiency is improved.
Drawings
FIG. 1 is a diagram of an application environment for a method for dynamic update of a micro-application, according to one embodiment;
FIG. 2 is a flowchart illustrating a method for dynamically updating a micro-application in one embodiment;
FIG. 3a is a diagram illustrating micro-applications in a native application program, in one embodiment;
FIG. 3b is a diagram illustrating a micro-application in an applet, in one embodiment;
FIG. 3c is a diagram illustrating micro-applications in a social application cookie, in one embodiment;
FIG. 4 is a diagram that illustrates sharing of micro applications by applications of different technology stacks in one embodiment;
FIG. 5 is a diagram illustrating an embodiment in which multiple micro-applications compose a target application on-line;
FIG. 6 is a diagram of publishing a micro-application in one embodiment;
FIG. 7 is a flowchart illustrating a method for generating a micro-application index address in one embodiment;
fig. 8 is a flowchart illustrating a method for reporting an operation log according to an embodiment;
FIG. 9 is a diagram illustrating components in a micro-application, according to one embodiment;
FIG. 10 is a flowchart illustrating a method for merging a micro-application with a target application in one embodiment;
FIG. 11 is a schematic illustration of a micro-application execution environment in one embodiment;
FIG. 12 is a schematic diagram illustrating a method for dynamically updating a micro-application in one embodiment;
FIG. 13 is a flowchart illustrating a method for dynamically updating a micro-application in accordance with another embodiment;
FIG. 14 is a block diagram of a dynamic update apparatus for a micro application in one embodiment;
FIG. 15 is a block diagram showing the structure of a dynamic update apparatus for a micro application in another embodiment;
FIG. 16 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 dynamic update method for the micro application provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the application platform 104 via a network. In the process of running the target application program, the terminal 102 detects a loading event of the target application program, and determines the file type and version information of the micro application to be loaded according to the loading event. And acquiring a micro application index address based on the version information and the file type, and acquiring micro application resources corresponding to the version information from the application platform 104 according to the micro application index address, wherein the micro application resources comprise application files which are issued to the application platform and correspond to micro applications of updated versions. And loading the micro application resource to the target application program. The terminal 102 may be, but not limited to, various desktop computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The application platform 104 may be an independent physical server, or may be a server cluster composed of a plurality of service nodes in a block chain system, a point-To-point (P2P, Peer To Peer) network is formed among the service nodes, and the P2P Protocol is an application layer Protocol operating on a Transmission Control Protocol (TCP). The application platform 104 may also be a server cluster composed of a plurality of physical servers, and may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
In one embodiment, as shown in fig. 2, a method for dynamically updating a micro application is provided, which is described by taking the method as an example for being applied to the terminal in fig. 1, and includes the following steps:
s202, in the process of running the target application program, detecting a loading event of the target application program.
The target application is an application capable of implementing various functions, and may be a front-end application, including a communication application, a social application, an entertainment application, an office application, or a resource exchange application. The target application may be a complete application implemented based on various different technology stacks, for example, a native application deployed in various operating systems such as android or ios (iphone Operation system), an applet that can be used without downloading and installation, or a public application based on an HTML5(HyperText Mark-up Language 5) framework, and the like.
A load event is an event for loading an application module, which may be a micro-application, component, or other form of executable code block, in a target application program. For example, the loading event may be an event that loads a fund bar micro application in a social application; for another example, the loading event may be an event of loading the panel micro application in an applet. The load event may be an event triggered in a page of the target application. For example, the load event may be an event triggered by clicking a control in the target application page. For example, as shown in FIG. 3a, the load event may be a load event triggered by clicking on a "fund" control in the target application page, in response to which the fund bar micro-application is loaded.
In one embodiment, the load event is an event triggered by a page switch operation; s202 specifically includes: in the process of running the target application program, detecting page switching operation triggered by a control in the target application program. The page switching operation is an operation of indicating the target application program to be switched to the micro application page. And when the page switching operation of switching to the micro application page is detected, determining that a loading event is detected, and loading the micro application according to the loading event. Therefore, when the terminal runs the target application program, the micro application contained in the target application program is not required to be loaded in a full amount, and only the corresponding micro application resource is loaded when a certain micro application page is switched, so that loading according to needs can be realized, and the loading efficiency is improved.
And S204, determining the file type and version information of the micro application to be loaded according to the loading event.
The micro application is an independent application based on a micro front-end framework, can be independently developed and deployed, and can be reused by target application programs of various different technology stacks. For example, as shown in FIG. 3a, the micro-application may be a fund bar micro-application in an optional shares application; for another example, as shown in FIG. 3b, the micro-application may be a stock bar micro-application in a self-selection stock applet; as another example, as shown in FIG. 3c, the micro-application may be a forum micro-application that is a social application edition of a selected stock. The micro front end is a World Wide Web (global Wide area network) front end application composed of a plurality of independent micro applications, and supports independent development and deployment of each micro application. The life cycle of the micro application comprises loading micro application resources when a micro application page is opened, analyzing the micro application resources, rendering the page, and removing the micro application resources when the micro application page is closed. The terminal can manage the micro-application life cycle through the micro-front-end framework and provide an independent running environment isolated from external applications for each micro-application.
The file type is an entry file type of the micro application, and may be an HTML type or a js (javascript) type. The version information is information of an updated version of the to-be-loaded micro application, and may be a version identifier or a version number of the to-be-loaded micro application. For example, the version information is "fund bar V2.0".
In one embodiment, a micro-application implemented based on a set of source code may be shared by multiple target applications of different technology stacks, with similar product representations in each of the different target applications. For example, as shown in fig. 4, the first and second micro applications are both micro applications that are independently developed and deployed, and the first and second micro applications may be integrated online into a native application program in an operating system, or online into a public application, or online into an applet. The native application, the public application, and the applet in the operating system may share one or two micro applications.
In one embodiment, the number of the micro applications to be loaded in the target application program may be multiple, and each micro application to be loaded realizes a part of functions of the target application program. For example, as shown in fig. 5, all of the first to fourth micro applications are independently developed and deployed micro applications, and a complete target application program can be synthesized online through the first to fourth micro applications. The target application program provides a running environment for the micro-applications through the micro-front-end framework, so that the micro-applications are isolated from each other.
In one embodiment, S204 specifically includes: in response to a loading event, reading micro-application configuration information from a configuration platform; and extracting the file type and version information of the micro application from the micro application configuration information.
S206, acquiring the micro application index address based on the version information and the file type.
The micro application index address is a network address of a micro application resource, and may be a network address determined based on a network Protocol, and the network Protocol may be an HTTP (Hyper Text Transfer Protocol) Protocol or an HTTPs (Hyper Text Transfer Protocol over secure transport Layer) Protocol. For example, the micro application index address may be https:// wzq./micro-app/v0.6.9/index.
In one embodiment, S206 specifically includes: and assembling the version information and the file type according to the network address format to obtain the micro application index address. The network address format may be an address format determined according to a network protocol.
S208, acquiring micro application resources corresponding to the version information from the application platform according to the micro application index address; the micro-application resources include application files published to the application platform and corresponding to the updated version of the micro-application.
The application platform is a platform for delivering micro application resources, and may be a CDN (Content Delivery Network) platform. The CDN platform is an intelligent virtual network constructed on the basis of the existing network, and content is distributed by means of the load balancing function module, the content distribution function module and the scheduling function module which are deployed at each place and the central platform, so that network congestion is reduced, and the response speed to an access request is improved. The micro application resource is a resource required to run a micro application, and includes executable files in various formats, for example, files in a Java format, files in a CSS (Cascading Style Sheets) format, and the like.
In one embodiment, as shown in fig. 6, S208 further includes before: and debugging the source code of the micro application through a debugging tool, and sending the source code to the compiling platform after the debugging is passed. And compiling the source code through the compiling platform to obtain an executable file of the micro application resource. And finally, delivering the micro application resources to the CDN application platform, and simultaneously sending the version information corresponding to the micro application resources to the configuration platform. And the configuration platform writes the version information corresponding to the micro application with the updated version into the configuration table.
S210, loading the micro application resource to the target application program.
When the terminal acquires the micro application resource, the micro application resource is loaded to the target application program, and the micro application resource and the target application program are fused through the micro front-end framework.
In one embodiment, S210 is followed by: detecting a page closing event of a micro application page; in response to a page close event, the micro-application resource is removed from the target application. The page closing event is an event for instructing the terminal to close the micro application page. And when the page closing event of the micro application page is detected, removing the micro application resource from the target application program, and ending the life cycle of the micro application. When a page closing event is detected, the micro application resource is removed from the target application program, so that the memory space of the target application program can be saved, and the running speed of the target application program is increased.
In one embodiment, S210 specifically includes: acquiring a loading progress in the process of loading the micro application resources to the target application program; and displaying the loading progress bar in the page of the target application program, and adjusting the length of the loading progress bar according to the loading progress.
In the above embodiment, in the process of running the target application program, a loading event of the target application program is detected, and the file type and version information of the micro application to be loaded are determined according to the loading event. Therefore, the micro application index address can be obtained based on the version information and the file type, the micro application resource with the updated version corresponding to the version information is obtained from the application platform according to the micro application index address, and then the micro application resource is loaded to the target application program, so that the integration of the micro application and the target application program is realized. Therefore, the terminal can dynamically load the micro application with the updated version to the target application program in the running process of the target application program, fuse the target application program and the micro application, and realize the updating of partial modules in the target application program without releasing the updated version to the target application program and integrally updating the target application program, thereby improving the updating efficiency. Furthermore, the target application program can share the micro application with other application programs in the running period, and the micro application can be reused among application programs of different technical stacks, so that a set of micro application does not need to be developed for each application program, and the module sharing among different application programs is realized. In addition, the target application program can be deconstructed into a plurality of independent micro applications, the coupling degree of the plurality of independent micro applications is low, the micro applications can be developed in parallel, and the development efficiency is improved.
In one embodiment, as shown in fig. 6, S204 specifically includes the following steps:
s602, acquiring a micro application scene identifier based on the loading event.
The micro application scene identifier is an application scene identifier of the micro application, and may be composed of numbers, letters, characters, or special symbols. The application scenes of the micro applications include scenes used in various target applications. Different updated versions of the micro-application may be used due to the application scenarios for the micro-application, e.g., a first version of the micro-application for application scenarios used in social applications; for application scenarios used in communication applications, a second version of micro-applications is used. And when the terminal detects a loading event, acquiring a micro application scene identifier according to the loading event.
In one embodiment, S602 specifically includes: the terminal acquires the network address of the micro application page based on the loading event and determines the micro application scene identification according to the network address of the micro application page. Or, the terminal acquires a UA (User Agent) value of the browser based on the loading event, and determines the micro application scene identifier according to the UA value.
And S604, reading the micro application configuration information from the configuration platform according to the micro application scene identification.
Wherein the configuration platform is a platform for managing micro application configuration information. The micro application configuration information is information for configuring the micro application, and includes version information, a micro application scene identifier, a user identifier, and the like corresponding to the micro application, and may be stored in a configuration table of the configuration platform.
S606, if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application.
After the terminal reads the micro application configuration information from the configuration platform, whether the micro application is loaded or not is judged according to the micro application configuration information, and if the micro application is determined to be loaded according to the micro application configuration information, the file type and version information of the micro application are determined.
In one embodiment, S606 specifically includes: and extracting the version number of the micro application with the updated version from the micro application configuration information, and determining to load the micro application if the application state corresponding to the version number is the available state. After the micro application of the updated version is released, testing the micro application of the updated version, and if the micro application of the updated version is found to have defects in the test, marking the version number corresponding to the micro application of the updated version into an unavailable state; and if no defect is found in the test, marking the version number corresponding to the micro application of the updated version as a usable state.
In one embodiment, S606 specifically includes: extracting a gray object identification set of the micro application from the micro application configuration information; acquiring a target object identifier registered in a target application program; and if the gray object identification set contains the target object identification, determining to load the micro application.
The gray level object identification set is an object identification set for openly using the micro application with the updated version. When the micro application of the updated version is released, the newly released updated version may be unstable in operation, in order to reduce the influence of version upgrading, part of users are opened to use the updated version firstly to test and improve the updated version, and the updated version is opened to use for all users after the updated version is stable in operation. And the terminal acquires a target object identifier registered in the target application program, and determines to load the micro application in the target application program if the gray object identifier set contains the target object identifier which is a user object opened to use the micro application of the updated version. Before the micro application of the updated version is opened and used for all users, the micro application of the updated version is tested through the gray objects in the gray object identification set, so that the influence caused by version upgrading can be reduced, and the running stability of the micro application is improved.
In one embodiment, S606 specifically includes: and if the micro application is determined to be loaded according to the micro application configuration information, inquiring the file type and version information corresponding to the micro application scene identification in the micro application configuration information to obtain the file type and version information of the micro application.
In the above embodiment, the micro application scene identifier is obtained based on the loading event, and the micro application configuration information is read from the configuration platform according to the micro application scene identifier. Therefore, the corresponding updated version micro application can be selected according to different micro application scenes. And if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application. The influence on use caused by loading when the micro application of the updated version is unavailable is avoided, and the loading efficiency is improved.
In one embodiment, S606 is followed by: if determining not to load the micro-application according to the micro-application configuration information, acquiring a target component of the target application program, which has the same function as the micro-application; and loading the target component consistent with the micro application function to the target application program.
The target component is a component consistent with the micro application function, and may be an npm (Node Package Manager) framework component. The target components are consistent with the functionality of the micro-applications and are packaged in the target application program at the time of compilation of the target application program. And if determining not to load the micro application according to the micro application configuration information, loading the target component with the function consistent with the micro application into the target application program.
In one embodiment, the target component is published simultaneously with the publication of the updated version of the micro-application. The released target component and the micro application with the updated version are compiled by the same set of source codes. And simultaneously issuing the micro application and the target component in the issuing stage of the micro application, and realizing the same function as the micro application in a mode of accessing the target component when the terminal cannot be compatible with the micro application or the issued micro application is unavailable.
In the above embodiment, if it is determined that the micro application is not loaded according to the micro application configuration information, the target component of the target application program, which has the same function as the micro application, is obtained, and the target component, which has the same function as the micro application, is loaded to the target application program. Therefore, when the micro application with the updated version is unavailable, the target component packaged in the target application program is used for backing up, the product function same as that of the micro application is presented, the fault is avoided in the loading process, and the loading efficiency is improved.
In one embodiment, as shown in fig. 7, S606 specifically includes S702, and S206 specifically includes S704-S706:
s702, determining the file type of the micro application, and determining the version information of the micro application in the micro application configuration information.
The file type of the micro application is an Entry file type of the micro application, and may be an HTML Entry type or a JS Entry type. The terminal acquires a pre-configured file type and determines the version information of the micro application in the micro application configuration information, wherein the determined version information can be the version number of the micro application with an updated version.
In one embodiment, S702 specifically includes: and determining the version information of the micro application in the micro application configuration information according to the micro application scene identification. For example, the micro application configuration information includes "scene identification 1: version 3; scene identification 2: version 2; scene identification 3: version 4 ", if the micro application scene identifier is 3, the determined version information is" version 4 ".
S704, determining the application identification of the micro application in the micro application configuration information.
The application identifier is a unique identifier for marking each micro application, and may be composed of numbers, letters, characters, or special symbols. The micro application configuration information may include an application identifier of the micro application, for example, the micro application configuration information is "micro application 1 — scene identifier 1: version 3 ".
S706, generating a micro application index address based on the version information, the file type and the application identification.
When determining the application identifier, the version information and the file type of the micro application to be loaded, the terminal assembles the application identifier, the version information and the file type to obtain a micro application index address, so as to obtain micro application resources from the release platform according to the micro application index address.
In one embodiment, S706 specifically includes: and assembling the version information, the file type and the application identification according to the network address format to obtain the micro application index address. The network address format is a format defined by a network protocol, and the network protocol may be an HTTP protocol or an HTTPs protocol, etc. The HTTP protocol is a hypertext transfer protocol running on top of the TCP protocol. The HTTPS protocol is a network transport protocol that adds SSL (Secure Sockets Layer) to the HTTP protocol and can perform encrypted transmission.
And the terminal assembles the version information, the file type and the application identification according to the network address format to obtain the micro application index address. For example, the micro application index address is https:// wzq./micro-app/v0.6.9/index. html, wherein "micro-app" is the application identification, "v0.6.9" is the version information, and "html" is the file type.
In the above embodiment, the file type of the micro application is determined, and the version information of the micro application and the application identifier of the micro application are determined in the micro application configuration information. A micro-application index address is generated based on the version information, the file type, and the application identification. Therefore, micro application resources can be downloaded from the application platform according to the micro application index address, the micro application resources are fused with the target application program, updating of part of modules in the target application program can be achieved without issuing an update file aiming at the target application program, and updating efficiency is improved.
In one embodiment, the target application is a different end application, including a native application, an applet, or a public application; after S210, further comprising: acquiring an environment variable corresponding to a micro application running an updated version in a target application program; acquiring tool packages corresponding to different end application programs according to the environment variables; calling a service program defined in the universal base class based on the tool kit; and executing the application service by running the called service program.
The environment variable is a variable used for representing the running environment corresponding to the updated version of the micro application, and a Software Development Kit (SDK) corresponding to different ends is mapped through the environment variable. The toolkit is a set of development tools corresponding to the Application, and includes a set of APIs (Application Programming interfaces) that the Application can call, and a set of other related documents, paradigms, and tools. The universal base class is a base class uniformly defined for application programs at different ends and is instantiated in the running process of the application programs. In the general base class, service programs are defined and unified for application programs at different ends, and the service programs are programs for executing application services and can be realized by functions defined in the base class. The executed application services include all services that can be executed by the application programs at different ends, such as page display, popup, text editing and the like.
In the above embodiment, the environment variable corresponding to the micro application running the updated version in the target application program is obtained, and the tool kit corresponding to the application program at different ends is obtained according to the environment variable. And calling the service program defined in the general base class based on the tool kit, and executing the application service by running the called service program. Because a plurality of tool packages inheriting the universal base class are packaged aiming at different end application programs, the micro application can complete application service through the corresponding tool packages when running, so that the micro application can run in the different end application programs, the different end application programs can share the same micro application, and the application programs of different technical stacks can dynamically share the same service module.
In one embodiment, as shown in fig. 8, the following steps are further included after S210:
s802, acquiring an environment variable corresponding to the micro application running the updated version in the target application program and an operation log generated by the micro application running the updated version.
The running log is a log used for recording the running state of the micro application, and may include data acquired by the micro application during running, generated data, alarm information, error information, configuration information, or the like. Errors generated during the running of the micro-application can be checked through the running log, and the micro-application is convenient to maintain.
And S804, triggering a corresponding log reporting event according to the environment variable, and reporting the running log to a log space corresponding to the environment variable through the log reporting event.
The log reporting event is an event for reporting the running log to a log space. The log space is a storage space for storing the operation log, and may be a disk space of the terminal.
In one embodiment, S804 specifically includes: the terminal determines a log identifier of the running log according to the environment variable, then triggers a log reporting event, calls a point burying method in the target application program through the log reporting event, and reports the running log to a log space corresponding to the environment variable through the called point burying method.
In the above embodiment, the environment variable corresponding to the micro application running the updated version in the target application program and the running log generated by the micro application running the updated version are obtained. And triggering a corresponding log reporting event according to the environment variable, so as to report the running log to a log space corresponding to the environment variable through the log reporting event. Therefore, when the micro application runs in application programs at different ends, the generated running logs can be reported to different log spaces so as to distinguish the flow from the application programs at different ends, and the same service module can be dynamically shared among the application programs of different technical stacks.
In one embodiment, an updated version of a micro-application includes at least one component; after S210, further comprising: when the component receives the interactive instruction, calling the shared interactive program according to the interactive instruction; processing the interactive instruction through the shared interactive program to obtain a processing result; and displaying the interactive interface corresponding to the component based on the processing result.
The component in the micro application is a component of the micro application and can be a graphical entity. For example, as shown in fig. 9, "view all", "comment" or "discussion area" displayed in the micro application is a component in the micro application, through which an interactive instruction for the micro application can be triggered. A shared interactive program is an interactive program shared among at least one component in a micro-application. And each component can execute the same processing method on the interactive instruction through the shared interactive program to obtain a processing result.
Specifically, as specifically explained in conjunction with fig. 9, when a user triggers an interactive instruction by clicking on the "forum 1" component or the "forum 2" component, the processing method of the interactive instruction triggered by the "forum 1" component and the "forum 2" component by the micro application is the same, so in order to save resources, the "forum 1" component and the "forum 2" component share an interactive program, and the interactive instruction triggered by the two components is processed by the shared interactive program, so that the interactive program does not need to be developed separately for the "forum 1" component and the "forum 2" component, thereby avoiding resource waste and improving the development efficiency of the program.
In the above embodiment, when the component receives the interactive instruction, the shared interactive program is called according to the interactive instruction. And processing the interactive instruction through the shared interactive program, and displaying an interactive interface corresponding to the component based on a processing result. Therefore, interactive programs do not need to be developed aiming at all the components, the development efficiency of the micro application is improved, and resources are saved.
In one embodiment, as shown in fig. 10, S210 specifically includes the following steps:
and S1002, accessing the micro application resource to the target application program through the micro front-end framework.
The micro front-end framework is a front-end framework created through a micro front-end technology, and is used for fusing micro application resources with a target application program, providing a running environment for the micro application and managing the life cycle of the micro application. In the micro front-end framework, the target application program can be formed by combining a plurality of micro applications, and each micro application can be independently developed and deployed and can run independently. The terminal can access a plurality of micro application resources to the target application program through the micro front-end framework, and the accessed micro application resources are fused with the target application program.
S1004, the micro application resources are analyzed, so that fusion between the micro application with the updated version and the target application program is realized.
The micro application resource comprises a plurality of resource files, the terminal analyzes the resource files in sequence and executes the resource files according to the analyzed data so as to realize the fusion between the micro application with the updated version and the target application program.
In one embodiment, S1004 specifically includes: analyzing the micro application resource to obtain analysis data; rendering the analyzed data to obtain a micro application page; and displaying the micro application page through the target application program to realize the fusion between the micro application with the updated version and the target application program.
The micro application page is a network page obtained by rendering micro application resources, and may include characters, pictures, controls, audio or video. The terminal can firstly analyze the micro application entry file, render the page according to the analysis data, then execute the analysis of other micro application resource files, render the page according to the analysis data, and complete the rendering of the page when all the micro application resource files are executed, so as to obtain the micro application page. The terminal displays the micro application page through the target application program, fusion between the micro application of the updated version and the target application program is achieved, and the function of the micro application is achieved in the target application program.
In the above embodiment, the micro application resource is accessed to the target application program through the micro front-end framework, and the micro application resource is analyzed, so as to realize the fusion between the micro application of the updated version and the target application program. Therefore, partial modules in the target application program can be updated without releasing an updated version of the target application program and integrally updating the target application program, and the updating efficiency is improved.
In one embodiment, S210 is followed by: detecting a communication request initiated by an external application and acting on a micro application of an updated version; the micro application of the updated version and the external application are isolated from each other; establishing an application communication channel between the external application and the updated version of the micro application; interactive data between the external application and the updated version of the micro-application is transmitted based on the application communication channel.
The external application may be other than the updated version of the micro application, and may be a micro application or an application program of various technology stacks. The communication request is a request for communicating with the micro application, and comprises a communication request for performing functional interaction with the micro application and a communication request for performing data transfer with the micro application. The terminal can establish an application communication channel between the external application and the micro application with the updated version through the micro front-end framework, and transmits interactive data between the external application and the micro application with the updated version based on the application communication channel. As shown in fig. 11, the running environment of the micro application is isolated from the external application, and the communication between the micro application and the external application is realized through the communication unit in the micro front-end framework. When the micro application runs in a running environment isolated from the outside, the micro application is communicated with the outside application through the application communication channel, the reliability of communication is guaranteed, the running of the micro application and the outside application are not affected mutually, and the independence of the micro application is guaranteed.
In the above embodiment, a communication request initiated by the external application and acting on the updated version of the micro application is detected, an application communication channel between the external application and the updated version of the micro application is established, and the interactive data between the external application and the updated version of the micro application is transmitted based on the application communication channel. Therefore, the micro application can run in the running environment isolated from the outside, the conflict between the micro application and the outside application is avoided, and the independent running of the micro application is realized.
In one embodiment, as shown in fig. 12, a plurality of micro applications are independently developed, the plurality of micro applications can synthesize a target application on-line, and the target application can be applications of various technology stacks, including native applications, applets, or public applications, and the like. And then delivering the micro application resources corresponding to the micro applications to the CDN platform, and updating the version number of each micro application to the configuration platform after the delivery is successful. When the micro application of the updated version is released, the micro application of the updated version is verified by opening part of gray level users, and after the verification is passed, the micro application of the updated version is opened to all users. And if the micro application of the updated version fails to be verified, starting a rollback switch to roll back to the micro application of the historical version so as to ensure the stability of the version upgrading process.
When compiling the front-end source code, the front-end source code can be constructed into npm component versions and micro application versions respectively, and the functions of the micro application versions and npm component versions are consistent. As shown in fig. 6, a micro application and a npm framework component are respectively constructed for a front-end source code, so that when an update file of a micro application version is unavailable, a npm version of the update file is used for backing up, and therefore, on a low-version terminal device which cannot be compatible with the micro application, access of corresponding functions can be directly reduced to a npm mode, and stability of an upgrading process is guaranteed.
And after the micro application of the updated version is successfully released, if the micro application page corresponding to the micro application of the updated version is switched to in the process of running the target application program, acquiring the micro application configuration information according to the micro application scene identifier. And judging whether to load the micro application with the updated version according to the micro application configuration information. And if determining to load the micro application with the updated version, determining the file type of the micro application, determining the version information of the micro application in the micro application configuration information, and splicing the version information, the file type and the application identification to obtain the micro application index address. And acquiring the micro application resources from the application platform according to the micro application index address, loading the micro application resources to the target application program, rendering the micro application resources, and displaying a micro application page in the target application program to realize the fusion of the micro application with an updated version and the target application program. If determining not to load the micro-application according to the micro-application configuration information, acquiring a target component of the target application program, which has the same function as the micro-application; and loading the target component consistent with the micro application function to the target application program.
The micro application can run in a multi-terminal environment, corresponding SDKs are packaged aiming at different terminals in the development stage of the micro application, and the SDKs corresponding to the different terminals inherit a unified universal base class. In the running period of the micro application, the SDKs corresponding to different ends are obtained through the environment variables, and the functions defined in the general base classes are called to execute the application service, so that the sharing of the micro application in the multi-end environment is realized. And reporting the operation logs generated by the micro applications operated at different ends to different log spaces so as to distinguish the flow from different ends. And generating a log name according to the environment variables corresponding to different ends, triggering a log reporting event, and reporting the running log to a corresponding log space by a point burying method defined in a target application program. Because the micro application is formed by rendering a plurality of components, the components at the lower layer can be nested in the components at the outer layer, the events triggered in the components are distributed outwards by the components at the innermost layer, and the application state modification and the interactive processing are uniformly carried out at the entrance of the micro application. And for the same event in different components, the same event is uniformly processed at the entrance of the micro application, so that the logic multiplexing of each component is realized.
In one embodiment, as shown in fig. 13, the method for dynamically updating a micro application includes the following steps:
s1302, in the process of running the target application program, detecting a loading event of the target application program.
S1304, acquiring a micro application scene identifier based on the loading event; and reading the micro application configuration information from the configuration platform according to the micro application scene identification.
S1306, extracting a gray object identification set of the micro application from the micro application configuration information; acquiring a target object identifier registered in a target application program; and if the gray object identification set contains the target object identification, determining to load the micro application.
S1308, determining the file type of the micro application, and determining the version information of the micro application in the micro application configuration information; an application identification of the micro-application is determined in the micro-application configuration information.
S1310, generating a micro application index address based on the version information, the file type and the application identification.
S1312, acquiring micro application resources corresponding to the version information from the application platform according to the micro application index address; and loading the micro application resource to the target application program.
S1314, accessing the micro application resources to the target application program through the micro front-end framework; analyzing the micro application resource to obtain analysis data; rendering the analyzed data to obtain the micro application page.
S1316, the micro application page is displayed through the target application program, and fusion between the micro application of the updated version and the target application program is achieved.
S1318, if the micro application is determined not to be loaded according to the micro application configuration information, acquiring a target component of the target application program, wherein the target component has the same function as the micro application; and loading the target component consistent with the micro application function to the target application program.
S1320, obtaining the environment variable corresponding to the micro application running the updated version in the target application program.
S1322, acquiring tool packages corresponding to the application programs of different ends according to the environment variables; calling a service program defined in the universal base class based on the tool kit; and executing the application service by running the called service program.
S1324, detecting a page closing event of the micro application page; in response to a page close event, the micro-application resource is removed from the target application.
The specific contents of S1302 to S1324 may refer to the specific implementation process described above.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially 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 a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a dynamic update apparatus for a micro application, which is used for implementing the above-mentioned dynamic update method for a micro application. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, so specific limitations in the following embodiments of the dynamic update apparatus for one or more micro applications may refer to the limitations in the above dynamic update method for micro applications, and details are not described here.
In one embodiment, as shown in fig. 14, there is provided a dynamic update apparatus of a micro application, including: a detection module 1402, a determination module 1404, an obtaining module 1406, an obtaining module 1408, and a loading module 1410, wherein:
a detection module 1402, configured to detect a loading event of a target application in a process of running the target application;
a determining module 1404, configured to determine, according to the loading event, a file type and version information of the to-be-loaded micro application;
an obtaining module 1406 for obtaining a micro application index address based on the version information and the file type;
an obtaining module 1408, configured to obtain, according to the app index address, a app resource corresponding to the version information from the application platform; the micro application resources comprise application files which are released to the application platform and correspond to micro applications of updated versions;
and a loading module 1410, configured to load the micro application resource to the target application program.
In the above embodiment, in the process of running the target application program, a loading event of the target application program is detected, and the file type and version information of the micro application to be loaded are determined according to the loading event. Therefore, the micro application index address can be obtained based on the version information and the file type, the micro application resource with the updated version corresponding to the version information is obtained from the application platform according to the micro application index address, and then the micro application resource is loaded to the target application program, so that the integration of the micro application and the target application program is realized. Therefore, the terminal can dynamically load the micro application with the updated version to the target application program in the running process of the target application program, fuse the target application program and the micro application, and realize the updating of partial modules in the target application program without releasing the updated version to the target application program and integrally updating the target application program, thereby improving the updating efficiency. Furthermore, the target application program can share the micro application with other application programs in the running period, and the micro application can be reused among application programs of different technical stacks, so that a set of micro application does not need to be developed for each application program, and the module sharing among different application programs is realized. In addition, the target application program can be deconstructed into a plurality of independent micro applications, the coupling degree of the plurality of independent micro applications is low, the micro applications can be developed in parallel, and the development efficiency is improved.
In one embodiment, the determining module 1404 is further configured to:
acquiring a micro application scene identifier based on a loading event;
reading micro application configuration information from a configuration platform according to the micro application scene identifier;
and if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application.
In the above embodiment, the micro application scene identifier is obtained based on the loading event, and the micro application configuration information is read from the configuration platform according to the micro application scene identifier. Therefore, the corresponding updated version micro application can be selected according to different micro application scenes. And if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application. The influence on use caused by loading when the micro application of the updated version is unavailable is avoided, and the loading efficiency is improved.
In one embodiment, the determining module 1404 is further configured to:
extracting a gray object identification set of the micro application from the micro application configuration information;
acquiring a target object identifier registered in a target application program;
and if the gray level object identification set contains the target object identification, determining to load the micro application.
In one embodiment, the apparatus further comprises:
the obtaining module 1408 is further configured to obtain a target component of the target application program, which is consistent with the micro application function, if it is determined that the micro application is not loaded according to the micro application configuration information;
and the loading module 1410 is further configured to load the target component consistent with the micro-application function to the target application program.
In the above embodiment, if it is determined not to load the micro application according to the micro application configuration information, the target component of the target application program, which has the same function as the micro application, is obtained, and the target component, which has the same function as the micro application, is loaded to the target application program. Therefore, when the micro application with the updated version is unavailable, the target component packaged in the target application program is used for backing up, the product function same as that of the micro application is presented, the fault is avoided in the loading process, and the loading efficiency is improved.
In one embodiment, the determining module 1404 is further configured to:
determining the file type of the micro application, and determining the version information of the micro application in the micro application configuration information;
an obtaining module 1406 further configured to:
determining an application identifier of the micro application in the micro application configuration information;
a micro-application index address is generated based on the version information, the file type, and the application identification.
In the above embodiment, the file type of the micro application is determined, and the version information of the micro application and the application identifier of the micro application are determined in the micro application configuration information. A micro-application index address is generated based on the version information, the file type, and the application identification. Therefore, micro application resources can be downloaded from the application platform according to the micro application index address, the micro application resources are fused with the target application program, updating of part of modules in the target application program can be achieved without issuing an update file aiming at the target application program, and updating efficiency is improved.
In one embodiment, the target application is a different end application, including a native application, applet, or a public application; as shown in fig. 15, the apparatus further includes:
the obtaining module 1408 is further configured to obtain an environment variable corresponding to the micro application running the updated version in the target application program; acquiring tool packages corresponding to different end application programs according to the environment variables;
a first calling module 1412, configured to call, based on the toolkit, a service program defined in the generic base class;
and an execution module 1414, configured to execute the application service by running the invoked service program.
In the above embodiment, the environment variable corresponding to the micro application running the updated version in the target application program is obtained, and the tool kit corresponding to the application program at different ends is obtained according to the environment variable. And calling the service program defined in the general base class based on the tool kit, and executing the application service by running the called service program. Because a plurality of tool packages inheriting the universal base class are packaged aiming at different end application programs, the micro application can complete application service through the corresponding tool packages when running, so that the micro application can run in the different end application programs, the different end application programs can share the same micro application, and the application programs of different technical stacks can dynamically share the same service module.
In one embodiment, the apparatus further comprises:
the obtaining module 1408 is further configured to obtain an environment variable corresponding to the micro application running the updated version in the target application program, and an operation log generated by the micro application running the updated version;
the reporting module 1416 is configured to trigger a corresponding log reporting event according to the environment variable, so as to report the running log to a log space corresponding to the environment variable through the log reporting event.
In the above embodiment, the environment variable corresponding to the micro application running the updated version in the target application program and the running log generated by the micro application running the updated version are obtained. And triggering a corresponding log reporting event according to the environment variable, so as to report the running log to a log space corresponding to the environment variable through the log reporting event. Therefore, when the micro application runs in different end application programs, the generated running log can be reported to different log spaces so as to distinguish the flow from the different end application programs, and the same service module can be dynamically shared among the application programs of different technical stacks.
In one embodiment, an updated version of a micro-application includes at least one component; the device still includes:
a second calling module 1418, configured to, when the component receives the interaction instruction, call the shared interaction program according to the interaction instruction;
the processing module 1420 is configured to process the interaction instruction through the shared interaction program to obtain a processing result;
and the display module 1422 is configured to display an interactive interface corresponding to the component based on the processing result.
In the above embodiment, when the component receives the interactive instruction, the shared interactive program is called according to the interactive instruction. And processing the interactive instruction through the shared interactive program, and displaying an interactive interface corresponding to the component based on a processing result. Therefore, interactive programs do not need to be developed aiming at all the components, the development efficiency of the micro application is improved, and resources are saved.
In one embodiment, the loading module 1410 is further configured to:
accessing micro application resources to a target application program through a micro front-end framework;
and analyzing the micro application resources to realize the fusion between the micro application with the updated version and the target application program.
In one embodiment, the loading module 1410 is further configured to:
analyzing the micro application resource to obtain analysis data;
rendering the analyzed data to obtain a micro application page;
and displaying the micro application page through the target application program to realize the fusion between the micro application with the updated version and the target application program.
In the above embodiment, the micro application resource is accessed to the target application program through the micro front-end framework, and the micro application resource is analyzed, so as to realize the fusion between the micro application of the updated version and the target application program. Therefore, partial modules in the target application program can be updated without releasing an updated version of the target application program and integrally updating the target application program, and the updating efficiency is improved.
In one embodiment, the apparatus further comprises:
the detecting module 1402 is further configured to detect a page close event of the micro application page;
a removal module 1424, configured to remove the micro application resource from the target application in response to the page close event.
In one embodiment, the apparatus further comprises:
a detection module 1402, further configured to detect a communication request initiated by an external application and acting on the updated version of the micro application; the micro application of the updated version and the external application are isolated from each other;
an establishing module 1426, configured to establish an application communication channel between an external application and the updated version of the micro application;
a transmission module 1428, configured to transmit interaction data between the external application and the updated version of the micro application based on the application communication channel.
In the above embodiment, a communication request initiated by the external application and acting on the updated version of the micro application is detected, an application communication channel between the external application and the updated version of the micro application is established, and the interaction data between the external application and the updated version of the micro application is transmitted based on the application communication channel. Therefore, the micro application can run in the running environment isolated from the outside, the conflict between the micro application and the outside application is avoided, and the independent running of the micro application is realized.
The various modules in the dynamic update apparatus of the above-described micro-application may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 16. The computer apparatus includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input device. The processor, the memory and the input/output interface are connected by a system bus, and the communication interface, the display unit and the input device are connected by the input/output interface to the 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 operating system and the computer program to run on the non-volatile storage medium. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a method for dynamic updating of micro-applications. The display unit of the computer equipment is used for forming a visual and visible picture, and can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, 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, and can also be 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. 16 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, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the above-described method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant country and region.
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 may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
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 present application. 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 application shall be subject to the appended claims.

Claims (16)

1. A method for dynamically updating a micro-application, the method comprising:
detecting a loading event of a target application program in the process of running the target application program;
determining the file type and version information of the micro application to be loaded according to the loading event;
obtaining a micro application index address based on the version information and the file type;
acquiring micro application resources corresponding to the version information from an application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and loading the micro application resource to the target application program.
2. The method of claim 1, wherein determining file type and version information of the micro application to be loaded according to the loading event comprises:
acquiring a micro application scene identifier based on the loading event;
reading micro application configuration information from a configuration platform according to the micro application scene identifier;
and if the micro application is determined to be loaded according to the micro application configuration information, determining the file type and version information of the micro application.
3. The method of claim 2, wherein determining to load the micro-application according to the micro-application configuration information comprises:
extracting a gray object identification set of the micro application from the micro application configuration information;
acquiring a target object identifier registered in the target application program;
and if the gray object identification set contains the target object identification, determining to load the micro application.
4. The method of claim 2, further comprising:
if the micro application is determined not to be loaded according to the micro application configuration information, acquiring a target component of the target application program, wherein the target component has the same function as the micro application;
and loading the target component consistent with the micro application function to the target application program.
5. The method of claim 2, wherein determining the file type and version information for the micro-application comprises:
determining a file type of the micro application, and determining version information of the micro application in the micro application configuration information;
the obtaining a micro application index address based on the version information and the file type comprises:
determining an application identifier of the micro application in the micro application configuration information;
and generating a micro application index address based on the version information, the file type and the application identifier.
6. The method of claim 1, wherein the target application is a different end application, including a native application, an applet, or a public application; after the loading the micro application resource to the target application program, the method further comprises:
acquiring an environment variable corresponding to the micro application running an updated version in the target application program;
acquiring tool packages corresponding to different end application programs according to the environment variables;
calling a service program defined in a universal base class based on the toolkit;
and executing the application service by running the called service program.
7. The method of claim 1, further comprising:
acquiring an environment variable corresponding to the micro application running an updated version in the target application program and an operation log generated by the micro application running the updated version;
and triggering a corresponding log reporting event according to the environment variable, so as to report the running log to a log space corresponding to the environment variable through the log reporting event.
8. The method of claim 1, wherein an updated version of the micro-application comprises at least one component; the method further comprises the following steps:
when the component receives an interactive instruction, calling a shared interactive program according to the interactive instruction;
processing the interactive instruction through the shared interactive program to obtain a processing result;
and displaying an interactive interface corresponding to the component based on the processing result.
9. The method of any of claims 1 to 8, wherein said loading the micro application resource to the target application comprises:
accessing the micro application resource to the target application program through a micro front-end framework;
and analyzing the micro application resource to realize the fusion between the micro application with an updated version and the target application program.
10. The method of claim 9, wherein parsing the micro-application resource to achieve a fusion between an updated version of the micro-application and the target application comprises:
analyzing the micro application resource to obtain analysis data;
rendering the analyzed data to obtain a micro application page;
and displaying the micro application page through the target application program to realize the fusion between the micro application of the updated version and the target application program.
11. The method according to any one of claims 1 to 8, further comprising:
detecting a page closing event of the micro application page;
in response to the page close event, removing the micro-application resource from the target application.
12. The method according to any one of claims 1 to 8, further comprising:
detecting a communication request initiated by an external application to act on an updated version of the micro-application; the micro application of the updated version is isolated from external applications;
establishing an application communication channel between the external application and an updated version of the micro-application;
transmitting interaction data between the external application and an updated version of the micro-application based on the application communication channel.
13. An apparatus for dynamically updating a micro-application, the apparatus comprising:
the detection module is used for detecting a loading event of a target application program in the process of running the target application program;
the determining module is used for determining the file type and version information of the micro application to be loaded according to the loading event;
the obtaining module is used for obtaining a micro application index address based on the version information and the file type;
the acquisition module is used for acquiring the micro application resources corresponding to the version information from the application platform according to the micro application index address; the micro application resource comprises an application file which is released to the application platform and corresponds to the micro application of an updated version;
and the loading module is used for loading the micro application resource to the target application program.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 12.
15. 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 12.
16. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 12 when executed by a processor.
CN202210535059.5A 2022-05-17 2022-05-17 Dynamic updating method and device for micro application, computer equipment and storage medium Pending CN115113898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210535059.5A CN115113898A (en) 2022-05-17 2022-05-17 Dynamic updating method and device for micro application, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210535059.5A CN115113898A (en) 2022-05-17 2022-05-17 Dynamic updating method and device for micro application, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115113898A true CN115113898A (en) 2022-09-27

Family

ID=83326170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210535059.5A Pending CN115113898A (en) 2022-05-17 2022-05-17 Dynamic updating method and device for micro application, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115113898A (en)

Similar Documents

Publication Publication Date Title
CN108334436B (en) Application software optimization method, device, equipment and computer readable storage medium
CN108334387B (en) Dynamic interface rendering method and device
CN114008994B (en) Method and system for proxy server to receive request from client to network server and response from network server to client corresponding to the request
US9665465B1 (en) Automated determination of application permissions
CN105335132B (en) Method, device and system for customizing application program function
CN113055492A (en) Control method and device for service gray scale link, computer equipment and storage medium
CN107729452B (en) Webpage loading method and device, electronic equipment and computer readable storage medium
US11846972B2 (en) Method and apparatus for generating software test reports
CN111782300A (en) Data processing method, device, equipment and system
CN104715309A (en) Service control method and device
CN106843901B (en) Page rendering and verification method and device
US20140157144A1 (en) Network system
JP2022505656A (en) Sub-application development methods, equipment, computer equipment, and computer programs
CN113778442A (en) System menu generating method, device, equipment and storage medium
CN114385382A (en) Light application access method and device, computer equipment and storage medium
US9164817B2 (en) Mobile communication terminal to provide widget expansion function using message communication, and operation method of the mobile communication terminal
JP2005228183A (en) Program execution method and computer system for executing the program
CN115113898A (en) Dynamic updating method and device for micro application, computer equipment and storage medium
CN110865818A (en) Application associated domain name detection method and device and electronic equipment
CN114428737A (en) Communication method, device, equipment and storage medium based on micro service system
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN112667441A (en) Service module scheduling method, system and storage medium based on fault-tolerant function
CN114428723A (en) Test system, system test method, related device and storage medium
CN112068895A (en) Code configuration method and device, video playing equipment and storage medium
CN113542323A (en) Service processing method, device, equipment and computer readable storage medium

Legal Events

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