Search

CN-121996266-A - Thermal updating and application development method and device, electronic equipment and storage medium

CN121996266ACN 121996266 ACN121996266 ACN 121996266ACN-121996266-A

Abstract

The disclosure relates to a method, a device, an electronic device and a storage medium for hot update and application development, and relates to the technical field of computers, wherein the hot update method comprises the steps of determining target update indication information corresponding to a target execution object and a target data structure body instance corresponding to the target execution object based on a first hot update file pushed by an application server in the process of running an application program; the method comprises the steps of updating a target execution object into a target update object by a first hot update file indication pair, updating target update indication information based on the first hot update file, wherein the updated target update indication information is used for pointing to the target update object, and calling a target data structure body instance in response to a first execution instruction aiming at the target execution object so as to obtain a processing result of the first execution instruction based on the updated target update indication information and the target update object. By utilizing the technical scheme provided by the embodiment of the disclosure, when the application program is operated, any execution object can be automatically replaced by a new object through the hot update file so as to execute the instruction originally aiming at the execution object, so that any function or configuration of the application program can be efficiently updated without affecting the use experience of a user.

Inventors

  • SHENG KAI
  • LIU BO
  • LIU RUILIN
  • FANG GANG

Assignees

  • 星臻科技(上海)有限公司

Dates

Publication Date
20260508
Application Date
20251212

Claims (20)

  1. 1. A method for hot update, applied to an application, the method comprising: in the process of running an application program, determining target update indication information corresponding to a target execution object and a target data structure body instance corresponding to the target execution object based on a first hot update file pushed by an application server, wherein the first hot update file indicates that the target execution object is updated to be a target update object; Updating the target update indication information based on the first hot update file, wherein the updated target update indication information is used for pointing to the target update object; and responding to a first execution instruction aiming at the target execution object, and calling the target data structure body instance to obtain a processing result of the first execution instruction based on the updated target update indication information-and the target update object.
  2. 2. The method of claim 1, wherein during the launching of the application, the method further comprises: The method comprises the steps of responding to a starting instruction aiming at an application program, acquiring the executable file, marking at least one execution object by the executable file, wherein the target execution object is any one of the at least one execution object; Initializing update indication information corresponding to each execution object in the at least one execution object based on the executable file, wherein the initialized update indication information indicates that the corresponding execution object is not updated; registering each execution object based on the executable file to obtain a global mapping table, wherein the global mapping table indicates the mapping relation between the identification information of each execution object and a data structure body instance corresponding to each execution object, and the data structure body instance is used for describing and controlling the corresponding execution object.
  3. 3. The method of claim 2, wherein the first thermal update file is written in a dynamic scripting language, and wherein updating the target-update-indicating information based on the first thermal update file comprises: Encapsulating the target update object into a first object by executing the first hot update file, and determining object identification information of the first object; and updating the value of the target update indication information into object identification information so that the updated target update indication information is a target pointer pointing to the target update object.
  4. 4. The method according to claim 1, wherein the calling the target data structure instance in response to the first execution instruction for the target execution object to obtain the processing result of the first execution instruction based on the updated target update instruction information and the target update object includes: determining target identification information of the target execution object and first parameter information of the first execution instruction aiming at the target execution object in response to the first execution instruction aiming at the target execution object; Invoking a control function in a target data structure body instance corresponding to the target execution object to generate and execute a first control function aiming at the target execution object based on target identification information of the target execution object, the target update indication information and the first parameter information; In the process of executing the first control function, responding to a branch judgment instruction in an update object body of the target execution object, and checking the target update instruction information to obtain a second check result; Invoking the control function to generate and execute a second control function for the target update subject based on the target update indication information and the first parameter information, if the second test result indicates that the target update indication information is not null; and obtaining an output result of the second control function, and taking the output result of the second control function as a processing result of the first execution instruction.
  5. 5. The method according to claim 4, wherein the method further comprises: Determining parameter attribute information of the target execution object from the target data structure body instance; Invoking a checking function in a target data structure body instance corresponding to the target execution object to check the parameter attribute information and the first parameter information for the parameter quantity and the parameter type to obtain a first checking result; The calling the control function in the target data structure body instance corresponding to the target execution object to generate and execute a first control function for the target execution object based on the target identification information of the target execution object, the target update indication information and the first parameter information, including: And calling a control function in a target data structure body instance corresponding to the target execution object under the condition that the first test result indicates parameter matching so as to generate and execute a first control function aiming at the target execution object based on target identification information of the target execution object, the target update indication information and the first parameter information.
  6. 6. The method of claim 4, wherein the invoking the control function to generate and execute a second control function for the target update subject based on the target update indication information and the first parameter information if the second test result indicates that the target update indication information is not null comprises: Converting the first parameter information number in the process of executing the second control function to obtain actual parameter information corresponding to the target updating object; based on the actual parameter information, executing processing operation on the target updated object to obtain a second execution result corresponding to the target updated object; and converting a second execution result corresponding to the target update object to obtain a first execution result, and taking the first execution result as an output result of the second control function.
  7. 7. The method of claim 1, wherein during the running of the application, if the first hot update file is not received, the method further comprises: determining target identification information of the target execution object and second parameter information of the target execution object in the second execution instruction in response to a second execution instruction of the target execution object; Invoking a control function in a target data structure body instance corresponding to the target execution object to generate and execute a third control function aiming at the target execution object based on target identification information of the target execution object, the target update indication information and the second parameter information; In the process of executing the third control function, responding to a branch judgment instruction in an update object body of the target execution object, and checking the target update instruction information to obtain a third check result; executing processing operation on the target execution object based on the second parameter information under the condition that the third test result indicates that the target update indication information is a null pointer, obtaining a third execution result corresponding to the target execution object, and taking the third execution result as an output result of the third control function; and obtaining an output result of the third control function, and taking the output result of the third control function as a processing result of the second execution instruction.
  8. 8. The method of claim 1, wherein after receiving the first hot update file, the method further comprises: And in the process of running the application program, updating the target update indication information into a null pointer based on a second hot update file which is pushed by the application server and aims at the target execution object, wherein the second hot update file indicates that the update of the previous target execution object is cancelled, and the null pointer indicates that the target execution object is not updated.
  9. 9. An application development method, applied to a development terminal, comprising: acquiring an original source file corresponding to an application program; determining at least one execution object in the original source file; Generating instrumentation codes corresponding to each execution object in the at least one execution object, wherein the instrumentation codes are used for declaring update indication information of the corresponding execution object, and the update indication information is used for indicating the update state of the corresponding execution object; generating a reflection code corresponding to each execution object, wherein the reflection code is used for generating a data structure body instance for describing and controlling the corresponding execution object; Compiling the original source file, the instrumentation code corresponding to each execution object and the reflection code corresponding to each execution object to obtain an executable file corresponding to the application program, so that the application end executes the hot updating method according to claim 1 based on the executable file.
  10. 10. The method of claim 9, wherein said determining at least one execution object in the original source file comprises: compiling the original source file to obtain an abstract syntax tree, wherein the abstract syntax tree indicates the syntax structure and semantic information of the original source file; And analyzing the abstract syntax tree based on a preset updating constraint condition, and determining the at least one execution object, wherein the type of the at least one execution object comprises a class, a function or a variable.
  11. 11. The method of claim 10, wherein compiling the original source file to obtain an abstract syntax tree comprises: Determining a construction file and a parameter response file corresponding to the original source file according to the original source file, wherein the construction file is used for indicating the compiling rule of the original source file; and compiling the original source file according to the construction file and the response file to obtain the abstract syntax tree.
  12. 12. The method of claim 9, wherein generating instrumentation code corresponding to each of the at least one execution object comprises: and generating instrumentation codes corresponding to the execution objects based on the pre-packaged first macro definition and attribute information corresponding to the execution objects, wherein the instrumentation codes comprise declaration codes and branch judgment codes, the declaration codes are used for declaring update indication information of the corresponding execution objects, and the branch judgment codes are used for judging processing logic of the corresponding execution objects.
  13. 13. The method of claim 9, wherein generating the reflection code corresponding to each of the execution objects comprises: compiling the original source file to obtain an abstract syntax tree, wherein the abstract syntax tree indicates the syntax structure and semantic information of the original source file; determining data structure information of each execution object based on the abstract syntax tree; And generating a reflection code corresponding to each execution object based on the pre-packaged second macro definition and the data structure information of each execution object.
  14. 14. The method according to claim 9, wherein the method further comprises: Determining target identification information of a target execution object and a target update object, wherein the target execution object is any execution object in the at least one execution object; Generating a first hot update file for the target execution object based on the target identification information of the target execution object and the target update object, wherein the first hot update file indicates that the target execution object in the executable file is updated to be a target update object; And releasing the first hot update file to an application server so as to be pushed to an application end through the application server.
  15. 15. The method of claim 14, wherein after publishing the first hot update file, the method further comprises: Generating a second hot update file based on target identification information corresponding to the target execution object, wherein the second hot update file indicates to cancel the update of the target execution object; And releasing the second hot update file to the application server so as to be pushed to the application end through the application server.
  16. 16. A thermal upgrade apparatus, said apparatus comprising: The system comprises a determining module, a target updating instruction information and a target data structure body instance, wherein the determining module is configured to determine target updating instruction information corresponding to a target execution object and the target data structure body instance corresponding to the target execution object based on a first hot updating file pushed by an application server in the process of running an application program, the first hot updating file instructs to update the target execution object into the target updating object, the target updating instruction information instructs the updating state of the target execution object, and the target data structure body instance is used for describing and controlling the target execution object; An updating module configured to perform updating the target update instruction information based on the first thermal update file, the updated target update instruction information being used to point to the target update object; And the replacement execution module is configured to execute a first execution instruction responding to the target execution object, call the target data structure body instance, and obtain a processing result of the first execution instruction based on the updated target update indication information and the target update object.
  17. 17. An application development apparatus, the apparatus comprising: The acquisition module is configured to execute an original source file corresponding to the acquisition application program; an object recognition module configured to execute a determination of at least one execution object in the original source file; The instrumentation module is configured to execute and generate instrumentation codes corresponding to each execution object in the at least one execution object, wherein the instrumentation codes are used for declaring update indication information of the corresponding execution object, and the update indication information is used for indicating the update state of the corresponding execution object; The reflection module is configured to execute and generate reflection codes corresponding to the execution objects, wherein the reflection codes are used for generating data structure body examples describing and controlling the corresponding execution objects; The compiling module is configured to perform compiling on the original source file, the instrumentation code corresponding to each execution object and the reflection code corresponding to each execution object to obtain an executable file corresponding to the application program, so that the application end performs the hot updating method according to claim 1 based on the executable file.
  18. 18. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; Wherein the processor is configured to execute the instructions to implement the thermal update method of any one of claims 1 to 8 or the application development method of any one of claims 9 to 15.
  19. 19. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the thermal update method of any one of claims 1 to 8 or the application development method of any one of claims 9 to 15.
  20. 20. A computer program product comprising computer program/instructions which, when executed by a processor, implements the thermal update method of any one of claims 1 to 8 or the application development method of any one of claims 9 to 15.

