CN111240730A - Application program updating method and device - Google Patents

Application program updating method and device Download PDF

Info

Publication number
CN111240730A
CN111240730A CN202010131923.6A CN202010131923A CN111240730A CN 111240730 A CN111240730 A CN 111240730A CN 202010131923 A CN202010131923 A CN 202010131923A CN 111240730 A CN111240730 A CN 111240730A
Authority
CN
China
Prior art keywords
native
version
application program
update
hot
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
CN202010131923.6A
Other languages
Chinese (zh)
Inventor
原鹏飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202010131923.6A priority Critical patent/CN111240730A/en
Publication of CN111240730A publication Critical patent/CN111240730A/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
    • G06F8/656Updates while running
    • 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)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application is suitable for development in research and development management, and discloses an application program updating method, which comprises the following steps: acquiring an RN hot update resource packet of a first application program, and adding the RN hot update resource packet to a first path; acquiring a first native version of a first native packet and an update version of an RN hot update resource packet; when the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version, and updating an operation file associated with the first application program and the native framework according to an operation result of the second native package, wherein the second native version is matched with the updated version; and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet. By the method and the device, the native packages of the application programs and the RN resources can be operated independently under the condition that the native packages are compatible with the RN resources, and the updating flexibility of the application programs is improved.

Description

Application program updating method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application updating method and apparatus.
Background
The Read Native (RN) is an open-source cross-platform mobile application development framework developed by Facebook (Facebook), and currently supports two major platforms, namely an apple mobile device Operating System (iOS) and an android. The RN develops the mobile application program by using Javascript language, Cascading Style Sheets (CSS) and the like, so that technical personnel familiar with network (Web) development can enter the field of mobile application development by virtue of the RN technology with little learning, and can simultaneously develop cross-platform type native application programs based on IOS and android mobile systems. Due to the adoption of the RN technology, the development efficiency of the mobile application program is improved to a certain extent.
At present, pure RN Application programs are almost rarely seen, and most of Application programs (APPs) applied to RNs in the market are embedded with partial RN codes based on native code shells, so that upgrading of such APPs also correspondingly involves three main problems of native upgrading, RN upgrading and the relationship between the two upgrades, and therefore, it is very important to coordinate the relationship between RN upgrading and native upgrading and realize updating of APPs under the condition of consuming less resources.
Disclosure of Invention
Based on this, the application provides an application program updating method and device, so as to improve the flexibility of application program updating.
A first aspect of an embodiment of the present application provides an application program updating method, including:
acquiring an RN hot update resource packet of a first application program, and adding the RN hot update resource packet to a first path, wherein the first path is different from a second path in which a first native packet of the first application program is positioned;
obtaining a first native version of a first native package of the first application and an updated version of the RN hot-update resource package, the first native version being indicative of a version of a native framework of the first application;
under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot update resource package, and updating an operation file associated with the first application program and a native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version;
and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet.
Wherein the method further comprises:
acquiring a maximum RN version matched with the first native version, wherein the maximum RN version is an RN version with the maximum release time in an RN version set matched with the first native version;
determining that the first native version matches the updated version if the maximum RN version is greater than or equal to the updated version;
determining that the first native version does not match the updated version if the maximum RN version is less than the updated version.
Wherein the first native package of the first application includes native resources and RN base resources, and the method further includes:
if the running process of the RN hot update resource packet is abnormal, extracting the RN basic resource in the first native packet;
and running the RN basic resource, and updating the running file associated with the first application program and the RN framework according to the running result of the RN basic resource.
The RN hot update resource packet corresponds to an update object tag set, the update object tag set comprises a plurality of update object tags, and the update object tags are used for indicating the object for acquiring the RN hot update resource packet;
the method is also preceded by:
when the RN hot update resource packet is monitored to be issued, acquiring the update object label set of the RN hot update resource packet;
and acquiring an object label corresponding to the user account associated with the first application program, and if the object label belongs to the updated object label set, executing the step of acquiring the RN hot update resource packet of the first application program.
The hot updating state comprises a forced updating state and an autonomous updating state; the method further comprises the following steps:
when the RN hot update resource packet is monitored to be issued, acquiring a hot update state corresponding to a user account associated with the first application program;
if the hot update state corresponding to the user account is the forced update state, executing the step of acquiring the RN hot update resource packet of the first application program;
if the hot update state corresponding to the user account is the autonomous update state, displaying an RN hot update issue message, receiving an RN hot update instruction based on the RN hot update issue message, and executing the step of acquiring the RN hot update resource packet of the first application program according to the RN hot update instruction, wherein the RN hot update instruction comprises an update version of the RN hot update resource packet.
Wherein the method further comprises, after:
receiving a starting instruction of the first application program, and acquiring an operation file associated with a current native framework in the first application program based on the starting instruction of the first application program;
running the running file associated with the current native framework, and building a native starting environment of the first application program;
running a running file associated with the current RN framework based on the native starting environment, and constructing an RN starting environment of the first application program;
starting the first application program according to the native starting environment and the RN starting environment of the first application program.
A second aspect of the embodiments of the present application provides an application updating apparatus, including:
a first obtaining module, configured to obtain an RN hot update resource packet of a first application program, and add the RN hot update resource packet to a first path, where the first path is different from a second path where a first native packet of the first application program is located;
a second obtaining module, configured to obtain a first native version of a first native package of the first application and an updated version of the RN hot update resource package, where the first native version is used to indicate a version of a native framework of the first application;
a native update module, configured to, when the first native version and the updated version are not matched, obtain and run a second native package of a second native version of the first application according to the updated version of the RN hot-update resource package, and update a run file associated with the native framework of the first application according to a run result of the second native package, where the second native version of the second native package is matched with the updated version;
and the RN updating module is used for operating the RN hot update resource packet and updating the operating file associated with the first application program and the RN framework according to the operating result of the RN hot update resource packet.
Wherein the apparatus further comprises:
a third obtaining module, configured to obtain a maximum RN version that is matched with the first native version, where the maximum RN version is an RN version with a maximum release time in an RN version set that is matched with the first native version;
a determining module for determining that the first native version matches the updated version if the maximum RN version is greater than or equal to the updated version;
the determining module is further configured to determine that the first native version does not match the updated version if the maximum RN version is less than the updated version.
Wherein the first native package of the first application includes native resources and RN base resources, the apparatus further comprising:
an extracting module, configured to extract the RN base resource in the first native packet if an operation process of the RN hot update resource packet is abnormal;
and the first running module is used for running the RN basic resource and updating the running file associated with the first application program and the RN framework according to the running result of the RN basic resource.
The RN hot update resource packet corresponds to an update object tag set, the update object tag set comprises a plurality of update object tags, and the update object tags are used for indicating the object for acquiring the RN hot update resource packet;
the device further comprises:
a fourth obtaining module, configured to obtain the update object tag set of the RN hot update resource packet when it is monitored that the RN hot update resource packet is issued;
the fourth obtaining module is further configured to obtain an object tag corresponding to the user account associated with the first application, and if the object tag belongs to the updated object tag set, the step of obtaining the RN hot update resource packet of the first application is executed by the first obtaining module.
The hot updating state comprises a forced updating state and an autonomous updating state; the device further comprises:
a fifth obtaining module, configured to obtain a hot update status corresponding to a user account associated with the first application program when it is monitored that the RN hot update resource packet is issued;
the fifth obtaining module is further configured to execute the step of obtaining the RN hot update resource package of the first application program through the first obtaining module if the hot update status corresponding to the user account is the forced update status;
the display module is used for displaying an RN hot update release message if the hot update state corresponding to the user account is the autonomous update state;
a first receiving module, configured to receive an RN hot update instruction based on the RN hot update issue message, and execute, by the first obtaining module, the step of obtaining the RN hot update resource packet of the first application according to the RN hot update instruction, where the RN hot update instruction includes an update version of the RN hot update resource packet.
Wherein the apparatus further comprises:
the second receiving module is used for receiving a starting instruction of the first application program and acquiring an operation file associated with the current native framework in the first application program based on the starting instruction of the first application program;
the second operation module is used for operating the operation file associated with the current native framework and building a native starting environment of the first application program;
the first running module is further used for running a running file associated with the current RN framework based on the native starting environment and building an RN starting environment of the first application program;
a starting module, configured to start the first application according to the native starting environment of the first application and the RN starting environment.
A third aspect of the embodiments of the present application provides an electronic device, including a processor, a memory, and an input/output interface;
the processor is respectively connected to the memory and the input/output interface, wherein the input/output interface is used for data interaction, the memory is used for storing a program code, and the processor is used for calling the program code to execute the application program updating method according to the first aspect in the embodiment of the present application.
The embodiment of the application has the following beneficial effects:
according to the embodiment of the application, the RN hot update resource packet of the first application program is acquired and added to a first path, and the first path is different from a second path where a first primary packet of the first application program is located; acquiring a first native version of a first native packet of a first application program and an update version of an RN hot update resource packet; under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot-update resource package, and updating an operation file associated with the first application program and the native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version; and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet. According to the application, the RN hot update resource packet and the primary packet are respectively added to the first path and the second path, decoupling of the primary packet and the RN hot update resource packet is achieved, independent updating is conducted on the primary packet and the RN hot update, the updating flexibility of the application program is improved, due to mutual independence of the primary packet and the RN hot update resource, the primary packet or the RN hot update resource which issues a new version can be acquired when the application program is updated, and the updating efficiency of the application program is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1a is a diagram illustrating an application update architecture according to an embodiment of the present application;
FIG. 1b is a block diagram of an embodiment of an application update architecture;
fig. 2 is a flowchart illustrating an application updating method according to an embodiment of the present application;
fig. 3 is a schematic view of a scenario for acquiring an RN hot update resource packet according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a display page of a RN hot update issue message according to an embodiment of the present application;
FIG. 5 is a diagram illustrating an application update apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1a, fig. 1a is a diagram of an application update architecture according to an embodiment of the present application, where the present application is applied to an update process of an application obtained by hybrid development of native and RN. As shown in fig. 1a, for a client 101, a first application program is installed in the client 101, and when the client 101 monitors that an RN hot update resource packet of the first application program is issued in a server 102, the RN hot update resource packet is obtained from the server 102, and the RN hot update resource packet is added to a first path 103 in the client 101, where the first path 103 is different from a second path 104 where a first native packet of the first application program is located. After acquiring the RN hot update resource packet, the client 101 compares the update version of the RN hot update resource packet with the first native version of the first native packet. If the updated version does not match the first native version, that is, the first native version of the first native package does not support the updated version of the RN hot-update resource package, obtaining a second native package of a second native version from the server 102, and updating the running file associated with the native framework in the first application according to the second native package. When the running file associated with the original framework in the first application program is updated or when the updated version is matched with the first original version, namely the first original version of the first original package can support the updated version of the RN hot update resource package, the acquired RN hot update resource package can be run, and the running file associated with the RN framework for the first application program is realized. According to the method and the device, the first native package of the first application program based on hybrid development and the RN hot update resource package are decoupled, so that the updating processes of the native package and the RN hot update resource package are mutually independent, when the first application program releases a new version, only the native package or the RN hot update resource package needing to be updated needs to be acquired, and the updating efficiency and flexibility of the application program are improved. The client may be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer, a notebook computer, a palmtop computer, a Mobile Internet Device (MID), a wearable device (e.g., a smart watch, a smart band, etc.), and the like.
Specifically, referring to fig. 1b, fig. 1b is a specific architecture diagram of an application update provided in an embodiment of the present application. As shown in fig. 1b, when a first application 106 existing in a client 105 issues a new version, the client 105 acquires an RN hot-update resource package of the first application from a server 107, and adds the RN hot-update resource package to a first path 108, wherein the first application 106 in the client 105 is associated with a first path 108 and a second path 109, the first path 108 is different from the second path 109, the first path 108 is used for storing the acquired RN hot-update resource, and the second path 109 is used for storing a native package of the first application. The client 105 obtains a first native version of a first native package of the first application 106 and an updated version of the RN hot-update resource package, compares the first native version and the updated version of the first native package, if the first native version does not match the updated version, obtains a second native package of a second native version from the server 107, and the client 105 runs the second native package to update a running file of the first application 106 associated with the native framework, where the second native version matches the updated version. When the client 105 runs the second native package, or when the client 105 determines that the first native version matches the updated version, the RN hot-update resource package is run to update the run file associated with the RN framework of the first application 106.
Further, please refer to fig. 2, and fig. 2 is a flowchart illustrating an application updating method according to an embodiment of the present application. As shown in fig. 2, the method includes the following steps:
step S201, acquiring an RN hot update resource packet of the first application program, and adding the RN hot update resource packet to the first path.
Specifically, an RN hot update resource packet of a first application program is acquired, and the RN hot update resource packet is added to a first path, where the first path is different from a second path where a first native packet of the first application program is located. Specifically, a first application program is installed in a client, the client acquires an RN hot update resource packet from a server and acquires a first path for storing the RN hot update resource packet when monitoring that the server issues the RN hot update resource packet of the first application program, if the first path does not exist, the first path is created for the acquired RN hot update resource packet, and the acquired RN hot update resource packet is added to the first path, wherein the first application program in the client is also associated with a second path which is used for storing a primary packet of the first application program, and the primary packet includes a primary resource of the first application program and an RN basic resource. For example, the first path associated with the first application in the client is an a directory, the second path is a B directory, the client adds the acquired RN hot update resource packet to the a directory, and the B directory stores the first native packet of the first application, so that the native packet of the first application and the RN hot update resource packet are placed in different paths. When the first application program is installed in the client, the primary packet of the first application program is placed in the second path, and when the first application program performs RN hot update, the RN hot update resource packet is acquired and placed in the first path.
Optionally, the RN hot update resource packet issued by the server corresponds to an update object tag set, where the update object tag set includes a plurality of update object tags, and each update object tag is used to indicate an object for acquiring the RN hot update resource packet, in other words, only a user account having any one or more update object tags in the update object tag set will acquire the corresponding RN hot update resource packet. Specifically, when the client monitors that the RN hot update resource packet is issued, an update object tag set corresponding to the RN hot update resource packet is obtained, an object tag corresponding to a user account associated with the first application program in the client is obtained, and if the object tag corresponding to the user account belongs to the update object tag set, the RN hot update resource packet of the first application program is obtained. The object label of the user account includes, but is not limited to, a gray label, a location label, a personal information label, and the like. When any one of the object labels of the user account corresponding to the first application program belongs to the update object label set, the RN hot update resource package of the first application program is considered to be acquired. Optionally, in this application, the server may also determine whether to send an RN hot update resource packet to the client, after the server issues the RN hot update resource packet, obtain an update object tag set corresponding to the RN hot update resource packet, determine to obtain each receiving user account of the RN hot update resource packet according to each update object tag in the update object tag set, where at least one tag in an object tag of a first application program of each receiving user account belongs to the update object tag set, the server sends the RN hot update resource packet to a receiving client corresponding to each receiving user account, and if the client in this application belongs to the receiving client, obtain the RN hot update resource packet sent by the server. For example, when the update object tag set of the RN hot update resource package includes an a tag, a B tag, and a C tag, and the object tags corresponding to the user account of the first application program of the client are the B tag and the D tag, the client acquires the RN hot update resource package issued in the server.
Optionally, the first application may be set by the user account to a hot update state, which includes a forced update state and an autonomic update state. When monitoring that an RN hot update resource packet of a first application program is issued, a client acquires a hot update state corresponding to a user account associated with the first application program; if the hot update state corresponding to the user account is the forced update state, it indicates that for the user account, as long as the server issues a new RN hot update resource package, the issued RN hot update resource package is acquired to update the first application program, and the RN hot update resource package of the first application program can be directly acquired without requesting the user account to install the RN hot update resource package again; if the hot update state corresponding to the user account is the self-updating state, the user account related to the first application program is represented to close the automatic updating function of the first application program, the RN hot update resource packet issued by the server can be acquired only when the RN hot update instruction submitted by the user account is acquired, at the moment, the client displays the RN hot update issuing message of the first application program, if the user account related to the first application program is subjected to the update confirmation operation, the client monitors the update confirmation operation of the user account based on the RN hot update issuing message, receives the RN hot update instruction, and acquires the RN hot update resource packet of the first application program from the server according to the RN hot update instruction, wherein the RN hot update instruction comprises the update version of the RN hot update resource packet. The RN hot update publishing message of the first application program may be displayed on a display page of the client, or the RN hot update publishing message may be displayed on the display page of the first application program when the first application program is started, or the RN hot update publishing message may be displayed in an operation process of the first application program, where the display page of the client or the display page of the first application program may be a current display page of the client or the first application program, or may be a pop-up window of the client or the first application program, or the like.
The processing procedure of the client for the object tag and the hot update state is an optional procedure, and the client may determine whether to acquire the RN hot update resource packet based on the object tag or the hot update state, or may determine whether to acquire the RN hot update resource packet based on the object tag and the hot update state at the same time.
Specifically, referring to fig. 3, fig. 3 is a scene schematic diagram for acquiring an RN hot update resource packet according to an embodiment of the present disclosure, and as shown in fig. 3, a case of determining whether to acquire the RN hot update resource packet based on an object tag and a hot update status is taken as an example. When the server 301 issues the RN hot update resource package 302 of the first application program, and the client 303 monitors that the server 301 issues the RN hot update resource package 302 of the first application program 304, the client 303 acquires the user account 3051 of the specific application 305 of the first application program 304, and acquires an object tag and a hot update state corresponding to the user account 3051, assuming that the object tag includes a grayscale tag and a location tag. The client 303 obtains an update object tag set corresponding to the RN hot update resource package 302, where the update object tag set includes a plurality of update object tags. The client 303 compares the plurality of update object tags with the object tags, and if the update object tag set includes at least one of the object tags and the hot update state is a forced update state, the client 303 acquires the RN hot update resource packet 302 issued by the server 301; or, if the update object tag set includes at least one tag in the object tags, and when the hot update state is the autonomous update state, displaying 3061 an RN hot update issue message in the client 306 (the same as the client 303, which is any page of the client 303 that can display a message), and receiving an RN hot update instruction based on the RN hot update issue message, the client 303 obtains the RN hot update resource package 302 issued by the server 301; or, if both of the above conditions are not satisfied, the client 303 does not acquire the RN hot update resource packet 302. The process of determining whether to acquire the RN hot update resource packet based on the object tag and the process of determining whether to acquire the RN hot update resource packet based on the hot update status are optional.
For a display situation of the RN hot update issue message, see fig. 4, where fig. 4 is a schematic display page diagram of the RN hot update issue message provided in the embodiment of the present application. As shown in fig. 4, in a first manner, the client may display an RN hot update publish message 4012 of the first application 4011 in any application display page 401, where the RN hot update publish message 4012 is displayed in a popup format; in a second manner, the client may display the RN hot update distribution message 4021 of the first application 4022 in any one of the application display pages 402, where the RN hot update distribution message 4021 is directly displayed in the application display page 402 in a linked form; in the third case, after the user enters the first application program, the RN hot update issue message 4031 is displayed in a popup window form in any one of the function pages 403 of the first application program; in the fourth situation, after the user enters the first application program, the RN hot update issue message 4041 is displayed in a linked form in any one of the function pages 404 of the first application program; alternatively, the RN hot update distribution message may be displayed in other manners that may display the message, which is not limited herein. And when the client monitors the confirmation operation of the RN hot update release message, receiving an RN hot update instruction, and if the client monitors the deletion operation of the RN hot update release message, determining that the user account does not perform the RN hot update of the time and does not acquire the RN hot update instruction. Optionally, in the first or second case, the page displaying the RN hot update publishing message may be a page currently displayed by the client, or may be an application display page in which the first application is located.
Step S202, a first native version of a first native packet of the first application and an update version of the RN hot update resource packet are obtained.
Specifically, a first native version of a first native package of the first application and an updated version of an RN hot-update resource package are obtained, wherein the first native version is used for indicating a version of a native framework of the first application. Acquiring a maximum RN version matched with the first native version, wherein the maximum RN version is the RN version with the maximum release time in an RN version set matched with the first native version; if the maximum RN version is greater than or equal to the update version, determining that the first native version is matched with the update version; if the maximum RN version is less than the updated version, determining that the first native version does not match the updated version. If all RN versions matched with the first native version have records, comparing all RN versions matched with the first native version with the updated version, and if an updated version exists in all RN versions matched with the first native version, determining that the first native version is matched with the updated version; if only part of the RN versions matched with the first native version are reserved, determining that the first native version is matched with the updated version as long as the maximum RN version matched with the first native version is greater than or equal to the updated version due to the downward compatibility characteristic of the application program; if the RN version series number matching the first native version is recorded, it is determined that the first native version matches the updated version when the updated version belongs to one of the RN version series numbers matching the first native version, such as when one of the RN version series numbers matching the first native version is 2.0 and the updated version is 2.0.5, it is determined that the first native version matches the updated version because the updated version 2.0.5 belongs to the RN version series number 2.0. In the above, for the implementation manner of determining that the first native version matches the updated version, other manners that can achieve the determination of the compatibility between the first native version and the updated version may also be used, which is not limited herein.
Wherein, when the first native version does not match the updated version, step S203 is executed, and when the first native version matches the updated version, step S204 is executed.
Step S203, obtaining and running a second native package of the second native version of the first application program, and updating the running file associated with the native framework of the first application program according to the running result of the second native package.
Specifically, under the condition that the first native version is not matched with the updated version, a second native package of a second native version of the first application program is obtained and operated according to the updated version of the RN hot update resource package, and the operation file associated with the native framework of the first application program is updated according to the operation result of the second native package, wherein the second native version of the second native package is matched with the updated version. Specifically, when the first native version is not matched with the updated version, it indicates that the first native package is not compatible with the RN hot-update resource package, that is, the RN hot-update resource package cannot run on the basis of the first native package, a second native package of a second native version is obtained from the server, the second native version is matched with the updated version, that is, the second native package is compatible with the RN hot-update resource package, the second native package can support running of the RN hot-update resource package, the obtained second native package is added to the second path to replace the first native package in the second path, the second native package is run, and the running file associated with the first application program and the native framework is updated according to the running result of the second native package, so that the native framework updated by the first application program can support running of the RN hot-update resource package. The client can directly obtain a primary package of a latest version which is released from the server as a second primary package, wherein the latest version refers to the version with the latest release time, and the second primary package supports the RN hot update resource package due to the downward compatibility characteristic of the application program; alternatively, the second native package of the second native version matching the updated version may be directly acquired from the server. After the operation file of the first application program associated with the native framework is updated according to the operation result of the second native package, step S204 is executed.
Step S204, the RN hot update resource packet is operated, and the operation file related to the first application program and the RN framework is updated according to the operation result of the RN hot update resource packet.
Specifically, the RN hot update resource packet is operated, and the operation file associated with the RN framework by the first application program is updated according to the operation result of the RN hot update resource packet. The first primary package of the first application program comprises primary resources and RN basic resources, and the RN basic resources in the first primary package are extracted if the running process of the RN hot update resource package is abnormal; and running the RN basic resource, and updating a running file associated with the first application program and the RN framework according to the running result of the RN basic resource.
When monitoring that the first application program is started, the client receives a starting instruction of the first application program, and acquires an operation file associated with a current native frame in the first application program based on the starting instruction of the first application program, wherein the current native frame is obtained based on the operation of a current native packet in a second path; running a running file associated with the current native framework, and building a native starting environment of the first application program; running a running file associated with a current RN frame based on the native starting environment, and constructing an RN starting environment of a first application program, wherein if the last update before the current moment is an RN frame based on RN hot update resource packet update, the current RN frame is obtained based on RN hot update resource packet running in a first path, and if the last update before the current moment is an RN frame based on RN basic resource update, the current RN frame is obtained based on RN basic resource running in a current native packet of a second path; and starting the first application program according to the native starting environment and the RN starting environment of the first application program.
According to the embodiment of the application, the RN hot update resource packet of the first application program is acquired and added to a first path, and the first path is different from a second path where a first primary packet of the first application program is located; acquiring a first native version of a first native packet of a first application program and an update version of an RN hot update resource packet; under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot-update resource package, and updating an operation file associated with the first application program and the native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version; and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet. According to the application, the RN hot update resource packet and the primary packet are respectively added to the first path and the second path, decoupling of the primary packet and the RN hot update resource packet is achieved, independent updating is conducted on the primary packet and the RN hot update, the updating flexibility of the application program is improved, and due to mutual independence of the primary packet and the RN hot update resource, when the application program is updated, the primary packet or the RN hot update resource which issues a new version can be acquired, a whole set of installation packet does not need to be acquired, the data volume used in the updating process is reduced, and the updating efficiency of the application program is improved. Meanwhile, if the RN basic resource of the primary packet of the second path is abnormal in the running process of the RN hot update resource packet, the RN basic resource of the primary packet of the second path can be run to update the first application program, so that the situation that the application program cannot run due to the abnormal updating process is reduced.
Further, referring to fig. 5, fig. 5 is a schematic diagram of an application updating apparatus according to an embodiment of the present application. As shown in fig. 5, the application updating apparatus can be used in the electronic device in the embodiment corresponding to fig. 2, and specifically, the application updating apparatus 50 includes a first obtaining module 11, a second obtaining module 12, a native updating module 13, and an RN updating module 14.
A first obtaining module 11, configured to obtain an RN hot update resource packet of a first application program, and add the RN hot update resource packet to a first path, where the first path is different from a second path where a first native packet of the first application program is located;
a second obtaining module 12, configured to obtain a first native version of a first native package of the first application and an updated version of the RN hot update resource package, where the first native version is used to indicate a version of a native framework of the first application;
a native update module 13, configured to, when the first native version and the updated version do not match, obtain and run a second native package of a second native version of the first application according to the updated version of the RN hot-update resource package, and update the running file associated with the native framework and the first application according to a running result of the second native package, where the second native version of the second native package matches the updated version;
and the RN update module 14 is configured to run the RN hot update resource package, and update the running file associated with the RN framework by the first application according to a running result of the RN hot update resource package.
Wherein the apparatus 50 further comprises:
a third obtaining module 15, configured to obtain a maximum RN version that matches the first native version, where the maximum RN version is an RN version with a maximum release time in an RN version set that matches the first native version;
a determining module 16, configured to determine that the first native version matches the updated version if the maximum RN version is greater than or equal to the updated version;
the determining module 16 is further configured to determine that the first native version does not match the updated version if the maximum RN version is smaller than the updated version.
Wherein the first native package of the first application includes native resources and RN base resources, and the apparatus 50 further includes:
an extracting module 17, configured to extract the RN base resource in the first native packet if an operation process of the RN hot update resource packet is abnormal;
a first running module 18, configured to run the RN base resource, and update a running file associated with the RN framework and the first application according to a running result of the RN base resource.
The RN hot update resource packet corresponds to an update object tag set, the update object tag set comprises a plurality of update object tags, and the update object tags are used for indicating the object for acquiring the RN hot update resource packet;
the apparatus 50 further comprises:
a fourth obtaining module 19, configured to obtain the update target tag set of the RN hot update resource packet when it is monitored that the RN hot update resource packet is issued;
the fourth obtaining module 19 is further configured to obtain an object tag corresponding to the user account associated with the first application, and if the object tag belongs to the updated object tag set, the step of obtaining the RN hot update resource packet of the first application is executed by the first obtaining module 11.
The hot updating state comprises a forced updating state and an autonomous updating state; the apparatus 50 further comprises:
a fifth obtaining module 20, configured to obtain a hot update status corresponding to a user account associated with the first application program when it is monitored that the RN hot update resource packet is issued;
the fifth obtaining module 20 is further configured to execute the step of obtaining the RN hot update resource package of the first application program through the first obtaining module 11 if the hot update status corresponding to the user account is the forced update status;
a display module 21, configured to display an RN hot update release message if the hot update status corresponding to the user account is the autonomous update status;
a first receiving module 22, configured to receive an RN hot update instruction based on the RN hot update issue message, and execute the step of acquiring the RN hot update resource packet of the first application through the first acquiring module 11 according to the RN hot update instruction, where the RN hot update instruction includes an update version of the RN hot update resource packet.
Wherein the apparatus 50 further comprises:
a second receiving module 22, configured to receive a start instruction of the first application program, and obtain, based on the start instruction of the first application program, an execution file associated with a current native framework in the first application program;
the second operation module 23 is configured to operate the operation file associated with the current native framework, and build a native start environment of the first application;
the first running module 18 is further configured to run a running file associated with the current RN framework based on the native boot environment, and build the RN boot environment of the first application;
a starting module 24, configured to start the first application according to the native starting environment and the RN starting environment of the first application.
The embodiment of the application provides an application program updating device, which adds an RN hot update resource packet to a first path by acquiring the RN hot update resource packet of a first application program, wherein the first path is different from a second path in which a first native packet of the first application program is located; acquiring a first native version of a first native packet of a first application program and an update version of an RN hot update resource packet; under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot-update resource package, and updating an operation file associated with the first application program and the native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version; and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet. According to the application, the RN hot update resource packet and the primary packet are respectively added to the first path and the second path, decoupling of the primary packet and the RN hot update resource packet is achieved, independent updating is conducted on the primary packet and the RN hot update, the updating flexibility of the application program is improved, due to mutual independence of the primary packet and the RN hot update resource, the primary packet or the RN hot update resource which issues a new version can be acquired when the application program is updated, and the updating efficiency of the application program is improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. As shown in fig. 6, the electronic device in the present embodiment may include: one or more processors 601, memory 602, and input-output interface 603. The processor 601, the memory 602, and the input/output interface 603 are connected by a bus 604. The memory 602 is used for storing a computer program, the computer program includes program instructions, and the input/output interface 603 is used for performing data interaction, including data interaction between a client and a server, interaction between a client and a user, and the like; the processor 601 is configured to execute the program instructions stored in the memory 602, and perform the following operations:
acquiring an RN hot update resource packet of a first application program, and adding the RN hot update resource packet to a first path, wherein the first path is different from a second path in which a first native packet of the first application program is positioned;
obtaining a first native version of a first native package of the first application and an updated version of the RN hot-update resource package, the first native version being indicative of a version of a native framework of the first application;
under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot update resource package, and updating an operation file associated with the first application program and a native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version;
and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet.
In some possible embodiments, the processor 601 may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 602 may include a read-only memory and a random access memory, and provides instructions and data to the processor 601 and the input output interface 603. A portion of the memory 602 may also include non-volatile random access memory. For example, the memory 602 may also store device type information.
In a specific implementation, the electronic device may execute the implementation manners provided in the steps of fig. 2 through the built-in functional modules, which may specifically refer to the implementation manners provided in the steps of fig. 2, and details are not described herein again.
The embodiment of the present application provides an electronic device, including: the processor, the input/output interface and the memory acquire computer instructions in the memory through the processor, execute the steps of the method shown in the figure 2, and place the RN hot update resource packet and the original packet of the first application program in different paths, so that the update processes of the RN hot update resource packet and the original packet can be performed independently.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a processor, the method for updating an application program provided in each step in fig. 2 is implemented, which may specifically refer to the implementation manner provided in each step in fig. 2, and is not described herein again.
The computer-readable storage medium may be the application updating apparatus provided in any of the foregoing embodiments or an internal storage unit of the terminal device, such as a hard disk or a memory of an electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, which are provided on the electronic device. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the electronic device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
The terms "first," "second," and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. An application program update method, comprising:
acquiring an RN hot update resource packet of a first application program, and adding the RN hot update resource packet to a first path, wherein the first path is different from a second path in which a first native packet of the first application program is positioned;
obtaining a first native version of a first native package of the first application and an updated version of the RN hot-update resource package, the first native version being indicative of a version of a native framework of the first application;
under the condition that the first native version is not matched with the updated version, acquiring and operating a second native package of a second native version of the first application program according to the updated version of the RN hot update resource package, and updating an operation file associated with the first application program and a native framework according to an operation result of the second native package, wherein the second native version of the second native package is matched with the updated version;
and running the RN hot update resource packet, and updating the running file associated with the first application program and the RN framework according to the running result of the RN hot update resource packet.
2. The method of claim 1, wherein the method further comprises:
acquiring a maximum RN version matched with the first native version, wherein the maximum RN version is an RN version with the maximum release time in an RN version set matched with the first native version;
determining that the first native version matches the updated version if the maximum RN version is greater than or equal to the updated version;
determining that the first native version does not match the updated version if the maximum RN version is less than the updated version.
3. The method of claim 1, wherein the first native package of the first application includes native resources and RN base resources, the method further comprising thereafter:
if the running process of the RN hot update resource packet is abnormal, extracting the RN basic resource in the first native packet;
and running the RN basic resource, and updating the running file associated with the first application program and the RN framework according to the running result of the RN basic resource.
4. The method of claim 1, wherein the RN hot update resource package corresponds to an update object tag set, the update object tag set comprising a plurality of update object tags, the update object tags indicating an object from which the RN hot update resource package is obtained;
the method is also preceded by:
when the RN hot update resource packet is monitored to be issued, acquiring the update object label set of the RN hot update resource packet;
and acquiring an object label corresponding to the user account associated with the first application program, and if the object label belongs to the updated object label set, executing the step of acquiring the RN hot update resource packet of the first application program.
5. The method of claim 1, wherein a hot update state comprises a forced update state and an autonomic update state; the method further comprises the following steps:
when the RN hot update resource packet is monitored to be issued, acquiring a hot update state corresponding to a user account associated with the first application program;
if the hot update state corresponding to the user account is the forced update state, executing the step of acquiring the RN hot update resource packet of the first application program;
if the hot update state corresponding to the user account is the autonomous update state, displaying an RN hot update issue message, receiving an RN hot update instruction based on the RN hot update issue message, and executing the step of acquiring the RN hot update resource packet of the first application program according to the RN hot update instruction, wherein the RN hot update instruction comprises an update version of the RN hot update resource packet.
6. The method of claim 1, further comprising, after the method:
receiving a starting instruction of the first application program, and acquiring an operation file associated with a current native framework in the first application program based on the starting instruction of the first application program;
running the running file associated with the current native framework, and building a native starting environment of the first application program;
running a running file associated with the current RN framework based on the native starting environment, and constructing an RN starting environment of the first application program;
starting the first application program according to the native starting environment and the RN starting environment of the first application program.
7. An application update apparatus, comprising:
a first obtaining module, configured to obtain an RN hot update resource packet of a first application program, and add the RN hot update resource packet to a first path, where the first path is different from a second path where a first native packet of the first application program is located;
a second obtaining module, configured to obtain a first native version of a first native package of the first application and an updated version of the RN hot update resource package, where the first native version is used to indicate a version of a native framework of the first application;
a native update module, configured to, when the first native version and the updated version are not matched, obtain and run a second native package of a second native version of the first application according to the updated version of the RN hot-update resource package, and update a run file associated with the native framework of the first application according to a run result of the second native package, where the second native version of the second native package is matched with the updated version;
and the RN updating module is used for operating the RN hot update resource packet and updating the operating file associated with the first application program and the RN framework according to the operating result of the RN hot update resource packet.
8. The apparatus of claim 7, wherein the apparatus further comprises:
a third obtaining module, configured to obtain a maximum RN version that is matched with the first native version, where the maximum RN version is an RN version with a maximum release time in an RN version set that is matched with the first native version;
a determining module for determining that the first native version matches the updated version if the maximum RN version is greater than or equal to the updated version;
the determining module is further configured to determine that the first native version does not match the updated version if the maximum RN version is less than the updated version.
9. An electronic device, comprising a processor, a memory, an input-output interface;
the processor is respectively connected with the memory and the input/output interface, wherein the input/output interface is used for data interaction, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-6.
CN202010131923.6A 2020-02-29 2020-02-29 Application program updating method and device Pending CN111240730A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010131923.6A CN111240730A (en) 2020-02-29 2020-02-29 Application program updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010131923.6A CN111240730A (en) 2020-02-29 2020-02-29 Application program updating method and device

