Application program updating method and device, storage medium and electronic device

文档序号:1963491 发布日期:2021-12-14 浏览:25次 中文

阅读说明:本技术 应用程序的更新方法、装置、存储介质和电子装置 (Application program updating method and device, storage medium and electronic device ) 是由 周瑞 王卫桥 王乐康 吕博 梁刚 于 2021-09-07 设计创作,主要内容包括:本发明实施例提供了一种应用程序的更新方法、装置、存储介质和电子装置,其中,该方法包括:获取更新请求,其中,更新请求用于请求将初始应用程序中的初始子程序更新为目标子程序,初始应用程序所划分的多个子程序包括初始子程序;根据初始应用程序和目标子程序,确定目标子程序的目标运行时间;在目标运行时间满足初始子程序对应的初始时间条件的情况下,响应更新请求,将初始应用程序中的初始子程序更新为目标子程序,得到目标应用程序。通过本发明,解决了相关技术中存在的对应用程序的更新的监控效率较低的问题,进而达到了提高对应用程序的更新的监控效率的效果。(The embodiment of the invention provides an updating method, a device, a storage medium and an electronic device of an application program, wherein the method comprises the following steps: acquiring an update request, wherein the update request is used for requesting to update an initial subprogram in an initial application program to a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram; determining the target running time of the target subprogram according to the initial application program and the target subprogram; and under the condition that the target running time meets the initial time condition corresponding to the initial subprogram, responding to the updating request, and updating the initial subprogram in the initial application program into the target subprogram to obtain the target application program. According to the invention, the problem of low monitoring efficiency of updating the application program in the related technology is solved, and the effect of improving the monitoring efficiency of updating the application program is further achieved.)

1. An update method for an application program, comprising:

acquiring an update request, wherein the update request is used for requesting to update an initial subprogram in an initial application program to a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram;

determining target running time of the target subprogram according to the initial application program and the target subprogram;

and under the condition that the target running time meets the initial time condition corresponding to the initial subprogram, responding to the updating request, and updating the initial subprogram in the initial application program into the target subprogram to obtain the target application program.

2. The method of claim 1, wherein determining the target runtime of the target subroutine from the initial application and the target subroutine comprises:

merging the target subprogram and the initial application program to obtain a test program;

testing the test program in a simulated operation environment to obtain a test result;

and extracting the target running time from the test result.

3. The method of claim 2, wherein extracting the target runtime from the test results comprises:

determining a first code corresponding to a first tag and a second code corresponding to a second tag in the program code of the test program, wherein the first tag is used for marking a start code of the program code of the target subprogram in the program code of the test program, and the second tag is used for marking an end code of the program code of the target subprogram in the program code of the test program;

acquiring a first running time of the first code and a second running time of the second code from the test result;

determining a difference between the second running time and the first running time as the target running time.

4. The method of claim 1, wherein updating the initial subprogram in the initial application to the target subprogram, and obtaining a target application comprises:

acquiring the target subprogram according to the updating request;

and replacing the initial subprogram in the initial application program with the target subprogram to obtain the target application program.

5. The method of claim 1, wherein before updating the initial sub-program in the initial application program to the target sub-program in response to the update request, the method further comprises:

acquiring target reference time corresponding to the initial subprogram from the subprogram and the reference time which have the corresponding relation;

determining that the target running time meets the initial time condition corresponding to the initial subprogram under the condition that the target reference time is greater than or equal to the target running time;

and under the condition that the target reference time is smaller than the target running time, determining that the target running time does not meet the initial time condition corresponding to the initial subprogram.

6. The method of claim 1, wherein after determining a target runtime of the target subroutine from the initial application and the target subroutine, the method further comprises:

rejecting the update request under the condition that the target running time does not meet the initial time condition corresponding to the initial subprogram;

and sending an alarm message to an initiator of the update request, wherein the alarm message is used for indicating that the update request is rejected because the target running time does not meet the initial time condition corresponding to the initial subprogram.

7. The method of claim 1, wherein after updating the initial sub-program in the initial application program to the target sub-program in response to the update request, the method further comprises:

updating the target running time corresponding to the target subprogram to a history updating record to obtain a current updating record, wherein the history updating record is used for indicating the historical running time of the history updating subprogram obtained after a history updating request is executed on a subprogram in the plurality of subprograms;

