Software update method, device and system

The software update method using LUA script language allows for flexible business logic changes and real-time hot swapping, addressing inflexibility in existing methods and enhancing game engine development.

CN113760322BActive Publication Date: 2025-07-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110169058.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-07
Publication Date
2025-07-15
Estimated Expiration
2041-02-07

AI Technical Summary

Technical Problem

Existing software update methods cannot flexibly change business logic or add business processes, and cannot support functional expansion and real-time hot updates.

Method used

It adopts the lightweight scripting language LUA, which realizes flexible changes in business logic and functional expansion through the combination of client, native and server, and supports real-time hot updates.

Benefits of technology

It realizes the universality and scalability of the game engine, improves the development business capabilities, has a short development cycle, and is suitable for dynamic updates of various marketing activities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760322B_ABST
    Figure CN113760322B_ABST
Patent Text Reader

Abstract

The present invention discloses a software update method, device, and system, which relate to the field of computer technology. A specific embodiment of the software update method includes: if it is detected that the download resource changes, a release request is sent to the native end, which is used to call the script system of the native end and release the native object according to the script system; a download request is sent to the server, and the latest download resource corresponding to the download request is received; an initialization request is sent, which is used for the native end to perform initialization processing on the script system according to the initialization request. This embodiment can flexibly change the business logic or add some business processes, and can support function expansion and real-time hot update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a software update method, apparatus, and system. Background Art

[0002] Generally speaking, as the main application (App) version is iteratively updated, a cut-off time needs to be reserved to complete algorithm and related business development. However, there are some very tricky and unsolvable situations in the existing software update methods: for example, the product suddenly wants to change some business processes; the business side wants to add some new business processes; the main App does not have time to allow you to modify the business logic. It can be understood that the existing software update methods cannot flexibly change the business logic or add some business processes, and do not support functions such as function expansion and real-time hot update. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a software update method, apparatus, and system, which can flexibly change the business logic or add some business processes, and can support function expansion and real-time hot update.

[0004] To achieve the above object, according to one aspect of the embodiments of the present invention, a software update method is provided.

[0005] The software update method of the embodiments of the present invention includes:

[0006] If it is detected that the downloaded resource has changed, a release request is sent to the native side to call the script system of the native side and release the native object according to the script system;

[0007] A download request is sent to the server, and the latest downloaded resource corresponding to the download request is received;

[0008] An initialization request is sent for the native side to initialize the script system according to the initialization request.

[0009] Optionally, the downloaded resource is a Uniform Resource Locator (URL) resource;

[0010] The step of, if it is detected that the downloaded resource has changed, sending a release request to the native side to call the script system of the native side and release the native object according to the script system includes:

[0011] If it is detected that the URL resource has changed, a release request is sent to the native side to call the interface class of the native side script system and release the native object according to the interface class.

[0012] Optionally, if the script system is initialized for the first time, the method further includes:

[0013] After initializing the script system, register script callbacks.

[0014] Optionally, further perform rendering processing on the script system, including:

[0015] Send a rendering request to the script system, where the rendering request carries a rendering message;

[0016] Receive callback information sent by the native side to complete the rendering processing of the script system; where the callback information is obtained by the native side sending the rendering message to the business script and invoking native methods to implement the business logic process within the business script.

[0017] To achieve the above object, according to another aspect of the embodiments of the present invention, a software update method is provided.

[0018] The software update method of the embodiments of the present invention includes:

[0019] Receive a release request sent by the client, execute the script system corresponding to the release request, and release native objects according to the script system;

[0020] Receive an initialization request sent by the client when initializing the script system according to the latest downloaded resources, and inject the binding dependency of the external algorithm library during the initialization process of the script system to initialize the script resources.

[0021] Optionally, the method further includes:

[0022] Receive a rendering request sent by the client, where the rendering request carries a rendering message;

[0023] Send the rendering message to the business script and invoke native methods to implement the business logic process within the business script;

[0024] Send callback information related to the business logic process to the client to complete the rendering processing of the script system.

[0025] To achieve the above object, according to another aspect of the embodiments of the present invention, a client is provided.

[0026] The client of the embodiments of the present invention includes:

[0027] A release module, configured to send a release request to the native side if it detects a change in the downloaded resources, for invoking the script system of the native side and releasing native objects according to the script system;

[0028] A download module, configured to send a download request to the server and receive the latest downloaded resources corresponding to the download request;

[0029] An initialization module, which is used to send an initialization request for the native side to perform initialization processing on the script system according to the initialization request.

[0030] To achieve the above object, according to another aspect of the embodiments of the present invention, a native side is provided.

[0031] The native side of the embodiments of the present invention includes:

[0032] An execution module, which is used to receive a release request sent by the client, execute the script system corresponding to the release request, and release native objects according to the script system;

[0033] An injection module, which is used to receive an initialization request sent by the client when initializing the script system according to the latest downloaded resources, and inject the binding dependencies of the external algorithm library during the initialization process of the script system to initialize the script resources.

[0034] To achieve the above object, according to another aspect of the embodiments of the present invention, a software update system is provided.

[0035] The software update system of the embodiments of the present invention includes: a client, a native side, and a server; wherein the native side at least includes: a script application factory interface class, and the script application factory interface class is used to be responsible for the creation, destruction, initialization of the script system, and the client sending messages to the script system.

[0036] Optionally, the native side further includes:

[0037] A script application callback interface class, which is used to be responsible for the information communication between the script system and the client.

[0038] Optionally, the native side further includes:

[0039] A binding loading class, which is used to be responsible for injecting the interfaces in the external algorithm library into the script system framework;

[0040] A binding management class, which is used to be responsible for managing various instances inherited from the binding loading class;

[0041] An interface binding file library, which is used to store the binding files corresponding to the interfaces in the external algorithm library.

[0042] To achieve the above object, according to another aspect of the embodiments of the present invention, an electronic device is provided.

[0043] The electronic device of the embodiments of the present invention includes:

[0044] One or more processors;

[0045] A storage device, which is used to store one or more programs,

[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0047] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a computer-readable medium.

[0048] The computer-readable medium of the embodiments of the present invention stores a computer program thereon, and when the program is executed by a processor, the method as described above is implemented.

[0049] One embodiment of the above invention has the following advantages or beneficial effects:

[0050] In the embodiments of the present invention, the software update method can achieve the generality of the game engine, support expansion and real-time hot update, and can improve the ability of the game engine development business. And the software update method uses a lightweight scripting language to implement the business logic, which is relatively easy to get started and has a short development cycle. In addition, the software update method can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0051] The further effects of the above non-conventional optional manners will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:

[0053] Figure 1 is a schematic diagram of the script system framework of the native end of the embodiments of the present invention;

[0054] Figure 2 is a schematic flowchart of the software update method according to the first embodiment of the present invention;

[0055] Figure 3 is a schematic flowchart of the software update method according to the second embodiment of the present invention;

[0056] Figure 4 is a schematic flowchart of the software update method according to the third embodiment of the present invention;

[0057] Figure 5 is a schematic diagram of the modules of the client of the embodiments of the present invention;

[0058] Figure 6 is a schematic diagram of the modules of the native end of the embodiments of the present invention;

[0059] Figure 7 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;

[0060] Figure 8It is a schematic structural diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0061] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0062] For the purposes of achieving high efficiency and algorithm protection, etc., the main App generally adopts a combination of a client (android and iOS), a native side (C++) and a server to complete. Among them, the client is responsible for writing the logic in the business direction to realize the communication between the native side and the client. The native side is responsible for implementing specific certain functional algorithms, and the server is responsible for configuring relevant basic resources. In the case where the main App cannot provide sufficient time, how to flexibly change the business logic or add some business processes, and how to support function expansion and real-time hot update, the following problems need to be solved:

[0063] 1) How to divide the business responsibilities among the client, the native side and the server;

[0064] 2) How to design in software update to implement an efficient and hot-update-supported script system;

[0065] 3) How to flexibly integrate other algorithm libraries in the hot-update-supported script system to enhance the capabilities of the original script;

[0066] 4) Which general method does the client adopt to communicate with the hot-update module to facilitate the hot update of subsequent services.

[0067] Considering the hot update design and running efficiency of common game software, the embodiments of the present invention propose a software update system based on the LUA (LUA is a lightweight and compact scripting language, written in standard C language and open-sourced in source code form) scripting language. The system at least includes: a client, a native side and a server. To support function expansion and real-time script hot update, the client needs to implement a communication bridge with the server and the native side, and there is no need to implement the development related to the core business functions; on the basis of implementing the basic functional algorithms, the native side also needs to provide support for the script system; the server can provide the configuration of some script resources. This software update system is a general new technology that can support function expansion and real-time script hot update, and the business layer only needs to be implemented using LUA scripts with native capabilities.

