Unity-based cross-platform dynamic updating method and system
Through the cross-platform dynamic update method based on Unity, using Lua code to achieve dynamic update of applications, solving the problem that cross-platform applications cannot be flexibly updated and repaired in the existing technology, and achieving flexible, safe and efficient application updates and repairs.
Patent Information
- Application Number
- CN202411781864.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology cannot flexibly implement the update and repair of cross-platform applications, especially when problems occur in the underlying code, it cannot be effectively updated and repaired.
Adopt a cross-platform dynamic update method based on Unity, create script files, update logic and resource files through Lua code, package them into update packages, and dynamic updates are carried out through the server, supporting resource updates, resource deletion and new resource downloads.
It realizes flexible updates and repairs of cross-platform applications, avoids uninstalling and reinstalling applications, reduces the risks of data loss and user churn, and supports the use of multiple environments and dynamic update address changes.
Smart Images

Figure CN119645460A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more specifically, to a cross-platform dynamic update method and system based on Unity. Background Art
[0002] Currently, most of the cross-platform dynamic update solutions of the Unity engine on the market use a combination of Lua and C#. This solution only performs hot updates on business logic and application content. Generally, dynamic loading is achieved by writing C# code. If there is a problem with the C# code, it can only be solved by hotfixing or recompiling the update package. However, hotfix does not support static constructors, and cannot hot-patch the C# system library, making it impossible to flexibly update and repair the code. Summary of the invention
[0003] In order to solve at least one of the above-mentioned defects, the present invention application proposes a cross-platform dynamic update method and system based on Unity, which is used to solve the problem that the prior art cannot flexibly implement cross-platform application updates.
[0004] According to a first aspect of the present application, a cross-platform dynamic update method based on Unity is provided, the method being used on a development end, comprising:
[0005] Obtaining update information corresponding to the application;
[0006] Creating a script file, update logic and resource file corresponding to the update information based on Lua code;
[0007] The script file, the update logic and the resource file are packaged into an update package of the application, and the update package is uploaded to a server, wherein the server is pre-configured with information through a configuration table so that the application end connects to the server through the configured information to update the application.
[0008] Preferably, the update logic includes at least one or more of resource update, resource deletion and new resource download;
[0009] Preferably, the script file saves the version number of the update package, the number of resource files and attribute information of each resource file;
[0010] and / or,
[0011] The configuration table at least includes server ID, server IP address, server IP port, server usage environment and service information.
[0012] Preferably, the resource file attribute information includes the size, relative path, name and MD5 value of the resource file.
[0013] Preferably, the method further comprises an application updating step for the application end, the application updating step comprising:
[0014] Get the version number of the local application;
[0015] Obtain the configuration table, connect to the corresponding server through the configuration table, obtain the update package corresponding to the local application from the corresponding server, and obtain the corresponding script file from the update package;
[0016] Obtaining the version number of the update package from the script file;
[0017] Compare the version number of the update package in the script file with the version number of the local application, if they are the same, skip the dynamic update, if they are different, perform the dynamic update;
[0018] The dynamically updating the local application includes updating the update logic of the local application and / or updating the files of the local application based on the update logic.
[0019] Preferably, dynamically updating the local application using the update package includes:
[0020] Obtaining the update logic in the update package, and obtaining the corresponding number of resource files and attribute information of each resource file from the script file of the update package;
[0021] Get the update logic, file quantity and file attribute information of the local application;
[0022] Comparing the update logic of the update package with the update logic of the local application, and comparing the number of resource files and resource file attribute information in the script file with the number of files and file attribute information of the local application to obtain update requirements;
[0023] The update logic in the update package is called to update the local application based on the update requirement.
[0024] Preferably, obtaining the update requirement specifically includes:
[0025] Compare the update logic of the update package with the update logic of the local application to see if they are consistent, and if not, obtain the update logic to be updated in the local application;
[0026] Compare the relative paths, names and MD5 values of the resource files in the script file and the files in the local application to see if they are consistent, and obtain the files to be updated and the redundant files in the local application, as well as the new resource files in the update package according to the inconsistency;
[0027] The obtained update logic to be updated, files to be updated, redundant files and new resource files in the update package are used as the update requirements.
[0028] Preferably, calling the update logic in the update package to update the resources of the local application based on the update requirement specifically includes:
[0029] Updating the local application according to the update logic to be updated so that the update logic in the local application is consistent with the update logic in the update package;
[0030] And / or, resource update, updating the to-be-updated file in the local application to a corresponding resource file under the same relative path in the update package;
[0031] and / or, resource deletion, deleting redundant files in the local application;
[0032] And / or, new resource downloading: downloading the new resource files in the update package to the corresponding relative path in the local application.
[0033] Preferably, the method further comprises verifying the updated local application, specifically comprising:
[0034] Compare the number and size of the files of the updated local application with the corresponding resource files in the update package to see if they are consistent, and check whether the corresponding files exist under the corresponding relative path of the updated application;
[0035] If they are consistent, updating the version number of the local application to the version number of the update package;
[0036] Disable the update logic to complete the dynamic update.
[0037] According to a second aspect of the present application, a cross-platform dynamic update method system based on Unity is provided, the system is used for the development end to update the application, the system comprises:
[0038] An acquisition module, used to acquire update information corresponding to the application;
[0039] A creation module is used to create a script file, update logic and resource file corresponding to the update information based on Lua code;
[0040] An upload module is used to package the script file, the update logic and the resource file into an update package of the application, and upload the update package to a server, wherein the server is pre-configured with information through a configuration table so that the application end connects to the server through the configured information to update the application.
[0041] According to a third aspect of the present application, an electronic device is provided, including:
[0042] a memory for storing one or more computer programs;
[0043] A processor, when the one or more computer programs are executed by the processor, implements the Unity-based cross-platform dynamic update method.
[0044] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the Unity-based cross-platform dynamic update method when executed.
[0045] Based on any of the above aspects, the embodiment of the present application provides a cross-platform dynamic update method based on Unity, which uses Lua code instead of C# code to realize dynamic update of cross-platform application content, avoiding the situation of uninstalling and reinstalling the application, and also solving the corresponding data loss risk and user loss risk; further, it supports updating and repairing the underlying code when problems occur in the underlying code.
[0046] In addition, it also supports the ability to dynamically change the update address to prevent abnormal situations such as server downtime, crash, power outage, etc. during downloading. It also supports the use of multiple environments. By modifying the configuration table file, it can realize the ability to switch freely and quickly between multiple environments such as test environment, development environment, and production environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 A schematic application scenario diagram of a cross-platform dynamic update method based on Unity provided in this embodiment.
[0049] Figure 2 A process of a cross-platform dynamic update method based on Unity provided in this embodiment Figure 1 .
[0050] Figure 3 A process of a cross-platform dynamic update method based on Unity provided in this embodiment Figure 2 .
[0051] Figure 4 A process of a cross-platform dynamic update method based on Unity provided in this embodiment Figure 3 .
[0052] Figure 5 A schematic diagram of a cross-platform dynamic update system module based on Unity provided in this embodiment.
[0053] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this embodiment.
[0054] Icons: 100, server; 200, terminal; 501, acquisition module; 502, creation module; 503, upload module; 710, electronic device; 711, memory; 712, processor; 713, communication module; 714, input / output interface; 715, bus. DETAILED DESCRIPTION
[0055] The drawings of this application are only used for illustrative purposes and should not be construed as limiting the present application. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.
[0056] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] At present, most cross-platform application dynamic update solutions use Lua and C# to implement their respective functions. However, this solution only performs hot updates on business logic and application content. When the underlying code changes or problems occur, the code cannot be updated and repaired flexibly.
[0059] For example, a schematic diagram of an application scenario of a cross-platform dynamic update method based on Unity is provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes at least a server 100 and a terminal 200 that can communicate with the server 100. The server 100 has functions such as data reception, data processing, and data storage; the terminal device 200 has functions such as data reception, data processing, and also supports functions such as downloading data from the server 100.
[0060] It is understandable that the server 100 can be an independent electronic device or a cluster of multiple electronic devices; the terminal 200 can be a smart phone terminal, a personal computer, a tablet computer, a car terminal, etc., but is not limited thereto.
[0061] In an operative manner, the server 100 and the terminal 200 may respectively execute a cross-platform dynamic update method based on Unity provided in an embodiment of the present application, or, optionally, a cross-platform dynamic update method based on Unity provided in an embodiment of the present application is partially executed in the server 100 and partially executed in the terminal 200.
[0062] Example 1
[0063] On the one hand, if Figure 2 As shown, an embodiment of the present application provides a cross-platform dynamic update method based on Unity, which is used to update application content across platforms. The method includes application update steps for the development end, and the steps at least include:
[0064] S1. Obtain update information corresponding to the application;
[0065] S2. Create a script file, update logic and resource file corresponding to the update information based on Lua code;
[0066] S3. Packing the script file, the update logic and the resource file into an update package of the application, and uploading the update package to a server, wherein the server is pre-configured with information through a configuration table, so that the application end can connect to the server through the configured information to update the application.
[0067] In this embodiment, Lua code is used to replace C# code to realize dynamic update of cross-platform applications, and when errors occur in the underlying code, the code can be updated and repaired without repackaging the update package. In specific implementation, the development end obtains the update information corresponding to the application, uses Lua code to create script files, update logic and resource files corresponding to the update information, and packages the script files, update logic and resource files into an update package, and uploads the update package to the server, and creates a configuration table for the server to cooperate with the code to implement the server-related information of this patent. Since the script files, update logic and resource files are all implemented using Lua code, when the local application is subsequently updated using the update package, it only needs to compare the consistency to perform hot update on the local application, without considering that the hot update cannot be achieved due to different underlying codes.
[0068] In the specific implementation process, step S2 creates a script file, update logic and resource file corresponding to the update information based on Lua code.
[0069] In a preferred embodiment, the script file saves the version number of the update package, the number of resource files and the attribute information of each resource file, wherein the version number is the version number of the current version, which is exemplarily set to an integer greater than or equal to 0; the resource file attribute information includes the size, relative path, name and MD5 value of the resource file; the number of resource files records how many related resource files there are under the version number, which is a positive integer greater than or equal to 0; the resource file size records the total size of the resource files under the version number, which is used for subsequent calculation of update time and verification of update; the relative path and name record the name corresponding to the resource file and the relative path where the resource file is located; the MD5 value of the resource file is generated based on the MD5 algorithm, and the MD5 value is used to compare whether two or more files are consistent.
[0070] The update logic may include resource update, resource deletion and new resource download. Furthermore, when the C# code is replaced by Lua code, when an error occurs in the replaced part of the code or the update logic needs to be updated, the corresponding Lua code can be directly updated without rebuilding a new update logic and update package.
[0071] The resource file is used to replace the corresponding resource in the local application during the update, or is downloaded to the local application as new content.
[0072] In this embodiment, the script file, update logic and resource file are packaged into an update package, and the update package is uploaded to the server so that the application terminal can obtain the version information of the latest update package and download the resource files in the latest update package to update the local application.
[0073] In a preferred embodiment, a configuration table is created for the server in advance, and the configuration table includes at least the ID, the IP address of the server, the IP port of the server, the usage environment of the server, and the service information. These fields are configured to cooperate with the code to implement the server-related information of this patent.
[0074] Based on the created configuration table, the embodiment of the present application supports dynamic change of update address to prevent abnormal situations such as server downtime, crash, power outage, etc. Furthermore, it also supports the use of multiple environments, and realizes free and fast switching of multiple environments such as test environment, development environment, and production environment by modifying the configuration table file.
[0075] In this embodiment, the method further includes an application update step for the application end, the steps comprising:
[0076] A1. Get the version number of the local application;
[0077] A2. Obtain the configuration table, connect to the corresponding server through the configuration table, obtain the update package corresponding to the local application from the corresponding server, and obtain the corresponding script file from the update package;
[0078] A3. Obtain the update package version number from the script file;
[0079] A4. Compare the update package version number in the script file with the version number of the local application. If they are the same, skip the dynamic update. If they are different, dynamically update the local application using the update package.
[0080] In a preferred implementation, the dynamically updating the local application includes updating the update logic of the local application and / or updating the files of the local application.
[0081] In a specific implementation, when the local application is opened on the application side, the application side obtains the version number of the local application, which is used to compare with the version number in the update package in the server to confirm whether the local application needs to be updated. When the version number of the local application is the same as the version number of the update package, the dynamic update process is skipped and the local application continues to be opened; when the version number of the local application is different from the version number of the update package, the local application is dynamically updated using the update package, which specifically includes:
[0082] Z1. Obtain the update logic in the update package, and obtain the number of resource files and attribute information of each resource file from the script file corresponding to the local application;
[0083] Z2. Obtain the update logic, file quantity and file attribute information of the local application;
[0084] Z3. Compare the update logic of the update package with the update logic of the local application, and compare the number of resource files and resource file attribute information in the script file with the number of files and file attribute information of the local application to obtain update requirements;
[0085] Z4. Call the update logic in the update package to update the local application based on the update requirement.
[0086] In a preferred implementation, in step Z1, the application end obtains the version number of the update package, the number of the resource files and the resource file attribute information from the script file based on the script file obtained in step A2, and further obtains the update logic in the update package;
[0087] In step Z2, the application side obtains the update logic, file quantity and file attribute information of the local application;
[0088] The specific process of the comparison in step Z3 includes:
[0089] The application side compares whether the update logic of the local application is consistent with the update logic of the update package, and if they are inconsistent, obtains the update logic to be updated in the local application;
[0090] and / or,
[0091] The application side compares the relative path, name and MD5 value of the resource file in the script file and the file in the local application to obtain the files to be updated and redundant files in the local application, as well as the new resource files in the update package. In specific implementation, the update status of the file is obtained by comparing the relative path, name and MD5 value of the corresponding update file in the local application and the update package. Specifically, if a resource file exists in both the local application and the update package, and has the same relative path and name but different MD5 values, then the file is a file to be updated; if a file exists in the local application, but there is no corresponding file under the same path of the update package, then the file is a redundant file; if a resource file exists in the update package, but there is no corresponding file under the same path of the local application, then the file is a new resource file.
[0092] The obtained update logic to be updated, files to be updated, redundant files and new resource files in the update package are used as the update requirements.
[0093] In step Z4, the update logic in the update package is called to update the local application based on the update requirement. In the specific implementation,
[0094] Updating the local application according to the update logic to be updated so that the update logic to be updated in the local application is consistent with the update logic in the update package;
[0095] And / or, resource update, updating the to-be-updated file in the local application to a corresponding resource file under the same relative path in the update package;
[0096] and / or, resource deletion, deleting redundant files in the local application;
[0097] And / or, new resource downloading: downloading the new resource files in the latest update package to the corresponding relative path in the local application.
[0098] In a preferred implementation, the embodiment of the present application further verifies the updated local application, specifically including:
[0099] Compare the number and size of the corresponding resource files of the updated local application and the update package to see if they are consistent, and check whether the corresponding files exist under the corresponding relative path of the updated application;
[0100] If they are consistent, updating the version number of the local application to the version number of the update package;
[0101] And disable the update logic to complete the dynamic update.
[0102] During specific implementation, the comparison method with step Z3 can be adopted.
[0103] If one or more of the files to be updated, the redundant files and the new resource files are obtained through comparison, the update logic is called again to update the files that have not been updated.
[0104] Furthermore, an upper limit on the number of updates is preset. When the upper limit on the number of updates is reached and the step Z3 compares and obtains one or more of the files to be updated, redundant files and new resource files, the application end reminds that the update has failed and displays the specific reasons for the update failure. The specific reasons include at least network abnormalities, server abnormalities and insufficient local space.
[0105] If the comparison result shows that the update file, redundant file or new resource file does not exist, the calling of the update logic is stopped and the dynamic update is completed.
[0106] On the other hand, Figure 5 This embodiment provides a cross-platform dynamic update system based on Unity, including an acquisition module 501, an upload module 502 and a configuration module 503.
[0107] The acquisition module 501 is used to acquire the update information corresponding to the application.
[0108] In this embodiment, the acquisition module 501 may be used to execute step S1 of the first aspect of the embodiment. For a detailed description of the acquisition module 501 , reference may be made to the description of step S1 .
[0109] A creation module 502 is used to create a script file, update logic and update file corresponding to the update information based on Lua code,
[0110] In this embodiment, the creation module 502 may be used to execute step S2 of the first aspect of the embodiment. For a detailed description of the creation module 502 , reference may be made to the description of step S2 .
[0111] The upload module 503 is used to package the script file, the update logic and the resource file into an update package of the application, and upload the update package to the server, wherein the server is configured with information in advance through a configuration table so that the application end can connect to the server through the configured information to update the application.
[0112] In this embodiment, the upload module 503 may be used to execute step S3 described in the first aspect of the embodiment. For a detailed description of the upload module 503 , reference may be made to the description of step S3 .
[0113] It can be understood that the above-mentioned system embodiment and the above-mentioned method embodiment can correspond to each other, and similar descriptions of the system embodiment can refer to the method embodiment. A cross-platform dynamic update system based on Unity provided in an embodiment of the present application can execute a cross-platform dynamic update method based on Unity provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method. The cross-platform dynamic update method based on Unity can be implemented in the form of hardware, can be implemented by instructions in the form of software, and can also be implemented by a combination of hardware and software modules.
[0114] Optionally, the software module may be located in a random access memory, a read-only memory, a programmable read-only memory, a flash memory, an electrically erasable programmable memory, a register, or other storage media. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in combination with its hardware.
[0115] The present application embodiment provides an electronic device 710, whose structure is as follows: Figure 6 The electronic device 710 may be Figure 1 The server 100 or the terminal 200 is shown.
[0116] like Figure 6 As shown, the electronic device 710 includes a memory 711, a processor 712, a communication module 713 and an input / output interface 714, etc. Optionally, the memory 711, the processor 712, the communication module 713 and the input / output interface 714 can be connected and communicated through a bus 715.
[0117] The memory 711 is used to store one or more computer programs and transmit the code of the computer program to the processor 712; when the one or more computer programs are executed by the processor 711, a cross-platform dynamic update method based on Unity in an embodiment of the present application is implemented.
[0118] Optionally, the electronic device 710 can be connected to a network via a communication module 713 to communicate with other devices, such as a terminal or a server, through the network to achieve data interaction. The electronic device 710 can be various forms of digital computers, such as desktop computers, servers, workstations, mainframe computers or other types of computers. The electronic device 710 can also be various forms of mobile terminals, such as smart phones, tablet computers, wearable devices (such as helmets, glasses, watches, etc.) and other similar mobile terminals.
[0119] Optionally, the electronic device 710 can be connected to a required input / output device, such as a keyboard, a display device, etc., through the input / output interface 714. The electronic device 710 itself can have a display device, and can also be connected to other external display devices through the input / output interface 714. Optionally, a storage device, such as a hard disk, can be connected through the input / output interface 714, so that data in the electronic device 710 can be stored in the storage device, or data in the storage device can be read, and data in the storage device can also be stored in the memory 711.
[0120] It is understandable that the input / output interface 714 may be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 714 may be a component of the electronic device 710 or an external device connected to the electronic device 710 when needed.
[0121] Optionally, the memory 711 may be a volatile memory and / or a non-volatile memory, the volatile memory may be a random access memory, etc., and the non-volatile memory may be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory or a flash memory, etc.
[0122] Optionally, the computer program stored in the processor 711 may be divided into one or more modules, which are stored in the memory 711 and executed by the processor 712 to complete the method provided in the embodiment. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the computer program instruction segments are used to describe the execution process of the computer program in the electronic device 710.
[0123] Optionally, the processor 712 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 712 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various special artificial intelligence computing chips, various processors running machine learning model algorithms, and any appropriate controller, microcontroller, processor, etc. The processor 712 executes the various methods and processes of this embodiment, illustratively, such as a cross-platform dynamic update system based on Unity in an embodiment of the present application.
[0124] Optionally, the bus 715 may include a path for transmitting information. The bus 715 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. According to different functions, the bus 715 may be divided into an address bus, a data bus, a control bus, etc.
[0125] In an optional implementation, the embodiment of the present application further provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. Part or all of the computer program can be loaded and / or installed on the memory 711 of the electronic device 710. When the computer program is executed by the processor 712, one or more steps of a cross-platform dynamic update method based on Unity in the embodiment of the present application can be executed.
[0126] Optionally, the computer-readable storage medium may be a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or the like.
[0127] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A cross-platform dynamic update method based on Unity, characterized in that: The method includes an application update step for a development end; The application update steps on the development end include: Obtaining update information corresponding to the application; Creating a script file, update logic and resource file corresponding to the update information based on Lua code; The script file, the update logic and the resource file are packaged into an update package of the application, and the update package is uploaded to a server, wherein the server is pre-configured with information through a configuration table so that the application end connects to the server through the configured information to update the application.
2. A cross-platform dynamic update method based on Unity according to claim 1, characterized in that: The update logic includes at least one or more of resource update, resource deletion and new resource download.
3. A cross-platform dynamic update method based on Unity according to claim 1, characterized in that: The script file stores the version number of the update package, the number of resource files and attribute information of each resource file; and / or, The configuration table at least includes server ID, server IP address, server IP port, server usage environment and service information.
4. A cross-platform dynamic update method based on Unity according to claim 3, characterized in that: The resource file attribute information includes the size, relative path, name and MD5 value of the resource file.
5. The cross-platform dynamic update method based on Unity according to claim 4, characterized in that: The method further comprises an application updating step for the application end; The application updating step for the application end includes: Get the version number of the local application; Obtain the configuration table, connect to the corresponding server through the configuration table, obtain the update package corresponding to the local application from the corresponding server, and obtain the corresponding script file from the update package; Obtaining the version number of the update package from the script file; Comparing the version number of the update package in the script file with the version number of the local application, if they are the same, skipping the dynamic update, if they are different, dynamically updating the local application using the update package; The dynamically updating the local application includes updating the update logic of the local application and / or updating the files of the local application based on the update logic.
6. A cross-platform dynamic update method based on Unity according to claim 5, characterized in that: dynamically updating the local application using the update package, include, Obtaining the update logic in the update package, and obtaining the corresponding number of resource files and attribute information of each resource file from the script file of the update package; Get the update logic, file quantity and file attribute information of the local application; Comparing the update logic of the update package with the update logic of the local application, and comparing the number of resource files and resource file attribute information in the script file with the number of files and file attribute information of the local application to obtain update requirements; The update logic in the update package is called to update the local application based on the update requirement.
7. A cross-platform dynamic update method based on Unity according to claim 6, characterized in that: The update requirements specifically include: Compare the update logic of the update package with the update logic of the local application to see if they are consistent, and if not, obtain the update logic to be updated in the local application; Compare the relative paths, names and MD5 values of the resource files in the script file and the files in the local application to see if they are consistent, and obtain the files to be updated and redundant files in the local application, as well as the new resource files in the update package according to the inconsistency; The obtained update logic to be updated, files to be updated, redundant files and new resource files in the update package are used as the update requirements.
8. A cross-platform dynamic update method based on Unity according to claim 7, characterized in that: The calling of the update logic in the update package to update the local application based on the update requirement specifically includes: Updating the local application according to the update logic to be updated so that the update logic in the local application is consistent with the update logic in the update package; And / or, resource update, updating the to-be-updated file in the local application to a corresponding resource file under the same relative path in the update package; and / or, resource deletion, deleting redundant files in the local application; And / or, new resource downloading: downloading the new resource files in the update package to the corresponding relative path in the local application.
9. A cross-platform dynamic update method based on Unity according to any one of claims 6 to 8, characterized in that: The method further includes verifying the updated local application, specifically including: Compare the number and size of the files of the updated local application with the corresponding resource files in the update package to see if they are consistent, and check whether the corresponding files exist under the corresponding relative path of the updated local application; If they are consistent, updating the version number of the local application to the version number of the update package; Disable the update logic to complete the dynamic update.
10. A cross-platform dynamic update system based on Unity, characterized in that: The system is used for the development end to update the application, and the system includes: An acquisition module, used to acquire update information corresponding to the application; A creation module is used to create a script file, update logic and resource file corresponding to the update information based on Lua code; An upload module is used to package the script file, the update logic and the resource file into an update package of the application, and upload the update package to a server, wherein the server is pre-configured with information through a configuration table so that the application end connects to the server through the configured information to update the application.
Citation Information
Patent Citations
Virtual resource management method and system
CN106776012A
Lua-based hot update method for cross-platform application program
CN112181462A
Cross-platform data conversion method based on Lua script
CN118605875A
Hot update method and device for code, storage medium, processor and terminal
WO2019184687A1