Description

Thermal updating and application development method and device, electronic equipment and storage medium Technical Field The present disclosure relates to the field of computer technology, and in particular, to a method, an apparatus, an electronic device, and a storage medium for hot update and application development. Background At present, the functions of large-scale applications such as games are more and more, and corresponding program codes are more and more complex, so that the problems of breakdown and the like are easy to generate. In the related art, the problem in running or the upgrade of the application can be solved by downloading and replacing the installation package or the SO (dynamic link library) file to update the program code, but the installation package or the SO file in the method has long manufacturing and publishing period and cannot respond to the requirement in time, and secondly, the installation package of the large-scale application is usually larger, the time required by the user for downloading and replacing the new installation package is longer, and the application end system suitable for the SO file is limited, no matter the installation package or the SO file is used, the user is required to stop the use of the application, the use experience of the user is influenced, and the loss of the user is easy to cause. Therefore, with the development of large-scale applications, how to efficiently update the program code of the application is a technical problem to be solved. Disclosure of Invention The present disclosure provides a hot update and application development method, apparatus, electronic device, and storage medium to solve at least the problems in the related art described above. The technical scheme of the present disclosure is as follows: According to a first aspect of an embodiment of the present disclosure, there is provided a thermal updating method, applied to an application end, including: in the process of running an application program, determining target update indication information corresponding to a target execution object and a target data structure body instance corresponding to the target execution object based on a first hot update file pushed by an application server, wherein the first hot update file indicates that the target execution object is updated to be a target update object; Updating the target update indication information based on the first hot update file, wherein the updated target update indication information is used for pointing to the target update object; And responding to a first execution instruction aiming at the target execution object, and calling the target data structure body instance to obtain a processing result of the first execution instruction based on the updated target update indication information and the target update object. Optionally, in the process of starting the application program, the method further includes: The method comprises the steps of responding to a starting instruction aiming at an application program, acquiring the executable file, marking at least one execution object by the executable file, wherein the target execution object is any one of the at least one execution object; Initializing update indication information corresponding to each execution object in the at least one execution object based on the executable file, wherein the initialized update indication information indicates that the corresponding execution object is not updated; registering each execution object based on the executable file to obtain a global mapping table, wherein the global mapping table indicates the mapping relation between the identification information of each execution object and a data structure body instance corresponding to each execution object, and the data structure body instance is used for describing and controlling the corresponding execution object. Optionally, the first thermal update file is written in a dynamic scripting language, and the updating the target update indication information based on the first thermal update file includes: Encapsulating the target update object into a first object by executing the first hot update file, and determining object identification information of the first object; and updating the value of the target update indication information into object identification information so that the updated target update indication information is a target pointer pointing to the target update object. Optionally, the responding to the first execution instruction for the target execution object calls the target data structure body instance to obtain a processing result of the first execution instruction based on the updated target update indication information and the target update object, including: determining target identification information of the target execution object and first parameter information of the first execution instruction aiming at the target execution object in