CN114138294A - Application updating method and device, computer equipment and storage medium - Google Patents

Application updating method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114138294A
CN114138294A CN202010925471.9A CN202010925471A CN114138294A CN 114138294 A CN114138294 A CN 114138294A CN 202010925471 A CN202010925471 A CN 202010925471A CN 114138294 A CN114138294 A CN 114138294A
Authority
CN
China
Prior art keywords
application
update
updating
target
function name
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010925471.9A
Other languages
Chinese (zh)
Inventor
陈贝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010925471.9A priority Critical patent/CN114138294A/en
Publication of CN114138294A publication Critical patent/CN114138294A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/425Lexical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Landscapes

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

Abstract

The embodiment of the application discloses an application updating method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring the updating information of the application, intercepting a calling instruction carrying a target function name in the running process of the application, wherein the target function name is any function name in the updating information, and executing a target updating code corresponding to the target function name. The online updating of the target function is realized, the device is not required to download and install the application program package of the application, and the application updating efficiency is improved. And in the online updating process, the user has no perception, so that the influence of the application updating on the user is reduced. When the application has the updating information, automatic updating can be realized in the application running process, and the user does not need to actively trigger to update the application, so that the coverage rate of application updating is effectively improved, the current version of the application is kept to be the latest version, the version number of the application needing to be maintained in the background is reduced, and the maintenance cost is reduced.

Description