Publications (1)

Publication Number Publication Date
CN111240730A true CN111240730A (en) 2020-06-05

Family

ID=70865940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010131923.6A Pending CN111240730A (en) 2020-02-29 2020-02-29 Application program updating method and device

Country Status (1)

Country Link
CN (1) CN111240730A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949251A (en) * 2020-07-21 2020-11-17 广州钢铁侠信息科技有限公司 Method for realizing software development and operation across platforms
CN112445510A (en) * 2020-11-30 2021-03-05 中国人寿保险股份有限公司 Gray scale publishing method and related equipment for hot update file of client application function
CN113268266A (en) * 2021-05-19 2021-08-17 上海视九信息科技有限公司 Multi-version coexistence management method, system and medium for applet rendering framework

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949251A (en) * 2020-07-21 2020-11-17 广州钢铁侠信息科技有限公司 Method for realizing software development and operation across platforms
CN112445510A (en) * 2020-11-30 2021-03-05 中国人寿保险股份有限公司 Gray scale publishing method and related equipment for hot update file of client application function
CN113268266A (en) * 2021-05-19 2021-08-17 上海视九信息科技有限公司 Multi-version coexistence management method, system and medium for applet rendering framework
CN113268266B (en) * 2021-05-19 2024-02-02 上海视九信息科技有限公司 Multi-version coexistence management method, system and medium for applet rendering framework

Similar Documents

Publication Publication Date Title
US10127057B2 (en) Method and apparatus for dynamically implementing application function
CN108804299B (en) Application program exception handling method and device
CN111240730A (en) Application program updating method and device
CN111694592A (en) Management method and system for project version release
CN111427596B (en) Software upgrading method and device and terminal equipment
CN107291481B (en) Component updating method, device and system
CN110895472A (en) Method and device for identifying service change
CN110647739A (en) Software installation detection method, device, terminal and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN112181437B (en) Gray release method and device based on Devops, computer equipment and storage medium
CN111241803A (en) Method and device for generating text file, computer equipment and readable storage medium
CN113434254B (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN112860662B (en) Automatic production data blood relationship establishment method, device, computer equipment and storage medium
CN109032612B (en) Interface calling method and device of hybrid application and computer readable storage medium
CN110765610B (en) PDM integration method, PDM integration device, computer equipment and storage medium
CN111158777B (en) Component calling method, device and computer readable storage medium
CN104516743A (en) Upgrading method and system of embedded device firmware based on ActiveX
CN103838575A (en) Plug-in type page customization implementation method based on EXTJS frame
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN113360172B (en) Application deployment method, device, computer equipment and storage medium
US20240031166A1 (en) Web-side data signature method and apparatus and computer device
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN112988192A (en) Version updating method and device, electronic equipment and storage medium
CN114356379A (en) Backup-based service upgrading method, device, equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and 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