CN114461247A - Hot update method, device, electronic equipment and computer readable medium - Google Patents

Hot update method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN114461247A
CN114461247A CN202210116540.0A CN202210116540A CN114461247A CN 114461247 A CN114461247 A CN 114461247A CN 202210116540 A CN202210116540 A CN 202210116540A CN 114461247 A CN114461247 A CN 114461247A
Authority
CN
China
Prior art keywords
hot
code
hot update
target program
text
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
CN202210116540.0A
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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202210116540.0A priority Critical patent/CN114461247A/en
Publication of CN114461247A publication Critical patent/CN114461247A/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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security

Abstract

Embodiments of the present disclosure disclose a hot update method, apparatus, electronic device, and computer readable medium. One embodiment of the method comprises: according to the hot update codes included in the hot update information corresponding to the target program, carrying out mounting processing on the application program instance corresponding to the target program; responding to the successful mounting, and determining whether the target program meets a hot updating condition; and responding to the condition that the hot update is met, and carrying out hot update on the target program according to the hot update code. The embodiment improves the updating efficiency of the application program.

Description

Hot update method, device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a hot update method, apparatus, electronic device, and computer-readable medium.
Background
The application program updating refers to a technology for releasing new application functions and/or repairing bugs existing in the program in an updating mode. At present, when an application program is updated, the following methods are generally adopted: firstly, packaging the application program, and then issuing the packaged application program.
However, when the application program is updated in the above manner, the following technical problems often occur:
when the application program has a bug, the application program of the version with the bug fix completed can only be repackaged, so that the updating efficiency of the application program is low.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a hot update method, apparatus, electronic device and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method of thermal update, the method comprising: according to the hot update codes included in the hot update information corresponding to the target program, carrying out mounting processing on the application program instance corresponding to the target program; responding to the successful mounting, and determining whether the target program meets a hot updating condition; and responding to the condition that the hot update is met, and carrying out hot update on the target program according to the hot update code.
Optionally, before the mount processing is performed on the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program, the method further includes: and sending a hot update request to a target server in response to the starting of the target program, wherein the hot update request is used for requesting hot update information corresponding to the target program from the target server.
Optionally, the performing, according to the hot update code included in the hot update information corresponding to the target program, mount the application instance corresponding to the target program includes: and performing code preprocessing on the hot updating code to generate a hot updating code text.
Optionally, the performing, according to the hot update code included in the hot update information corresponding to the target program, mount processing on the application instance corresponding to the target program further includes: and mounting the hot updating code text to the application program example.
Optionally, the performing a hot update on the target program according to the hot update code includes: performing text conversion on the hot update code text to generate at least one text keyword; and performing text analysis on the text keywords in the at least one text keyword to generate an abstract syntax tree.
Optionally, the abstract syntax tree comprises at least one tree node; and the hot updating is carried out on the target program according to the hot updating code, and the method also comprises the following steps: and for each tree node in each tree node included in the abstract syntax tree, executing hot updating operation corresponding to the node type according to the node type corresponding to the tree node.
Optionally, the hot update information further includes: code version information; and the mounting of the hot update code text to the application program instance includes: and mounting the hot updating code text and the code version information to the application program example.
Optionally, the text converting the hot update code text to generate at least one text keyword includes: and performing keyword recognition on the hot update code text, and taking the recognized keywords as text keywords to generate the at least one text keyword.
Optionally, the executing, according to the node type corresponding to the tree node, a hot update operation corresponding to the node type includes: in response to determining that the node type corresponding to the tree node is a target node type, acquiring function name information and function parameter information corresponding to the tree node; and executing the function corresponding to the function name information according to the function name information and the function parameter information.
Optionally, the hot update condition is that a version number corresponding to the version information of the target program is not greater than a version number corresponding to the code version information.
In a second aspect, some embodiments of the present disclosure provide a thermal update apparatus, the apparatus comprising: the mounting processing unit is configured to mount an application program instance corresponding to a target program according to a hot update code included in hot update information corresponding to the target program; a determination unit configured to determine whether the target program satisfies a hot update condition in response to the mount success; and the hot updating unit is configured to respond to the satisfaction of the hot updating condition and carry out hot updating on the target program according to the hot updating code.
Optionally, before the mount processing is performed on the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program, the apparatus further includes: and sending a hot update request to a target server in response to the starting of the target program, wherein the hot update request is used for requesting hot update information corresponding to the target program from the target server.
Optionally, the mount processing unit is further configured to: and performing code preprocessing on the hot updating code to generate a hot updating code text.
Optionally, the mount processing unit is further configured to: and mounting the hot updating code text to the application program example.
Optionally, the thermal update unit is further configured to: performing text conversion on the hot update code text to generate at least one text keyword; and performing text analysis on the text keywords in the at least one text keyword to generate an abstract syntax tree.
Optionally, the abstract syntax tree comprises at least one tree node; and the thermal update unit is further configured to: and for each tree node in each tree node included in the abstract syntax tree, executing hot updating operation corresponding to the node type according to the node type corresponding to the tree node.
Optionally, the hot update information further includes: code version information; and the mount processing unit is further configured to: and mounting the hot updating code text and the code version information to the application program example.
Optionally, the thermal update unit is further configured to: and performing keyword recognition on the hot update code text, and taking the recognized keywords as text keywords to generate the at least one text keyword.
Optionally, the thermal update unit is further configured to: in response to determining that the node type corresponding to the tree node is a target node type, acquiring function name information and function parameter information corresponding to the tree node; and executing the function corresponding to the function name information according to the function name information and the function parameter information.
Optionally, the hot update condition is that a version number corresponding to the version information of the target program is not greater than a version number corresponding to the code version information.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device, on which one or more programs are stored, which when executed by one or more processors cause the one or more processors to implement the method described in any implementation of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: by the hot update method of some embodiments of the present disclosure, the update efficiency of the application program is improved. Specifically, the reasons for the inefficient update of the application are: when the application program has a bug, the repackaging processing can be performed on the application program of the version with the bug fixed. Based on this, in the hot update method according to some embodiments of the present disclosure, first, according to the hot update code included in the hot update information corresponding to the target program, mount processing is performed on the application instance corresponding to the target program. In practical situations, the purpose of application program update is to release new application functions and/or fix existing vulnerabilities of the program, and corresponding to the application program, part of code segments are often added/modified. Therefore, the application program instance is mounted through the hot updating code, and the application program is conveniently updated according to the hot updating code. Further, in response to the mount success, it is determined whether the target program satisfies a hot update condition. In practical situations, the update of the application program is often to push hot update codes to the user terminal through the server in a unified manner. Since the versions of the applications installed on different user terminals are often different, it is necessary to determine whether the applications can be updated. And finally, responding to the condition that the hot update is met, and carrying out hot update on the target program according to the hot update code. By this way, the application program does not need to be packaged. The updating efficiency of the application program is greatly improved. Meanwhile, the use experience of the user is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of one application scenario of a thermal update method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a thermal update method according to the present disclosure;
FIG. 3 is a flow chart of further embodiments of a thermal update method according to the present disclosure;
FIG. 4 is a schematic diagram of the communication between the target program and the target server of the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of a thermal regeneration device according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a thermal update method of some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may mount, according to the hot update code 104 included in the hot update information 103 corresponding to the target program 102, the application program instance 105 corresponding to the target program 102; second, the computing device 101 may determine, in response to the mount success, whether the target program 102 satisfies a hot-update condition; finally, the computing device 101 may perform a hot update on the target program 102 according to the hot update code 104 in response to the hot update condition being satisfied.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a thermal update method according to the present disclosure is shown. The thermal updating method comprises the following steps:
step 201, according to the hot update code included in the hot update information corresponding to the target program, mount the application instance corresponding to the target program.
In some embodiments, the executing entity (e.g., the computing device 101 shown in fig. 1) of the hot update method may mount the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program, and include the following steps:
and firstly, creating the application program instance corresponding to the target program.
Wherein, the target program may be a WEB application program. The WEB application is an application that can be accessed through a WEB page. For example, the target program may be an applet. The application program instance is an instance of a class corresponding to the target program. The execution subject may generate the application instance by instantiating a class corresponding to the target program.
As an example, the execution agent may acquire the application instance through a taro.
And secondly, mounting the hot updating code to the application program example through a hook function.
The hot update information may be information required to update the target program. The hot update information may include: the code is updated hot. The hot update code may be a code that replaces a corresponding code in the target program to update the target program.
In response to the mount success, step 202 determines whether the target program satisfies a hot-update condition.
In some embodiments, the execution subject may determine whether the target program satisfies a hot update condition in response to the mount success. When the hot update code is successfully mounted to the application program instance, a unique identifier can be generated. For example, the unique identifier may be a Hash value such as "d 2e4208eca62aa1c 5389". Therefore, the execution subject can determine whether the mount is successful by judging whether the unique identifier exists. The hot update condition may be: the number of the application programs of each version between the version number corresponding to the version information of the target program and the version number corresponding to the hot update code is less than a predetermined threshold. In practical situations, the update of the application program often has the following two situations: firstly, repairing or adding partial functions to the bugs existing in the program; and secondly, reconstructing the application program. For the first situation, it is often only necessary to replace the corresponding code in the application program of the current version, or add a new code in the application program of the current version, so as to achieve the purpose of repairing the bug existing in the program or adding part of the functions. For the second case, since the reconfiguration requires a large change to the code in the current version of the application. Therefore, when the difference between the version number corresponding to the target program and the version number corresponding to the hot update code is large, the target program can be updated unsuccessfully even if the mounting is successful, and therefore whether the target program can be subjected to hot update or not is judged according to the hot update condition, the success rate of update is improved, and the stability of program update is ensured.
As an example, the execution subject may first determine a difference between a version number corresponding to the version information of the target program and a version number corresponding to the hot update code. Then, the difference is compared with the predetermined threshold value, so as to determine whether the target program meets the hot update condition.
As another example, the execution agent may first send a version number corresponding to the version information of the target program and a version number corresponding to the hot update code to a program version information database in a server. Then, according to the version information result obtained by the inquiry of the program version information database returned by the server, whether the target program meets the hot updating condition is determined. The program version information database may be a database for program information of each version corresponding to the target program. The version information result may be information of each version of program corresponding to the target program between a version number corresponding to the version information of the target program and a version number corresponding to the hot update code. The server may obtain the version information result from the program version information database through an SQL (Structured Query Language) statement. For example, the SQL statement may be: "SELECT is the version number corresponding to the version information of the FROM version information database WHERE version number betweeen target program AND the version number corresponding to the hot update code". For example, the version information result may include at least one version number.
And step 203, responding to the satisfaction of the hot update condition, and performing hot update on the target program according to the hot update code.
In some embodiments, the executing entity performs a hot update on the target program according to the hot update code in response to the hot update condition being satisfied, and may include the following steps:
the first step is that the position of the code needing to be updated is determined according to the identification corresponding to the hot updating code so as to generate position information.
For example, the execution subject may search in each configuration file corresponding to the target program by using the identifier corresponding to the hot update code as a key to determine the location of the code that needs to be updated. For example, the location information may be [ file path: a \ XX.js; code position: "X-Y lines" ]. Js can refer to a file with the format js (JavaScript) and the name XX in the file "A". The "X-Y lines" may refer to the code that needs to be updated and has the starting position of the "X" lines and the ending address of the "Y" lines.
And secondly, replacing the code at the position corresponding to the position information according to the hot update code.
The above embodiments of the present disclosure have the following beneficial effects: by the hot update method of some embodiments of the present disclosure, the update efficiency of the application program is improved. Specifically, the reasons for the inefficient update of the application are: when the application program has a bug, the repackaging processing can be performed on the application program of the version with the bug fixed. Based on this, in the hot update method according to some embodiments of the present disclosure, first, according to the hot update code included in the hot update information corresponding to the target program, mount processing is performed on the application instance corresponding to the target program. In practical situations, the purpose of application program update is to release new application functions and/or fix existing vulnerabilities of the program, and corresponding to the application program, part of code segments are often added/modified. Therefore, the application program instance is mounted through the hot updating code, and the application program is conveniently updated according to the hot updating code. Further, in response to the mount success, it is determined whether the target program satisfies a hot update condition. In practical situations, the update of the application program is often to push hot update codes to the user terminal through the server in a unified manner. Since the versions of the applications installed on different user terminals are often different, it is necessary to determine whether the applications can be updated. And finally, responding to the condition that the hot update is met, and carrying out hot update on the target program according to the hot update code. By this way, the application program does not need to be packaged. The updating efficiency of the application program is greatly improved. Meanwhile, the use experience of the user is improved.
With further reference to FIG. 3, a flow 300 of further embodiments of a thermal update method is illustrated. The process 300 of the hot update method includes the following steps:
step 301, in response to the target program starting, sending a hot update request to the target server.
In some embodiments, an executing agent of the hot update method (e.g., computing device 101 shown in FIG. 1) may send a hot update request to a target server in response to a target program launch. The execution subject may determine that the target program is started in response to determining that the thread corresponding to the target program is started. The target server may be a server for storing hot update information. The hot update request is used to request hot update information corresponding to the target program from the target server. The execution agent may send a hot update request to the target server by way of a wireless connection.
Optionally, the hot update information may further include: code version information. The code version information is used for representing the version corresponding to the hot update code. The hot update code and the code version information corresponding to the hot update code may be manually stored in the target server.
As an example, a schematic diagram of the communication between the target program and the target server may be as shown in fig. 4. The execution agent may send the hot update request 402 to the target server 403 by wireless connection via the terminal 401 running the target program. The target server 403, upon receiving the hot-update request 402, transmits the hot-update information 103 to the terminal 401 running the target program. For example, the terminal 401 running the target program may be a mobile phone.
As yet another example, the hot update request may be:
Taro.request(
{url:'XXXX'
data:{x:'AAA',y:'BBB'}
header:{'content-type':'application/json'}
success (res) { con. log (res. data) } }). Wherein, 'XXXX' is the server address of the target server. "data: { x: ' AAA ', y: ' BBB ' } ' is the request parameter of the above-described hot update request. "header { 'content-type': application/json '}" is the request header of the above-mentioned hot update request, and the default parameter is "' content-type ': application/json'". "success (res)" is a callback function. Data is the above hot update information.
Step 302, code preprocessing is performed on the hot update code to generate a hot update code text.
In some embodiments, the execution subject may perform code preprocessing on the hot update code included in the hot update information in response to receiving the hot update information sent by the target server, so as to generate the hot update code text. The execution body may convert the hot update code into a text of a character string type to generate the hot update code text.
Step 303, mount the hot update code text to the application program instance.
In some embodiments, the execution agent may mount the hot update code text to the application instance. The mounting manner and the technical effect thereof can refer to step 201 in the embodiments corresponding to fig. 2, and are not described herein again.
In some optional implementations of some embodiments, the execution subject may further mount the hot update code text and the code version information to the application program instance. For example, the execution body may mount the hot update code text and the code version information to the application instance through a function for mounting in a hook function.
In response to the mount being successful, a determination is made as to whether the target program satisfies a hot-update condition, step 304.
In some embodiments, the execution subject may determine whether the target program satisfies the hot update condition in response to a successful mount. Wherein, the hot update condition may be: and the version number corresponding to the version information of the target program is not greater than the version number corresponding to the code version information.
As an example, the version information of the target program may be [ version number: "12.2.3"]. The code version information may be [ version number: "12.2.4"]. And the version number corresponding to the version information of the target program is smaller than the version number corresponding to the code version information. Therefore, the target program satisfies the hot update condition.
Step 305, in response to the hot update condition being satisfied, text converting the hot update code text to generate at least one text keyword.
In some embodiments, the executing entity performs text conversion on the hot updated code text to generate at least one text keyword in response to the hot update condition being satisfied, and may include the following steps:
the method comprises the following steps of firstly, segmenting the hot update code text according to a target identifier to generate at least one candidate text keyword.
Wherein, the target identifier may be a space.
As an example, the above hot update code text may be "var a ═ 12". The execution subject may be represented by code: the "hot update code text" (") is divided. The at least one candidate text keyword to be generated may be [ "var", "a", "═ 12" ].
And secondly, for each candidate text keyword in the at least one candidate text keyword, performing character elimination on the candidate text keywords to generate text keywords.
As an example, the execution main body may remove a preset character from the candidate text keyword. For example, the preset character may be "\".
In some optional implementations of some embodiments, the execution subject may perform text conversion on the hot updated code text to generate at least one text keyword in response to the hot update condition being satisfied. The execution subject may perform keyword recognition on the hot update code text, and use the recognized keyword as a text keyword to generate the at least one text keyword. Wherein, the type of the keyword may be but is not limited to at least one of the following: keyword type, identifier type, operator type, numeric type, string type, space type, comment type, and punctuation type. For example, the keyword corresponding to the keyword type may be "var" or "const". The above identifier type keyword may be "if" or "else". The keywords of the operator type may be "+" or "-". The above-mentioned numeric type keyword may be "1". The keyword of the above character string type may be "abc". The above space type keyword may be "". The keyword of the above annotation type may be "// 3". The above-mentioned punctuation type keyword may be "{" or ": ".
As an example, the above hot update code text may be "var a ═ 1". The generated at least one text keyword may be [ { type: "keyword type", value: "var" }, { type: "string type", value: "a" }, { type: "operator type", value: "═" }, { type: "value type", value: "1"}].
In response to the hot update condition being satisfied, text parsing is performed on text keywords of the at least one text keyword to generate an abstract syntax tree, step 306.
In some embodiments, the execution subject may perform text parsing on a text keyword of the at least one text keyword through a recursive algorithm to generate an abstract syntax tree in response to the hot update condition being satisfied. Optionally, the abstract syntax tree may include at least one tree node.
As an example, the above-mentioned at least one text keyword may be [ { type: "keyword type", value: "var" }, { type: "string type", value: "a" }, { type: "operator type", value: "═" }, { type: "value type", value: "1"}]. The generated code segment corresponding to the abstract syntax tree may be:
Figure BDA0003496698220000131
wherein the "type" field indicates a type of a code segment corresponding to the abstract syntax tree. For example, "Program" may characterize that the type of the code segment corresponding to the abstract syntax tree is a Program type. "VariableDeclaration" can characterize that the type of a code segment is a variable declaration type. The "Identifier" may characterize the type of the code fragment as an identification type. "Literal" may characterize the type of code segment as a text type. The "start" field indicates a start position. The "end" field indicates the end position. The "value" field indicates a value. The init field represents information corresponding to the initialized value of the identifier. The "kid" field is a category identification field.
And 307, in response to the hot update condition being met, for each tree node in the tree nodes included in the abstract syntax tree, executing a hot update operation corresponding to the node type according to the node type corresponding to the tree node.
In some embodiments, the executing entity performs, for each tree node in the respective tree nodes included in the abstract syntax tree, a hot update operation corresponding to the node type according to the node type corresponding to the tree node in response to the hot update condition being satisfied.
As an example, when the node type of the tree node is a first type, the execution main body may obtain a value corresponding to the tree node. The first type may be an "Identifier" type. The execution body may obtain a value corresponding to the tree node through find (). As in the abstract syntax tree in step 308, the value of the variable "a" with the type "Identifier" may be "1".
As another example, when the node type of the tree node is the second type, the execution body may obtain a value corresponding to the tree node by a node value () method. Wherein the second type may be a "live" type.
In some optional implementations of some embodiments, in response to that the hot update condition is satisfied, for each tree node in the respective tree nodes included in the abstract syntax tree, the executing unit may perform a hot update operation corresponding to the node type according to the node type corresponding to the tree node, and may include the following steps:
the method comprises the following steps of responding to the fact that the node type corresponding to the tree node is determined to be a target node type, and obtaining function name information and function parameter information corresponding to the tree node.
And the target node type is a function node type. The function name information is used for representing the name of the function corresponding to the tree node. The function parameter information includes parameters of a function corresponding to the tree node. For example, the execution body may acquire the function name information through a node. The execution body may acquire the function parameter information through a node.
And secondly, executing the function corresponding to the function name information according to the function name information and the function parameter information.
And the execution main body executes the function corresponding to the function name information by using the parameter included in the function parameter information as a parameter.
As an example, the execution subject may execute a function corresponding to the function name information through a function.
As can be seen from fig. 3, compared with the description of some embodiments corresponding to fig. 2, the present disclosure first adds a step of preprocessing the hot update code to generate a hot update code text. The hot updating code is converted into the hot updating code text, so that the data processability is improved. In addition, the hot update code text is text converted to generate at least one text keyword. Then, text parsing is performed on text keywords of the at least one text keyword to generate an abstract syntax tree. In practice, when a program is updated, it may be necessary to update code segments at different positions in different files. Thus, by constructing the abstract syntax tree, program updates can be made while preserving the relationships between the individual text keywords via the abstract syntax tree. The accuracy of program updates is higher than with direct code section replacement. And finally, for each tree node in each tree node included in the abstract syntax tree, executing hot updating operation corresponding to the node type according to the node type corresponding to the tree node. In practical situations, the node types corresponding to different tree nodes in the abstract syntax tree are often different, for example, the node types corresponding to some tree nodes may be variable types, that is, only variable replacement is required. The node type corresponding to some tree nodes may be a function type, that is, the corresponding function needs to be executed to implement the program update. Therefore, the hot updating operation corresponding to the node type is executed according to the node type, and the program updating efficiency is greatly improved.
With further reference to fig. 5, as an implementation of the methods illustrated in the above figures, the present disclosure provides some embodiments of a thermal update apparatus, which correspond to those illustrated in fig. 2, and which may be particularly applicable in various electronic devices.
As shown in fig. 5, the thermal update apparatus 500 of some embodiments includes: mount processing unit 501, determination unit 502, and hot update unit 503. The mount processing unit 501 is configured to mount an application instance corresponding to a target program according to a hot update code included in hot update information corresponding to the target program; a determination unit 502 configured to determine whether the target program satisfies a hot update condition in response to the mount success; a hot update unit 503 configured to perform hot update on the target program according to the hot update code in response to the hot update condition being satisfied.
In some optional implementation manners of some embodiments, before the mount processing is performed on the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program, the apparatus 500 further includes: and sending a hot update request to a target server in response to the starting of the target program, wherein the hot update request is used for requesting hot update information corresponding to the target program from the target server.
In some optional implementations of some embodiments, the mount processing unit 501 is further configured to: and performing code preprocessing on the hot updating code to generate a hot updating code text.
In some optional implementations of some embodiments, the mount processing unit 501 is further configured to: and mounting the hot updating code text to the application program example.
In some optional implementations of some embodiments, the thermal update unit 503 is further configured to: performing text conversion on the hot update code text to generate at least one text keyword; and performing text analysis on the text keywords in the at least one text keyword to generate an abstract syntax tree.
In some optional implementations of some embodiments, the abstract syntax tree includes at least one tree node; and the thermal update unit 503 is further configured to: and for each tree node in each tree node included in the abstract syntax tree, executing hot updating operation corresponding to the node type according to the node type corresponding to the tree node.
In some optional implementations of some embodiments, the hot update information further includes: code version information; and the mount processing unit 501 is further configured to: and mounting the hot updating code text and the code version information to the application program example.
In some optional implementations of some embodiments, the thermal update unit 503 is further configured to: and performing keyword recognition on the hot update code text, and taking the recognized keywords as text keywords to generate the at least one text keyword.
In some optional implementations of some embodiments, the thermal update unit 503 is further configured to: in response to determining that the node type corresponding to the tree node is a target node type, acquiring function name information and function parameter information corresponding to the tree node; and executing the function corresponding to the function name information according to the function name information and the function parameter information.
In some optional implementation manners of some embodiments, the hot update condition is that a version number corresponding to the version information of the target program is not greater than a version number corresponding to the code version information.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to FIG. 6, a block diagram of an electronic device (such as computing device 101 shown in FIG. 1)600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: according to the hot update codes included in the hot update information corresponding to the target program, carrying out mounting processing on the application program instance corresponding to the target program; responding to the successful mounting, and determining whether the target program meets a hot updating condition; and responding to the condition that the hot update is met, and carrying out hot update on the target program according to the hot update code.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a mount processing unit, a determination unit, and a thermal update unit. The names of these units do not limit the unit itself in some cases, for example, the mount processing unit may also be described as a unit that mounts the hot update code included in the hot update information corresponding to the target program to the application instance corresponding to the target program.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (13)

1. A method of thermal renewal, comprising:
according to the hot update codes included in the hot update information corresponding to the target program, carrying out mounting processing on the application program instance corresponding to the target program;
in response to the mount success, determining whether the target program satisfies a hot update condition;
and responding to the condition that the hot updating is met, and performing hot updating on the target program according to the hot updating code.
2. The method according to claim 1, wherein before the mount processing of the application instance corresponding to the target program is performed according to the hot update code included in the hot update information corresponding to the target program, the method further includes:
responding to target program starting, and sending a hot update request to a target server, wherein the hot update request is used for requesting hot update information corresponding to the target program from the target server.
3. The method according to claim 1, wherein the mounting the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program includes:
code preprocessing is carried out on the hot updating code to generate hot updating code text.
4. The method according to claim 3, wherein the mounting processing of the application instance corresponding to the target program according to the hot update code included in the hot update information corresponding to the target program further includes:
and mounting the hot updating code text to the application program instance.
5. The method of claim 4, wherein said hot updating the target program according to the hot update code comprises:
performing text conversion on the hot update code text to generate at least one text keyword;
and performing text analysis on the text key words in the at least one text key word to generate an abstract syntax tree.
6. The method of claim 5, wherein the abstract syntax tree comprises at least one tree node; and
the hot updating the target program according to the hot updating code further comprises:
and for each tree node in each tree node included in the abstract syntax tree, executing hot updating operation corresponding to the node type according to the node type corresponding to the tree node.
7. The method of claim 4, wherein the hot update information further comprises: code version information; and
the mounting the hot update code text to the application program instance comprises:
and mounting the hot updating code text and the code version information to the application program instance.
8. The method of claim 5, wherein the text converting the hot update code text to generate at least one text keyword comprises:
and performing keyword identification on the hot updating code text, and taking the identified keywords as text keywords to generate the at least one text keyword.
9. The method of claim 6, wherein the performing a hot update operation corresponding to the node type according to the node type corresponding to the tree node comprises:
in response to determining that the node type corresponding to the tree node is a target node type, acquiring function name information and function parameter information corresponding to the tree node;
and executing the function corresponding to the function name information according to the function name information and the function parameter information.
10. The method of claim 7, wherein the hot update condition is that a version number corresponding to version information of the target program is not greater than a version number corresponding to the code version information.
11. A thermal update apparatus comprising:
the mounting processing unit is configured to mount an application program instance corresponding to a target program according to a hot update code included in hot update information corresponding to the target program;
a determination unit configured to determine whether the target program satisfies a hot update condition in response to the mount success;
a hot update unit configured to perform a hot update on the target program according to the hot update code in response to the hot update condition being satisfied.
12. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1 to 10.
CN202210116540.0A 2022-02-07 2022-02-07 Hot update method, device, electronic equipment and computer readable medium Pending CN114461247A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210116540.0A CN114461247A (en) 2022-02-07 2022-02-07 Hot update method, device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210116540.0A CN114461247A (en) 2022-02-07 2022-02-07 Hot update method, device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN114461247A true CN114461247A (en) 2022-05-10

Family

ID=81410872

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210116540.0A Pending CN114461247A (en) 2022-02-07 2022-02-07 Hot update method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN114461247A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116414424A (en) * 2023-06-09 2023-07-11 建信金融科技有限责任公司 Thermal updating method, device, equipment and storage medium
CN116501348A (en) * 2023-04-11 2023-07-28 北京三维天地科技股份有限公司 Method for thermally updating java code based on java virtual machine

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501348A (en) * 2023-04-11 2023-07-28 北京三维天地科技股份有限公司 Method for thermally updating java code based on java virtual machine
CN116501348B (en) * 2023-04-11 2023-12-05 北京三维天地科技股份有限公司 Method for thermally updating java code based on java virtual machine
CN116414424A (en) * 2023-06-09 2023-07-11 建信金融科技有限责任公司 Thermal updating method, device, equipment and storage medium
CN116414424B (en) * 2023-06-09 2023-09-12 建信金融科技有限责任公司 Thermal updating method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
CN109656923B (en) Data processing method and device, electronic equipment and storage medium
CN114461247A (en) Hot update method, device, electronic equipment and computer readable medium
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN113760948A (en) Data query method and device
CN116743785A (en) Cloud network data storage method, device, equipment and medium based on fog calculation
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN114115941A (en) Resource sending method, page rendering method, device, electronic equipment and medium
CN111125163A (en) Method and apparatus for processing data
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN113468342A (en) Data model construction method, device, equipment and medium based on knowledge graph
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112115154A (en) Data processing and data query method, device, equipment and computer readable medium
CN110019671B (en) Method and system for processing real-time message
CN113127416A (en) Data query method and device
CN113157276A (en) Layout file conversion method, device, electronic equipment and computer readable medium
CN115994151B (en) Data request changing method, device, electronic equipment and computer readable medium
CN115563183B (en) Query method, query device and program product
CN114090420A (en) Point burying method and device, electronic equipment and computer readable medium
CN113434124A (en) Method, device, equipment and medium for constructing multi-language project engineering
CN114398437A (en) User information processing method and device, electronic equipment and computer readable medium
CN115391358A (en) Array updating method and device, electronic equipment and computer readable medium
CN114443126A (en) Multi-version image processing method, information pushing method and device and electronic equipment

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