Program updating method and device, equipment and storage medium thereof
By extracting and parsing the update files of WeChat applets, compiling and loading update scripts, combining database storage control and H5 page QR code record update information, the problem of lack of historical archives and version positioning of WeChat applet updates in the existing technology is solved. , realizes efficient updates and version management.
Patent Information
- Application Number
- CN202411550508.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
The existing WeChat mini program update method lacks historical archives for previewing the QR code, which is not conducive to viewing historical version information. When there is a problem with the program, it is impossible to locate the problem code version in time.
Provides a program update method, which can extract the target version file from the preset file version library by obtaining update instructions, parse the file to obtain the update script, compile the script, and use the WeChat applet development tool to load and upload the compiled code to complete the update. At the same time, connect to the database for storage control, record update operations, and generate the H5 page QR code to save the update record.
It realizes efficient updates of WeChat applets, records update history and version information, facilitates problem positioning and version management, and improves the reasonable separation of update efficiency and data.
Smart Images

Figure CN119473355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of R&D and design technology, and is applied to WeChat mini-program update scenarios, and in particular to a program update method, device, equipment and storage medium thereof. Background Art
[0002] The traditional way to update WeChat Mini Programs is to download code from a remote warehouse to the local according to the development environment, install project dependencies, use front-end script commands, compile the code, use the WeChat Mini Program development tool to load the code, and use the WeChat Mini Program tool to upload it to WeChat.
[0003] This method lacks the historical archive of the preview QR code, which is not conducive to viewing historical version information. Moreover, when a problem occurs in the program, it is impossible to locate in time which version of the code has the problem. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a program update method, device, equipment and storage medium thereof to solve the problem that the existing WeChat mini-program update method lacks historical archiving of preview QR codes, is not conducive to viewing historical version information, and cannot locate the problem code version in time when a problem occurs in the program.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a program update method, which adopts the following technical solution:
[0006] A program updating method comprises the following steps:
[0007] Obtaining an update instruction for a target program, wherein the target program includes a WeChat applet;
[0008] According to the update instruction, extract the target version file from the preset file version library;
[0009] Parsing the target version file to obtain an update script for the target program;
[0010] Compile the update script to generate compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program, wherein the target program development tool includes a preset WeChat applet development tool.
[0011] Furthermore, before executing the step of extracting the target version file from a preset file version library according to the update instruction, the method further includes:
[0012] Connecting to a preset database, wherein the preset database includes a file version library and an update record database;
[0013] According to a preset storage control tool, the file version library is controlled to store only updated version files used for program updates, and the update record database is controlled to store only update record data, wherein the updated version files include updated version files uploaded respectively through a program development branch and a program pre-release branch.
[0014] Furthermore, the step of extracting the target version file from a preset file version library according to the update instruction specifically includes:
[0015] Parsing the update instruction to obtain version number information carried in the update instruction, wherein the carried version number information refers to version number information of the target version file;
[0016] Based on the version number information, a file search is performed from the file version library to extract the target version file, wherein the target version file refers to an update file of the target program.
[0017] Further, after executing the step of parsing the target version file to obtain the update script of the target program, the method further includes:
[0018] Compiling the update script, and generating an update preview result corresponding to the update script in a target preview tool, wherein the target preview tool is used to integrate the update preview result into a preview QR code format;
[0019] By comparing, identifying whether the update preview result is consistent with the preset update requirement result;
[0020] If the update preview result is consistent with the update requirement result, compile the update script to generate the compiled code;
[0021] If the update preview result is inconsistent with the update requirement result, a prompt message is sent to a preset update monitoring terminal.
[0022] Further, after executing the step of using the target program development tool to load and upload the compiled code to complete the update of the target program, the method further includes:
[0023] Obtaining the extracted warehouse information of the target version file, wherein the extracted warehouse information includes warehouse time information;
[0024] Obtaining loading and uploading information of the compiled code, wherein the loading and uploading information includes loading and uploading time information;
[0025] The version number information, the outgoing time information and the loading and uploading time information of the target version file are sent to the update record database to record the update operation.
[0026] Furthermore, the step of sending the version number information, the outgoing time information and the loading and uploading time information of the target version file to the update record database to update the operation record specifically includes:
[0027] The H5 page QR code generation method is adopted to generate the H5 page QR code for the version number information, the outgoing time information and the loading and uploading time information of the target version file;
[0028] The generated H5 page QR code is sent to the update record database as update operation record information.
[0029] Furthermore, a one-click code generation tool is used to parse the target version file and compile the update script, wherein the one-click code generation tool includes a code generation tool based on Node.js.
[0030] In order to solve the above technical problems, the embodiment of the present application also provides a program updating device, which adopts the following technical solution:
[0031] A program updating device, comprising:
[0032] An update instruction acquisition module, used to acquire an update instruction of a target program, wherein the target program includes a WeChat applet;
[0033] A target version file extraction module is used to extract the target version file from a preset file version library according to the update instruction;
[0034] An update script obtaining module, used for parsing the target version file to obtain an update script for the target program;
[0035] The script compilation and upload module is used to compile the update script, generate the compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program, wherein the target program development tool includes a preset WeChat applet development tool.
[0036] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0037] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the program updating method described above when executing the computer-readable instructions.
[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0039] A computer-readable storage medium stores computer-readable instructions, which implement the steps of the program updating method described above when executed by a processor.
[0040] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0041] The program update method described in the embodiment of the present application is to obtain the update instruction of the target program; extract the target version file from the preset file version library according to the update instruction; parse the target version file to obtain the update script of the target program; compile the update script to generate the compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are 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.
[0043] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0044] Figure 2 is a flowchart of an embodiment of a program updating method according to the present application;
[0045] Figure 3 is a flowchart of a specific embodiment of storage control in the program update method described in this application;
[0046] Figure 4 yes Figure 2 A flowchart of a specific embodiment of step 202 is shown;
[0047] Figure 5 is a flowchart of a specific embodiment of performing update preview in the program update method described in the present application;
[0048] Figure 6is a flowchart of a specific embodiment of recording update operations in the program update method described in the present application;
[0049] Figure 7 yes Figure 6 A flowchart of a specific embodiment of step 603 is shown;
[0050] Figure 8 is a schematic structural diagram of an embodiment of a program updating device according to the present application;
[0051] Fig. 9 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0053] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0054] 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 accompanying drawings.
[0055] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0056] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0057] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0058] The server 103 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal device 101 .
[0059] It should be noted that the program updating method provided in the embodiment of the present application is generally executed by a terminal device, and accordingly, the program updating apparatus is generally arranged in the terminal device.
[0060] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0061] Continue to refer Figure 2 , shows a flow chart of an embodiment of a program updating method according to the present application. The program updating method comprises the following steps:
[0062] Step 201, obtaining an update instruction of a target program.
[0063] Wherein, the target program includes a WeChat applet.
[0064] In this embodiment, the update instruction of the target program can be obtained by receiving the WeChat applet update instruction sent by the user end through the instruction receiving method, and its purpose is to update the WeChat applet to the latest or specified version released by the server end through the user end request; it can also be obtained by obtaining the WeChat applet update instruction sent by the server end through the instruction receiving method, and its purpose is to uniformly release and deploy the WeChat applet into a certain service version through the server end's update request for subsequent updates by the user end.
[0065] Step 202: extract the target version file from a preset file version library according to the update instruction.
[0066] In this embodiment, it can be understood that the preset file version library pre-stores various patch version files of the WeChat applet, each patch version file corresponds to a different version number, and different patch version files can be screened for updating by specifying the version number, or multiple patch version files can be screened for updating by specifying the version number interval; of course, it can also include an update from a test version to a formal version. At this time, the pre-stored WeChat applet formal version file is extracted from the preset file version library to realize the update from the test version to the formal version.
[0067] Step 203: Parse the target version file to obtain an update script for the target program.
[0068] Specifically, the target version file is parsed to obtain the update script of the target program. It can be understood that by parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program.
[0069] By obtaining the update script of the target program, the target program can be updated efficiently in the future.
[0070] Step 204, compile the update script to generate compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program.
[0071] Among them, the target program development tool includes a preset WeChat applet development tool.
[0072] Specifically, the compiled code is released and deployed to WeChat by compiling first and then loading and uploading, thereby realizing the update operation of the target program.
[0073] In this embodiment, the target program is updated by obtaining the update instruction of the target program; extracting the target version file from the preset file version library according to the update instruction; parsing the target version file to obtain the update script of the target program; compiling the update script to generate the compiled code corresponding to the update script, and using the target program development tool to load and upload the compiled code to complete the update of the target program. The target version file is parsed to obtain the difference code between the target version file and the version file in use, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program.
[0074] Continue to refer Figure 3 In some optional implementations, a step of performing storage control is also included before step 202. Figure 3 1 is a flowchart of a specific embodiment of storage control in the program update method described in the present application, comprising the following steps:
[0075] Step 301, connecting to a preset database, wherein the preset database includes a file version library and an update record database;
[0076] Step 302, according to a preset storage control tool, controls the file version library to only store updated version files used for program updates, and controls the update record database to only store update record data, wherein the updated version files include updated version files uploaded respectively through the program development branch and the program pre-release branch.
[0077] Specifically, the program development branch includes a develop branch, and the program pre-release branch includes a release branch.
[0078] By performing storage control in the program update method, it is achieved that the file version library only stores the updated version files used for program updates, and the update record database only stores the update record data, which not only facilitates the extraction and call of the updated version files during subsequent version updates, but also facilitates the subsequent review of the update record data, thereby achieving reasonable separation of storage data.
[0079] Continue to refer Figure 4 , Figure 4 yes Figure 2 The flowchart of a specific embodiment of step 202 shown includes the following steps:
[0080] Step 401, parsing the update instruction to obtain version number information carried in the update instruction, wherein the carried version number information refers to the version number information of the target version file;
[0081] Specifically, the version number information carried in the update instruction can be a specified version number information or a specified version number range; if it is a specified version number information, it should be understood that the target version file is the patch version file or update version file corresponding to the specified version number information; if it is a specified version number range, it should be understood that the target version file is a series of continuous patch version files, and the version numbers of the series of continuous patch version files correspond to the version numbers in the version number range.
[0082] Step 402: Based on the version number information, perform a file search from the file version library to extract the target version file, wherein the target version file refers to an update file of the target program.
[0083] Specifically, it can be understood that when storing different patch version files in the file version library, a storage address mapping relationship between the version number and the patch version file is provided to the external extraction component, that is, the storage address of the corresponding patch version file can be obtained through the version number, and then the patch version file can be extracted according to the storage address.
[0084] In this embodiment, according to the update instruction, the target version file is extracted from a preset file version library, so that the target program can be updated according to the target version file later.
[0085] Continue to refer Figure 5 In some optional implementations, after step 203, a step of performing update preview is also included. Figure 5 This is a flowchart of a specific embodiment of performing update preview in the program update method described in this application, including the following steps:
[0086] Step 501, compile the update script, and generate an update preview result corresponding to the update script in a target preview tool, wherein the target preview tool is used to integrate the update preview result into a preview QR code format;
[0087] By generating an update preview result corresponding to the update script in the target preview tool, before the official update, the update preview method can be used to identify whether the subsequent official update can achieve the expected update result, and update errors and deficiencies can be discovered as soon as possible to facilitate subsequent timely adjustments.
[0088] Step 502, identifying whether the update preview result is consistent with the preset update requirement result by comparison;
[0089] Step 503: If the update preview result is consistent with the update requirement result, compile the update script to generate the compiled code;
[0090] Step 504: If the update preview result is inconsistent with the update request result, a prompt message is sent to a preset update monitoring terminal.
[0091] Specifically, if the update preview result is inconsistent with the update requirement result, a prompt message is sent to a preset update monitoring terminal, which can not only promptly remind the update monitoring terminal to perform update defect screening, but also promptly send a remedial reminder to the problem handling terminal.
[0092] By performing update preview in the program update method, it is possible to perform automatic update when the update preview result is consistent with the update requirement result, and it is also possible to promptly remind the update monitoring end to perform update defect screening and send remedial reminders to the problem handling end when the update preview result is inconsistent with the update requirement result.
[0093] Continue to refer Figure 6 In some optional implementations, after step 204, a step of updating the operation record is also included. Figure 6 This is a flowchart of a specific embodiment of recording update operations in the program update method described in the present application, comprising the following steps:
[0094] Step 601, obtaining the extracted information of the target version file, wherein the extracted information includes the time of the extraction;
[0095] Step 602, obtaining the loading and uploading information of the compiled code, wherein the loading and uploading information includes the loading and uploading time information;
[0096] Step 603, the version number information, the outgoing time information and the loading and uploading time information of the target version file are sent to the update record database to record the update operation.
[0097] By recording the update operation in the program update method, it is not only convenient to trace back the program update in the future, but also convenient to screen out the directly responsible personnel according to the update operation record for remedial treatment when an operation problem occurs in the target program, which is beneficial to the subsequent maintenance and management of the target program.
[0098] In this embodiment, before executing the step of sending the version number information, the release time information, and the loading and uploading time information of the target version file to the update record database to record the update operation, that is, before executing step 603, the method further includes: if the target program causes a display page change after the update, obtaining display page screenshots before and after the update, and storing the display page screenshots before and after the update in the update record database. Figure 1 And sent to the update record database.
[0099] Continue to refer Figure 7 , Figure 7 yes Figure 6 The flowchart of a specific embodiment of step 603 shown includes the following steps:
[0100] Step 701, using an H5 page QR code generation method to generate an H5 page QR code for the version number information, release time information, and loading and uploading time information of the target version file;
[0101] Step 702: Send the generated H5 page QR code as update operation record information to the update record database.
[0102] In this embodiment, before executing the step of sending the generated H5 page QR code as update operation record information to the update record database, that is, before executing step 702, the method also includes: obtaining the storage address information of the display page screenshots before and after the update in the update record database; and constructing a mapping relationship between the storage address information and the H5 page QR code.
[0103] By generating an H5 page QR code, the version number information, release time information and loading and upload time information of the target version file can be displayed in combination with the H5 page QR code, and the display page changes before and after the update can be identified according to the H5 page QR code.
[0104] In this embodiment, in step 203 and step 204, a one-click code generation tool may be used to parse the target version file and compile the update script, wherein the one-click code generation tool includes a code generation tool based on Node.js.
[0105] By using a Node.js-based code generation tool to parse the target version file and compile the update script, one-click update script processing is achieved, thereby improving the update efficiency of the target program.
[0106] The present application obtains the update instruction of the target program; extracts the target version file from the preset file version library according to the update instruction; parses the target version file to obtain the update script of the target program; compiles the update script to generate the compiled code corresponding to the update script, and uses the target program development tool to load and upload the compiled code to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program. At the same time, storage control is performed in the program update method, so that the file version library only stores the update version files used for program updates, and the update record database only stores the update record data, which is convenient for the extraction and call of the update version files during subsequent version updates, and also convenient for the subsequent review of the update record data, thereby achieving reasonable separation of storage data; an update preview result corresponding to the update script is generated in the target preview tool, so that before the formal update, the update preview method can be used to identify whether the subsequent formal update can achieve the expected update result, and update errors and deficiencies can be discovered as soon as possible to facilitate subsequent timely adjustments; a one-click update script processing tool is used to improve the update efficiency of the target program.
[0107] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0108] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0109] In the embodiment of the present application, the update instruction of the target program is obtained; according to the update instruction, the target version file is extracted from the preset file version library; the target version file is parsed to obtain the update script of the target program; the update script is compiled to generate the compiled code corresponding to the update script, and the compiled code is loaded and uploaded by the target program development tool to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program. At the same time, storage control is performed in the program update method, so that the file version library only stores the update version files used for program updates, and the update record database only stores the update record data, which is convenient for the extraction and call of the update version files during subsequent version updates, and also convenient for the subsequent review of the update record data, thereby achieving reasonable separation of storage data; an update preview result corresponding to the update script is generated in the target preview tool, so that before the formal update, the update preview method can be used to identify whether the subsequent formal update can achieve the expected update result, and update errors and deficiencies can be discovered as soon as possible to facilitate subsequent timely adjustments; a one-click update script processing tool is used to improve the update efficiency of the target program.
[0110] Further references Figure 8 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a program updating device, and the embodiment of the device is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0111] like Figure 8 As shown, the program updating device 800 described in this embodiment includes: an update instruction acquisition module 801, a target version file extraction module 802, an update script acquisition module 803 and a script compilation and upload module 804. Among them:
[0112] An update instruction acquisition module 801 is used to acquire an update instruction of a target program, wherein the target program includes a WeChat applet;
[0113] The target version file extraction module 802 is used to extract the target version file from the preset file version library according to the update instruction;
[0114] An update script obtaining module 803 is used to parse the target version file to obtain an update script for the target program;
[0115] The script compilation and upload module 804 is used to compile the update script, generate the compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program, wherein the target program development tool includes a preset WeChat applet development tool.
[0116] The present application obtains the update instruction of the target program; extracts the target version file from the preset file version library according to the update instruction; parses the target version file to obtain the update script of the target program; compiles the update script to generate the compiled code corresponding to the update script, and uses the target program development tool to load and upload the compiled code to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program.
[0117] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0118] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0119] To solve the above technical problems, the present application also provides a computer device. Fig. 9 , Fig. 9 This is a basic structural block diagram of the computer device in this embodiment.
[0120] The computer device 9 includes a memory 9a, a processor 9b, and a network interface 9c which are interconnected through a system bus. It should be noted that: Fig. 9 Only a computer device 9 having a component memory 9a, a processor 9b, and a network interface 9c is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital processor (DSP), an embedded device, etc.
[0121] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0122] The memory 9a includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 9a can be an internal storage unit of the computer device 9, such as a hard disk or memory of the computer device 9. In other embodiments, the memory 9a can also be an external storage device of the computer device 9, such as a plug-in hard disk equipped on the computer device 9, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 9a can also include both the internal storage unit of the computer device 9 and its external storage device. In this embodiment, the memory 9a is generally used to store the operating system and various application software installed on the computer device 9, such as a computer-readable instruction of a program update method, etc. In addition, the memory 9a can also be used to temporarily store various types of data that have been output or are to be output.
[0123] The processor 9b may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 9b is generally used to control the overall operation of the computer device 9. In this embodiment, the processor 9b is used to run the computer-readable instructions stored in the memory 9a or process data, such as running the computer-readable instructions of the program update method.
[0124] The network interface 9c may include a wireless network interface or a wired network interface. The network interface 9c is generally used to establish a communication connection between the computer device 9 and other electronic devices.
[0125] The computer device proposed in this embodiment belongs to the field of research and development design technology and is applied to the WeChat applet update scenario. This application obtains the update instruction of the target program; according to the update instruction, extracts the target version file from the preset file version library; parses the target version file to obtain the update script of the target program; compiles the update script to generate the compiled code corresponding to the update script, and uses the target program development tool to load and upload the compiled code to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program. At the same time, storage control is performed in the program update method, so that the file version library only stores the update version files used for program updates, and the update record database only stores the update record data, which is convenient for the extraction and call of the update version files during subsequent version updates, and also convenient for the subsequent review of the update record data, thereby achieving reasonable separation of storage data; an update preview result corresponding to the update script is generated in the target preview tool, so that before the formal update, the update preview method can be used to identify whether the subsequent formal update can achieve the expected update result, and update errors and deficiencies can be discovered as soon as possible to facilitate subsequent timely adjustments; a one-click update script processing tool is used to improve the update efficiency of the target program.
[0126] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by a processor to enable the processor to perform the steps of the program updating method as described above.
[0127] The computer-readable storage medium proposed in this embodiment belongs to the field of research and development design technology and is applied to the WeChat applet update scenario. This application obtains the update instruction of the target program; according to the update instruction, the target version file is extracted from the preset file version library; the target version file is parsed to obtain the update script of the target program; the update script is compiled to generate the compiled code corresponding to the update script, and the compiled code is loaded and uploaded using the target program development tool to complete the update of the target program. By parsing the target version file, the difference code between the target version file and the version file in use is obtained, and the difference code is directly used as the update script of the target program, so as to facilitate the subsequent efficient update of the target program. At the same time, storage control is performed in the program update method, so that the file version library only stores the update version files used for program updates, and the update record database only stores the update record data, which is convenient for the extraction and call of the update version files during subsequent version updates, and also convenient for the subsequent review of the update record data, thereby achieving reasonable separation of storage data; an update preview result corresponding to the update script is generated in the target preview tool, so that before the formal update, the update preview method can be used to identify whether the subsequent formal update can achieve the expected update result, and update errors and deficiencies can be discovered as soon as possible to facilitate subsequent timely adjustments; a one-click update script processing tool is used to improve the update efficiency of the target program.
[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0129] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A program updating method, characterized in that: The steps include: Obtaining an update instruction for a target program, wherein the target program includes a WeChat applet; According to the update instruction, extract the target version file from the preset file version library; Parsing the target version file to obtain an update script for the target program; Compile the update script to generate compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program, wherein the target program development tool includes a preset WeChat applet development tool.
2. The program updating method according to claim 1, characterized in that: Before executing the step of extracting the target version file from a preset file version library according to the update instruction, the method further includes: Connecting to a preset database, wherein the preset database includes a file version library and an update record database; According to a preset storage control tool, the file version library is controlled to store only updated version files used for program updates, and the update record database is controlled to store only update record data, wherein the updated version files include updated version files uploaded respectively through a program development branch and a program pre-release branch.
3. The program updating method according to claim 1 or 2, characterized in that: The step of extracting the target version file from the preset file version library according to the update instruction specifically includes: Parsing the update instruction to obtain version number information carried in the update instruction, wherein the carried version number information refers to version number information of the target version file; Based on the version number information, a file search is performed from the file version library to extract the target version file, wherein the target version file refers to an update file of the target program.
4. The program updating method according to claim 1, characterized in that: After executing the step of parsing the target version file to obtain the update script of the target program, the method further includes: Compiling the update script, and generating an update preview result corresponding to the update script in a target preview tool, wherein the target preview tool is used to integrate the update preview result into a preview QR code format; By comparing, identifying whether the update preview result is consistent with the preset update requirement result; If the update preview result is consistent with the update requirement result, compile the update script to generate the compiled code; If the update preview result is inconsistent with the update requirement result, a prompt message is sent to a preset update monitoring terminal.
5. The program updating method according to claim 2, characterized in that: After executing the step of using the target program development tool to load and upload the compiled code to complete the update of the target program, the method further includes: Obtaining the extracted warehouse information of the target version file, wherein the extracted warehouse information includes warehouse time information; Obtaining loading and uploading information of the compiled code, wherein the loading and uploading information includes loading and uploading time information; The version number information, the outgoing time information and the loading and uploading time information of the target version file are sent to the update record database to record the update operation.
6. The program updating method according to claim 5, characterized in that: The step of sending the version number information, the outgoing time information and the loading and uploading time information of the target version file to the update record database to update the operation record specifically includes: The H5 page QR code generation method is adopted to generate the H5 page QR code for the version number information, the outgoing time information and the loading and uploading time information of the target version file; The generated H5 page QR code is sent to the update record database as update operation record information.
7. The program updating method according to claim 1, characterized in that: A one-click code generation tool is used to parse the target version file and compile the update script, wherein the one-click code generation tool includes a code generation tool based on Node.js.
8. A program updating device, characterized in that: include: An update instruction acquisition module, used to acquire an update instruction of a target program, wherein the target program includes a WeChat applet; A target version file extraction module is used to extract the target version file from a preset file version library according to the update instruction; An update script obtaining module, used for parsing the target version file to obtain an update script for the target program; The script compilation and upload module is used to compile the update script, generate the compiled code corresponding to the update script, and use the target program development tool to load and upload the compiled code to complete the update of the target program, wherein the target program development tool includes a preset WeChat applet development tool.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the program updating method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the program updating method according to any one of claims 1 to 7 are implemented.