Application updating method and device, computer equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to an application updating method, an application updating device, computer equipment and a storage medium.
Background
After the application is released, the application is usually updated to meet the increasing demands of users. With the development of computer technology, the functions of the application are more and more abundant, and the updating speed is faster and faster. When the application on a certain device is updated, the device downloads the application package after the application is updated, and installs the application package to realize the update of the application. However, since the above method requires downloading and installing an application package, the update efficiency is low.
Disclosure of Invention
The embodiment of the application updating method and device, the computer equipment and the storage medium can improve the application updating efficiency. The technical scheme is as follows:
in one aspect, an application update method is provided, and the method includes:
acquiring update information of an application, wherein the update information comprises at least one function name and an update code corresponding to each function name;
intercepting a calling instruction carrying a target function name in the application running process, wherein the target function name is any function name in the updating information;
and executing the target updating code corresponding to the target function name.
In another aspect, an application update apparatus is provided, the apparatus including:
the updating information acquiring module is used for acquiring updating information of the application, wherein the updating information comprises at least one function name and an updating code corresponding to each function name;
the instruction intercepting module is used for intercepting a calling instruction carrying a target function name in the application running process, wherein the target function name is any function name in the updating information;
and the code execution module is used for executing the target updating code corresponding to the target function name.
In a possible implementation manner, the instruction intercepting module is configured to intercept, by a dynamic engine in the application, a call instruction carrying a name of a target function in the running process of the application;
and the code execution module is used for executing the target updating code corresponding to the target function name through the dynamic engine.
In another possible implementation, the dynamic engine includes a message interceptor; the instruction interception module comprises:
and the instruction intercepting unit is used for intercepting a calling instruction carrying a target function name through the message interceptor in the application running process.
In another possible implementation manner, the instruction intercepting unit includes:
a pointer pointing subunit, configured to monitor the call instruction through the message interceptor in the application running process, and point a function pointer corresponding to the target function name to a message forwarding function pointer;
and the instruction interception subunit is used for operating an interface interception function corresponding to the message forwarding function pointer and intercepting the call instruction.
In another possible implementation manner, after the interface interception function corresponding to the message forwarding function pointer is run and the call instruction is intercepted, and before the target update code corresponding to the target function name is executed, the apparatus further includes:
a function pointer directing module, configured to direct a function pointer of the interface interception function to a callback function in the message interceptor;
and the code query module is used for operating the callback function and querying the target update code corresponding to the target function name in the update information.
In another possible implementation manner, the update code includes a plurality of characters, and the dynamic engine includes a lexical analyzer, a syntax parser, and a statement executor;
the code execution module includes:
the analysis processing unit is used for analyzing and processing the update code through the lexical analyzer to obtain a Token combination, wherein the Token combination comprises a plurality of tokens, each Token comprises a character combination and a corresponding character type, and the character combination comprises at least one character;
the syntax parsing unit is used for parsing the plurality of tokens through the syntax parser to obtain an abstract syntax tree, wherein the abstract syntax tree comprises at least one of a single-line statement or a control statement;
and the statement execution unit is used for executing the statements in the abstract syntax tree through the statement executor.
In another possible implementation manner, the analysis processing unit includes:
the analysis processing subunit is configured to perform analysis processing on the update code according to the sequence of the plurality of characters through the lexical analyzer to obtain a plurality of character combinations;
the generating subunit is used for generating the plurality of tokens according to the plurality of character combinations and the character type corresponding to each character combination;
and the combined processing subunit is used for performing combined processing on the plurality of tokens to obtain the Token combination.
In another possible implementation, the abstract syntax tree includes a plurality of nodes, each node including the single line statement or the control statement; the statement execution unit comprises:
a path determining subunit, configured to traverse each node in the abstract syntax tree through the statement executor, and determine a path corresponding to the call instruction, where the path includes at least one node;
and the statement execution subunit is used for executing the statement of each node in the path according to the path.
In another possible implementation manner, the update information obtaining module includes:
a first request sending unit, configured to send an update information acquisition request to a server;
and the information receiving unit is used for receiving the updating information returned by the server according to the updating information acquisition request.
In another possible implementation manner, the update information obtaining module includes:
a second request sending unit, configured to send an update information acquisition request to a server, so that the server processes the update information according to a target protocol to obtain update response data, and returns the update response data to the application;
the data receiving unit is used for receiving the updating response data returned by the server;
and the information extraction unit is used for extracting the updating information from the updating response data according to the target protocol.
In another aspect, a computer device is provided, which includes a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the operations performed in the application update method according to the above aspect.
In another aspect, a computer-readable storage medium is provided, in which at least one program code is stored, the at least one program code being loaded and executed by a processor to implement the operations performed in the application update method according to the above aspect.
In yet another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer program code, the computer program code being stored in a computer readable storage medium. The processor of the computer device reads the computer program code from the computer-readable storage medium, and executes the computer program code, so that the computer device implements the operations performed in the application update method as described in the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
according to the method, the device, the computer equipment and the storage medium, after the application acquires the updating information, when the calling instruction carrying the target function name is intercepted, the original code corresponding to the function name is not executed any more, but the target updating code corresponding to the target function name is directly executed, so that the online updating of the target function is realized, the equipment does not need to download and install the application program package of the application, and the application updating efficiency is improved. And moreover, the application is automatically updated online in the running process of the application, and the user does not feel in the online updating process, so that the influence of the application updating on the user is reduced. In addition, according to the automatic updating method provided by the embodiment of the application, when the application has the updating information, the automatic updating can be realized in the application running process, and the user does not need to actively trigger the application to update, so that the coverage rate of the application updating is effectively improved, the current version of the application is kept to be the latest version, the version number of the application needing to be maintained in the background is reduced, and the maintenance cost is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, 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 diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of an application update method provided in an embodiment of the present application;
fig. 3 is a flowchart of an application update method provided in an embodiment of the present application;
FIG. 4 is a flow chart of a dynamic engine to application update provided by an embodiment of the present application;
fig. 5 is a flowchart illustrating a message interceptor intercepting a call instruction according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a lexical analyzer processing update code according to an embodiment of the present application;
FIG. 7 is a flow diagram of a parser for generating an abstract syntax tree according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a sentence executor provided in an embodiment of the present application;
FIG. 9 is a schematic diagram of a code composition provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of a code provided by an embodiment of the present application;
FIG. 11 is a flowchart of an application update method provided in an embodiment of the present application;
fig. 12 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
As used herein, the terms "at least one," "a plurality," "each," and "any," at least one of which includes one, two, or more than two, and a plurality of which includes two or more than two, each of which refers to each of the corresponding plurality, and any of which refers to any of the plurality. For example, the plurality of character combinations includes 3 character combinations, each of the 3 character combinations refers to each of the 3 character combinations, and any one of the 3 character combinations refers to any one of the 3 character combinations, which may be a first character combination, a second character combination, or a third character combination.
The application updating method provided by the embodiment of the application can be used in computer equipment, and optionally, the computer equipment is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, web service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network), big data and artificial intelligence platform. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, or the like, but is not limited thereto. Optionally, the terminal and the server are directly or indirectly connected through wired or wireless communication, and the application is not limited herein.
Fig. 1 is a schematic structural diagram of an implementation environment provided in an embodiment of the present application, and as shown in fig. 1, the implementation environment includes a terminal 101 and a server 102, where an application 103 is installed in the terminal 101.
The terminal 101 provides an installation environment for the application 103, and the application 103 is installed in the terminal 101. The server 102 is a server corresponding to the application 103, and provides a service for the application 103. The server 102 stores update information of the application 103, provides the update information to the application 103 by interaction with the application 103, and updates the application 103 based on the update information.
The method provided by the embodiment of the application can be used in an application updating scene. When the application is started, the updating information of the application is obtained from the server, the calling instruction carrying the function name included in the updating information is intercepted, the original code corresponding to the function name is not executed any more, the updating code corresponding to the function name in the updating information is executed subsequently, the function corresponding to the function name is realized, and therefore the online updating effect on the application is achieved.
In the related art, under the condition that the application is not started, the application package of the application is downloaded and installed, then the application program is operated, and the codes in the application program are executed.
Fig. 2 is a flowchart of an application updating method provided in an embodiment of the present application, which is applied to a computer device, and as shown in fig. 2, the method includes:
201. the computer device obtains update information for the application.
The updating information comprises at least one function name and an updating code corresponding to each function name. The function name is the name of a function for realizing one function in the application, and the update code corresponding to the function name is the code for realizing the function corresponding to the function name and is different from the original code corresponding to the function name. That is, the function realized by executing the update code corresponding to the function name is different from the function realized by executing the original code corresponding to the function name.
202. And intercepting a calling instruction carrying a target function name by the computer equipment in the application running process.
The target function name is any function name in the update information.
203. And the computer equipment executes the target updating code corresponding to the target function name.
According to the method provided by the embodiment of the application, after the application acquires the updating information, when the calling instruction carrying the target function name is intercepted, the original code corresponding to the function name is not executed any more, but the target updating code corresponding to the target function name is directly executed, so that the online updating of the target function is realized, the application program package of the application is not required to be downloaded and installed by equipment, and the application updating efficiency is improved. And moreover, the application is automatically updated online in the running process of the application, and the user does not feel in the online updating process, so that the influence of the application updating on the user is reduced. In addition, according to the automatic updating method provided by the embodiment of the application, when the application has the updating information, the automatic updating can be realized in the application running process, and the user does not need to actively trigger the application to update, so that the coverage rate of the application updating is effectively improved, the current version of the application is kept to be the latest version, the version number of the application needing to be maintained in the background is reduced, and the maintenance cost is reduced.
Fig. 3 is a flowchart of an application updating method provided in an embodiment of the present application, where an interaction subject includes a terminal and a server, and as shown in fig. 3, the method includes:
301. the terminal sends an update information acquisition request to the server.
The update information acquisition request is used for acquiring the update information of the application.
In the embodiment of the application, the server stores the update information of the application, and the application sends an update information acquisition request to the server, so that the update information stored by the server is acquired, and the application can be updated subsequently according to the update information.
In one possible implementation, this step 301 includes: the terminal determines the current version information of the application and sends an update information acquisition request to the server, wherein the update information acquisition request carries the current version information of the application.
Optionally, the current version information includes a version identification of the application, an update time, and the like. The version identification is used for indicating the version of the application, and the version identifications corresponding to different versions of the application are different. For example, the version identification of the application is "2.0", or "3.0", etc. The update time is used for indicating the time when the update information of the corresponding version is uploaded to the server.
When the terminal sends an update information acquisition request to the server, the update information acquisition request carries the current version information of the application, so that the server can determine the update information corresponding to the application from the stored data subsequently according to the current version information of the application, namely the update information corresponding to the application of the latest version.
In one possible implementation, this step 301 includes: and when the application is started, sending an updating information acquisition request to the server. For example, when the user clicks an application icon in the terminal, the application is started, and an update information acquisition request is sent to the server.
In one possible implementation, this step 301 includes: when the application is started, popping up an update prompt interface, detecting the trigger operation of an update option in the update prompt interface, and sending an update information acquisition request to the server. And the updating option is used for triggering the sending of an updating information acquisition request to the server. For example, when the instant messaging application is started, an update prompt interface is popped up to prompt a user that the application has corresponding update information, and the terminal sends an update information acquisition request to the server when detecting that the user triggers an update option in the update prompt interface based on the update prompt interface.
302. And the server receives the update information acquisition request, processes the update information according to the target protocol to obtain update response data, and returns the update response data to the application.
The updating information comprises at least one function name and an updating code corresponding to each function name. The function name indicates a name of a function that implements one function in an application, and function names indicated by different function names are different, for example, the function name is a jump function, a color conversion function, or the like. When the application subsequently responds to the call instruction carrying the function name, the original code corresponding to the function name is not executed, and the update code corresponding to the function name is executed, so that the function after the function is updated can be realized, and the effect of updating the application is realized.
The target protocol refers to a protocol to which the application and the server need to communicate, and optionally, a format of data transmitted between the application and the server is defined in the target protocol.
In one possible implementation, the target protocol includes an interaction information template, the interaction information template includes a plurality of fields, and then the step 302 includes: and the server determines a target field corresponding to the updating information in the interactive information template, and adds the updating information to the target field to obtain the updating response data. Optionally, the plurality of fields further include an interface identification field, an address field, and the like.
Optionally, the interaction information template includes a function name field and a code field, the update information includes a plurality of function names and corresponding update codes, the server sequentially adds the plurality of function names to the function name field, sequentially adds the update codes corresponding to the plurality of function names to the code field, and an arrangement order of the plurality of function names in the function name field corresponds to an arrangement order of the plurality of update codes in the code field. For example, the update information includes a function name a and a corresponding update code 1, a function name B and a corresponding update code 2, a function name C and a corresponding update code 3, the arrangement order of the function names in the function name field is the function name a, the function name C and the function name B, and the arrangement order of the update codes in the code field is the update code 1, the update code 3 and the update code 2.
In a possible implementation manner, the server stores a corresponding relationship between version information and update information, and the update information acquisition request carries current version information of the application, then step 302 includes: the server inquires the corresponding relation according to the current version information of the application, determines the target version information after the current version information, and takes the updating information corresponding to the target version information as the updating information corresponding to the application.
Optionally, the version information includes a first update time corresponding to the version, and after receiving the update information acquisition request, the server determines, according to the first update time in the version information carried in the update information acquisition request and the update time corresponding to the stored version information, the version information corresponding to the update time after the first update time, and determines the update information corresponding to the version information as the update information corresponding to the application.
For example, the first update time is 9 months and 10 days, and the update time of the first version information stored in the server is 10 months and 5 days, that is, it is determined that the first version information is updated after the current version information of the application, and therefore, the update information corresponding to the first version information is determined as the update information corresponding to the application.
In addition, the update information stored in the server is uploaded to the server by another terminal. In one possible implementation, the other terminal uploads the update information to the server, and the server stores the update information. Optionally, the update information is stored in the server in the form of a character string.
Optionally, the other terminals process the update information according to the interface protocol to obtain update upload data, upload the update upload data to the server, extract the update information from the update upload data by the server according to the interface protocol, and store the update information. The interface protocol refers to a protocol to be followed for communication between other terminals and the server.
For example, a developer writes a code through an OC (Objective-C), converts the written code through a format conversion tool to obtain update information in a character string form, processes the update information in the character string form through other terminals according to an interface protocol to obtain update upload data, extracts the update information in the character string form from the update upload data according to the interface protocol after receiving the update upload data, and stores the update information in the character string form.
303. And the terminal receives the updating response data returned by the server and extracts the updating information from the updating response data according to the target protocol.
Since the update response data is generated by the server according to the target protocol, the application can extract the update information from the update response data according to the target protocol.
In a possible implementation manner, the update response data is composed of a plurality of fields, and the plurality of fields includes a target field corresponding to the update information, then the step 303 includes: and according to the target protocol, determining a target field corresponding to the updating information in the updating response data, and extracting the updating information from the target field. Wherein the target field is any one of a plurality of fields.
Optionally, the update response data includes a function name field and a code field, and the terminal determines the function name field and the code field in the update response data according to the target protocol, sequentially extracts the plurality of function names according to the arrangement sequence of the plurality of function names in the function name field, sequentially extracts the plurality of update codes according to the arrangement sequence of the plurality of update codes in the code field, and generates the update information according to the extracted plurality of function names and the plurality of update codes. And according to the extraction sequence, the function names correspond to the update codes one by one.
In one possible implementation, the update information is in the form of a list, and the update information is shown in table 1.
TABLE 1
Function name Update generationCode
Function name A Updating code 1
Function name B Update code 2
Function name C Update code 3
It should be noted that, in the embodiment of the present application, the application and the server are described as an example of interaction according to a target protocol, but in another embodiment, step 301 and step 303 need not be executed, the application directly sends an update information acquisition request to the server, the server receives the update information acquisition request sent by the application, returns the update information to the application, and the application receives the update information returned by the server according to the update information acquisition request.
It should be noted that, in the embodiment of the present application, an example of interaction between an application and a server is described, through interaction between the application and the server, the application acquires update information returned by the server, and in another embodiment, the application acquires update information of the application in another manner.
304. And in the application running process, the terminal intercepts a calling instruction carrying the name of the target function through the message interceptor.
In the embodiment of the application, the application includes a dynamic engine, the dynamic engine includes a message interceptor, a lexical analyzer, a syntax parser, and a statement executor, the message interceptor is configured to intercept a call instruction carrying a name of a target function, the lexical analyzer is configured to analyze an update code, the syntax parser is configured to generate an abstract syntax tree, and the statement executor is configured to execute a statement in the abstract syntax tree. After the application acquires the updating information, a message interceptor in the application intercepts a calling instruction carrying the function name included in the updating information, and after the calling instruction is intercepted, a lexical analyzer, a syntax parser and a statement executor sequentially process corresponding updating codes, namely, the updating codes corresponding to the function name are executed to respond to the calling instruction, so that the application is updated. The process of updating the application is realized through a dynamic engine, as shown in fig. 4, a message interceptor intercepts a call instruction of a target function name, directs a pointer to an update code, analyzes and processes the update code by a lexical analyzer to obtain a Token combination, then performs syntax analysis on the Token combination by a syntax analyzer to obtain an abstract syntax tree, and executes a statement in the abstract syntax tree by a syntax executor to obtain a statement execution result.
In the embodiment of the application, the application comprises at least one function name and a corresponding code, and after the application monitors a call instruction carrying any function name, the code corresponding to the function name is executed, so that the call instruction is responded, and a corresponding function is realized. For example, a call instruction carrying a page jump function name is monitored, and a code corresponding to the page jump function name is executed, so that a page jump function can be realized. After the application acquires the updating information, the calling instruction carrying the target function name is intercepted, so that the application does not execute the original code corresponding to the target function name according to the calling instruction any more, and subsequently executes the target updating code corresponding to the target function name, thereby realizing the corresponding function of the updating code, realizing the function replacement and realizing the effect of updating the application.
The target function name is any function name in the update information.
In the application running process, the triggering operation of the application is detected, and a calling instruction carrying a function name is obtained, so that a code corresponding to the function name can be executed subsequently, and the triggering operation is responded. Because the update information comprises at least one function name, after the application acquires the update information, the message interceptor intercepts the calling instruction carrying the target function name, so that the application does not execute the original code corresponding to the target function name according to the calling instruction any more, and can subsequently execute the corresponding update code, thereby realizing the online update effect of the application.
In one possible implementation, the step 304 includes the following steps 3041 and 3042:
3041. in the application running process, a calling instruction carrying the name of the target function is monitored through the message interceptor, and a function pointer corresponding to the name of the target function points to a message forwarding function pointer.
The function pointer is used for indicating a code corresponding to the function name, and the application can determine the code corresponding to the function name through the function pointer corresponding to the function name. The message forwarding function pointer is used for pointing the calling instruction of the target function name to the interface interception function, and subsequently, the calling instruction can be intercepted.
In the embodiment of the application, when the application monitors a call instruction carrying any function name, a code corresponding to the function name can be determined through a function pointer corresponding to the function name, so that the code corresponding to the function name can be executed, and a function corresponding to the function name is realized. Therefore, after the application acquires the update information, when the message interceptor monitors a call instruction carrying the name of the target function, the function pointer corresponding to the name of the target function points to the message forwarding function pointer, so that the application can not execute the original code corresponding to the name of the target function any more, and can subsequently execute the target update code corresponding to the name of the target function, thereby realizing the update of the application.
Optionally, the message forwarding function pointer is a pointer executed by the application in Runtime (Runtime environment) and is used for forwarding the intercepted call instruction. The runtime environment refers to an environment in which the application runs. The method can change the codes of the function functions of the application in the runtime environment, thereby realizing the online update of the application. For example, the message forwarding function pointer is _ objc _ msgForward applied in Runtime.
3042. And operating an interface interception function corresponding to the message forwarding function pointer, and intercepting the calling instruction.
The interface interception function is used for intercepting the monitored calling instruction carrying the name of the target function. For example, the interface interception function is forwardlnvocation (forward call function).
In one possible implementation, this step 3042 includes: and in response to the fact that the Class to which the target function name belongs comprises an interface interception function, operating the interface interception function in the Class, and intercepting the calling instruction.
In one possible implementation, this step 3042 includes: and responding to the fact that the Class to which the target function name belongs does not comprise an interface interception function, operating the Class method adding function, adding the interface interception function in the Class, operating the interface interception function in the Class, and intercepting the call instruction.
In one possible implementation, after step 3042, the method further includes: and directing a function pointer of the interface interception function to a callback function in the message interceptor, running the callback function, and inquiring a target update code corresponding to the name of the target function in the update information.
And the callback function is used for inquiring the monitored target update code corresponding to the target function name from the update information. For example, the callback function is a Handler (callback) function in an Interceptor (message Interceptor). Intercepting a call instruction carrying a name of a target function by a message interceptor, and inquiring a process of an update code corresponding to the target function, as shown in fig. 5, the message interceptor directs a function pointer of the call instruction carrying the name of the target function to a forwarding function pointer in a runtime environment, adds a function by a run Class method in the runtime environment, adds an interface interception function in a Class (Class) where the current target function is located, directs the function pointer of the interface interception function to a callback function in the message interceptor, and inquires the target update code corresponding to the name of the target function from update information by the callback function.
Optionally, referring to table 1 above, the update exists in the form of a list, and after the callback function is executed by the application, the target update code corresponding to the target function name is queried from the list. It should be noted that, in the embodiment of the present application, a message interceptor is taken as an example, and the message interceptor intercepts a call instruction carrying a target function name for description, while in another embodiment, in an application running process, an application does not need to intercept the call instruction via the message interceptor, and the application directly intercepts the call instruction carrying the target function name via a dynamic engine in the application, or intercepts the call instruction carrying the target function name in other manners.
305. And the terminal analyzes and processes the update code through a lexical analyzer to obtain a Token combination.
Wherein, Token combination includes a plurality of Token, and each Token includes character combination and corresponding character type, and character combination includes at least one character. The character type is a type corresponding to a character combination, and optionally, the character type includes at least one of a number type, a character string type, a word type, a symbol type, or a space type. For example, the word type includes an identifier and a keyword, the identifier being generated by a combination of a number, a letter, and an underline. Symbol types include arithmetic symbols and logical operation symbols such as "+", "-", "not", "and", etc. The space type includes a line break character in addition to a space character.
The application groups the characters in the updated code through a lexical analyzer to obtain a plurality of character combinations, determines the character type corresponding to each character combination, and generates a Token, thereby obtaining a Token combination composed of a plurality of tokens.
In one possible implementation, the step 305 includes the following steps 3051-3052:
3051. and analyzing the updated code according to the sequence of the characters by a lexical analyzer to obtain a plurality of character combinations.
The updating code comprises a plurality of characters, and the updating code is analyzed and processed in sequence according to the sequence of the characters to obtain a plurality of character combinations. For example, the character combination is "0", "9", "HelloWorld", "()" or the like.
Optionally, the word segmentation processing is performed on the update code according to the sequence of the plurality of characters through a lexical analyzer, so as to obtain a plurality of character combinations.
3052. And generating a plurality of tokens according to the plurality of character combinations and the character type corresponding to each character combination.
After the lexical analyzer obtains the character combination, the character type corresponding to the character combination is determined, and the character combination and the corresponding character type are combined to generate the corresponding Token.
In a possible implementation manner, according to the generation sequence of the character combinations, the character type corresponding to each character combination is sequentially determined, and a plurality of tokens are generated.
3053. And combining the plurality of tokens to obtain Token combinations.
And generating a Token combination according to the sequence of the corresponding character combination in the updating code by the obtained multiple tokens.
As shown in fig. 6, reading the characters in the update code according to the sequence of the plurality of characters by the lexical analyzer, after obtaining a character combination, determining the character type corresponding to the character combination, generating a Token corresponding to the character combination, storing the generated Token into a Token list (Token array), and continuing to read the remaining characters in the update code, repeating the above process, thereby storing the generated plurality of tokens into the Token array, if it is determined that the update code has been completely read while continuing to read the remaining characters in the update code, the lexical analyzer ends the process, and the obtained Token list is the Token combination, and then provides the obtained Token combination to the parser, and then the parser parses the Token combination by the parser.
306. And the terminal carries out syntactic analysis on the plurality of tokens through a syntactic analyzer to obtain an abstract syntactic tree.
Wherein the abstract syntax tree includes at least one of a single line of statements or control statements. Optionally, the single line statement comprises at least one character combination. Optionally, the control statement comprises at least one character combination.
Because each Token comprises a character combination and a corresponding character type, an association relation is established on the grammar of the plurality of tokens according to the character combination and the corresponding character type in the plurality of tokens through a grammar resolver to obtain the abstract grammar tree.
In one possible implementation, this step 306 includes: establishing association relations between any number of character combinations according to the character types corresponding to the character combinations in the Tokens by a grammar parser according to the sequence of the Tokens to obtain a plurality of sentences, and establishing the association relations between the sentences to obtain the abstract grammar tree.
In one possible implementation, the abstract syntax tree includes a plurality of nodes, each node corresponding to a statement, which is a single line statement or control statement.
In one possible implementation, the LineNode (single line statement) includes a MethodNode (method call), an AssignNode (declaration assignment), a BlockNode (block call), or a Return Node (return value). Optionally, the assignonnode comprises an assignLeftNode (left value) or an assignRightNode (right value). Optionally, the AssignRightNode comprises a ValueNode (expression evaluation), a MethodNode (method call), or a blockanode (block call).
In one possible implementation, a control node (control statement) includes IfElseNode (conditional judgment node), ForNode (traversal node), and whisenode (conditional loop node), i.e., the corresponding statements include If-Else statement, For-In statement, While statement, and Do-While statement. Optionally, each control statement includes at least one of a LineNode (single line statement), a ValueNode (expression evaluation), a break node, and a continue node.
As shown in fig. 7, after the Token combination is parsed by the parser, the root node of the generated abstract syntax tree is the update code, that is, the abstract syntax tree is composed of characters in the update code. The abstract syntax tree comprises a single-line statement or a control statement, the single-line statement and the control statement comprise various statements, for example, the single-line statement comprises a method calling statement, a statement assignment statement, a block calling statement and a return value statement, the statement assignment statement comprises a left value statement and a right value statement, and the right value statement comprises an expression evaluation statement, a method calling statement and a block calling statement; the control statement comprises a condition judgment node statement, a traversal node statement and a condition cycle node statement, and the condition judgment node statement, the traversal node statement and the condition cycle node statement can comprise a single-line statement, an expression evaluation statement, an interruption node statement, a jump-out cycle node statement and the like.
307. And the terminal executes the sentences in the abstract syntax tree through the sentence executor.
And executing the statements in the abstract syntax tree by the statement executor according to the generated abstract syntax tree to realize the function corresponding to the target function name, thereby realizing the response to the calling instruction.
In one possible implementation, the abstract syntax tree includes a plurality of nodes, each node including a single line of statements or control statements, step 307 includes: and traversing each node in the abstract syntax tree through a statement executor, determining a path corresponding to the calling instruction, and executing the statement of each node in the path according to the path.
Wherein the path comprises at least one node.
In an embodiment of the application, the abstract syntax tree includes a plurality of paths, and different paths include at least one different node. And determining a path corresponding to the call instruction by traversing each node in the abstract syntax tree, thereby determining a plurality of statements in the path, and sequentially executing the plurality of statements in the path by the statement executor to respond to the call instruction.
Optionally, the statement executor includes a plurality of statement execution components, different statement execution components are used for executing statements of different types, and the statement executor executes the statement of each node in the path, including: determining the type of the statement of the current node according to the sequence of the plurality of nodes in the path, calling a statement execution component matched with the type, and executing the statement of the current node.
As shown in fig. 8, the sentence executor contains 3 components: value invoker, methodlnvoker, and blockacaller, where ValueInvoker is based on nsepression (expression system) and nsprediute (predicate system) to execute ValueNode, methodlnvoker executes fixed-parameter MethodNode based on NSInvocation, executable-variable-parameter MethodNode dnbased on obj _ msgSend, blockacaller implements definition of block based on Libffi (a database) library, and blockanode callback based on NSInvocation. And after the abstract syntax tree is obtained, traversing statements corresponding to each node in the abstract syntax tree, determining the type of the statements in each node, and executing the statements with the matched types through different types of components in the syntax executor.
It should be noted that, in the embodiment of the present application, the dynamic engine includes a lexical analyzer, a syntax parser, and a statement executor as an example, and the update code is executed through the lexical analyzer, the syntax parser, and the statement executor, but in another embodiment, the step 305 and the step 307 do not need to be executed, and the application directly executes the target update code corresponding to the target function name through the dynamic engine; alternatively, the application can execute the target update code corresponding to the target function name in other ways.
In the embodiment of the present application, the update code in the form of a character string is composed of a plurality of sentences, which include a single line sentence or a control sentence as shown in fig. 9. The single line statement includes a declarative assignment, a method call, an arithmetic operation, or a logical operation. The control statement includes a branch statement or a loop statement, and the branch statement and the loop statement include a single-line statement, i.e., the single-line statement is the most basic execution unit. As shown in fig. 9, a function of executing a statement included in the update code already exists in the iOS system. Based on an expression system, arithmetic operation statements can be executed; based on the predicate system, the logical operation statement can be executed; based on a message forwarding mechanism, method calling statements can be executed; based on custom symbol parsing, declarative assignment statements can be executed, storing variable values in context parameters. Therefore, the dynamic engine provided by the embodiment of the application can realize online updating of the application in the iOS system.
The size of the installation package of the dynamic engine provided by the embodiment of the application is only 446KB, and the size of the JSPatch (a dynamic update framework) installation package in the related art is 733KB, that is, the dynamic engine provided by the embodiment of the application is lighter than the JSPatch in the prior art. Moreover, the method call is used as a test case, the execution time of the dynamic engine and the JSPatch is compared, and the implementation code is shown in FIG. 10. And the execution time of the dynamic engine and the JPatch is obtained by executing the method call 10000 times. According to the method provided by the embodiment of the application, a call instruction carrying a target function name is intercepted through a message interceptor, a lexical analyzer, a grammar parser and a statement executor which are included in a dynamic engine, and a target updating code corresponding to the target function name is executed, the time required by the process is 494 milliseconds, the updating code in the application is executed through a JSCore interface and an OC interface in JSPtc in the related technology, the application is updated, the time required by the process is 1085 milliseconds, and the execution speed of the application updating through the dynamic engine is higher.
According to the method provided by the embodiment of the application, after the application acquires the updating information, when the calling instruction carrying the target function name is intercepted, the original code corresponding to the function name is not executed any more, but the target updating code corresponding to the target function name is directly executed, so that the online updating of the target function is realized, the application program package of the application is not required to be downloaded and installed by equipment, and the application updating efficiency is improved. And moreover, the application is automatically updated online in the running process of the application, and the user does not feel in the online updating process, so that the influence of the application updating on the user is reduced. In addition, according to the automatic updating method provided by the embodiment of the application, when the application has the updating information, the automatic updating can be realized in the application running process, and the user does not need to actively trigger the application to update, so that the coverage rate of the application updating is effectively improved, the current version of the application is kept to be the latest version, the version number of the application needing to be maintained in the background is reduced, and the maintenance cost is reduced.
And the calling instruction carrying the function name included in the updating information is monitored by the message interceptor in the application, so that the omission of the calling instruction of the function name to be updated is avoided, and the updating code corresponding to the function name is processed by the lexical analyzer, the statement resolver and the statement executor, so that the application can accurately execute the updating code corresponding to the function name, and the accuracy of updating the application is ensured.
As shown in fig. 11, is a flowchart of an application updating method according to an embodiment of the present application, and as shown in fig. 11, the method includes:
1. a developer obtains OC source codes by using OC compiling codes through a development terminal, converts the compiled OC source codes into a character string form by using a tool to obtain character string codes, and uploads the character string codes to a server according to an interface data protocol between the development terminal and the server.
Among them, the development terminal is a PC (Personal Computer) terminal or a mobile terminal. Optionally, the mobile terminal is a mobile phone, a tablet computer, or the like.
2. And after receiving the character string codes uploaded by the development terminal, the server takes the character string codes as the application update information and stores the update information.
3. And when the application is started, sending an information acquisition request to the server.
4. The server receives the information acquisition request, inquires the update information of the application, and sends an information acquisition response to the application, wherein the information acquisition response carries the update information.
5. After the application receives the update information acquisition response, the dynamic engine intercepts a calling instruction carrying the name of the target function according to the update information and executes an update code in the update information.
And intercepting a calling instruction carrying the name of the target function by the dynamic engine in a monitoring interception mode, so that the application does not execute the original code corresponding to the name of the target function according to the calling instruction any more, and subsequently executes the updating code corresponding to the target name, thereby realizing the corresponding function of the updating code and realizing the function replacement.
Fig. 12 is a schematic structural diagram of an application update apparatus according to an embodiment of the present application, and as shown in fig. 13, the apparatus includes:
an update information obtaining module 1201, configured to obtain update information of an application, where the update information includes at least one function name and an update code corresponding to each function name;
the instruction intercepting module 1202 is configured to intercept a call instruction carrying a name of a target function in an application running process, where the name of the target function is any function name in the update information;
the code executing module 1203 is configured to execute the target update code corresponding to the target function name.
According to the method provided by the embodiment of the application, after the application acquires the updating information, when the calling instruction carrying the target function name is intercepted, the original code corresponding to the function name is not executed any more, but the target updating code corresponding to the target function name is directly executed, so that the online updating of the target function is realized, the application program package of the application is not required to be downloaded and installed by equipment, and the application updating efficiency is improved. And moreover, the application is automatically updated online in the running process of the application, and the user does not feel in the online updating process, so that the influence of the application updating on the user is reduced. In addition, according to the automatic updating method provided by the embodiment of the application, when the application has the updating information, the automatic updating can be realized in the application running process, and the user does not need to actively trigger the application to update, so that the coverage rate of the application updating is effectively improved, the current version of the application is kept to be the latest version, the version number of the application needing to be maintained in the background is reduced, and the maintenance cost is reduced.
In a possible implementation manner, the instruction intercepting module 1202 is configured to intercept, in an application running process, a call instruction carrying a name of a target function through a dynamic engine in the application;
the code executing module 1203 is configured to execute, by the dynamic engine, the target update code corresponding to the target function name.
In another possible implementation, the dynamic engine includes a message interceptor; as shown in fig. 13, the instruction interception module 1202 includes:
and the instruction intercepting unit 1221 is configured to intercept, by using a message interceptor, a call instruction carrying a name of the target function in an application running process.
In another possible implementation manner, as shown in fig. 13, the instruction intercepting unit 1221 includes:
the pointer directing subunit 12211 is configured to monitor, by using the message interceptor, a call instruction in an application running process, and direct a function pointer corresponding to the target function name to a message forwarding function pointer;
and the instruction intercepting subunit 12212 is configured to run an interface intercepting function corresponding to the message forwarding function pointer, and intercept the call instruction.
In another possible implementation manner, as shown in fig. 13, the apparatus further includes:
a function pointer directing module 1204, configured to direct a function pointer of the interface interception function to a callback function in the message interceptor;
the code query module 1205 is configured to run the callback function, and query the target update code corresponding to the target function name in the update information.
In another possible implementation manner, the update code comprises a plurality of characters, and the dynamic engine comprises a lexical analyzer, a syntactic parser and a statement executor;
as shown in fig. 13, the code execution module 1203 includes:
the analysis processing unit 1231 is configured to perform analysis processing on the update code through a lexical analyzer to obtain a Token combination, where the Token combination includes multiple tokens, each Token includes a character combination and a corresponding character type, and the character combination includes at least one character;
a syntax parsing unit 1232, configured to perform syntax parsing on the tokens through a syntax parser to obtain an abstract syntax tree, where the abstract syntax tree includes at least one of a single-line statement or a control statement;
and a statement executing unit 1233, configured to execute the statement in the abstract syntax tree through the statement executor.
In another possible implementation, as shown in fig. 13, the analysis processing unit 1231 includes:
an analysis processing subunit 12311, configured to perform analysis processing on the update code according to the order of the multiple characters through the lexical analyzer, so as to obtain multiple character combinations;
a generating subunit 12312, configured to generate multiple tokens according to the multiple character combinations and the character type corresponding to each character combination;
a combining subunit 12313, configured to perform combining processing on the multiple tokens to obtain Token combinations.
In another possible implementation, the abstract syntax tree includes a plurality of nodes, each node including a single line of statements or control statements; as shown in fig. 13, the statement execution unit 1233 includes:
a path determining subunit 12331, configured to traverse each node in the abstract syntax tree through the statement executor, and determine a path corresponding to the call instruction, where the path includes at least one node;
a statement execution subunit 12332, configured to execute the statement for each node in the path according to the path.
In another possible implementation manner, as shown in fig. 13, the update information obtaining module 1201 includes:
a first request transmitting unit 1211 for transmitting an update information acquisition request to the server;
and an information receiving unit 1212, configured to receive the update information returned by the server according to the update information obtaining request.
In another possible implementation manner, as shown in fig. 13, the update information obtaining module 1201 includes:
a second request sending unit 1213, configured to send an update information acquisition request to the server, so that the server processes the update information according to the target protocol to obtain update response data, and returns the update response data to the application;
a data receiving unit 1214, configured to receive update response data returned by the server;
an information extraction unit 1215 for extracting the update information from the update response data in accordance with the target protocol.
Fig. 14 is a schematic structural diagram of a terminal according to an embodiment of the present application, which can implement operations performed by the terminal in the foregoing embodiments. Terminal 1400 can also be referred to as user equipment, a portable terminal, a laptop terminal, a desktop terminal, or other names.
In general, terminal 1400 includes: a processor 1401, and a memory 1402.
Processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. Memory 1402 may include one or more computer-readable storage media, which may be non-transitory, for storing at least one instruction for processor 1401 to have to implement an application update method provided by method embodiments herein.
In some embodiments, terminal 1400 may further optionally include: a peripheral device interface 1403 and at least one peripheral device. The processor 1401, the memory 1402, and the peripheral device interface 1403 may be connected by buses or signal lines. Each peripheral device may be connected to the peripheral device interface 1403 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1404, display 1405 and audio circuitry 1406.
The Radio Frequency circuit 1404 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 1404 communicates with a communication network and other communication devices by electromagnetic signals.
The display screen 1405 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. The display 1405 may be a touch display and may also be used to provide virtual buttons and/or a virtual keyboard.
The audio circuitry 1406 may include a microphone and a speaker. The microphone is used for collecting audio signals of a user and the environment, converting the audio signals into electric signals, and inputting the electric signals to the processor 1401 for processing or inputting the electric signals to the radio frequency circuit 1404 to realize voice communication. For stereo capture or noise reduction purposes, multiple microphones may be provided, each at a different location of terminal 1400. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is then used to convert the electrical signals from the processor 1401 or the radio frequency circuit 1404 into audio signals.
Those skilled in the art will appreciate that the configuration shown in fig. 14 is not intended to be limiting with respect to terminal 1400 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be employed.
Fig. 15 is a schematic structural diagram of a server 1500 according to an embodiment of the present application, where the server 1500 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1501 and one or more memories 1502, where at least one program code is stored in the memory 1502, and the at least one program code is loaded and executed by the processors 1501 to implement the methods provided by the foregoing method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The server 1500 may be used to perform the steps performed by the server in the application update method described above.
The embodiment of the present application further provides a computer device, where the computer device includes a processor and a memory, and the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the application updating method of the foregoing embodiment.
The embodiment of the present application further provides a computer-readable storage medium, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the operations performed in the application updating method of the foregoing embodiment.
Embodiments of the present application also provide a computer program product or a computer program comprising computer program code stored in a computer readable storage medium. The processor of the computer apparatus reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer apparatus implements the operations performed in the application update method as in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only an alternative embodiment of the present application and should not be construed as limiting the present application, and any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (15)