and adjusting the time condition corresponding to each subprogram in the plurality of subprograms according to the running time recorded in the current updating record.

8. An apparatus for updating an application program, comprising:

the method comprises the steps of obtaining an updating request, wherein the updating request is used for requesting to update an initial subprogram in an initial application program to a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram;

the first determining module is used for determining the target running time of the target subprogram according to the initial application program and the target subprogram;

and the first updating module is used for responding to the updating request and updating the initial subprogram in the initial application program into the target subprogram to obtain the target application program under the condition that the target running time meets the initial time condition corresponding to the initial subprogram.

9. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method as claimed in any of claims 1 to 7 are implemented when the computer program is executed by the processor.

Technical Field

The embodiment of the invention relates to the field of computers, in particular to an updating method and device of an application program, a storage medium and an electronic device.

Background

Compared with the traditional macro base station, the pico base station is limited by the requirements of product volume and cost control, and the selected hardware platform is relatively poor in computing capacity and storage performance, so that a software module is required to achieve the highest processing performance under the limited computing capacity and storage performance. In the TDD mode, due to the requirement of the frame structure, the scheduling module of the MAC layer is required to strictly meet the timing sequence requirement in terms of processing delay, and if the scheduling processing is not completed at a specific time, the performance index of the pico-cell product will be affected.

The traditional software development process carries out manual function test after the development is finished so as to verify whether the performance of a product can meet the requirement, the method lacks the measurement of the processing time delay of a scheduling module, the allowance of the current processing time delay cannot be intuitively grasped, if the performance of the product cannot meet the requirement, the processing flow of the software is generally deteriorated to the extent that the restoration is difficult, and at the moment, the code architecture can be repaired only by consuming a great deal of energy to optimize and adjust.

Aiming at the problem of low monitoring efficiency of updating of the application program in the related art, no effective solution is provided at present.

Disclosure of Invention

The embodiment of the invention provides an updating method and device of an application program, a storage medium and an electronic device, and aims to at least solve the problem that monitoring efficiency of updating of the application program is low in the related art.

According to an embodiment of the present invention, there is provided an update method of an application program, including: acquiring an update request, wherein the update request is used for requesting to update an initial subprogram in an initial application program to a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram; determining target running time of the target subprogram according to the initial application program and the target subprogram; and under the condition that the target running time meets the initial time condition corresponding to the initial subprogram, responding to the updating request, and updating the initial subprogram in the initial application program into the target subprogram to obtain the target application program.

Optionally, determining the target runtime of the target subroutine according to the initial application program and the target subroutine includes: merging the target subprogram and the initial application program to obtain a test program; testing the test program in a simulated operation environment to obtain a test result; and extracting the target running time from the test result.

Optionally, extracting the target runtime from the test result comprises: determining a first code corresponding to a first tag and a second code corresponding to a second tag in the program code of the test program, wherein the first tag is used for marking a start code of the program code of the target subprogram in the program code of the test program, and the second tag is used for marking an end code of the program code of the target subprogram in the program code of the test program; acquiring a first running time of the first code and a second running time of the second code from the test result; determining a difference between the second running time and the first running time as the target running time.

Optionally, updating the initial subprogram in the initial application program to the target subprogram, and obtaining the target application program includes: acquiring the target subprogram according to the updating request; and replacing the initial subprogram in the initial application program with the target subprogram to obtain the target application program.

Optionally, before responding to the update request and updating the initial subprogram in the initial application program to the target subprogram to obtain the target application program, the method further includes: acquiring target reference time corresponding to the initial subprogram from the subprogram and the reference time which have the corresponding relation; determining that the target running time meets the initial time condition corresponding to the initial subprogram under the condition that the target reference time is greater than or equal to the target running time; and under the condition that the target reference time is smaller than the target running time, determining that the target running time does not meet the initial time condition corresponding to the initial subprogram.

Optionally, after determining the target runtime of the target subroutine according to the initial application program and the target subroutine, the method further includes: rejecting the update request under the condition that the target running time does not meet the initial time condition corresponding to the initial subprogram; and sending an alarm message to an initiator of the update request, wherein the alarm message is used for indicating that the update request is rejected because the target running time does not meet the initial time condition corresponding to the initial subprogram.

