CN108958785B - Application program upgrading method and device - Google Patents
Application program upgrading method and device Download PDFInfo
- Publication number
- CN108958785B CN108958785B CN201710366234.1A CN201710366234A CN108958785B CN 108958785 B CN108958785 B CN 108958785B CN 201710366234 A CN201710366234 A CN 201710366234A CN 108958785 B CN108958785 B CN 108958785B
- Authority
- CN
- China
- Prior art keywords
- specified
- command
- application program
- information
- android
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000001514 detection method Methods 0.000 claims abstract description 38
- 238000012795 verification Methods 0.000 claims description 29
- 238000009434 installation Methods 0.000 claims description 27
- 238000012545 processing Methods 0.000 claims description 10
- 238000013467 fragmentation Methods 0.000 abstract description 6
- 238000006062 fragmentation reaction Methods 0.000 abstract description 6
- 230000008569 process Effects 0.000 abstract description 6
- 230000004044 response Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000011900 installation process Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version 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)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides an application program upgrading method and device, which are executed in a local application program of a terminal. On one hand, the embodiment of the invention sends an update detection request to the server; receiving a download address returned by the server according to the update detection request; sending a downloading request to the server according to the downloading address; receiving appointed updating information returned by the server according to the downloading request; acquiring specified updating information; therefore, a command parser running environment of the android debugging bridge is started by calling the specified command; and further upgrading the application program based on the specified updating information in the command parser operating environment of the android debugging bridge. The technical scheme provided by the embodiment of the invention reduces the version fragmentation degree of the application program, avoids a fussy upgrading operation process and improves the upgrading efficiency.
Description
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of computers, in particular to an application program upgrading method and device.
[ background of the invention ]
With the rapid development of intelligent operating systems applied to electronic devices, such as IOS and android, Application programs (APPs) are also rapidly developing. APP generally refers to a third party application installed in the smart operating system. Currently, in order to meet various requirements, a third-party application installed on an electronic device needs to be updated.
The upgrade scheme used in the prior art is to prompt a user when an application program detects that update information exists, and download the update information and upgrade based on the update information only when the user clicks a corresponding key to trigger upgrade. However, if the user does not click the corresponding button, the old version of the application still needs maintenance, and the fragmentation degree of the version of the application is high. Moreover, the user needs to perform a specific operation to perform the upgrade, which results in a low upgrade efficiency of the application program.
[ summary of the invention ]
In view of this, embodiments of the present invention provide an application program upgrading method and apparatus, which reduce the fragmentation degree of the version of the application program, avoid a complicated upgrading operation process, and improve the upgrading efficiency.
On one hand, the embodiment of the invention provides an application program upgrading method, which is executed in a local application program of a terminal; the method comprises the following steps:
sending an update detection request to a server;
receiving a download address returned by the server according to the update detection request;
sending a downloading request to the server according to the downloading address;
receiving appointed updating information returned by the server according to the downloading request;
invoking a command parser running environment of an android debug bridge by calling a specified command;
and upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
The above-described aspect and any possible implementation manner further provide an implementation manner that enables a command parser runtime environment of an android debug bridge by calling a specified command, including:
the android debugging bridge is operated by calling an enabling command of the android debugging bridge;
in the operating state of the android debugging bridge, establishing connection with a specified device in the electronic device where the application program is located by calling an android debugging bridge connection command; and the specified equipment is equipment for bearing the operating environment of a command parser of the android debugging bridge.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, before the upgrading of the application program based on the specified update information in the command parser runtime environment of the android debug bridge, further including:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, executing the step of upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
The above-described aspect and any possible implementation manner further provide an implementation manner, in a command parser runtime environment of the android debug bridge, that is, performing upgrading on the application program based on the specified update information, where the implementation manner includes:
and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, and when receiving the specified update information returned by the server according to the download request, the method further includes: receiving verification information returned by the server;
by calling the specified command, before the command parser running environment of the android debug bridge is started, the method further comprises the following steps:
verifying the specified updating information based on the verification information;
and when the verification is passed, executing a step of invoking a command parser operating environment of the android debugging bridge by calling a specified command.
In another aspect, an embodiment of the present invention provides an application program upgrading apparatus, which is disposed in a local application program of a terminal; the method comprises the following steps:
a sending unit, configured to send an update detection request to a server;
a receiving unit, configured to receive a download address returned by the server according to the update detection request;
the sending unit is further configured to send a download request to the server according to the download address;
the receiving unit is further configured to receive specified update information returned by the server according to the download request;
the environment acquisition unit is used for starting a command parser running environment of the android debugging bridge by calling a specified command;
and the upgrading processing unit is used for upgrading the application program based on the specified updating information in the command parser operating environment of the android debugging bridge.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the environment obtaining unit is specifically configured to:
the android debugging bridge is operated by calling an enabling command of the android debugging bridge;
in the operating state of the android debugging bridge, establishing connection with a specified device in the electronic device where the application program is located by calling an android debugging bridge connection command; and the specified equipment is equipment for bearing the operating environment of a command parser of the android debugging bridge.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the environment obtaining unit is specifically further configured to:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, triggering the upgrading processing unit to execute the upgrading of the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
The above-described aspect and any possible implementation manner further provide an implementation manner, where the upgrade processing unit is specifically configured to: and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
The above aspect and any possible implementation manner further provide an implementation manner, where the receiving unit is further configured to receive check information returned by the server;
the device further comprises:
an information checking unit, configured to check the specified update information based on the check information; and when the verification is passed, triggering the environment acquisition unit to execute the command designated by calling, and starting a command parser running environment of the android debugging bridge.
In another aspect, an embodiment of the present invention further provides a computer-readable medium, including: computer-executable instructions which, when executed, perform the steps of:
sending an update detection request to a server;
receiving a download address returned by the server according to the update detection request;
sending a downloading request to the server according to the downloading address;
receiving appointed updating information returned by the server according to the downloading request;
invoking a command parser running environment of an android debug bridge by calling a specified command;
and upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
One of the above technical solutions has the following beneficial effects:
in the embodiment of the invention, a local application program of a terminal acquires specified updating information through interaction with a server, and after the specified updating information is acquired, a specified command is called to start a command resolver operating environment of an android debugging bridge, so that the application program is upgraded based on the specified updating information in the command resolver operating environment of the android debugging bridge; after the command parser operation environment of the android debugging bridge is acquired, the permission can be provided, so that automatic upgrading can be realized. According to the automatic upgrading scheme, the user does not need to click the corresponding key to trigger upgrading, so that the problem that the old version of the application program still needs to be maintained due to the fact that the user does not click the corresponding key can be avoided, the version fragmentation degree of the application program is reduced to a certain extent, and the maintenance cost is reduced to a certain extent. In addition, because the user is prevented from clicking corresponding keys, the upgrading operation can be simplified, and the upgrading efficiency of the application program is improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an application program upgrading method according to an embodiment of the present invention;
FIG. 2 is another flowchart illustrating an application program upgrading method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of an implementation of step 105 provided by an example of the present invention;
FIG. 4 is a schematic flow chart diagram illustrating an implementation of step 302 provided by an example of the present invention;
FIG. 5 is a flowchart illustrating an application interacting with a server to implement downloading an upgrade package according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating installation of an application upgrade package according to an embodiment of the present invention;
FIG. 7 is a functional block diagram of an application upgrade apparatus according to an embodiment of the present invention;
fig. 8 is another functional block diagram of an application upgrading apparatus according to an embodiment of the present invention.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all 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 invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
Aiming at the problems that in the prior art, when a user clicks a key to trigger upgrading, updating information of an application program is obtained and the upgrading is carried out, so that the version fragmentation degree of the application program is high and the upgrading efficiency is low, the embodiment of the invention provides a corresponding solution thought: after the specified updating information of the application program is obtained, a specified instruction is called, a command parser running environment of the android debugging bridge is started, and the application program is upgraded based on the specified updating information in the command parser running environment of the android debugging bridge. The upgrading mode can be upgraded without being triggered by a user, and automatic upgrading of the application program can be realized, so that the experience of silent upgrading can be realized.
Guided by this idea, embodiments of the present invention provide the following possible implementations.
The embodiment of the invention provides an application program upgrading method which is executed on a local application program of a terminal. Referring to fig. 1, it is a schematic flow chart of an application program upgrading method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
101. and sending an update detection request to the server.
102. And receiving the download address returned by the server according to the update detection request.
103. And sending a downloading request to the server according to the downloading address.
104. And receiving the specified updating information returned by the server according to the downloading request.
105. And invoking a command parser running environment of the android debugging bridge by calling the specified command.
106. And in a command parser running environment of the android debugging bridge, upgrading the application program based on the specified updating information.
The application program according to the embodiment of the present invention may be a third-party application program installed on the electronic device. It should be noted that the electronic device according to the embodiment of the present invention may include, but is not limited to, a wireless handheld device, a tablet computer, a mobile phone, a smart television box, and other smart devices that employ an android operating system.
For the implementation of step 101, the following possible implementation modes are provided in the embodiment of the present invention.
In one possible embodiment, the application may send an update detection request to the server after starting or when other conditions are met (e.g., when the application reaches a specified time during running) to achieve upgrade detection. The update detection request may carry current version information of the application program. It should be noted that the conditions that need to be satisfied when the application sends the update detection request to the server are described herein for illustration and are not used to limit the implementation of the embodiment of the present invention.
For the implementation of step 102, the following possible implementation modes are provided in the embodiment of the present invention.
The server may be preconfigured with an upgrade policy. For example, when the version information of the application program is 1.0, the corresponding upgrade policy is a forced upgrade, and when the version information of the application program is not 1.0 (e.g., 1.9, 2.0, etc.), the corresponding upgrade policy is a recommended upgrade.
In a possible implementation, after receiving an update detection request sent by an application, the server compares current version information of the application carried by the server with latest version information of the application, and if the current version information of the application is consistent with the latest version information of the application, it indicates that the application is already the latest version and does not need to be updated, that is, there is no specified update information, and the server returns an update detection response to the application, where the update detection response carries an indication that no update is needed.
Otherwise, if the two are not consistent, the application program needs to be updated, that is, the specified update information exists. The embodiment of the invention is applied to a recommended upgrading scene, so that the server judges whether the corresponding upgrading strategy is recommended upgrading or not according to the current version information carried by the updating detection request, if the updating strategy is recommended upgrading, the server generates upgrading information, and the upgrading information can comprise a download address and verification information of the appointed updating information.
Further, the server sends the generated upgrade information to the application program through an update detection response. In this way, the application program can receive the download address of the specified update information returned by the server according to the update detection request when the specified update information exists.
In a possible implementation, the server may perform an operation on the specified update information by using a specified algorithm to obtain an operation result, and send the operation result to the application program as the verification information. For example, the specified algorithm may include, but is not limited to, a message digest algorithm (e.g., a fifth version of the message digest algorithm or a fourth version of the message digest algorithm, etc.), a hash algorithm, etc., which is not particularly limited in this embodiment of the present invention, but the specified algorithm needs to be negotiated in the application and the server in advance, and both the specified algorithm and the server use the same algorithm.
For example, the specific update information according to the embodiment of the present invention may be an upgrade package of the application program.
For the implementation of step 103, the following possible implementation modes are provided in the embodiment of the present invention. In a possible implementation scheme, after receiving an update detection response returned by the server, the application program extracts the upgrade information from the update detection response, and then analyzes the upgrade information to obtain a download address and verification information of the specified update information.
Further, after the download address of the designated update information is obtained, the application program sends a download request to the server, where the download request may carry the download address of the designated update information to request to obtain the designated update information from the server.
Embodiments of the present invention provide the following possible implementations for the implementation of step 104.
In a feasible implementation scheme, after receiving a download request sent by an application program, a server acquires specified update information according to a download address of the specified update information carried in the download request, and then returns the specified update information to the application program through a download response, so that the application program can receive the specified update information returned by the server according to the download request, and the acquisition of the specified update information by the application program is realized.
In a possible embodiment, as shown in fig. 2, before step 105, the method may further include:
and 105A, acquiring verification information.
The embodiment of the application program obtaining the check information may refer to the related description in step 102, and is not described herein again.
105B, verifying the specified updating information based on the verification information; and when the verification is passed, executing a step of invoking a command parser runtime environment of the android debug bridge by calling the specified command (namely step 105).
In a possible embodiment, after the application program obtains the specified update information, the application program needs to check the integrity of the specified update information based on the check information before performing the upgrade based on the specified update information.
In a specific embodiment, the application program uses the same algorithm as used on the server side to operate on the received specified updated information to obtain an operation result, and the operation result is used as locally obtained verification information. Then, the application program compares the check information obtained after the self-operation with the check information received from the server, if the two check information are consistent, it indicates that the specified update information received from the server is complete, it determines that the check is passed, and then step 105 is executed.
On the contrary, if the two check messages are not identical, the specified updating message received from the server is not complete, and the check is determined not to pass. Further, when the verification fails, the specified update information may be downloaded again from the server, and then step 105B may be performed to perform the integrity verification again.
Embodiments of the present invention provide the following possible implementations for the implementation of step 105. As shown in fig. 3, includes:
301. and operating the android debugging bridge by calling the starting command of the android debugging bridge.
It should be noted that, when the application has an Android Debug Bridge (ADB) right, the application can call a related command of the Android Debug Bridge, and therefore, the application needs to start the Android Debug Bridge first to enable the Android Debug Bridge to enter a running state.
In the embodiment of the present invention, in order to enable an application program to call an enabling command of an android debug bridge and a related command of the android debug bridge, the commands need to be configured in a code for implementing the application program, so that the application program can run the commands under a specified condition.
In a possible embodiment, when the application program downloads the specified updating information from the server, and the specified updating information passes the integrity check, the application program can open the android debugging bridge by calling an enabling command of the android debugging bridge.
For example, the enable command for the android debug bridge may be: and # start adbd, that is, the application program may start the android debug bridge by calling # start adbd, so that the android debug bridge enters a running state.
It should be noted that, if the android debug bridge can be successfully opened by invoking the enabling command of the android debug bridge, the related command of the android debug bridge can be invoked subsequently. If the android debugging bridge is not successfully opened by calling the starting command of the android debugging bridge, the related command of the android debugging bridge cannot be called. Further, when the android debugging bridge is not successfully opened by calling the starting command of the android debugging bridge, the starting command of the android debugging bridge can be repeatedly called, and the android debugging bridge is tried to be opened again until the android debugging bridge is successfully opened. Or, in the embodiment of the present invention, a corresponding repeated call threshold may also be configured for the start command of the android debugging bridge in advance, and when the android debugging bridge is not successfully started by calling the start command of the android debugging bridge, the start command of the android debugging bridge may be repeatedly called, but if the number of calls reaches the repeated call threshold, the call process is stopped, and the flow is ended.
302. And under the operating state of the android debugging bridge, starting a command parser operating environment of the android debugging bridge by calling related commands of the android debugging bridge.
For the implementation of step 302, the following possible implementation manners are provided in the embodiment of the present invention. As shown in fig. 4, includes:
401. in the operating state of the android debugging bridge, establishing connection with a specified device in the electronic device where the application program is located by calling an android debugging bridge connection command; the specified equipment is equipment which carries a command parser running environment of the android debugging bridge.
It should be noted that the establishment of the connection with the specified device in the electronic device where the application program is located is to obtain a command parser operating environment of the android debug bridge. It can also be understood that if the connection with the specified device in the electronic device where the application program is located is successfully established, it is equivalent to acquiring the command parser operating environment of the android debug bridge.
It should be further noted that, in the operating environment of the command parser of the android debug bridge, the installation permission is set when the installation command is executed, and the automatic upgrade of the application program can be realized. On the contrary, if the command parser running environment of the android debugging bridge is not acquired, the installation permission is not provided, if the installation command is called, the operating system can detect whether the permission is provided, and if the permission is not provided, the installation command is called to fail, so that the automatic upgrading and the complete upgrading of the application program cannot be realized. When the upgrade module does not have the right, other upgrade modes can be used, such as passive upgrade of the application program, namely, the upgrade can be performed only after the user triggers, or only partial modules can be upgraded and complete upgrade cannot be performed when the automatic upgrade is to be realized.
In addition, it should be noted that after the command parser operating environment of the android debug bridge is obtained, the electronic device enters the designated mode, and the application program is upgraded in the command parser operating environment of the android debug bridge, and the upgrade is also effective when the electronic device is in other modes.
In one possible implementation, the android debug bridge connection command may be: the # adb connect (address of the specified device), that is, the application may request to establish a connection with a specified device among the electronic devices where the application is located by calling the # adb connect (address of the specified device).
In an embodiment of the present invention, the specified device, that is, the device that carries the operating environment of the command parser of the android debug bridge, may be a simulator in an electronic device that uses an android operating system.
In one possible implementation, the android debug bridge connection command may be: the # adb connect 172.0.0.1, that is, the application program may request to establish a connection with each simulator in the electronic device where the application program is located by calling the command # adb connect 172.0.0.1, where the simulator includes a simulator that carries a command parser operating environment of the android debug bridge.
Alternatively, in another possible implementation, if the port number of the simulator of the command parser operating environment carrying the android debug bridge is 5555, the android debug bridge connection command may be: an application may request to establish a connection with the emulator in the electronic device in which the application is located by calling the command # adb connect 172.0.0.1:5555, i.e. the application # adb connect 172.0.0.1: 5555.
It should be noted that the address 172.0.0.1 included in the android debug bridge connection command is an address of the electronic device, and when the address is included in the android debug bridge connection command called by the application, it indicates that it is desirable to establish a connection with each device in the electronic device, where the connection includes the specified device. When the address 172.0.0.1 and the port number are contained in the android debug bridge connection command, the application program calls the android debug bridge connection command to indicate that the connection of the device corresponding to the port number in the electronic device is expected to be established. Therefore, the connection attempt with the specified device can be realized through the two android debugging bridge connection commands.
402. And obtaining the connected equipment information by calling the android debugging bridge equipment to obtain the command.
403. And judging whether the connected equipment information contains the information of the specified equipment, if so, executing 404, and if not, executing 401.
404. And when the connected equipment information contains the information of the specified equipment, executing the step of upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
It should be noted that, the invoking of the android debug bridge connection command is to attempt to establish connection with the specified device, but whether the connection is successful or not is not known, so that the application program may further obtain connected device information by invoking an android debug bridge device acquisition command, where the connected device information includes information of each device that has been successfully connected. Further, whether the connection with the specified device is established successfully is detected according to the connected device information. Specifically, if the connected device information includes the information of the specified device, it is considered that the connection establishment with the specified device is successful, that is, the command parser operating environment of the android debug bridge is successfully acquired, and then the application program may be updated, that is, step 106 is executed.
On the contrary, if the connected device information does not include the information of the specified device, the connection establishment between the connected device and the specified device is considered to be failed, the command parser operating environment of the android debug bridge is not acquired, and the application program can also repeatedly call the android debug bridge connection command to try to establish the connection between the connected device and the specified device in the electronic device where the application program is located again.
It should be noted that, after the connection with the specified device is failed to be established, the application program may repeatedly invoke the android debug bridge connection command to attempt to establish the connection until the connection with the specified device is successfully established, or a corresponding repeated invocation threshold may be set for the android debug bridge connection command in advance, and when the number of times that the application program repeatedly invokes the android debug bridge connection command reaches the repeated invocation threshold, the invocation is stopped, and if the connection with the specified device is still not successfully established, the current flow may be ended.
In one possible implementation, the android debug bridge device get command may be: the # adb devices, that is, the application program can obtain the connected device information by calling the # adb devices.
Embodiments of the present invention provide the following possible implementations for the implementation of step 106.
In one possible embodiment, in a command parser execution environment of an android debug bridge, upgrading the application program based on the specified update information may include: and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
It should be noted that, if the connection with the specified device in the electronic device where the application program is located is successfully established, it is equivalent to obtaining the operating environment of the command parser of the android debug bridge. Under the operating environment of the command parser of the android debug bridge, the installation permission is provided when the installation command is executed. Therefore, in the embodiment of the invention, in the command parser operating environment of the android debug bridge, the application program loads the acquired specified updating information in the specified equipment by calling the installation command, so that the automatic upgrading of the application program is realized.
In a possible embodiment, the installation command may be:
#adb–s emulator-5444shell pm install–r xxx.apk。
that is, the application program may load the specified update information in the specified device by calling # adb-s assembler-5444 shell pm install-r xxx.
Taking the example that the specified update information of the application program is an upgrade package of the application program, in the installation command, estimator-5444 is the name of a simulator carrying the operating environment of a command parser of an android debug bridge, apk represents the upgrade package, and the installation command represents: and (5) installing an upgrade package xxx.apk on a simulator estimator-5444.
In another possible embodiment, the installation command may be:
#adb–s 127.0.0.1:5555shell pm install–r xxx.apk。
that is, the application may load the specified update information in the specified device by calling # adb-s 127.0.0.1:5555shell pm install-r xxx.
Taking the example that the specified update information of the application program is an upgrade package of the application program, in the installation command, 127.0.0.1:5555 is an address of the specified device of the command parser operating environment bearing the android debug bridge, where 5555 is a port number of the specified device, xxx.apk represents the upgrade package, and the installation command represents: install the upgrade package xxx. apk on the device represented by 127.0.0.1: 5555.
The following description will take the update information as the upgrade package.
Please refer to fig. 5, which is a schematic flowchart illustrating a process of downloading an upgrade package by an application program interacting with a server according to an embodiment of the present invention, as shown in fig. 5, including:
501. the server obtains the configured upgrade policy.
502. And the application program sends an update detection request to the server to realize upgrade detection.
503. And the server compares the current version information of the application program with the latest version information of the application program according to the update detection request, finds that the current version information and the latest version information of the application program are inconsistent, and indicates that an upgrade package exists.
504. The server generates upgrade information, which may include a download address and verification information of the upgrade package.
505. The server returns an update detection response to the application program, which carries the upgrade information.
506. The application program extracts the download address of the upgrade package.
507. The application program sends a download request to the server based on the download address.
508. And the server acquires the upgrade package according to the downloading request.
509. The server returns a download response to the application, which carries the upgrade package.
510. And the application program generates verification information according to the received upgrade package.
511. And the application program compares the check information generated by the application program with the check information obtained from the server to obtain a comparison result.
And if the comparison result shows that the two check information are consistent, the subsequent upgrade patch installation process needs to be executed. If the two check information are not consistent, the installation package needs to be downloaded again.
The following description will be given by taking a specific device as a specific simulator-5444 as an example.
Please refer to fig. 6, which is a schematic flowchart illustrating an installation process of an application upgrade package according to an embodiment of the present invention, as shown in fig. 6, including:
601. the application program calls the starting command # start adbd of the android debug bridge to run the android debug bridge.
602. In the operating state of the android debugging bridge, the application program calls an android debugging bridge connection command # adb connect 172.0.0.1 to request to establish connection with one or more simulators in the electronic equipment where the application program is located.
603. And calling the android debug bridge equipment acquisition command # adb devices by the application program to acquire connected equipment information, wherein the connected equipment information contains the name of each simulator in one or more simulators in the electronic equipment.
604. The application program judges whether the connected equipment information contains simulator-5444, if yes, step 605 is executed; if not, step 602 is performed.
605. The application program calls an installation command # adb-s assembler-5444 shell pm install-r xxx.apk or an installation command # adb-s assembler-5444 shell pm install-r xxx.apk, and an upgrade package is installed in the simulator assembler-5444.
The embodiment of the invention further provides an embodiment of a device for realizing the steps and the method in the embodiment of the method.
The embodiment of the invention also provides an application program upgrading device which is arranged in the application program. Please refer to fig. 7, which is a functional block diagram of an application program upgrading apparatus according to an embodiment of the present invention. As shown, the apparatus comprises:
a sending unit 10, configured to send an update detection request to a server;
a receiving unit 20, configured to receive a download address returned by the server according to the update detection request;
the sending unit 10 is further configured to send a download request to the server according to the download address;
the receiving unit 20 is further configured to receive specified update information returned by the server according to the download request;
the environment obtaining unit 30 is used for invoking a command parser running environment of the android debug bridge by calling a specified command;
and the upgrading processing unit 40 is configured to upgrade the application program based on the specified update information in a command parser operating environment of the android debug bridge.
In a possible embodiment, the environment obtaining unit 30 is specifically configured to:
the android debugging bridge is operated by calling an enabling command of the android debugging bridge;
and under the operating state of the android debugging bridge, starting a command parser operating environment of the android debugging bridge by calling related commands of the android debugging bridge.
In a possible implementation scheme, the environment obtaining unit 30 is specifically configured to, in an operating state of an android debug bridge, when a command parser operating environment of the android debug bridge is invoked by calling a related instruction of the android debug bridge,:
in the operating state of the android debugging bridge, establishing connection with a specified device in the electronic device where the application program is located by calling an android debugging bridge connection command; and the specified equipment is equipment for bearing the operating environment of a command parser of the android debugging bridge.
In a possible embodiment, the environment obtaining unit 30 is further configured to:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, triggering the upgrading processing unit to execute the upgrading of the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
In a possible embodiment, the upgrade processing unit 40 is specifically configured to: and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
In a possible embodiment, as shown in fig. 8, the receiving unit 10 is further configured to: receiving verification information returned by the server;
the device further comprises:
an information verification unit 50 configured to verify the specified update information based on the verification information; and when the verification is passed, triggering the environment acquisition unit to execute the command designated by calling, and starting a command parser running environment of the android debugging bridge.
Since each unit in the present embodiment can perform the method shown in fig. 1 to 6, reference may be made to the related description of fig. 1 to 6 for a part not described in detail in the present embodiment.
An embodiment of the present invention further provides a computer-readable medium, including: computer-executable instructions which, when executed, perform the steps of:
sending an update detection request to a server;
receiving a download address returned by the server according to the update detection request;
sending a downloading request to the server according to the downloading address;
receiving appointed updating information returned by the server according to the downloading request;
invoking a command parser running environment of an android debug bridge by calling a specified command;
and upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
In a possible embodiment, the step of invoking a command parser runtime environment of the android debug bridge by calling a specified command specifically includes:
the android debugging bridge is operated by calling an enabling command of the android debugging bridge;
in the operating state of the android debugging bridge, establishing connection with a specified device in the electronic device where the application program is located by calling an android debugging bridge connection command; and the specified equipment is equipment for bearing the operating environment of a command parser of the android debugging bridge.
In a possible embodiment, in the command parser execution environment of the android debug bridge, before the upgrading of the application program based on the specified update information, the following steps are further executed:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, executing the step of upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
In a possible embodiment, in a command parser execution environment of the android debug bridge, the step of upgrading the application program based on the specified update information includes:
and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
In a possible embodiment, when receiving the specified updating information returned by the server according to the downloading request, the following steps are further executed: receiving verification information returned by the server;
by calling the specified command, before the command parser running environment of the android debug bridge is started, the following steps are further executed:
verifying the specified updating information based on the verification information;
and when the verification is passed, executing a step of invoking a command parser operating environment of the android debugging bridge by calling a specified command.
The technical scheme of the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, after the appointed updating information is obtained, the operation environment of a command resolver of the android debugging bridge is started by calling the appointed command, and then the upgrading of the application program is carried out based on the appointed updating information in the operation environment of the command resolver of the android debugging bridge; after the command parser operation environment of the android debugging bridge is acquired, the permission can be provided, so that automatic upgrading can be realized. According to the automatic upgrading scheme, the user does not need to click the corresponding key to trigger upgrading, so that the problem that the old version of the application program still needs to be maintained due to the fact that the user does not click the corresponding key can be avoided, the version fragmentation degree of the application program is reduced to a certain extent, and the maintenance cost is reduced to a certain extent. In addition, because the user is prevented from clicking corresponding keys, the upgrading operation can be simplified, and the upgrading efficiency of the application program is improved.
In addition, the technical scheme provided by the embodiment of the invention realizes automatic upgrading, achieves the effect of silent upgrading, avoids bad experience brought to users by a forced upgrading mode, and improves user experience. In addition, the method and the device obtain the authority by obtaining the command parser operating environment of the android debugging bridge, and further can completely upgrade the application program according to the obtained specified updating information due to the authority.
Moreover, compared with the technical scheme that the terminal is connected with the terminal through the computer, the update information is downloaded through the computer and installed on the terminal in the prior art, according to the technical scheme provided by the embodiment of the invention, the local application program of the terminal interacts with the server, the update information is downloaded, and the related command of the android debug bridge is locally operated to cross the authority to complete the upgrade of the application program, so that the terminal is not required to be connected with the computer, the download and installation of the computer are not required, the limitation that the installation can be completed by using the computer is eliminated, the upgrade flexibility of the application program is improved, and the upgrade efficiency is improved.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a Processor (Processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (8)
1. An application program upgrading method is characterized in that the method is executed in an application program local to a terminal; the method comprises the following steps:
sending an update detection request to a server;
receiving a download address and check information returned by the server according to the update detection request;
sending a downloading request to the server according to the downloading address;
receiving appointed updating information returned by the server according to the downloading request;
verifying the integrity of the specified updating information based on the verification information;
when the verification is passed, operating the android debugging bridge by calling an enabling command of the android debugging bridge;
in the operating state of the android debugging bridge, establishing connection with a specified device in the terminal where the application program is located by calling an android debugging bridge connection command; the specified equipment is equipment bearing a command parser running environment of the android debugging bridge;
wherein the connect command comprises: the address of the terminal and the port number of the simulator;
and upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
2. The method of claim 1, wherein before performing the upgrade of the application program based on the specified update information in a command parser runtime environment of the android debug bridge, the method further comprises:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, executing the step of upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
3. The method according to any one of claims 1 to 2, wherein in a command parser runtime environment of the android debug bridge, upgrading the application program based on the specified update information comprises:
and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
4. An application program upgrading device is characterized in that the device is arranged in an application program of a local terminal; the device comprises:
a sending unit, configured to send an update detection request to a server;
a receiving unit, configured to receive a download address and verification information returned by the server according to the update detection request;
the sending unit is further configured to send a download request to the server according to the download address;
the receiving unit is further configured to receive specified update information returned by the server according to the download request;
an environment acquisition unit, configured to verify integrity of the specified update information based on the verification information; when the verification is passed, operating the android debugging bridge by calling an enabling command of the android debugging bridge; in the operating state of the android debugging bridge, establishing connection with a specified device in the terminal where the application program is located by calling an android debugging bridge connection command; the specified equipment is equipment bearing a command parser running environment of the android debugging bridge; wherein the connect command comprises: the address of the terminal and the port number of the simulator;
and the upgrading processing unit is used for upgrading the application program based on the specified updating information in the command parser operating environment of the android debugging bridge.
5. The apparatus according to claim 4, wherein the environment obtaining unit is further configured to:
obtaining the information of the connected equipment by calling an android debugging bridge equipment acquisition command;
judging whether the connected equipment information contains the information of the specified equipment or not;
and when the connected equipment information contains the information of the specified equipment, triggering the upgrading processing unit to execute the step of upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
6. The apparatus according to any one of claims 4 to 5, wherein the upgrade processing unit is specifically configured to: and in the command parser operating environment of the android debugging bridge, loading the specified updating information in the specified equipment by calling an installation command.
7. A computer-readable storage medium, comprising: computer-executable instructions which, when executed, perform the steps of:
sending an update detection request to a server;
receiving a download address and check information returned by the server according to the update detection request;
sending a downloading request to the server according to the downloading address;
receiving appointed updating information returned by the server according to the downloading request;
verifying the integrity of the specified updating information based on the verification information;
when the verification is passed, operating the android debugging bridge by calling an enabling command of the android debugging bridge;
in the operating state of the android debugging bridge, establishing connection with a specified device in the terminal where the application program is located by calling an android debugging bridge connection command; the specified equipment is equipment bearing a command parser running environment of the android debugging bridge;
wherein the connect command comprises: the address of the terminal and the port number of the simulator;
and upgrading the application program based on the specified updating information in a command parser operating environment of the android debugging bridge.
8. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for implementing the application upgrade method of any one of claims 1 to 3 when executing computer executable instructions stored in the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710366234.1A CN108958785B (en) | 2017-05-23 | 2017-05-23 | Application program upgrading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710366234.1A CN108958785B (en) | 2017-05-23 | 2017-05-23 | Application program upgrading method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108958785A CN108958785A (en) | 2018-12-07 |
CN108958785B true CN108958785B (en) | 2022-01-07 |
Family
ID=64462633
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710366234.1A Active CN108958785B (en) | 2017-05-23 | 2017-05-23 | Application program upgrading method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108958785B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109684026B (en) * | 2019-01-14 | 2022-02-22 | 武汉斗鱼鱼乐网络科技有限公司 | APP skin replacement method and device, electronic equipment and storage medium |
CN110018838B (en) * | 2019-03-01 | 2022-05-06 | 视联动力信息技术股份有限公司 | Method and system for configuring programs in android medical terminal |
CN112783519B (en) * | 2019-11-04 | 2023-10-20 | 航天科工惯性技术有限公司 | Application program updating method and system for measuring nipple |
CN116541045B (en) * | 2023-07-03 | 2023-11-03 | 京东科技信息技术有限公司 | Application resource updating method, device and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104679654A (en) * | 2015-02-26 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Method, equipment and system for testing application program |
CN105323299A (en) * | 2015-03-06 | 2016-02-10 | 维沃移动通信有限公司 | Data transmission method and terminal |
CN105786538A (en) * | 2014-12-24 | 2016-07-20 | 博雅网络游戏开发(深圳)有限公司 | Software upgrading method and device based on Android system |
US9459858B2 (en) * | 2015-01-07 | 2016-10-04 | International Business Machines Corporation | Selectively hotpatching only a selection of processes of a running instance of an application that match a selection criteria |
CN106686073A (en) * | 2016-12-19 | 2017-05-17 | 北京东方车云信息技术有限公司 | Information processing method and system |
-
2017
- 2017-05-23 CN CN201710366234.1A patent/CN108958785B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786538A (en) * | 2014-12-24 | 2016-07-20 | 博雅网络游戏开发(深圳)有限公司 | Software upgrading method and device based on Android system |
US9459858B2 (en) * | 2015-01-07 | 2016-10-04 | International Business Machines Corporation | Selectively hotpatching only a selection of processes of a running instance of an application that match a selection criteria |
CN104679654A (en) * | 2015-02-26 | 2015-06-03 | 百度在线网络技术(北京)有限公司 | Method, equipment and system for testing application program |
CN105323299A (en) * | 2015-03-06 | 2016-02-10 | 维沃移动通信有限公司 | Data transmission method and terminal |
CN106686073A (en) * | 2016-12-19 | 2017-05-17 | 北京东方车云信息技术有限公司 | Information processing method and system |
Non-Patent Citations (1)
Title |
---|
adb协议模拟实现静默安装apk;koozxcv;《https://blog.csdn.net/koozxcv/article/details/52162462》;20160809;第1-2页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108958785A (en) | 2018-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10871953B2 (en) | Application update method and apparatus | |
CN105955782B (en) | Application program operation control method and device | |
US8099472B2 (en) | System and method for a mobile cross-platform software system | |
CN103617380B (en) | Application program authority dynamic control method and system | |
CN108958785B (en) | Application program upgrading method and device | |
CN103379481B (en) | Method for achieving safety protection | |
CN105786538B (en) | software upgrading method and device based on android system | |
CN108845812A (en) | Update of plug-in method, apparatus, computer equipment and storage medium | |
CN106502747A (en) | A kind of method of application upgrade and mobile terminal | |
CN107844306B (en) | Application program repairing method and device, storage medium and terminal | |
CN115659343B (en) | Container attack simulation method and detection method for simulating real attack, and terminal | |
US11023220B2 (en) | Firmware update with integrated smart sequence and action engine | |
US20240394380A1 (en) | Data processing method and apparatus | |
US8549166B2 (en) | Execution of unverified programs in a wireless, device operating environment | |
CN111694583B (en) | Cloud game updating method, cloud game updating system and storage medium | |
CN105975333A (en) | Method and device for running control of application programs | |
CN110852259A (en) | Living body identification method, system, apparatus, device, and computer-readable storage medium | |
CN112199151B (en) | Application program running method and device | |
CN116340956B (en) | Trusted protection optimization method and device for electric embedded terminal equipment | |
CN104503760B (en) | The method and device of acquisition system highest authority | |
CN116775172A (en) | Method and system for achieving Android data acquisition through reflection | |
CN104598807B (en) | Increment upgrade detection method, management method, terminal and increment updating and management platform | |
CN111475763B (en) | Webpage running method and device, storage medium and equipment | |
CN113064601B (en) | Method, device, terminal and storage medium for determining dynamic loading file | |
CN113867756A (en) | Software upgrading method, terminal equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |