CN111488169A - Method and device for hot updating of application program, storage medium and electronic equipment - Google Patents

Method and device for hot updating of application program, storage medium and electronic equipment Download PDF

Info

Publication number
CN111488169A
CN111488169A CN202010265831.7A CN202010265831A CN111488169A CN 111488169 A CN111488169 A CN 111488169A CN 202010265831 A CN202010265831 A CN 202010265831A CN 111488169 A CN111488169 A CN 111488169A
Authority
CN
China
Prior art keywords
content
hot
script
application program
signature
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
CN202010265831.7A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010265831.7A priority Critical patent/CN111488169A/en
Publication of CN111488169A publication Critical patent/CN111488169A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

Landscapes

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

Abstract

The disclosure provides a method and a device for hot updating of an application program, electronic equipment and a computer readable storage medium, and relates to the technical field of communication software. The method for hot updating of the application program comprises the following steps: responding to the starting operation of the application program, and starting the application program; starting an engine of the application program, accessing a server and acquiring hot update content issued by the server aiming at the application program, wherein the hot update content comprises script byte codes obtained by compiling updated script codes; the hot update content is interpreted and executed using a script interpreter. According to the method and the device, the application program is updated thermally after the engine of the application program is started, so that the repairability timeliness is guaranteed, and meanwhile, blind areas in the application program repairing process are reduced.

Description

Method and device for hot updating of application program, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of communication software technologies, and in particular, to a method for hot update of an application, an apparatus for hot update of an application, an electronic device, and a computer-readable storage medium.
Background
An application is software written for a particular application purpose of a user, and different services can be provided for the user through different applications. In practical applications, the application program often needs to be updated for the purposes of expanding functions, repairing bugs, improving user experience, and the like.
When the conventional updating technology is improved, the application program needs to be completely replaced, that is, a developer needs to modify the source code, recompile the link in the development environment, generate new application software, and release the new application software on the corresponding mobile terminal for the user to reinstall, which causes the problems of large workload, long time consumption and the like. PATCH update (PATCH update) and hot update push can improve the problems of the conventional update technology, but also increase the blind areas which cannot be repaired.
Therefore, it is necessary to provide a method for hot update of an application program, which starts to perform hot update on the application program after an engine of the application program is started, and can reduce blind areas in the application program repair process while ensuring repairability timeliness.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the disclosed embodiments is to provide a method for hot updating an application, an apparatus for hot updating an application, an electronic device, and a computer-readable storage medium, which can reduce a blind area in a process of repairing an application while ensuring repairability timeliness.
According to a first aspect of the present disclosure, there is provided a method for hot update of an application, comprising:
responding to the starting operation of the application program, and starting the application program;
starting an engine of the application program, accessing a server and acquiring hot update content issued by the server aiming at the application program, wherein the hot update content comprises script byte codes obtained by compiling updated script codes;
the hot update content is interpreted and executed using a script interpreter.
In an exemplary embodiment of the present disclosure, after the interpreting and executing the hot updated content using the script interpreter, the method further comprises:
and responding to the login operation of the user to enter the application program.
In an exemplary embodiment of the present disclosure, after the interpreting and executing the hot updated content using the script interpreter, the method further comprises:
accessing the server, inquiring and acquiring patch updating information;
and responding to the selection operation of the user aiming at the patch updating information, and executing updating according to the patch updating information.
In an exemplary embodiment of the present disclosure, the hot update content includes a script bytecode that is an encrypted ciphertext content, and the hot update content further includes a signature content obtained by signing the ciphertext content;
after the obtaining of the hot update content published by the server, the method further includes:
acquiring a signature public key which is issued by the server and corresponds to a signature private key, and performing signature decoding operation on the signature content by using the signature public key to obtain the signature content after signature decoding operation, wherein the signature private key is a private key used by the server for signature on the ciphertext content;
and comparing the signature content after the signature is removed with the ciphertext content, and when the comparison result is consistent, the signature verification is passed.
In an exemplary embodiment of the present disclosure, the ciphertext content is a ciphertext content in a text format;
after the signature verification passes, the method further comprises:
and converting the ciphertext content in the text format into the ciphertext content in the binary format through a preset encoding algorithm.
In an exemplary embodiment of the present disclosure, after the ciphertext content in the text format is converted into the ciphertext content in the binary format by using a preset encoding algorithm, the method further includes:
and decompressing the ciphertext content.
In an exemplary embodiment of the present disclosure, when the signature verification passes, the method further includes:
acquiring an XOR encrypted decryption key, wherein the decryption key is an encryption key used by the server for XOR of the script byte codes;
and decrypting the ciphertext content by using the decryption key to obtain the script byte code to be executed.
According to a second aspect of the present disclosure, there is provided a method for hot update of an application, comprising:
acquiring a script code for updating, compiling the script code by using a script interpreter, generating a corresponding script byte code, and obtaining hot updating content according to the script byte code;
and releasing the hot updating content for the client to access.
In an exemplary embodiment of the disclosure, the obtaining hot updated content according to the script bytecode includes:
acquiring an XOR encrypted encryption key;
carrying out bitwise XOR operation on the script byte codes through the encryption key to obtain ciphertext contents corresponding to the script byte codes;
and obtaining the hot updating content according to the ciphertext content.
In an exemplary embodiment of the disclosure, after obtaining the ciphertext content corresponding to the script bytecode, the method further includes:
and compressing the ciphertext content.
In an exemplary embodiment of the present disclosure, the obtaining hot updated content according to the ciphertext content includes:
converting the ciphertext content in the binary format into ciphertext content in a text format through a preset encoding algorithm;
and obtaining hot updating content according to the ciphertext content in the text format.
In an exemplary embodiment of the present disclosure, the obtaining hot updated content according to the ciphertext content includes:
acquiring a signature private key;
signing the ciphertext content through the signature private key to obtain signature content aiming at the ciphertext content;
and obtaining the hot updating content according to the ciphertext content and the signature content.
In an exemplary embodiment of the disclosure, before obtaining the hot updated content according to the ciphertext content and the signature content, the method further includes:
and converting the signature content in the binary format into the signature content in the text format through a preset encoding algorithm.
According to a third aspect of the present disclosure, there is provided an apparatus for hot update of an application, including:
the response module is used for responding to the starting operation of the application program and starting the application program;
the acquisition module is used for starting an engine of the application program, accessing a server and acquiring hot update contents issued by the server aiming at the application program, wherein the hot update contents comprise script byte codes obtained by compiling updated script codes;
and the hot updating module is used for interpreting and executing the hot updating content by utilizing the script interpreter.
According to a fourth aspect of the present disclosure, there is provided an apparatus for hot update of an application, including:
the compiling module is used for acquiring script codes for updating, compiling the script codes by using a script interpreter, generating corresponding script byte codes and obtaining hot updating contents according to the script byte codes;
and the issuing module is used for issuing the hot updating content for the client to access.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to a sixth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present disclosure may have some or all of the following benefits:
in the method for hot updating of an application provided by the disclosed example embodiment, first, the application is started in response to a start operation acting on the application; starting an engine of an application program, accessing a server and acquiring hot updating content issued by the server aiming at the application program, wherein the hot updating content comprises script byte codes obtained by compiling aiming at an updated script code; the hot update content is interpreted and executed using a script interpreter. On one hand, compared with the conventional updating method for completely replacing the application program and the patch updating method, the hot updating method provided by the embodiment of the disclosure releases hot updating contents at the server side of the application program so as to be obtained and executed by the client side, repair bugs and expand functions, and the process can be completed in a shortest time of only a few minutes, so that the updating of the application program is more efficient, and the method can be better suitable for the processing of emergency problems. On the other hand, the updating process in the method is carried out after the application program engine is started and before the user logs in, and after the updating is finished, other repairing and updating modes such as patch updating and the like can be carried out continuously, so that the repairing timeliness can be ensured, and meanwhile, blind areas in the application program repairing process can be reduced. Meanwhile, the method does not need to be reissued in the application market again, and the user downloads the application program, so that the development and updating efficiency of the version of the application program can be improved, the latest technical requirement can be met in time, and great convenience is provided for software development.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 is a diagram illustrating an exemplary system architecture to which a method and apparatus for hot update of an application according to an embodiment of the present disclosure may be applied;
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device used to implement embodiments of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a method of application hot update according to one embodiment of the present disclosure;
FIG. 4 schematically shows a schematic diagram of a script bytecode generation process of a method of application hot-update according to one embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow diagram of a method of application hot update according to one embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of an XOR encryption process of a method of application hot update according to one embodiment of the present disclosure;
FIG. 7 schematically shows a schematic diagram of a compression process of a method of application hot-update according to one embodiment of the present disclosure;
FIG. 8 schematically illustrates a diagram of a text conversion process of a method of application hot update according to one embodiment of the present disclosure;
FIG. 9 schematically illustrates a block diagram of an apparatus for hot update of an application, according to one embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of an apparatus for hot update of an application, according to one embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a method and apparatus for hot update of an application according to an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The method for hot update of the application provided by the embodiment of the present disclosure may be executed by the terminal devices 101, 102, and 103, and accordingly, the apparatus for hot update of the application may be disposed in the terminal devices 101, 102, and 103. The method for hot update of the application provided by the embodiment of the present disclosure may also be executed by the server 105, and accordingly, an apparatus for hot update of the application may be disposed in the server 105. In addition, the method for hot update of the application provided by the embodiment of the present disclosure may also be executed by the terminal devices 101, 102, and 103 and the server 105 together, and accordingly, the apparatus for hot update of the application may be disposed in the terminal devices 101, 102, and 103 and the server 105, which is not particularly limited in this exemplary embodiment.
For example, in the present exemplary embodiment, in response to a start operation acting on an application client in the mobile terminal 101, 102, 103, the application is started; after an engine of an application program is started, a client accesses a server 105 of the application program through a network 104, and obtains hot update content issued by the server 105 for the application program, wherein the hot update content comprises script byte codes compiled aiming at updated script codes; and finally, the client interprets and executes the hot updating content by using the script interpreter to complete the updating of the application program.
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
It should be noted that the computer system 200 of the electronic device shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 2, the computer system 200 includes a Central Processing Unit (CPU)201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for system operation are also stored. The CPU201, ROM 202, and RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
To the I/O interface 205, AN input section 206 including a keyboard, a mouse, and the like, AN output section 207 including a keyboard such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 208 including a hard disk and the like, and a communication section 209 including a network interface card such as a L AN card, a modem, and the like, the communication section 209 performs communication processing via a network such as the internet, a drive 210 is also connected to the I/O interface 205 as necessary, a removable medium 211 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
An application is software written for a particular application purpose of a user, and different services can be provided for the user through different applications. In practical applications, the application program often needs to be updated for the purposes of expanding functions, repairing bugs, improving user experience, and the like.
Regarding the update of the application, the inventors first proposed the following three methods:
the first method is the conventional update method. According to the method, firstly, a developer writes codes required by an updated application program in a development environment by using a compiling language, then, the corresponding updated application program is generated and issued in an application market of the mobile terminal through compiling and linking, and the application program is completely replaced. The updating process needs to go through the processes of code modification, compiling and linking, redistribution, reinstallation and the like, so that the problems of large workload, long time consumption, complex intermediate relationship and the like can be caused.
Generally, a stable engine is not required to be updated, and therefore, the update of an application is mainly performed for a resource package. The second method is to merge the newly added and modified resources into a new resource package, which is provided to the application client for obtaining and updating the application, called PATCH update.
The updating process can be divided into two parts of publishing and updating. In the release process, a developer newly and improves game functions in a development environment, and packs all game resources into a new resource package after the test is finished; then, comparing the new resource package with the resource package of the application program client in the application market of the mobile terminal to obtain a resource change list, extracting the changed resources, and packaging into a PATCH update package; and finally, distributing the PATCH updating package to an application program server side and waiting for the client side to access.
After the PATCH update package is distributed to the application program server, the update process may be entered, and the specific process is as follows: firstly, a user runs an application program client through an operating system, the client executes application initialization after receiving user operation, and a script language interpreter and a script code running environment are prepared; then, executing script initialization to prepare a PATCH updating environment; accessing a game server through a network, inquiring the latest PATCH information, checking a local resource packet according to the inquiry information, and determining a resource list needing to be updated; and downloading the corresponding resources to the local, and updating the local resource package according to the resource content.
However, although the PATCH update method does not completely replace the application program, the following problems still exist: (1) and (3) resource packaging consumes time: integrating script codes and other resources into a complete resource package through processes of encryption, compression, conversion, screening and the like, wherein the process is usually different from dozens of minutes to hours and consumes very much time; (2) the time consumed for manufacturing PATCH is as follows: and repackaging the modified resources into a new resource package every time the PATCH is manufactured, and comparing the resources to obtain a resource change list. And then, the PATCH resource packet can be formed only by carrying out resource packaging again. The whole process of comparison, picking and packing also brings great time cost; (3) time spent on PATCH update: in the PATCH updating process, the whole resources of the application program client side need to be scanned, and the subsequent downloading and updating processes need to consume a large amount of time; (4) PATCH code blind area: the PATCH updating process has many steps and complicated logic, so that the probability of defects occurring in the updating process is increased. Once the PATCH updating process goes wrong, the conventional updating method of the mobile phone application can be returned, and the time is longer. Meanwhile, if a defect occurs in the core engine function executed earlier than the PATCH update, the core engine function cannot be solved by the PATCH update, and the core engine function also needs to be returned to the conventional update mode of the mobile phone application.
The third method is a hot update push method. After the application program is connected with the server, user identity authentication is carried out, and then functions provided by the server can be received. Meanwhile, script codes can also be transmitted in the established network link. When online modification is needed, the script codes for updating can be actively pushed to the client from the server for execution.
Compared with a PATCH updating method, the hot updating pushing method is lighter in weight and quick in response. However, the following problems also exist: the hot update push technique must be followed by a login before the code can be transmitted in the secure network link. The user login is a blind area for updating before login, and due to the fact that the user login process is long in flow and complex in logic, defects are likely to occur, and the user login needs to be updated through PATCH.
In order to solve the problems in the above three methods, in the present exemplary embodiment, the inventor proposes a new technical solution, and the technical solution of the embodiments of the present disclosure is explained in detail below:
the present example embodiment first provides a method for hot update of an application. The method for hot updating the application is applied to one or more of the terminal devices 101, 102, and 103 after the application engine is started and before the user logs in, and may also be applied to the server 105. Referring to fig. 3, the method for hot update of an application specifically includes the following steps:
step S310: responding to the starting operation of the application program, and starting the application program;
step S320: starting an engine of the application program, accessing a server and acquiring hot update content issued by the server aiming at the application program, wherein the hot update content comprises script byte codes obtained by compiling updated script codes;
step S330: the hot update content is interpreted and executed using a script interpreter.
In the method for hot updating of an application provided in the present exemplary embodiment, on one hand, compared with a conventional updating method for completely replacing an application and a patch updating method, the hot updating method provided in the present exemplary embodiment of the disclosure issues hot updating content at a server of the application for a client to obtain and execute updating, bug fixing, and function expanding, and this process can be completed in only a few minutes at the fastest speed, so that the updating of the application is more efficient, and the method can better adapt to the processing of an emergency problem. On the other hand, the updating process in the method is carried out after the application program engine is started and before the user logs in, and after the updating is finished, other repairing and updating modes such as patch updating and the like can be carried out continuously, so that the repairing timeliness can be ensured, and meanwhile, blind areas in the application program repairing process can be reduced. Meanwhile, the method does not need to be reissued in the application market again, and the user downloads the application program, so that the development and updating efficiency of the version of the application program can be improved, the latest technical requirement can be met in time, and great convenience is provided for software development.
Next, in another embodiment, the above steps are explained in more detail.
In step S310, in response to a start operation of an application program, the application program is started.
The method for hot updating of the application program provided by the exemplary embodiment is applied to the client of the application program. The updating method is used after the application program engine is started and before the user logs in, and can continue to execute functions of PATCH updating, user login verification and the like after the hot updating is completed. In this way, blind areas in the application update process can be reduced.
In this exemplary embodiment, the client of the application program may be located in a terminal device, and the terminal device may be, for example, a smart phone, a tablet computer, or a notebook computer, and this is not particularly limited in this exemplary embodiment.
In the present exemplary embodiment, the application is application software written to meet the application requirements of the user, and different services may be provided to the user through different applications. For example, the application may be a gaming application. When the game application runs, the game application usually needs to communicate with a server through a network, and the client arranged on the mobile terminal is the client of the game application. In addition, the application program may also be another type of application program, and this exemplary embodiment is not particularly limited to this.
In the present exemplary embodiment, generally, the starting of the application program mainly includes three phases of application starting, engine starting and script starting. The process of "the terminal device starts the application program in response to the start operation of the user on the application program client" is an application start phase, where the application start phase is generally a process of preparing necessary resources and running environments for the application program client, and may also be understood as a process of loading application running environments, resource packages, and the like, and this process occurs before the user logs in. Taking a game application as an example, that is, starting an operating system of a terminal device, in this process, the terminal device prepares necessary resources and an operating environment for a game client, and then executes a game client function written by a developer. It should be noted that the above scenario is only an exemplary illustration, and does not limit the exemplary embodiment.
In this exemplary embodiment, the starting operation may be, for example, a clicking operation applied to the application icon in the desktop of the terminal device, or a set shortcut operation, and the application may be self-started along with the operating system. In addition, the starting operation may be other operations that can perform the same function, and this exemplary embodiment is not particularly limited to this.
In step S320, an engine of the application program is started, a server is accessed, and hot update content issued by the server for the application program is obtained, where the hot update content includes script bytecode compiled for an updated script code.
In the present exemplary embodiment, after the application is started, the engine of the application is started, and in the engine starting stage, the mobile terminal gives part of the system rights to the application client for management, and the client performs initialization to prepare the necessary environment for the script interpreter to run and the loading environment of other resources. Taking a game application as an example, in the process, the game client obtains part of system operation authority, executes the initialization work of the game client, prepares a necessary environment for running the script interpreter and a loading environment of other resources, and executes the script resources in the game resource package after the completion. It should be noted that the game application scenario is only an exemplary illustration, and does not limit the exemplary embodiment.
In this exemplary embodiment, after an engine of an application program is started, it is first queried whether a hot update push exists at an application program server, and if the hot update push exists, the application program server is accessed and hot update content issued by the server for the application program is acquired. The hot update content is code required by the application program to update, and the update code is script code written by using a script language. The script language can be interpreted and executed by the script interpreter, so that the executable program through the interpreter can be loaded and executed without the development step of compiling and linking, thereby saving time and improving efficiency. The executable program refers to a binary sequence, i.e., machine code, that can be understood and executed by a computer device. When any language is executed in a computer device, it needs to be converted into machine code and stored together in an organized manner so as to be scheduled and executed by the operating system of the computer.
The hot update content is in a bytecode form of the script code, that is, after a developer writes a script code required by application program update using a scripting language, a server side obtains the script code and converts the script code into a bytecode to obtain the hot update content, as shown in fig. 4, the conversion process may be as follows: and compiling the script codes in the text format by using an interpreter corresponding to the script language to generate intermediate codes expressed in binary, so as to obtain script byte codes. For example, if the scripting language used for writing the script code is PYTHON, the script bytecode can be compiled by a PYTHON interpreter. By converting the script codes into script byte codes, the script codes can be prevented from being transmitted in a plaintext mode, and meanwhile, the speed of the application program client side for explaining and executing the script codes can be increased.
In this exemplary embodiment, the hot update content acquired by the application client may also be content obtained by performing one or more operations of encryption, compression, text conversion, signature, and the like on the script bytecode. Accordingly, the application client needs to perform operations of signature verification, text conversion, inverse conversion, decompression and decryption. These operations are explained in detail below:
the script bytecode included in the hot update content is encrypted ciphertext content, and the hot update content further includes signature content obtained by signing the ciphertext content. After the application client obtains the hot update content issued by the server, first, the application client checks the label of the hot update content, and the label checking process may be implemented as follows: acquiring a signature public key corresponding to the signature private key issued by the server, and performing signature decoding operation on the signature content in the hot updated content by using the signature public key to obtain the signature content subjected to signature decoding, wherein the signature private key is a private key used by the server for signature on the ciphertext content; and comparing the signature content after the signature is removed with the ciphertext content, and when the comparison result is consistent, the signature passes the verification.
In this example embodiment, the signature verification of the signed content may determine the legitimate source of the hot updated content. For example, when an attacker forges hot updated content and attempts to cheat an application client so that the client operates according to the intention of the client, through the signature verification algorithm, the content obtained by signature decryption and the ciphertext content generated by the encrypted script bytecode are inconsistent, and through the inconsistency, the client can know that the hot updated content is not issued by the server, so that the security of the system can be improved. Besides, the process may also ensure the integrity of the script bytecode for updating, and the like, which all fall within the scope of protection of the present exemplary embodiment.
After the signature verification passes, the application hot-update method provided in this exemplary embodiment further needs to perform a decryption operation on the ciphertext content of the hot-update content to obtain an executable script bytecode, and taking the used encryption algorithm as an exclusive-or encryption as an example, the decryption process may be as follows; acquiring a decryption key encrypted by XOR, wherein the decryption key is an encryption key used by the server for carrying out XOR on the script byte codes; and decrypting the ciphertext content by using the decryption key to obtain the script bytecode to be executed. It should be noted that the above scenario is only an exemplary illustration, and other encryption and decryption algorithms also belong to the protection scope of the present exemplary embodiment.
In this exemplary embodiment, for convenience of transmission, the ciphertext content may also be a ciphertext content in a text format obtained through text conversion, and for this case, after the signature verification passes and before the decryption process, the corresponding inverse conversion needs to be performed on the ciphertext content, and the process may be implemented as follows: the ciphertext content in the text format is converted into the ciphertext content in the binary format through a preset encoding algorithm, where the preset encoding algorithm may be a BASE64 encoding algorithm, or may be other encoding algorithms, and this is not particularly limited in this example embodiment.
Further, the ciphertext content may also be a compressed file obtained through a compression algorithm, and in this case, after the ciphertext content in the text format is converted into the ciphertext content in the binary format through the preset encoding algorithm, the corresponding decompression operation needs to be performed on the ciphertext content, so that the decryption can be continued.
It should be noted that, according to the corresponding operation of the server side on the script code, the operations of signature verification, reverse conversion of text conversion, decompression and decryption may be performed in whole or in part, and this is not particularly limited in this exemplary embodiment.
In step S330, the hot update content is interpreted and executed using a script interpreter.
In the present exemplary embodiment, through the process in step S320, the executable hot update content, that is, the executable script bytecode in the present disclosure, can be obtained. After the script bytecode is obtained, a script starting stage is entered, in which the application program client engine gives part of function execution authority to a script interpreter, and the obtained script bytecode, that is, the hot update content, can be interpreted and executed at the same time through the script interpreter, so that the hot update function is completely completed before the user logs in. Taking game application as an example, at this stage, the game client engine gives part of function execution authority to the script interpreter, starts to run script codes, and executes specific game functions. It should be noted that the game application scenario is only an exemplary illustration, and does not limit the exemplary embodiment.
In the present exemplary embodiment, after the hot update content is interpreted and executed by the script interpreter, the application program may be entered and specific functions of the application program may be executed in response to a login authentication operation of the user. Taking the game application as an example, the functions of PATCH update, user login verification, game server entry, game playing and the like may be continuously performed, and this example embodiment is not particularly limited thereto.
The process of executing PATCH update may be: accessing a server, and inquiring and acquiring patch updating information; and responding to the selection operation of the user for the patch updating information, and executing updating according to the patch updating information. It should be noted that the above description is only an exemplary description, and does not limit the present exemplary embodiment.
Correspondingly, the example embodiment also provides a method for hot updating of the application program. The application program hot updating method is applied to an application program server side. Referring to fig. 5, the method for hot update of an application specifically includes the following steps:
step S510: acquiring a script code for updating, compiling the script code by using a script interpreter, generating a corresponding script byte code, and obtaining hot updating content according to the script byte code;
step S520: and releasing the hot updating content for the client to access.
Next, in another embodiment, the above steps are explained in more detail.
In step S510, a script code for updating is obtained, the script code is compiled by using a script interpreter, a corresponding script bytecode is generated, and hot update content is obtained according to the script bytecode.
In the exemplary embodiment, after the developer writes the script code required by the application program update using the scripting language, the server side obtains the script code and converts the script code into the bytecode to obtain the hot update content. The process of compiling the obtained script code to generate the corresponding script bytecode by using the script interpreter is already described in detail in step S320, and therefore, no further description is provided herein. By converting the script codes into script byte codes, the script codes can be prevented from being transmitted in a plaintext mode, and meanwhile, the speed of the application program client side for explaining and executing the script codes can be increased.
In this exemplary embodiment, the process of obtaining the hot updated content according to the script bytecode may include one or more of encrypting, compressing, text converting, and signing the script bytecode. These operations are explained in detail below:
the above is to protect the bytecode content from being stolen after the script bytecode is obtained. Taking a game application as an example, when some game sensitive data, such as a token for accessing a game server, is contained in the hot updated content and is not expected to be stolen and cracked in transmission, the content can be protected by an encryption means. The encryption process may adopt an exclusive or encryption method, as shown in fig. 6, the process is as follows: acquiring an XOR encrypted encryption key; carrying out bitwise XOR operation on the script byte codes through the encryption key to obtain ciphertext contents corresponding to the script byte codes; and obtaining hot updating content according to the ciphertext content. It should be noted that the above scenario is only an exemplary illustration, and other encryption methods, such as DES encryption, etc., also belong to the protection scope of the present exemplary embodiment.
In the present exemplary embodiment, in order to reduce the size of the hot update content, further shorten the network transmission time, reduce the pressure of the network transmission, and save the traffic cost of the server, after encrypting the script bytecode, the obtaining of the hot update content according to the ciphertext content may further include compressing the ciphertext content.
Further, in this exemplary embodiment, for convenience of transmission, the obtaining hot update content according to ciphertext content may further include: converting the ciphertext content in the binary format into the ciphertext content in the text format through a preset encoding algorithm; and obtaining hot updating content according to the ciphertext content in the text format. As shown in fig. 8, the preset encoding algorithm may be a BASE64 encoding algorithm, so that it is convenient to transmit the content in the HTTP protocol. It should be noted that the above scenario is only an exemplary illustration, and other encoding algorithms, such as HEX, etc., also belong to the protection scope of the present exemplary embodiment. In addition, binary transmission may also be directly employed, which is not required by the present example embodiment.
In this exemplary embodiment, in order to ensure the legitimacy of the source of the hot update content and the integrity of the content, and prevent an attacker from stealing and changing the update content in the transmission process, the exemplary embodiment may further perform signature operation on the hot update content, and then the obtaining of the hot update content according to the ciphertext content may further include: acquiring a signature private key; signing the ciphertext content through a signature private key to obtain signature content aiming at the ciphertext content; and obtaining the hot updating content according to the ciphertext content and the signature content. The server generates the key pair, signs the ciphertext content by using the private key and publishes the public key. The signature algorithm may be an RSA signature algorithm, or may also be a signature algorithm based on other private key systems, which is not particularly limited in this example embodiment.
Optionally, the signature content may be converted into a text format through an encoding algorithm, so as to facilitate transmission, and the specific implementation may be as follows: and converting the signature content in the binary format into the signature content in the text format through a preset encoding algorithm. Likewise, the preset encoding algorithm may be a BASE64 encoding algorithm, which facilitates the transmission of content in the HTTP protocol; other encoding algorithms such as HEX may be used, and this is not particularly limited in this exemplary embodiment.
In step S520, the hot updated content is published for access by the client.
In the present exemplary embodiment, after obtaining the hot update content through the process of step S510, the application server issues the hot update content through the network for the client to access and obtain, and executes the hot update on the application according to the hot update content.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Correspondingly, the present example embodiment further provides an apparatus for applying a hot update to a client, and as shown in fig. 9, the apparatus 900 for applying a hot update to an application may include a response module 910, an obtaining module 920, and a hot update module 930, where:
the response module 910 may be configured to start an application program in response to a start operation of the application program;
the obtaining module 920 may be configured to start an engine of the application, access a server, and obtain hot update content issued by the server for the application, where the hot update content includes script bytecode compiled for an updated script code;
the hot update module 930 may be used to interpret and execute the hot update content using a script interpreter.
The specific details of each module or unit in the above apparatus for hot update of application program have been described in detail in the corresponding method for hot update of application program, and therefore are not described herein again.
Further, the present exemplary embodiment also provides an apparatus for hot update of an application, which is applied to a server side, and as shown in fig. 10, the apparatus 1000 for hot update of an application may include a compiling module 1010 and a publishing module 1020, where:
the compiling module 1010 may be configured to obtain a script code for updating, compile the script code using a script interpreter, generate a corresponding script bytecode, and obtain a hot update content according to the script bytecode;
the publishing module 1020 may be used to publish the hot update content for access by clients.
The specific details of each module or unit in the above apparatus for hot update of application program have been described in detail in the corresponding method for hot update of application program, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below. For example, the electronic device may implement the steps shown in fig. 3 to 8, and the like.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media 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 the present 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 contrast, in the present disclosure, 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (17)