[0068] Among them, the script system framework implemented on the native side is the most critical module in the whole process. Refer to Figure 1 , the script system framework on the native side includes the following three layers: the basic layer, the binding layer, and the external layer. Among them, the basic layer mainly includes: the graphics library, the Lua library, and the Tolua library. The graphics library is the most core dynamic library with graphics rendering capabilities for software updates. The Lua library and the Tolua library mainly provide support for the script system. The main purpose of the binding layer is to support the flexible function expansion of the script system. The most critical objects are the binding management class (IBinderManger) and the binding loading class (IBinderLoader). IBinderManager is responsible for managing various instances inherited from IBinderLoader inside and outside. IBinderLoader is responsible for managing how the interfaces in the external algorithm library are injected into the software update script system framework. pkg (interface binding file library) is the binding file corresponding to the interfaces in the external algorithm library. The main purpose of the external layer is to implement the communication between the client and the Lua script. The core objects in the external layer include the script application factory class (IAppFactory) and the script application callback class (IAppCallBack). IAppFactory is responsible for the creation, destruction, initialization of the script system, and sending messages from the client to the script system. IAppCallBack is responsible for the information communication between the script system and the client.

[0069] Based on the software update system described above, an embodiment of the present invention provides a software update method. The execution subject of this software update method is the client. Figure 2 It is a schematic flowchart of the software update method according to the first embodiment of the present invention. As Figure 2 shown, this software update method may specifically include the following steps S201 to step S202.

[0070] Step S201: If it is detected that the downloaded resources have changed, send a release request to the native side to call the script system on the native side and release the native objects according to the script system.

[0071] In step S201, the downloaded resources may be Uniform Resource Locator (URL) resources, and the downloaded resources include at least one or more of the following: script resources, model resources, picture resources, and video resources. The native side refers to the application's database, and the native objects include at least: the script system, business scripts, and memory and video memory resources related to the native side.

[0072] If a URL resource change is detected, a release request is sent to the native side to call the interface class of the native side script system, and native objects are released according to the interface class. When releasing native objects, the memory and video memory resources of the script system, business scripts, and native side related to native objects can be further released based on the releaseApp method provided by the script application factory interface class (or called IAppFactory).

[0073] Step S202: Send a download request to the server and receive the latest download resource corresponding to the download request.

[0074] Step S203: Send an initialization request for the native side to perform initialization processing on the script system according to the initialization request.

[0075] When performing initialization processing on the script system, the client can call the script application factory interface class to initialize the script system, and inject the binding dependencies of the external algorithm library during the creation process of the script system by the native side to initialize the script resources. Specifically, when the client detects a change in the download resource, it can call the createApp method provided by the script application factory interface class of the native side to create and initialize the script system, and through this method, the purpose of function expansion can be achieved, and the script resources related to the business are loaded and initialized during the initialization process.

[0076] After performing initialization processing on the script system, rendering processing can also be performed on the script system. When performing rendering processing on the script system, the client sends a rendering request to the script system, and the rendering request carries a rendering message; the client receives the callback information sent by the native side to complete the rendering processing of the script system; where the callback information is obtained by the native side sending the rendering message to the business script and calling the native method to implement the business logic process in the business script.

[0077] Furthermore, the callFunc method provided by the script application factory interface class can be called to send a rendering request to the script system, and a frame-by-frame call method can be adopted. Further, the processing process of the callFunc method is generally as follows: first, the function name and parameter information are pushed onto the stack on the native side, then the script global function is executed, and finally the information pushed onto the stack is popped to execute the corresponding function.

[0078] It can be understood that after the client successfully downloads the latest download resource, it enters the subsequent process of script initialization in the initialization stage again in a loop, so as to achieve the purpose of real-time hot update.

[0079] In an embodiment of the present invention, the software update method can achieve the generality of the game engine, support expansion and real-time hot update, and can improve the ability of game engine development business. Moreover, the software update method uses a lightweight scripting language to implement business logic, which is relatively easy to get started and has a short development cycle. In addition, the software update method can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0080] Figure 3 FIG. 4 is a schematic flowchart of the software update method according to the second embodiment of the present invention. The execution subject of the software update method is the native side, and the script system framework of the native side is shown in FIG. 1. It should be noted that the native side can be deployed on the client or the server. As Figure 3 shown, the software update method may specifically include the following steps S301 to S302.

[0081] Step S301: Receive a release request sent by the client, execute the script system corresponding to the release request, and release native objects according to the script system.

[0082] In step S301, the release request is used to call the script system of the native side and release native objects according to the script system. The native objects at least include: the script system, business scripts, and memory and video memory resources related to the native side. Among them, when releasing native objects, the releaseApp method provided by IAppFactory can be used to release native objects such as the script system, business scripts, and memory and video memory resources related to the native side.

[0083] Step S302: Receive an initialization request sent by the client when initializing the script system according to the latest downloaded resources, and inject the binding dependency of the external algorithm library during the initialization process of the script system to initialize the script resources.

[0084] When initializing the script system, the client can call the script application factory interface class to initialize the script system, and inject the binding dependency of the external algorithm library during the creation process of the script system to initialize the script resources.

[0085] After the script system is initialized, the script system can be drawn. When the script system is drawn, a draw request sent by the client can be received, and the draw request carries a draw message. Then, the draw message is sent to the business script, and a native method is called to implement the business logic process in the business script, and callback information related to the business logic process is sent to the client to complete the drawing process of the script system.

[0086] In an embodiment of the present invention, the software update method can achieve the generality of the game engine, support extension and real-time hot update, and can improve the ability of the game engine development business. Moreover, the software update method uses a lightweight scripting language to implement the business logic, which is relatively easy to get started and has a short development cycle. In addition, the software update method can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0087] See Figure 4 , an embodiment of the present invention further provides a software update method, which is a software update technology that supports function extension and script hot update. The client is used to implement the dynamic monitoring of server resources and the general call of the script system; the native side is responsible for providing the capabilities of the script and the implementation of specific algorithms; the server is used to provide the ability of resource configuration. In this way, the ability of real-time hot update can be flexibly completed according to the needs of the product or the business side. The specific detailed program flow is as Figure 4 shown and can be simply summarized into the following three stages: the initialization stage, the drawing stage, and the hot update stage.

[0088] Among them, the initialization stage mainly completes the download of resources and the initialization of scripts, which simply includes the following steps:

[0089] 1) Initial resource download. The client requests to download the corresponding download resources from the server. The download resources include: script resources, model resources, picture resources, video resources, etc.

[0090] 2) Script initialization. Call the createApp method provided by IAppFactory to create and initialize the script system. During the creation of the script system, inject the binding dependencies of the external algorithm library. Through this method, the purpose of function extension can be achieved, and the script resources related to the business are loaded and initialized during the initialization process;

[0091] 3) Register callback. Implement a callback class that inherits from IAppCallBack, and call the interface provided by IAppFactory to register the callback (for example: registerCallBack, registerCallBack is the interface for registering the callback) method to register the script callback to achieve the purpose of communication between the script system and the client.

[0092] The drawing stage mainly completes the update call between the client and the script system through messages. The drawing stage includes the following important messages:

[0093] 1) Drawing message. Call the callFunc method provided by IAppFactory frame by frame to send a drawing request to the script system. This message will be forwarded to the business script through the native side, and the business logic process in the script is implemented by calling the native methods provided by the native side;

[0094] 2) Event messages. When the client triggers operations such as clicking, double - clicking, and zooming, it calls the sendEvent method provided by IAppFactory to send event responses to the script system, triggering the behaviors associated with the event on the business side. It should be noted that the basic process of the sendEvent method is the same as that of the callFunc method, except for the corresponding global functions.

[0095] 3) Callback messages. During the execution of business - related processes, when the business script needs to send a message to the client, it calls the sendMessage method to send the specified message. It can be understood that the specific message is returned to the client in a callback manner.

[0096] The hot - update stage mainly and flexibly implements new tasks or new logics proposed by the business side in real - time, which can be simply summarized into the following steps:

[0097] 1) Resource change. When there is a change in new tasks or new logics, it first needs to be implemented in the script system, and then replace the relevant resources under the corresponding URL of the server.

[0098] 2) Release of old resources. When the client detects that the resources corresponding to the specified URL of the server have changed, it calls the releaseApp method provided by IAppFactory to release the memory and video memory resources, etc., related to the script system, business scripts, and the native side.

[0099] 3) Loading of new resources. Request to download the latest resources under the specified URL from the server again. After successful download, it enters the subsequent process of script initialization in the initialization stage again in a loop, so as to achieve the purpose of real - time hot - update.

[0100] In the embodiments of the present invention, this software update method can achieve the generality of the game engine, support expansion, and real - time hot - update, which can improve the ability of game engine development business. And this software update method uses a lightweight scripting language to implement business logics, which is relatively easy to get started and has a short development cycle. In addition, this software update method can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0101] Figure 5 It is a schematic diagram of the modules of the client in the embodiments of the present invention. Refer to Figure 5 As shown in the figure, the client 500 includes the following modules:

[0102] A release module 501, configured to send a release request to the native side if it detects a change in the downloaded resources, for calling the script system of the native side and releasing native objects according to the script system.

[0103] A download module 502, configured to send a download request to a server and receive the latest downloaded resource corresponding to the download request;

[0104] An initialization module 503, configured to send an initialization request for the native side to perform initialization processing on the script system according to the initialization request.

[0105] Optionally, the downloaded resource is a Uniform Resource Locator (URL) resource; the release module 501 is further configured to:

[0106] If it is detected that the URL resource has changed, send a release request to the native side to call the interface class of the native side script system and release the native object according to the interface class.

[0107] Optionally, if the script system is initialized for the first time, the client further includes:

[0108] A callback module, configured to register a script callback after the script system is initialized.

[0109] Optionally, the client 500 further includes:

[0110] A first sending module, configured to send a drawing request to the script system, where the drawing request carries a drawing message;

[0111] A first receiving module, configured to receive callback information sent by the native side to complete the drawing processing of the script system; where the callback information is obtained by the native side sending the drawing message to the business script and calling a native method to implement the business logic process in the business script.

[0112] In an embodiment of the present invention, this implementation manner can achieve the generality of the game engine, support expansion and real-time hot update, and can improve the ability of the game engine development business. And this implementation manner uses a lightweight scripting language to implement the business logic, which is relatively easy to get started and has a short development cycle. In addition, this implementation manner can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0113] Figure 6 It is a schematic diagram of the modules of the native side in an embodiment of the present invention. Refer to Figure 6 and the native side 600 includes the following modules:

[0114] An execution module 601, configured to receive a release request sent by the client, execute the script system corresponding to the release request, and release the native object according to the script system;

[0115] An injection module 602, configured to receive an initialization request sent by a client when initializing a script system according to the latest downloaded resources, and inject a binding dependency of an external algorithm library during the initialization of the script system to initialize script resources.

[0116] Optionally, the native end 600 further includes:

[0117] A second receiving module, configured to receive a drawing request sent by a client, where the drawing request carries a drawing message;

[0118] A second sending module, configured to send the drawing message to a business script and call a native method to implement a business logic process within the business script;

[0119] A third sending module, configured to send callback information related to the business logic process to the client to complete the drawing process of the script system.

[0120] In an embodiment of the present invention, this implementation manner can achieve the generality of the game engine, support extension and real-time hot update, and can improve the ability of game engine development services. And this implementation manner uses a lightweight script language to implement business logic, which is relatively easy to get started and has a short development cycle. In addition, this implementation manner can be widely applied to various marketing activities and can be dynamically updated according to product requirements.

[0121] Figure 7 An exemplary system architecture 700 to which the software update method or software update device according to an embodiment of the present invention can be applied is shown.

[0122] As Figure 7 shown, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is used to provide a medium for a communication link between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0123] Users can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. The terminal devices 701, 702, 703 may include, but are not limited to, smart phones, tablet computers, laptop portable computers, and desktop computers, etc. The server 705 may be a server that provides various services.

[0124] It should be noted that the software update method provided by the embodiment of the present invention is generally executed by the server 705. Correspondingly, the software update device is generally disposed in the server 705.

[0125] It should be understood, Figure 7The numbers of the terminal devices, networks, and servers in [it] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.

[0126] Reference is made below to Figure 8 , which shows a schematic structural diagram of a computer system 800 of a terminal device suitable for implementing the embodiments of the present invention. Figure 8 The terminal device shown is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.

[0127] As Figure 8 shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage section 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0128] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read from it can be installed into the storage section 808 as needed.

[0129] Specifically, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above functions defined in the system of the present invention are executed.

[0130] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and the combination of blocks in a block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0132] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or may exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: if a download resource change is detected, sending a release request to the native side to call the script system of the native side and release native objects according to the script system; sending a download request to the server and receiving the latest download resource corresponding to the download request; sending an initialization request for the native side to perform initialization processing on the script system according to the initialization request.

[0133] According to the technical solution of the embodiment of the present invention, the business logic can be flexibly changed or some business processes can be added, and the purpose of supporting function expansion and real-time hot update can be achieved.

[0134] The above specific embodiments do not limit the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A software update method, characterized in that, The software update method includes: If a download resource change is detected, a release request is sent to the native side to call the script system of the native side and release native objects according to the script system; the native side refers to the application's database, and the native objects at least include: the script system, business scripts, and memory and video memory resources related to the native side; Send a download request to the server and receive the latest download resource corresponding to the download request; Send an initialization request for the native side to perform initialization processing on the script system according to the initialization request; performing initialization processing on the script system includes: calling the create application method provided by the script application factory interface class of the native side to create and initialize the script system, so as to load and initialize script resources related to the business during the initialization process; Send a drawing request to the script system, and the drawing request carries a drawing message; Receive the callback information sent by the native side to complete the drawing processing of the script system; wherein the callback information is obtained by the native side sending the drawing message to the business script and calling the native method to implement the business logic process in the business script.

2. The method according to claim 1, wherein The download resource is a Uniform Resource Locator (URL) resource; The step of if a download resource change is detected, sending a release request to the native side to call the script system of the native side and release native objects according to the script system includes: If a URL resource change is detected, a release request is sent to the native side to call the interface class of the native side script system and release native objects according to the interface class.

3. The method according to claim 1, characterized in that, If initializing the script system for the first time, the method further includes: After initializing the script system, register a script callback.

4. A software update method, characterized in that, The software update method includes: Receive a release request sent by the client, execute the script system corresponding to the release request, and release native objects according to the script system; the native objects at least include: the script system, business scripts, and memory and video memory resources related to the native side; Receive an initialization request sent by the client when initializing the script system according to the latest download resource, and inject the binding dependency of the external algorithm library during the initialization process of the script system to initialize the script resources; performing initialization processing on the script system includes: calling the create application method provided by the script application factory interface class of the native side to create and initialize the script system, so as to load and initialize script resources related to the business during the initialization process; Receive a drawing request sent by the client, and the drawing request carries a drawing message; Send the drawing message to the business script and call the native method to implement the business logic process in the business script; Send callback information related to the business logic process to the client to complete the drawing processing of the script system.

5. A client, characterized in that, It includes: A release module for, if a download resource change is detected, sending a release request to the native side to call the script system of the native side and release native objects according to the script system; The native side refers to the application's database, and the native objects at least include: the script system, business scripts, and memory and video memory resources related to the native side; A download module, configured to send a download request to a server and receive the latest downloaded resource corresponding to the download request; An initialization module, configured to send an initialization request for the native side to perform initialization processing on the script system according to the initialization request; the initialization module is further configured to: call the create application method provided by the script application factory interface class of the native side to create and initialize the script system, so as to load and initialize the script resources related to the business during the initialization process; A first sending module, configured to send a drawing request to the script system, where the drawing request carries a drawing message; A first receiving module, configured to receive the callback information sent by the native side to complete the drawing processing of the script system; wherein the callback information is obtained by the native side sending the drawing message to the business script and calling the native method to implement the business logic process in the business script.

6. A native side, characterized in that, It includes: An execution module, configured to receive a release request sent by a client, execute the script system corresponding to the release request, and release the native object according to the script system; The native side refers to the database of the application, and the native object at least includes: a script system, a business script, and the memory and video memory resources related to the native side; An injection module, configured to receive the initialization request sent by the client during the initialization process of the script system according to the latest downloaded resource, inject the binding dependencies of the external algorithm library during the initialization process of the script system to initialize the script resources; performing initialization processing on the script system includes: calling the create application method provided by the script application factory interface class of the native side to create and initialize the script system, so as to load and initialize the script resources related to the business during the initialization process; A second receiving module, configured to receive a drawing request sent by a client, where the drawing request carries a drawing message; A second sending module, configured to send the drawing message to the business script and call the native method to implement the business logic process in the business script; A third sending module, configured to send callback information related to the business logic process to the client to complete the drawing processing of the script system.

7. A software update system, characterized in that, It includes: A client, a native side, and a server; Wherein the native side at least includes: a script application factory interface class, and the script application factory interface class is responsible for the creation, destruction, initialization of the script system, and the client sending messages to the script system.

8. The software update system according to claim 7, wherein The native side further includes: A script application callback interface class, configured to be responsible for the information communication between the script system and the client.

9. The software update system according to claim 7 or 8, characterized in that, The native side further includes: A binding loading class, configured to be responsible for injecting the interfaces in the external algorithm library into the script system framework; A binding management class, configured to be responsible for managing the instances inherited from the binding loading class; An interface binding file library, configured to store the binding files corresponding to the interfaces in the external algorithm library.

10. An electronic device, characterized in that, It includes: One or more processors; A storage device, configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-4.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Page construction method, device and equipment, and storage medium

    CN108776592A