1. An application update method, the method comprising:
acquiring update information of an application, wherein the update information comprises at least one function name and an update code corresponding to each function name;
intercepting a calling instruction carrying a target function name in the application running process, wherein the target function name is any function name in the updating information;
and executing the target updating code corresponding to the target function name.
2. The method according to claim 1, wherein intercepting a call instruction carrying a target function name during the running of the application comprises:
intercepting a calling instruction carrying a target function name by a dynamic engine in the application in the running process of the application;
the executing the target update code corresponding to the target function name includes:
and executing the target updating code corresponding to the target function name through the dynamic engine.
3. The method of claim 2, wherein the dynamic engine comprises a message interceptor; in the running process of the application, intercepting a call instruction carrying a target function name through a dynamic engine in the application, wherein the intercepting comprises the following steps:
and intercepting a calling instruction carrying a target function name by the message interceptor in the running process of the application.
4. The method according to claim 3, wherein intercepting, by the message interceptor during the running of the application, a call instruction carrying a name of a target function comprises:
in the application running process, monitoring the calling instruction through the message interceptor, and pointing a function pointer corresponding to the target function name to a message forwarding function pointer;
and operating an interface interception function corresponding to the message forwarding function pointer, and intercepting the call instruction.
5. The method according to claim 4, wherein after the interface interception function corresponding to the message forwarding function pointer is run and the call instruction is intercepted, and before the target update code corresponding to the target function name is executed, the method further comprises:
pointing a function pointer of the interface interception function to a callback function in the message interceptor;
and running the callback function, and inquiring the target update code corresponding to the target function name in the update information.
6. The method of claim 2, wherein the update code comprises a plurality of characters, and wherein the dynamic engine comprises a lexical analyzer, a parser, and a statement executor;
the executing, by the dynamic engine, the target update code corresponding to the target function name includes:
analyzing and processing the update code through the lexical analyzer to obtain a Token combination, wherein the Token combination comprises a plurality of tokens, each Token comprises a character combination and a corresponding character type, and the character combination comprises at least one character;
parsing the plurality of tokens through the syntax parser to obtain an abstract syntax tree, wherein the abstract syntax tree comprises at least one of a single-line statement or a control statement;
executing the statement in the abstract syntax tree through the statement executor.
7. The method of claim 6, wherein the analyzing the updated code by the lexical analyzer to obtain a Token combination comprises:
analyzing the updated code according to the sequence of the characters through the lexical analyzer to obtain a plurality of character combinations;
generating the plurality of tokens according to the plurality of character combinations and the character type corresponding to each character combination;
and combining the plurality of tokens to obtain the Token combination.
8. The method of claim 6, wherein the abstract syntax tree comprises a plurality of nodes, each node comprising the single line of statements or the control statements; executing, by the statement executor, the statement in the abstract syntax tree, including:
traversing each node in the abstract syntax tree through the statement executor, and determining a path corresponding to the call instruction, wherein the path comprises at least one node;
and executing the statement of each node in the path according to the path.
9. The method of claim 1, wherein the obtaining update information of the application comprises:
sending an update information acquisition request to a server;
and receiving the updating information returned by the server according to the updating information acquisition request.
10. The method of claim 1, wherein the obtaining update information of the application comprises:
sending an update information acquisition request to a server so that the server processes the update information according to a target protocol to obtain update response data, and returning the update response data to the application;
receiving the updating response data returned by the server;
and extracting the updating information from the updating response data according to the target protocol.
11. An application update apparatus, the apparatus comprising:
the updating information acquiring module is used for acquiring updating information of the application, wherein the updating information comprises at least one function name and an updating code corresponding to each function name;
the instruction intercepting module is used for intercepting a calling instruction carrying a target function name in the application running process, wherein the target function name is any function name in the updating information;
and the code execution module is used for executing the target updating code corresponding to the target function name.
12. The apparatus according to claim 11, wherein the instruction intercepting module is configured to intercept, by a dynamic engine in the application, a call instruction carrying a name of a target function during the running of the application;
and the code execution module is used for executing the target updating code corresponding to the target function name through the dynamic engine.
13. The apparatus of claim 12, wherein the update code comprises a plurality of characters, and wherein the dynamic engine comprises a lexical analyzer, a parser, and a sentence executor;
the code execution module includes:
the analysis processing unit is used for analyzing and processing the update code through the lexical analyzer to obtain a Token combination, wherein the Token combination comprises a plurality of tokens, each Token comprises a character combination and a corresponding character type, and the character combination comprises at least one character;
the syntax parsing unit is used for parsing the plurality of tokens through the syntax parser to obtain an abstract syntax tree, wherein the abstract syntax tree comprises at least one of a single-line statement or a control statement;
and the statement execution unit is used for executing the statements in the abstract syntax tree through the statement executor.
14. A computer device comprising a processor and a memory, the memory having stored therein at least one program code, the at least one program code being loaded and executed by the processor to perform operations carried out in the application update method of any of claims 1 to 10.
15. A computer-readable storage medium having at least one program code stored therein, the at least one program code being loaded and executed by a processor to perform the operations performed in the application update method of any of claims 1 to 10.
CN202010925471.9A 2020-09-03 2020-09-03 Application updating method and device, computer equipment and storage medium Pending CN114138294A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010925471.9A CN114138294A (en) 2020-09-03 2020-09-03 Application updating method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010925471.9A CN114138294A (en) 2020-09-03 2020-09-03 Application updating method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114138294A true CN114138294A (en) 2022-03-04