1. A method for application hot-update, comprising:
responding to the starting operation of the application program, and starting the application program;
starting an engine of the application program, accessing a server and acquiring hot update content issued by the server aiming at the application program, wherein the hot update content comprises script byte codes obtained by compiling updated script codes;
the hot update content is interpreted and executed using a script interpreter.
2. The method of claim 1, wherein after interpreting and executing the hot update content using a script interpreter, the method further comprises:
and responding to the login operation of the user to enter the application program.
3. The method of claim 1, wherein after interpreting and executing the hot update content using a script interpreter, the method further comprises:
accessing the server, inquiring and acquiring patch updating information;
and responding to the selection operation of the user aiming at the patch updating information, and executing updating according to the patch updating information.
4. The method for hot update of an application program according to claim 1, wherein the hot update content contains script bytecode that is encrypted ciphertext content, and the hot update content further includes signature content obtained by signing the ciphertext content;
after the obtaining of the hot update content published by the server, the method further includes:
acquiring a signature public key which is issued by the server and corresponds to a signature private key, and performing signature decoding operation on the signature content by using the signature public key to obtain the signature content after signature decoding operation, wherein the signature private key is a private key used by the server for signature on the ciphertext content;
and comparing the signature content after the signature is removed with the ciphertext content, and when the comparison result is consistent, the signature verification is passed.
5. The method for hot update of an application program according to claim 4, wherein the ciphertext content is in a text format;
after the signature verification passes, the method further comprises:
and converting the ciphertext content in the text format into the ciphertext content in the binary format through a preset encoding algorithm.
6. The method for hot update of an application program according to claim 5, wherein after the ciphertext content in the text format is converted into the ciphertext content in the binary format by a preset encoding algorithm, the method further comprises:
and decompressing the ciphertext content.
7. The method of claim 4, wherein when the signature verification passes, the method further comprises:
acquiring an XOR encrypted decryption key, wherein the decryption key is an encryption key used by the server for XOR of the script byte codes;
and decrypting the ciphertext content by using the decryption key to obtain the script byte code to be executed.
8. A method for application hot-update, comprising:
acquiring a script code for updating, compiling the script code by using a script interpreter, generating a corresponding script byte code, and obtaining hot updating content according to the script byte code;
and releasing the hot updating content for the client to access.
9. The method for hot update of application programs according to claim 8, wherein the obtaining hot update contents according to the script bytecode includes:
acquiring an XOR encrypted encryption key;
carrying out bitwise XOR operation on the script byte codes through the encryption key to obtain ciphertext contents corresponding to the script byte codes;
and obtaining the hot updating content according to the ciphertext content.
10. The method for hot update of an application according to claim 9, wherein after obtaining the ciphertext content corresponding to the script bytecode, the method further comprises:
and compressing the ciphertext content.
11. The method for hot update of an application program according to claim 9, wherein the obtaining hot update content according to the ciphertext content comprises:
converting the ciphertext content in the binary format into ciphertext content in a text format through a preset encoding algorithm;
and obtaining hot updating content according to the ciphertext content in the text format.
12. The method for hot update of an application program according to claim 9, wherein the obtaining hot update content according to the ciphertext content comprises:
acquiring a signature private key;
signing the ciphertext content through the signature private key to obtain signature content aiming at the ciphertext content;
and obtaining the hot updating content according to the ciphertext content and the signature content.
13. The method of claim 12, wherein before obtaining the hot updated content according to the ciphertext content and the signature content, the method further comprises:
and converting the signature content in the binary format into the signature content in the text format through a preset encoding algorithm.
14. An apparatus for hot updating an application, comprising:
the response module is used for responding to the starting operation of the application program and starting the application program;
the acquisition module is used for starting an engine of the application program, accessing a server and acquiring hot update contents issued by the server aiming at the application program, wherein the hot update contents comprise script byte codes obtained by compiling updated script codes;
and the hot updating module is used for interpreting and executing the hot updating content by utilizing the script interpreter.
15. An apparatus for hot updating an application, comprising:
the compiling module is used for acquiring script codes for updating, compiling the script codes by using a script interpreter, generating corresponding script byte codes and obtaining hot updating contents according to the script byte codes;
and the issuing module is used for issuing the hot updating content for the client to access.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1-13.
17. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-13 via execution of the executable instructions.
CN202010265831.7A 2020-04-07 2020-04-07 Method and device for hot updating of application program, storage medium and electronic equipment Pending CN111488169A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010265831.7A CN111488169A (en) 2020-04-07 2020-04-07 Method and device for hot updating of application program, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010265831.7A CN111488169A (en) 2020-04-07 2020-04-07 Method and device for hot updating of application program, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111488169A true CN111488169A (en) 2020-08-04