Optionally, after the initial sub-program in the initial application program is updated to the target sub-program in response to the update request, and the target application program is obtained, the method further includes: updating the target running time corresponding to the target subprogram to a history updating record to obtain a current updating record, wherein the history updating record is used for indicating the historical running time of the history updating subprogram obtained after a history updating request is executed on a subprogram in the plurality of subprograms; and adjusting the time condition corresponding to each subprogram in the plurality of subprograms according to the running time recorded in the current updating record.

According to another embodiment of the present invention, there is also provided an apparatus for updating an application, including: the method comprises the steps of obtaining an updating request, wherein the updating request is used for requesting to update an initial subprogram in an initial application program to a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram; the first determining module is used for determining the target running time of the target subprogram according to the initial application program and the target subprogram; and the first updating module is used for responding to the updating request and updating the initial subprogram in the initial application program into the target subprogram to obtain the target application program under the condition that the target running time meets the initial time condition corresponding to the initial subprogram.

According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.

According to the method and the device, the updating request is obtained, wherein the updating request is used for requesting the initial subprogram in the initial application program to be updated into the target subprogram, and the plurality of subprograms divided by the initial application program comprise the initial subprogram; determining the target running time of the target subprogram according to the initial application program and the target subprogram; under the condition that the target running time meets the initial time condition corresponding to the initial subprogram, responding to an update request, updating the initial subprogram in the initial application program into the target subprogram, and obtaining the target application program, namely the initial application program comprises a plurality of subprograms, the update request can update the subprogram in the initial application program, the initial subprogram in the plurality of subprograms in the initial application program is updated into the target subprogram, the running time of the updated subprogram also changes, the target running time of the target subprogram obtained by updating the update request can be determined according to the initial application program and the target subprogram, different subprograms correspond to different time conditions, and under the condition that the target running time of the target subprogram meets the initial time condition corresponding to the initial subprogram, the initial subprogram in the initial application program is updated into the target subprogram in response to the update request, therefore, the monitoring of the running time of each subprogram included in the application program is realized, the problem of low monitoring efficiency of updating the application program in the related technology is solved, and the effect of improving the monitoring efficiency of updating the application program is achieved.

Drawings

Fig. 1 is a block diagram of a hardware configuration of a mobile terminal of an application program update method according to an embodiment of the present invention;

FIG. 2 is a flow chart of a method for updating an application according to an embodiment of the present invention;

FIG. 3 is a flow diagram of an alternative runtime monitoring according to an embodiment of the present application;

fig. 4 is a block diagram of an update apparatus of an application according to an embodiment of the present invention.

Detailed Description

Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the method for updating an application program according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.

The memory 104 may be used for storing computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the update method of the application program in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.

In this embodiment, an updating method of an application program is provided, and fig. 2 is a flowchart of the updating method of an application program according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:

step S202, obtaining an update request, wherein the update request is used for requesting to update an initial subprogram in an initial application program into a target subprogram, and a plurality of subprograms divided by the initial application program comprise the initial subprogram;

step S204, determining the target running time of the target subprogram according to the initial application program and the target subprogram;

step S206, in a case that the target running time satisfies the initial time condition corresponding to the initial subprogram, responding to the update request, and updating the initial subprogram in the initial application program to the target subprogram to obtain the target application program.

Through the steps, the initial application program comprises a plurality of subprograms, the update request can update the subprograms in the initial application program, the initial subprograms in the plurality of subprograms in the initial application program are updated to the target subprograms, the running time of the updated subprograms also changes, the target running time of the target subprogram obtained by updating the update request can be determined according to the initial application program and the target subprograms, different subprograms correspond to different time conditions, when the target running time of the target subprogram meets the initial time condition corresponding to the initial subprogram, the update request can be responded, and the initial subprogram in the initial application program is updated to the target subprogram, so that the running time of each subprogram included in the application program is monitored, and therefore, the problem that the monitoring efficiency of updating the application program in the related technology is low is solved, the effect of improving the monitoring efficiency of the update of the application program is achieved.

In the technical solution provided in step S202 above, the initial application program may be, but is not limited to be, in the form of a code library, and the codes stored in the code library may be, but is not limited to be, divided into multiple segments of codes according to the functions implemented by each segment, so as to obtain multiple sub programs.