Family

ID=80438403

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010925471.9A Pending CN114138294A (en) 2020-09-03 2020-09-03 Application updating method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114138294A (en)

Similar Documents

Publication Publication Date Title
EP3876116A1 (en) Method and apparatus for running mini program, electronic device, and storage medium
CN110324169B (en) Interface management method and device
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN111831538B (en) Debugging method, device and storage medium
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN110858172A (en) Automatic test code generation method and device
CN111913741B (en) Object interception method, device, medium and electronic equipment
CN103294598A (en) Method and device for source code inspection
CN112732572A (en) Service testing method, device and system, storage medium and electronic device
US11934287B2 (en) Method, electronic device and computer program product for processing data
CN111338623A (en) Method, device, medium and electronic equipment for developing user interface
CN111880801A (en) Application program dynamic method and device and electronic equipment
CN111399840A (en) Module development method and device
CN113010827A (en) Page rendering method and device, electronic equipment and storage medium
CN114398673A (en) Application compliance detection method and device, storage medium and electronic equipment
CN108304164B (en) Business logic development method and development system
CN110727429A (en) Front-end page generation method, device and equipment
CN110362317B (en) Code conversion method, device and storage medium
CN115145574A (en) Code generation method and device, storage medium and server
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN114217789A (en) Function component expansion method, device, equipment, storage medium and program product
CN112988175A (en) Cross-platform application installation package generation method, device, medium and electronic equipment
CN111488286B (en) Method and device for independently developing Android modules
CN114115884A (en) Management method and related device for programming service
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium

Legal Events

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