Family

ID=71794706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010265831.7A Pending CN111488169A (en) 2020-04-07 2020-04-07 Method and device for hot updating of application program, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111488169A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467803A (en) * 2021-06-28 2021-10-01 广州虎牙科技有限公司 Application program repairing method, related device and equipment
CN114115964A (en) * 2022-01-24 2022-03-01 在线途游(北京)科技有限公司 Hot updating method and device for Unity, computing equipment and computer-readable storage medium
CN116991452A (en) * 2023-07-26 2023-11-03 上海合芯数字科技有限公司 Method and device for thermally updating OPAL function firmware code in OpenPower architecture

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471299B1 (en) * 2013-03-25 2016-10-18 Amazon Technologies, Inc. Updating code within an application
CN109445832A (en) * 2018-10-09 2019-03-08 深圳点猫科技有限公司 Language carries out the method and electronic equipment of hot update to application program based on programming
CN109800005A (en) * 2018-12-06 2019-05-24 广州西山居世游网络科技有限公司 A kind of hot update method of client and device
CN110278115A (en) * 2019-06-20 2019-09-24 京东方科技集团股份有限公司 Hot update method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471299B1 (en) * 2013-03-25 2016-10-18 Amazon Technologies, Inc. Updating code within an application
CN109445832A (en) * 2018-10-09 2019-03-08 深圳点猫科技有限公司 Language carries out the method and electronic equipment of hot update to application program based on programming
CN109800005A (en) * 2018-12-06 2019-05-24 广州西山居世游网络科技有限公司 A kind of hot update method of client and device
CN110278115A (en) * 2019-06-20 2019-09-24 京东方科技集团股份有限公司 Hot update method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467803A (en) * 2021-06-28 2021-10-01 广州虎牙科技有限公司 Application program repairing method, related device and equipment
CN113467803B (en) * 2021-06-28 2024-03-01 广州虎牙科技有限公司 Application program repairing method, related device and equipment
CN114115964A (en) * 2022-01-24 2022-03-01 在线途游(北京)科技有限公司 Hot updating method and device for Unity, computing equipment and computer-readable storage medium
CN116991452A (en) * 2023-07-26 2023-11-03 上海合芯数字科技有限公司 Method and device for thermally updating OPAL function firmware code in OpenPower architecture