Optionally, in this embodiment, the update request may be an update of the code of the subroutine, such as updating one or more lines of code in the initial subroutine to other code, replacing all code of the initial subroutine with code of the target subroutine, adding code at a specific position in the initial subroutine, and the like, which is not limited in this embodiment.

Optionally, in this embodiment, the change request may be generated by an account corresponding to a program operator, and when the program operator submits a program code that needs to be changed for a sub program, the change request is generated.

In the technical solution provided in step S204, determining the target running time of the target sub-program may be obtained by running the program in a simulated running environment, where running times obtained by running the program in different simulated running environments are different.

Optionally, in this embodiment, the running time of the target subprogram may be obtained by running the target subprogram in a running environment, and a tag or a breakpoint may also be set at a code start position and a code end position of the target subprogram, and the target subprogram is merged into the initial application program, and the running time of the target subprogram is determined by running the merged initial application program and according to the running absolute time running to the tag or the breakpoint, which is not limited in this embodiment.

In the technical solution provided in step S206, the initial time condition may be a time threshold range within which the time delay of the initial subprogram set for the initial subprogram in advance needs to fall, the time threshold range may be set according to the requirement or the requirement for the initial subprogram, and different subprograms may correspond to different time conditions.

Optionally, in this embodiment, the target subprogram may be obtained by updating the initial subprogram according to an update request, in this embodiment, after the update request is obtained, the corresponding initial subprogram may be copied into a certain specific storage space, where the storage space may be the same as or different from a storage space in which the initial application program is stored, the initial subprogram is updated in the storage space according to the update request to obtain the target subprogram, and the initial subprogram in the initial application program is replaced by the target subprogram when the running time of the target subprogram satisfies the corresponding initial time condition, or the initial subprogram in the initial application program is updated to the target subprogram according to the update request.

As an alternative embodiment, determining the target runtime of the target subroutine according to the initial application and the target subroutine comprises:

s11, merging the target subprogram and the initial application program to obtain a test program;

s12, testing the test program in a simulated operation environment to obtain a test result;

and S13, extracting the target running time from the test result.

In this embodiment, merging the target sub-program and the initial application program may be replacing all codes of the initial sub-program corresponding to the target sub-program in the initial application program with codes of the target sub-program, or comparing codes of the initial sub-program and the target sub-program, and replacing codes of the initial sub-program that are different from the target sub-program with codes of the target sub-program.

Optionally, in this embodiment, the test result may only include the runtime of the target subprogram, and may also include the runtime of the target subprogram and the runtime of other subprograms included in the initial application program, which is not limited in this embodiment.

Optionally, in this embodiment, a tag may be set at a code start position and a code end position of each subroutine, and when the initial application program runs, the execution time of the code corresponding to the tag may be detected, and then the running time of each subroutine may be determined according to the tag, so as to extract the target running time from the test result.

As an optional embodiment, extracting the target runtime from the test result comprises:

s21, determining a first code corresponding to a first label and a second code corresponding to a second label in the program code of the test program, wherein the first label is used for marking the start code of the program code of the target subprogram in the program code of the test program, and the second label is used for marking the end code of the program code of the target subprogram in the program code of the test program;

s22, acquiring a first running time of the first code and a second running time of the second code from the test result;

s23, determining the difference between the second running time and the first running time as the target running time.

Optionally, in this embodiment, the first code may be one or more continuous codes of the starting position of the program code, for example, the first code of the starting position of the program code may be set as the first code, and the first line code of the revealing position of the program code may also be set as the first code, which is not limited in this embodiment.

Optionally, in this embodiment, the second code may be one or more codes of the termination position of the program code, for example, the last code of the program code may be set as the second code, and the last line code of the program code may also be set as the second code, which is not limited by this embodiment.

Optionally, in this embodiment, the first running time of the first code may represent a time for starting running the target sub-program, and the second running time of the second code may represent a time for finishing running the target sub-program, and the target running time of the target sub-program may be obtained by calculating a difference between the first running time and the second running time.

As an optional embodiment, the updating the initial subprogram in the initial application program to the target subprogram, and obtaining the target application program includes:

s31, acquiring the target subprogram according to the updating request;

s32, replacing the initial subprogram in the initial application program with the target subprogram to obtain the target application program.

Optionally, in this embodiment, the update request may include a target subprogram to be updated, the target subprogram is directly obtained in the update request by analyzing the update request, the update request may also include only a part of codes of an initial subprogram that needs to be updated, and a corresponding code in the initial subprogram is updated to a content included in the update request, so as to obtain the target subprogram.

As an optional embodiment, before responding to the update request, updating the initial subprogram in the initial application program to the target subprogram, and obtaining a target application program, the method further includes:

s41, acquiring target reference time corresponding to the initial subprogram from the subprogram and the reference time with the corresponding relation;

s42, determining that the target running time meets the initial time condition corresponding to the initial subprogram when the target reference time is greater than or equal to the target running time;

s43, determining that the target running time does not meet the initial time condition corresponding to the initial subprogram under the condition that the target reference time is less than the target running time.

Optionally, in this embodiment, the reference time may be, but is not limited to, used to represent the maximum acceptable delay in the running process of the subroutine, for example, the reference time may be set to be 1 second, 1.1 second, 1.5 seconds, 2 seconds, and the like, and the value of the reference time is not specifically limited in this scheme.

Optionally, in this embodiment, the reference time corresponding to each sub-program may be flexibly set according to a requirement or a characteristic of each sub-program, and different sub-programs correspond to different reference times.

As an optional embodiment, after determining the target runtime of the target subroutine according to the initial application program and the target subroutine, the method further includes:

s51, rejecting the update request under the condition that the target running time does not meet the initial time condition corresponding to the initial subprogram;

s52, sending an alarm message to the initiator of the update request, wherein the alarm message is used to indicate that the update request is rejected because the target running time does not satisfy the initial time condition corresponding to the initial subprogram.

Optionally, in this embodiment, the warning message may be a message in the form of audio, reminding text, or the like, for example, when the update request is rejected, the client of the initiator of the update request may receive a warning message that the current change does not meet the requirement of the running time.

As an optional embodiment, after responding to the update request, updating the initial subprogram in the initial application program to the target subprogram, and obtaining the target application program, the method further includes:

s61, updating the target running time corresponding to the target subprogram to the history updating record to obtain a current updating record, wherein the history updating record is used for indicating the history running time of the history updating subprogram obtained after a history updating request is executed on the subprogram in the plurality of subprograms;

and S62, adjusting the time condition corresponding to each subprogram in the plurality of subprograms according to the running time recorded in the current updating record.

Optionally, in this embodiment, adjusting the reference time of each sub-program may be increasing or decreasing the reference time by a certain margin, for example, when it is detected that a certain number of times of historical run times of a certain sub-program of the initial application program is less than the reference time of the sub-program, decreasing a value of the reference time of the sub-program by a certain margin.

Fig. 3 is a flow chart of alternative runtime monitoring according to an embodiment of the present application, which may be applied, but is not limited, to application runtime monitoring in a pico-base station, as shown in fig. 3, where an initial application includes a plurality of subroutines, each subroutine has a corresponding reference runtime, the reference runtime is generally determined by factors such as frame structure configuration, MAC and RLC communication delay, PHY processing capability, and the like, and needs to be determined by combining a specific implementation of the initial application, the reference runtime is divided into an overall reference runtime and a sub-reference runtime of each subroutine, the overall reference runtime is generally 90% of a maximum available scheduling time, and the sub-reference runtimes of each subroutine are allocated in proportion according to respective code flow time consumption of each subroutine; the monitoring module checks code change, triggers a flow if the code change is detected, requests an initiator to submit a code flow if a function change occurs, starts system operation if the monitoring module detects the code change, combines the code change with a current code base code, constructs and generates a new test version, and sends the test version to the data acquisition module for next operation; the data acquisition module executes a scheduling process, counts and records running time data of each subprogram, receives a test version sent by the monitoring module, loads the test version to a simulated running environment, executes a test action, a breakpoint arranged in the test version can output the processing start time and the processing end time of each subprogram, stores an execution result to a database, sets the result as baseline data if no record exists in the database, and summarizes the data and triggers a decision module process if a history record exists in the database; the decision module makes a decision result according to the comparison of the reported result of the data acquisition module and the baseline data, receives the test result data, calculates according to a preset decision model to obtain the decision result, and sends an alarm and rejects the updating request if the result exceeds the corresponding sub-reference time, otherwise, approves the updating request; the statistical module reads results of the data acquisition module and the decision module in the database, sorts the data, outputs a program operation monitoring report, generates a time delay monitoring report through the statistical module, and displays operation time statistical details of the historical version, including the total operation time of the initial application program and the actual operation time of each subprogram, the operation time allowance between the actual operation time of each subprogram and the sub-reference operation time, the change condition of the sub-reference operation time of each subprogram, and the like.

Through the embodiment, automatic collection of the running time data of the application program can be realized, manual intervention is not needed after the reference running time is set, and the running result can be automatically analyzed and output to the report. Secondly, the time delay performance of the application program of the scheduling module can be alarmed and guarded, and progressive performance deterioration is avoided. In addition, the runtime data of the application program is modularized and visualized, and guidance is provided for function development and code optimization. And the decision module can consider the importance degree of function change and comprehensively coordinate the function realization and the performance requirement.

Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

In this embodiment, an apparatus for updating an application program is further provided, and fig. 4 is a block diagram of a structure of an apparatus for updating an application program according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes: a first obtaining module 42, configured to obtain an update request, where the update request is used to request an initial sub program in an initial application program to be updated to a target sub program, where multiple sub programs divided by the initial application program include the initial sub program; a first determining module 44, configured to determine a target runtime of the target subprogram according to the initial application program and the target subprogram; a first updating module 46, configured to respond to the update request and update the initial subprogram in the initial application program to the target subprogram to obtain a target application program when the target running time meets an initial time condition corresponding to the initial subprogram.

Optionally, the first determining module includes: the merging unit is used for merging the target subprogram and the initial application program to obtain a test program; the test unit is used for testing the test program in a simulated operation environment to obtain a test result; and the extracting unit is used for extracting the target running time from the test result.

Optionally, the extracting unit is configured to: determining a first code corresponding to a first tag and a second code corresponding to a second tag in the program code of the test program, wherein the first tag is used for marking a start code of the program code of the target subprogram in the program code of the test program, and the second tag is used for marking an end code of the program code of the target subprogram in the program code of the test program; acquiring a first running time of the first code and a second running time of the second code from the test result; determining a difference between the second running time and the first running time as the target running time.

Optionally, the first updating module includes: an obtaining unit, configured to obtain the target subprogram according to the update request; and the replacing unit is used for replacing the initial subprogram in the initial application program with the target subprogram to obtain the target application program.

Optionally, the apparatus further comprises: a second obtaining module, configured to obtain, before responding to the update request, a target reference time corresponding to the initial subprogram from the subprograms and the reference time that have a corresponding relationship, before updating the initial subprogram in the initial application to the target subprogram to obtain the target application; a second determining module, configured to determine that the target running time satisfies the initial time condition corresponding to the initial subroutine when the target reference time is greater than or equal to the target running time; and the third determining module is used for determining that the target running time does not meet the initial time condition corresponding to the initial subprogram under the condition that the target reference time is less than the target running time.

Optionally, the apparatus further comprises: the processing module is used for refusing the updating request under the condition that the target running time does not meet the initial time condition corresponding to the initial subprogram after the target running time of the target subprogram is determined according to the initial application program and the target subprogram; and a sending module, configured to send an alarm message to an initiator of the update request, where the alarm message is used to indicate that the update request is rejected because the target running time does not satisfy the initial time condition corresponding to the initial subroutine.

Optionally, the apparatus further comprises: a second updating module, configured to update the initial subprogram in the initial application program to the target subprogram in response to the update request, and after the target application program is obtained, update the target running time corresponding to the target subprogram to a history update record, so as to obtain a current update record, where the history update record is used to indicate a history running time of the history update subprogram obtained after the history update request is executed on a subprogram in the plurality of subprograms; and the adjusting module is used for adjusting the time condition corresponding to each subprogram in the plurality of subprograms according to the running time recorded in the current updating record.

It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.

Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.

In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.

Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.

In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.

It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.

The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种远程升级方法及相应的设备、存储介质和产品

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!