Similar Documents

Publication Publication Date Title
CN111488169A (en) Method and device for hot updating of application program, storage medium and electronic equipment
CN112104709B (en) Intelligent contract processing method, device, medium and electronic equipment
CN112039826B (en) Login method and device applied to applet end, electronic equipment and readable medium
CN109995523B (en) Activation code management method and device and activation code generation method and device
WO2023029447A1 (en) Model protection method, device, apparatus, system and storage medium
US10970264B2 (en) Supporting secure layer extensions for communication protocols
CN111199037A (en) Login method, system and device
JP2022541929A (en) Method and apparatus for issuing smart contracts
CN108564363B (en) Transaction processing method, server, client and system
CN111144878B (en) Instruction generation method and instruction generation device
CN111242462B (en) Data processing method and device, computer storage medium and electronic equipment
CN114675962A (en) Attestation support for elastic cloud computing environments
CN110928571A (en) Business program development method and device
CN110535631A (en) Method, system, equipment and the storage medium of edge calculations node data transmission
CN111045722A (en) Intelligent contract packaging method, device, system, computer equipment and storage medium
Kochnev et al. Surviving Java for mobiles
CN112416395A (en) Hot repair updating method and device
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN113420313A (en) Program safe operation and encryption method and device, equipment and medium thereof
CN113515747A (en) Equipment upgrading method, device, equipment and storage medium
CN109462604A (en) A kind of data transmission method, device, equipment and storage medium
WO2023159900A1 (en) Remote development method and device
CN111506503B (en) JMeter-based interface signature verification method and device, computing equipment and storage medium
US11902453B2 (en) Method, system and apparatus for delayed production code signing for heterogeneous artifacts
CN111562916B (en) Method and device for sharing algorithm

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