WO2019047480A1 - Program update method, computer-readable storage medium, terminal device and apparatus - Google Patents
Program update method, computer-readable storage medium, terminal device and apparatus Download PDFInfo
- Publication number
- WO2019047480A1 WO2019047480A1 PCT/CN2018/076522 CN2018076522W WO2019047480A1 WO 2019047480 A1 WO2019047480 A1 WO 2019047480A1 CN 2018076522 W CN2018076522 W CN 2018076522W WO 2019047480 A1 WO2019047480 A1 WO 2019047480A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- function module
- code
- target
- target program
- module
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Definitions
- the present application belongs to the field of computer technologies, and in particular, to a program update method, a computer readable storage medium, a terminal device, and a device.
- the embodiment of the present application provides a program update method, a computer readable storage medium, a terminal device and a device, so as to solve the problem that the existing program update method has a high abnormal probability.
- a first aspect of the embodiment of the present application provides a program update method, which may include:
- the code of the target function module is read from a preset code library
- the code of the target function module is added to the code of the target program to complete the update of the target program.
- a second aspect of embodiments of the present application provides a computer readable storage medium storing computer readable instructions, the steps of implementing the program update method when executed by a processor .
- a third aspect of an embodiment of the present application provides a program update terminal device including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, the processor executing the The steps of the above program update method are implemented when the computer readable instructions are described.
- a fourth aspect of the embodiments of the present application provides a program updating apparatus, which may include a module for implementing the steps of the above program updating method.
- the embodiment of the present application pre-configures the correspondence between the function modules that have conflicts in the running environment. Before adding the code of the newly added function module to the current program, firstly, according to the corresponding relationship, whether there is a running environment between the modules The conflict is judged. Only when there is no conflict, the code of the newly added function module can be added to the current program, and the integrity of the newly added code is verified before the code is added, thereby effectively reducing the conflict. The abnormal probability of the updated program running.
- FIG. 1 is a flowchart of an embodiment of a method for updating a program according to an embodiment of the present application
- FIG. 2 is a schematic flowchart of adding a dependency function module in an embodiment of the present application
- FIG. 3 is a schematic flowchart of verifying whether a target program runs normally according to an embodiment of the present application
- FIG. 4 is a schematic block diagram of a program update terminal device according to an embodiment of the present application.
- FIG. 5 is a block diagram of a computer readable program according to an embodiment of the present application.
- a complete code library is pre-built, and the code library includes various function modules that may be used by the target program.
- the number of function modules in the code library is extremely large, if All of them are applied to the target program, which makes the target program very large and occupies a large amount of memory space in the user's terminal device. Therefore, the target program generally only includes the function modules of the functions required by the current version. It does not include other functional modules, but for the subsequent scalability, the module interface is reserved for other modules. When a version update is required, a new function needs to be added to the target program, and only needs to be read from the code base. The corresponding function module is added to the module interface location reserved by the target program.
- an embodiment of a program update method in an embodiment of the present application may include:
- Step S101 Acquire a target function module to be updated into the target program.
- the target program is a program that can run normally.
- the target program may be run once to ensure that it does not have any running abnormality.
- the target function module is used to implement a new function that has not been implemented in the target program.
- the target program can currently implement function A and function B, and the target function module can implement the new function C.
- Step S102 Acquire each functional module currently in the target program.
- Step S103 Determine, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program.
- the first correspondence records a correspondence between functional modules that have a running environment conflict.
- compatibility between the various function modules needs to be tested, for example, if the function module A affects the normal operation of the function module B during operation, or the function module B is running Affecting the normal operation of function module A indicates that the two are incompatible, that is, there is a conflict between the two operating environments.
- the correspondence between the functional modules having the running environment conflicts is recorded in the first correspondence relationship to avoid conflicts in the running environment between the functional modules in the subsequent program update process. As a result, the target program does not work properly.
- step S104 to step S105 are performed, and if the conflicting function module exists in each of the current functional modules of the target program, the step is performed. S107 to step S108.
- Step S104 reading the code of the target function module from a preset code base.
- step S105 the information digest algorithm 5 or the secure hash algorithm is used to determine whether the code of the target function module is complete.
- the message digest algorithm 5 (Message-Digest Algorithm) may be used. 5, MD5) or Secure Hash Algorithm (SHA), etc. to verify the integrity of the code.
- MD5 Message-Digest Algorithm
- SHA Secure Hash Algorithm
- the code of the target function module needs to be first converted into a binary form, and then it is padded so that the result of the bit length pair 512 is equal to 448, and a result is appended with 64 bits. The length of the information before the padding of the binary representation, and finally divided into 16 groups.
- the main cycle has four rounds, and each cycle is similar.
- each operation performs a nonlinear function operation on three of a, b, c, and d, and then the result is added to the fourth variable, one of the texts.
- Group and a constant then shift the result to the left by an indefinite number, and add one of a, b, c or d, and finally replace one of a, b, c or d with the result.
- the SHA algorithm is similar to the MD5 algorithm, but uses different information grouping methods, as well as different variable values and calculation functions, and finally obtains a 160-bit SHA value.
- the MD5 value or the SHA value of each function module code may be pre-stored in the code base.
- the MD5 value or the SHA value may be recalculated, and then Comparing the calculated MD5 value or SHA value with the MD5 value or the SHA value of the code of the target function module stored in the code base. If the two are consistent, indicating that the code of the target function module is complete, Step S106 is executed. If the two are inconsistent, indicating that the code of the target function module has been damaged, step S110 is performed.
- Step S106 adding the code of the target function module into the code of the target program to complete the update of the target program.
- a corresponding module interface is reserved for different function modules in the target program.
- Step S107 Acquire a first priority corresponding to the target function module and a second priority corresponding to the conflict function module, respectively, from a preset priority list.
- each functional module needs to be prioritized according to the importance degree of the function, and recorded in the priority list.
- priority is given. Guarantee the function realization of higher priority function modules.
- Step S108 determining whether the first priority is higher than the second priority
- step S109 is performed, and if the first priority is less than or equal to the second priority, step S110 is performed.
- Step S109 deleting the code of the conflicting function module from the target program, and executing the code of reading the target function module from the preset code library in step S104, and using the information digest algorithm 5 in step S105 or The secure hash algorithm determines whether the code of the target functional module is complete.
- step S110 it is determined that the program update has an abnormality.
- a notification message for updating the exception can be sent to the designated developer to process the exception in time.
- an alternate function module that is the same as the function of the target function module is first acquired from the preset third correspondence.
- the third correspondence records the correspondence between functional modules having the same function.
- the code of the substitute function module is read from the code library, and then the information digest algorithm is used. 5 or a secure hash algorithm determines whether the code of the substitute function module is complete, and if the code of the substitute function module is complete, adding the code of the substitute function module to the code of the target program to complete An update to the target program.
- the program update method may further include the steps as shown in FIG. 2:
- Step S201 Search for a pre-function module that the target function module depends on in a preset second correspondence.
- the second correspondence records the correspondence between the pre-function module and the post-function module, and the operation of the post-function module depends on the pre-function module.
- Step S202 reading the code of the pre-function module from the code base.
- Step S203 determining whether the code of the pre-function module is complete by using the information digest algorithm 5 or the secure hash algorithm.
- the step S203 is similar to the step S105. For details, refer to the description in the step S105.
- step S204 is performed; otherwise, step S205 is performed.
- Step S204 adding the code of the pre-function module to the code of the target program.
- step S106 in the process of adding the code, it is necessary to ensure that the code of the pre-function module is added to the correct location, that is, to the module interface location corresponding thereto.
- step S205 it is determined that the program update has an abnormality.
- a notification message for updating the exception can be sent to the designated developer to process the exception in time.
- the function modules on which the target function module is operated are also added to the target program, which effectively ensures that the updated target program can run normally.
- the program update method may further include the steps as shown in FIG. 3:
- Step S301 running the target program, and obtaining a running result report.
- the running process is recorded in real time, and the running result report is generated. If there is no running environment conflict between the newly added function module and the original function module, the target program may be smooth. Run and get the expected results. If there is a running environment conflict between the newly added function module and the original function module, the target program will have an abnormality during the running process, and it cannot continue to run, and the expected result cannot be obtained.
- Step S302 Determine, according to the operation result report, whether the target program is abnormal.
- step S303 to step S305 are performed, and if the target program runs normally, step S306 is performed.
- Step S303 Search, from the operation result report, a function module that is being executed when an abnormality occurs.
- the function module does not have an exception when it is added before adding a new function module, after the new function module is added, the function module will be abnormal when executed, and it can be determined that there is a running environment conflict between the two. .
- Step S304 adding a relationship of a running environment conflict existing between the function module being executed when the abnormality occurs and the target function module is added to the first correspondence relationship.
- the running environment conflict between some modules may be missed in the first correspondence relationship. Therefore, in the actual program update process, when a new running environment conflict occurs, it is required. It is added to the first correspondence in time to ensure the integrity of the correspondence.
- Step S305 deleting the code of the target function module from the code of the target program.
- the program update is abnormal, that is, the target function module cannot be smoothly added to the target program, and the notification message of the update exception can be sent to the designated developer, so that the abnormality can be processed in time.
- Step S306 ending the update of the target program.
- the embodiment of the present application pre-configures the correspondence between the functional modules that have conflicts in the running environment.
- the module Before adding the code of the newly added function module to the current program, the module must first be based on the corresponding relationship. Whether there is a running environment conflict between the judgments, only when there is no conflict, the code of the newly added function module can be added to the current program, and the integrity of the newly added code is verified before the code is added. , which effectively reduces the abnormal probability of the updated program running.
- FIG. 4 is a schematic block diagram of a program update terminal device provided by an embodiment of the present application.
- the program update terminal device can include a processor 40, a memory 41, and computer readable instructions 42 stored in the memory 41 and executable on the processor 40.
- FIG. 5 is a block diagram of computer readable instructions 42 provided by an embodiment of the present application.
- the computer readable instructions 42 may be partitioned into one or more modules, the one or more modules being stored in the memory 41 and executed by the processor 40, To complete this application.
- the computer readable instructions 42 may be divided into a target function module acquisition module 501, a current function module acquisition module 502, a first determination module 503, a target function module code reading module 504, and a target function.
- the program updating apparatus provided in the embodiment of the present application may also include these modules. The following description will specifically describe the functions of the modules 501-506:
- the target function module acquiring module 501 is configured to acquire a target function module to be updated into the target program
- the current function module acquiring module 502 is configured to acquire each function module currently in the target program
- the first judging module 503 is configured to determine, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first corresponding The relationship records the correspondence between functional modules that have conflicts in the operating environment;
- the target function module code reading module 504 is configured to: if the conflicting function module does not exist in each function module currently in the target program, read the code of the target function module from a preset code library;
- the target function module code integrity determining module 505 is configured to determine whether the code of the target function module is complete by using the information digest algorithm 5 or the secure hash algorithm;
- the target function module code adding module 506 is configured to add the code of the target function module into the code of the target program to complete the update of the target program if the code of the target function module is complete. .
- computer readable instructions 42 may further include:
- the pre-function module search module is configured to search for a pre-function module that the target function module depends on in a preset second correspondence, and the second correspondence records the pre-function module and the post function Corresponding relationship between the modules, the operation of the post function module depends on the pre-function module;
- a pre-function module code reading module configured to read code of the pre-function module from the code base
- a pre-function module code integrity judgment module configured to determine whether the code of the pre-function module is complete by using a message digest algorithm 5 or a secure hash algorithm;
- the pre-function module code adding module is configured to add the code of the pre-function module to the code of the target program if the code of the pre-function module is complete.
- computer readable instructions 42 may further include:
- an alternative function module acquiring module configured to acquire the same function as the target function module from the preset third correspondence relationship if the conflict function module exists in each of the current function modules of the target program a module, wherein the third correspondence records a correspondence between functional modules having the same function;
- a second determining module configured to determine, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program
- An alternative function module code reading module configured to read, in the current function modules of the target program, a function module that conflicts with a running environment of the substitute function module, and read the replacement function from the code library Module code;
- An alternative function module code integrity judging module configured to determine whether the code of the substitute function module is complete by using an information digest algorithm 5 or a secure hash algorithm;
- the substitute function module code adding module is configured to add the code of the substitute function module into the code of the target program to complete the update of the target program if the code of the substitute function module is complete.
- computer readable instructions 42 may further include:
- a priority obtaining module configured to acquire a first priority corresponding to the target function module from a preset priority list, if the conflicting function module exists in each function module currently in the target program a second priority corresponding to the conflicting function module;
- the first deleting module is configured to delete the code of the conflicting function module from the target program if the first priority is higher than the second priority.
- computer readable instructions 42 may further include:
- a running judgment module configured to determine, according to the running result report, whether the target program is abnormally operated
- An abnormal module acquiring module configured to: if the target program runs abnormally, search for a function module that is being executed when an abnormality occurs;
- a relationship adding module configured to add, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module
- a second deleting module configured to delete code of the target function module from code of the target program.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
A program update method, a computer-readable storage medium, a terminal device and an apparatus. The method: acquiring a target function module to be updated into a target program (S101); acquiring each current function module of the target program (S102); determining whether there is a conflicting function module having an operating environment conflict with the target function module among each current module of the target program (S103); if there is no conflicting function module among each current function module of the target program, reading from a pre-determined code library code of the target function module (S104); using an information abstracting algorithm 5 or a secure hashing algorithm to determine whether code for the target function module is complete (S105); if the code for the target function module is complete, adding the code for the target function module to the code of the target program, so as to complete updating of the target program (S106).
Description
本申请要求于2017年9月8日提交中国专利局、申请号为CN201710804129.1、发明名称为“一种程序更新方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on Sep. 8, 2017, the Chinese Patent Application No. CN201710804129.1, entitled "A Program Update Method and Terminal Equipment", the entire contents of which are incorporated by reference. In this application.
本申请属于计算机技术领域,尤其涉及一种程序更新方法、计算机可读存储介质、终端设备及装置。The present application belongs to the field of computer technologies, and in particular, to a program update method, a computer readable storage medium, a terminal device, and a device.
现有技术中一般会采用模块化的方法进行程序的开发和维护,将程序划分为多个实现不同功能的模块,但由于这些功能模块往往是由多名开发人员分别编写的,各个模块之间往往存在运行环境冲突的问题,进行程序更新时会有较高的异常概率。In the prior art, a modular method is generally used for program development and maintenance, and the program is divided into multiple modules that implement different functions, but since these functional modules are often written by multiple developers, between the modules There are often problems with running environment conflicts, and there is a higher probability of abnormality when updating programs.
本申请实施例提供了一种程序更新方法、计算机可读存储介质、终端设备及装置,以解决现有的程序更新方法会有较高的异常概率的问题。The embodiment of the present application provides a program update method, a computer readable storage medium, a terminal device and a device, so as to solve the problem that the existing program update method has a high abnormal probability.
本申请实施例的第一方面提供了一种程序更新方法,可以包括:A first aspect of the embodiment of the present application provides a program update method, which may include:
获取待更新入目标程序的目标功能模块;Obtain a target function module to be updated into the target program;
获取所述目标程序当前的各个功能模块;Obtaining each function module of the target program;
根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;Determining, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first correspondence records a conflict of a running environment Correspondence between functional modules;
若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;If the conflict function module does not exist in each function module currently in the target program, the code of the target function module is read from a preset code library;
使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;Determining whether the code of the target function module is complete by using an information digest algorithm 5 or a secure hash algorithm;
若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the target function module is complete, the code of the target function module is added to the code of the target program to complete the update of the target program.
本申请实施例的第二方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述程序更新方法的步骤。A second aspect of embodiments of the present application provides a computer readable storage medium storing computer readable instructions, the steps of implementing the program update method when executed by a processor .
本申请实施例的第三方面提供了一种程序更新终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述程序更新方法的步骤。A third aspect of an embodiment of the present application provides a program update terminal device including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, the processor executing the The steps of the above program update method are implemented when the computer readable instructions are described.
本申请实施例的第四方面提供了一种程序更新装置,可以包括用于实现上述程序更新方法的步骤的模块。A fourth aspect of the embodiments of the present application provides a program updating apparatus, which may include a module for implementing the steps of the above program updating method.
本申请实施例预先构造出了存在运行环境冲突的功能模块的之间的对应关系,在将新增的功能模块的代码添加入当前程序之前,首先要根据该对应关系对模块间是否存在运行环境冲突进行判断,只有在不存在冲突时,才可以将新增的功能模块的代码添加入当前程序中,而且在添加代码之前,还对新增代码的完整性进行了校验,从而有效降低了更新出来的程序运行时的异常概率。The embodiment of the present application pre-configures the correspondence between the function modules that have conflicts in the running environment. Before adding the code of the newly added function module to the current program, firstly, according to the corresponding relationship, whether there is a running environment between the modules The conflict is judged. Only when there is no conflict, the code of the newly added function module can be added to the current program, and the integrity of the newly added code is verified before the code is added, thereby effectively reducing the conflict. The abnormal probability of the updated program running.
图1为本申请实施例中一种程序更新方法的一个实施例流程图;FIG. 1 is a flowchart of an embodiment of a method for updating a program according to an embodiment of the present application;
图2为本申请实施例中添加依赖功能模块的示意流程图;2 is a schematic flowchart of adding a dependency function module in an embodiment of the present application;
图3为本申请实施例中验证目标程序是否正常运行的示意流程图;FIG. 3 is a schematic flowchart of verifying whether a target program runs normally according to an embodiment of the present application;
图4为本申请实施例提供的程序更新终端设备的示意框图;4 is a schematic block diagram of a program update terminal device according to an embodiment of the present application;
图5为本申请实施例提供的计算机可读程序的模块图。FIG. 5 is a block diagram of a computer readable program according to an embodiment of the present application.
在本申请实施例中,会预先构建出一个完整的代码库,该代码库包括了目标程序可能会使用到的各个功能模块,一般而言,该代码库中功能模块的数目极多,若将其全部都应用于目标程序中,则会使目标程序变得十分庞大,占用掉用户的终端设备中的大量内存空间,因此,目标程序中一般只包含当前版本所需功能的功能模块即可,而不包含其它的功能模块,但是为了后续的可拓展性,为其它模块仍预留了模块接口,当进行版本更新,需要在目标程序中加入新的功能时,只需从代码库中读取对应的功能模块添加到目标程序为其预留的模块接口位置即可。In the embodiment of the present application, a complete code library is pre-built, and the code library includes various function modules that may be used by the target program. Generally speaking, the number of function modules in the code library is extremely large, if All of them are applied to the target program, which makes the target program very large and occupies a large amount of memory space in the user's terminal device. Therefore, the target program generally only includes the function modules of the functions required by the current version. It does not include other functional modules, but for the subsequent scalability, the module interface is reserved for other modules. When a version update is required, a new function needs to be added to the target program, and only needs to be read from the code base. The corresponding function module is added to the module interface location reserved by the target program.
请参阅图1,本申请实施例中一种程序更新方法的一个实施例可以包括:Referring to FIG. 1, an embodiment of a program update method in an embodiment of the present application may include:
步骤S101,获取待更新入目标程序的目标功能模块。Step S101: Acquire a target function module to be updated into the target program.
所述目标程序为一可正常运行的程序,优选地,在步骤S101之前,可以先运行一次所述目标程序,保证其无任何运行异常的发生。The target program is a program that can run normally. Preferably, before the step S101, the target program may be run once to ensure that it does not have any running abnormality.
所述目标功能模块用来实现所述目标程序中尚未实现的新功能,例如,目标程序当前可以实现功能A和功能B,而目标功能模块可以实现新的功能C。The target function module is used to implement a new function that has not been implemented in the target program. For example, the target program can currently implement function A and function B, and the target function module can implement the new function C.
步骤S102,获取所述目标程序当前的各个功能模块。Step S102: Acquire each functional module currently in the target program.
步骤S103,根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块。Step S103: Determine, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program.
所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系。优选地,在构建代码库的过程中,需要对各个功能模块之间的兼容性进行测试,例如,若功能模块A在运行时会影响功能模块B的正常运行,或者功能模块B在运行时会影响功能模块A的正常运行,则说明两者是不兼容的,也即两者存在运行环境冲突。在对各个功能模块进行遍历测试后,将存在运行环境冲突的功能模块之间的对应关系记录到所述第一对应关系中,以避免在后续的程序更新过程中因功能模块间的运行环境冲突而导致目标程序无法正常运行。The first correspondence records a correspondence between functional modules that have a running environment conflict. Preferably, in the process of constructing the code base, compatibility between the various function modules needs to be tested, for example, if the function module A affects the normal operation of the function module B during operation, or the function module B is running Affecting the normal operation of function module A indicates that the two are incompatible, that is, there is a conflict between the two operating environments. After the traversal test is performed on each function module, the correspondence between the functional modules having the running environment conflicts is recorded in the first correspondence relationship to avoid conflicts in the running environment between the functional modules in the subsequent program update process. As a result, the target program does not work properly.
若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则执行步骤S104至步骤S105,若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则执行步骤S107至步骤S108。If the conflicting function module does not exist in each of the current functional modules of the target program, step S104 to step S105 are performed, and if the conflicting function module exists in each of the current functional modules of the target program, the step is performed. S107 to step S108.
步骤S104,从预设的代码库中读取所述目标功能模块的代码。Step S104, reading the code of the target function module from a preset code base.
步骤S105,使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整。In step S105, the information digest algorithm 5 or the secure hash algorithm is used to determine whether the code of the target function module is complete.
为了保证在读取的过程中所述目标功能模块的代码没有受到损坏,在读取之后,还需要对其完整性进行校验,在本实施中,可以使用信息摘要算法5(Message-Digest Algorithm 5,MD5)或者安全哈希算法(Secure Hash Algorithm,SHA)等对代码的完整性进行校验。In order to ensure that the code of the target function module is not damaged during the reading process, the integrity of the target function module needs to be verified. In this implementation, the message digest algorithm 5 (Message-Digest Algorithm) may be used. 5, MD5) or Secure Hash Algorithm (SHA), etc. to verify the integrity of the code.
下面以MD5算法为例进行说明:The following takes the MD5 algorithm as an example:
若使用MD5算法,则需要首先将所述目标功能模块的代码转化为二进制形式,然后对其进行填充,使其位长对512求余的结果等于448,并在这个结果后面附加一个以64位二进制表示的填充前的信息长度,最后将其划分为16个分组。If the MD5 algorithm is used, the code of the target function module needs to be first converted into a binary form, and then it is padded so that the result of the bit length pair 512 is equal to 448, and a result is appended with 64 bits. The length of the information before the padding of the binary representation, and finally divided into 16 groups.
每一分组的算法流程如下:第一分组需要初始化四个变量,即A=0x01234567,B=0x89ABCDEF,C=0xFEDCBA98,D=0x76543210,并将这四个变量复制到另外四个变量中:A到a,B到b,C到c,D到d。从第二分组开始的变量为上一分组的运算结果,即A=a,B=b,C=c,D=d。主循环有四轮,每轮循环都类似。以第一轮为例,进行16次操作,每次操作对a、b、c和d中的其中三个作一次非线性函数运算,然后将所得结果加上第四个变量,文本的一个子分组和一个常数,再将所得结果向左环移一个不定的数,并加上a、b、c或d中之一,最后用该结果取代a、b、c或d中之一。The algorithm flow of each group is as follows: the first group needs to initialize four variables, namely A=0x01234567, B=0x89ABCDEF, C=0xFEDCBA98, D=0x76543210, and copy these four variables into the other four variables: A to a, B to b, C to c, D to d. The variable starting from the second group is the result of the operation of the previous group, that is, A = a, B = b, C = c, D = d. The main cycle has four rounds, and each cycle is similar. Taking the first round as an example, 16 operations are performed, and each operation performs a nonlinear function operation on three of a, b, c, and d, and then the result is added to the fourth variable, one of the texts. Group and a constant, then shift the result to the left by an indefinite number, and add one of a, b, c or d, and finally replace one of a, b, c or d with the result.
在各轮循环完成之后,将a、b、c和d的最后取值级联输出,得到一个128比特的值,即为所述目标功能模块的代码的MD5值。After each round of the loop is completed, the final values of a, b, c, and d are cascaded to obtain a 128-bit value, which is the MD5 value of the code of the target function module.
SHA算法与MD5算法类似,但其中使用到了不同的信息分组方法,以及不同的变量值及计算函数,最终得到160比特的SHA值。The SHA algorithm is similar to the MD5 algorithm, but uses different information grouping methods, as well as different variable values and calculation functions, and finally obtains a 160-bit SHA value.
本实施例中,在所述代码库中可以预先存储各个功能模块代码的MD5值或SHA值,当需要判断所述目标功能模块的代码是否完整时,可以重新计算其MD5值或SHA值,然后将计算得到的MD5值或SHA值与代码库中存储的所述目标功能模块的代码的MD5值或SHA值进行比对,若两者一致,说明所述目标功能模块的代码是完整的,则执行步骤S106,若两者不一致,说明所述目标功能模块的代码已被损坏,则执行步骤S110。In this embodiment, the MD5 value or the SHA value of each function module code may be pre-stored in the code base. When it is necessary to determine whether the code of the target function module is complete, the MD5 value or the SHA value may be recalculated, and then Comparing the calculated MD5 value or SHA value with the MD5 value or the SHA value of the code of the target function module stored in the code base. If the two are consistent, indicating that the code of the target function module is complete, Step S106 is executed. If the two are inconsistent, indicating that the code of the target function module has been damaged, step S110 is performed.
步骤S106,将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。Step S106, adding the code of the target function module into the code of the target program to complete the update of the target program.
在本实施例中,为了保证目标程序的可拓展性,在目标程序中为不同的功能模块预留了对应的模块接口,在添加代码的过程中,需要保证所述目标功能模块的代码添加到正确的位置上,也即添加到与其对应的模块接口位置。In this embodiment, in order to ensure the scalability of the target program, a corresponding module interface is reserved for different function modules in the target program. In the process of adding the code, it is necessary to ensure that the code of the target function module is added to In the correct position, it is added to the corresponding module interface location.
步骤S107,从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级。Step S107: Acquire a first priority corresponding to the target function module and a second priority corresponding to the conflict function module, respectively, from a preset priority list.
优选地,在构建代码库的过程中,需要对各个功能模块按照功能的重要程度进行优先级排序,并记录到所述优先级列表中,当两个功能模块之间存在运行环境冲突时,优先保证优先级较高的功能模块的功能实现。Preferably, in the process of constructing the code base, each functional module needs to be prioritized according to the importance degree of the function, and recorded in the priority list. When there is a running environment conflict between the two functional modules, priority is given. Guarantee the function realization of higher priority function modules.
步骤S108,判断所述第一优先级是否高于所述第二优先级;Step S108, determining whether the first priority is higher than the second priority;
若所述第一优先级高于所述第二优先级,则执行步骤S109,若所述第一优先级小于或等于所述第二优先级,则执行步骤S110。If the first priority is higher than the second priority, step S109 is performed, and if the first priority is less than or equal to the second priority, step S110 is performed.
步骤S109,从所述目标程序中删除所述冲突功能模块的代码,并执行步骤S104中从预设的代码库中读取所述目标功能模块的代码,以及步骤S105中使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整的过程。Step S109, deleting the code of the conflicting function module from the target program, and executing the code of reading the target function module from the preset code library in step S104, and using the information digest algorithm 5 in step S105 or The secure hash algorithm determines whether the code of the target functional module is complete.
步骤S110,确定程序更新出现异常。In step S110, it is determined that the program update has an abnormality.
在程序更新出现异常时,可以向指定开发人员发送更新异常的通知消息,以使其及时对异常进行处理。When an exception occurs in the program update, a notification message for updating the exception can be sent to the designated developer to process the exception in time.
通过以上步骤S107至步骤S110,当目标功能模块与原有功能模块之间存在运行环境冲突时,根据其优先级的高低,在目标程序中只保留高优先级的功能模块,而不保留低优先级的功能模块,从而使得更新后的所述目标程序可以在正常运行的前提下最大程度地保证主要功能的实现。Through the above steps S107 to S110, when there is a running environment conflict between the target function module and the original function module, according to the priority level, only the high priority function module is retained in the target program, and the low priority is not retained. The functional modules of the level, so that the updated target program can guarantee the realization of the main functions to the greatest extent under normal operation.
在构建代码库的过程中,由于其中功能模块的数目极多,往往会出现多个不同的功能模块实现相同功能的情况,因此,可选地,当目标功能模块与原有功能模块之间存在运行环境冲突时,可以使用与其功能相同的功能模块来代替目标功能模块。In the process of building a code base, due to the large number of functional modules, there are often cases where multiple different functional modules implement the same function. Therefore, optionally, when there is a relationship between the target functional module and the original functional module. When the operating environment conflicts, you can use the same function module as the function module instead.
具体地,首先从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块。Specifically, an alternate function module that is the same as the function of the target function module is first acquired from the preset third correspondence.
所述第三对应关系记录了功能相同的功能模块之间的对应关系。优选地,在构建代码库的过程中,需要记录下各个功能相同的功能模块之间的对应关系,例如,若功能模块A和功能模块B所实现的功能相同,则将其关系记录到所述第三对应关系中。The third correspondence records the correspondence between functional modules having the same function. Preferably, in the process of constructing the code base, it is necessary to record the correspondence between the functional modules having the same function. For example, if the functions implemented by the function module A and the function module B are the same, the relationship is recorded to the In the third correspondence.
然后根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;And determining, according to the first correspondence, whether a function module that conflicts with the operating environment of the substitute function module exists in each function module currently in the target program;
若在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码,然后使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整,若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If there is no functional module in the current function module of the target program that conflicts with the operating environment of the substitute function module, the code of the substitute function module is read from the code library, and then the information digest algorithm is used. 5 or a secure hash algorithm determines whether the code of the substitute function module is complete, and if the code of the substitute function module is complete, adding the code of the substitute function module to the code of the target program to complete An update to the target program.
若在所述目标程序当前的各个功能模块中存在与所述替代功能模块存在运行环境冲突的功能模块,则继续从预设的第三对应关系中获取其它的功能相同的功能模块并重复以上过程,若所有与目标功能模块的功能相同的功能模块均已被遍历后仍然存在运行环境冲突,则执行步骤S107至步骤S110中的过程。If there is a function module that conflicts with the operating environment of the substitute function module in each function module currently in the target program, continue to obtain other functional modules with the same function from the preset third correspondence relationship and repeat the above process. If all the functional modules having the same function as the target functional module have been traversed and there is still a running environment conflict, the processes in steps S107 to S110 are performed.
由于功能模块之间往往存在着相互依赖的关系,因此为了保证更新后的所述目标程序可以正常运行,还需要将目标功能模块运行时所依赖的功能模块也加入到目标程序中。优选地,在步骤S106之后,所述程序更新方法还可以包括如图2所示的步骤:Since the function modules often have an interdependent relationship, in order to ensure that the updated target program can run normally, it is also necessary to add the function modules on which the target function module is running, to the target program. Preferably, after step S106, the program update method may further include the steps as shown in FIG. 2:
步骤S201,在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块。Step S201: Search for a pre-function module that the target function module depends on in a preset second correspondence.
所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块。优选地,在构建代码库的过程中,需要记录下各个功能模块之间的依赖关系,例如,若功能模块A的正常运行需要依赖于功能模块B的正常运行,则将其关系记录到所述第二对应关系中。The second correspondence records the correspondence between the pre-function module and the post-function module, and the operation of the post-function module depends on the pre-function module. Preferably, in the process of constructing the code base, it is necessary to record the dependencies between the various functional modules. For example, if the normal operation of the functional module A needs to depend on the normal operation of the functional module B, the relationship is recorded to the In the second correspondence.
步骤S202,从所述代码库中读取所述前置功能模块的代码。Step S202, reading the code of the pre-function module from the code base.
步骤S203,使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整。Step S203, determining whether the code of the pre-function module is complete by using the information digest algorithm 5 or the secure hash algorithm.
步骤S203与步骤S105类似,具体可参照步骤S105中的描述,本实施例对此不再赘述。The step S203 is similar to the step S105. For details, refer to the description in the step S105.
若所述前置功能模块的代码是完整的,则执行步骤S204,否则,则执行步骤S205。If the code of the pre-function module is complete, step S204 is performed; otherwise, step S205 is performed.
步骤S204,将所述前置功能模块的代码添加入所述目标程序的代码中。Step S204, adding the code of the pre-function module to the code of the target program.
与步骤S106类似,在添加代码的过程中,需要保证所述前置功能模块的代码添加到正确的位置上,也即添加到与其对应的模块接口位置。Similar to step S106, in the process of adding the code, it is necessary to ensure that the code of the pre-function module is added to the correct location, that is, to the module interface location corresponding thereto.
步骤S205,确定程序更新出现异常。In step S205, it is determined that the program update has an abnormality.
在程序更新出现异常时,可以向指定开发人员发送更新异常的通知消息,以使其及时对异常进行处理。When an exception occurs in the program update, a notification message for updating the exception can be sent to the designated developer to process the exception in time.
通过如图2所示的步骤,将目标功能模块运行时所依赖的功能模块也加入到目标程序中,有效保证了更新后的所述目标程序可以正常运行。Through the steps shown in FIG. 2, the function modules on which the target function module is operated are also added to the target program, which effectively ensures that the updated target program can run normally.
在完成对所述目标程序的更新之后,为了验证所述目标程序是否可以正常运行,优选地,在步骤S106之后,所述程序更新方法还可以包括如图3所示的步骤:After the update of the target program is completed, in order to verify whether the target program can run normally, preferably, after step S106, the program update method may further include the steps as shown in FIG. 3:
步骤S301,运行所述目标程序,并获取运行结果报告。Step S301, running the target program, and obtaining a running result report.
在所述目标程序的运行过程中,对其运行过程进行实时记录,生成所述运行结果报告,若新添加的功能模块与原有功能模块之间不存在运行环境冲突,则该目标程序可以顺利运行,并得到预期的结果。若新添加的功能模块与原有功能模块之间存在运行环境冲突,则该目标程序在运行过程中会出现异常,无法继续运行下去,也无法得到预期的结果。During the running process of the target program, the running process is recorded in real time, and the running result report is generated. If there is no running environment conflict between the newly added function module and the original function module, the target program may be smooth. Run and get the expected results. If there is a running environment conflict between the newly added function module and the original function module, the target program will have an abnormality during the running process, and it cannot continue to run, and the expected result cannot be obtained.
步骤S302,根据所述运行结果报告判断所述目标程序是否运行异常。Step S302: Determine, according to the operation result report, whether the target program is abnormal.
若所述目标程序运行异常,则执行步骤S303至步骤S305,若所述目标程序运行正常,则执行步骤S306。If the target program runs abnormally, step S303 to step S305 are performed, and if the target program runs normally, step S306 is performed.
步骤S303,从所述运行结果报告中查找出现异常时正在执行的功能模块。Step S303: Search, from the operation result report, a function module that is being executed when an abnormality occurs.
由于在加入新功能模块之前,该功能模块在执行时并未出现异常,而在加入新功能模块之后,该功能模块在执行时却会出现异常,据此可以判定两者之间存在运行环境冲突。Since the function module does not have an exception when it is added before adding a new function module, after the new function module is added, the function module will be abnormal when executed, and it can be determined that there is a running environment conflict between the two. .
步骤S304,将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中。Step S304, adding a relationship of a running environment conflict existing between the function module being executed when the abnormality occurs and the target function module is added to the first correspondence relationship.
在代码库的构建过程中,在所述第一对应关系中可能会遗漏掉某些模块间的运行环境冲突,因此,在实际的程序更新过程中,当出现了新的运行环境冲突时,需要及时将其添加到所述第一对应关系中,以保证该对应关系的完整性。During the construction process of the code base, the running environment conflict between some modules may be missed in the first correspondence relationship. Therefore, in the actual program update process, when a new running environment conflict occurs, it is required. It is added to the first correspondence in time to ensure the integrity of the correspondence.
步骤S305,从所述目标程序的代码中删除所述目标功能模块的代码。Step S305, deleting the code of the target function module from the code of the target program.
此时程序更新出现异常,即目标功能模块无法顺利添加入所述目标程序中,可以向指定开发人员发送更新异常的通知消息,以使其及时对异常进行处理。At this time, the program update is abnormal, that is, the target function module cannot be smoothly added to the target program, and the notification message of the update exception can be sent to the designated developer, so that the abnormality can be processed in time.
步骤S306,结束对所述目标程序的更新。Step S306, ending the update of the target program.
通过以上步骤S301至步骤S306,在完成对所述目标程序的更新之后,进一步对其正常运行与否进行了验证。Through the above steps S301 to S306, after the update of the target program is completed, the normal operation or not is verified.
综上所述,本申请实施例预先构造出了存在运行环境冲突的功能模块的之间的对应关系,在将新增的功能模块的代码添加入当前程序之前,首先要根据该对应关系对模块间是否存在运行环境冲突进行判断,只有在不存在冲突时,才可以将新增的功能模块的代码添加入当前程序中,而且在添加代码之前,还对新增代码的完整性进行了校验,从而有效降低了更新出来的程序运行时的异常概率。In summary, the embodiment of the present application pre-configures the correspondence between the functional modules that have conflicts in the running environment. Before adding the code of the newly added function module to the current program, the module must first be based on the corresponding relationship. Whether there is a running environment conflict between the judgments, only when there is no conflict, the code of the newly added function module can be added to the current program, and the integrity of the newly added code is verified before the code is added. , which effectively reduces the abnormal probability of the updated program running.
图4示出了本申请实施例提供的程序更新终端设备的示意框图。该程序更新终端设备可包括:处理器40、存储器41以及存储在所述存储器41中并可在所述处理器40上运行的计算机可读指令42。FIG. 4 is a schematic block diagram of a program update terminal device provided by an embodiment of the present application. The program update terminal device can include a processor 40, a memory 41, and computer readable instructions 42 stored in the memory 41 and executable on the processor 40.
请参阅图5,是本申请实施例提供的计算机可读指令42的模块图。在本实施例中,所述的计算机可读指令42可以被分割成一个或多个模块,所述一个或者多个模块被存储于所述存储器41中,并由所述处理器40所执行,以完成本申请。例如,在图5中,所述的计算机可读指令42可以被分割成目标功能模块获取模块501、当前功能模块获取模块502、第一判断模块503、目标功能模块代码读取模块504、目标功能模块代码完整性判断模块505、目标功能模块代码添加模块506。同样地,本申请实施例提供的程序更新装置也可包括这些模块。以下描述将具体介绍所述模块501-506的功能:FIG. 5 is a block diagram of computer readable instructions 42 provided by an embodiment of the present application. In the present embodiment, the computer readable instructions 42 may be partitioned into one or more modules, the one or more modules being stored in the memory 41 and executed by the processor 40, To complete this application. For example, in FIG. 5, the computer readable instructions 42 may be divided into a target function module acquisition module 501, a current function module acquisition module 502, a first determination module 503, a target function module code reading module 504, and a target function. The module code integrity determination module 505 and the target function module code addition module 506. Similarly, the program updating apparatus provided in the embodiment of the present application may also include these modules. The following description will specifically describe the functions of the modules 501-506:
目标功能模块获取模块501,用于获取待更新入目标程序的目标功能模块;The target function module acquiring module 501 is configured to acquire a target function module to be updated into the target program;
当前功能模块获取模块502,用于获取所述目标程序当前的各个功能模块;The current function module acquiring module 502 is configured to acquire each function module currently in the target program;
第一判断模块503,用于根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;The first judging module 503 is configured to determine, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first corresponding The relationship records the correspondence between functional modules that have conflicts in the operating environment;
目标功能模块代码读取模块504,用于若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;The target function module code reading module 504 is configured to: if the conflicting function module does not exist in each function module currently in the target program, read the code of the target function module from a preset code library;
目标功能模块代码完整性判断模块505,用于使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;The target function module code integrity determining module 505 is configured to determine whether the code of the target function module is complete by using the information digest algorithm 5 or the secure hash algorithm;
目标功能模块代码添加模块506,用于若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。The target function module code adding module 506 is configured to add the code of the target function module into the code of the target program to complete the update of the target program if the code of the target function module is complete. .
进一步地,所述计算机可读指令42中还可以包括:Further, the computer readable instructions 42 may further include:
前置功能模块查找模块,用于在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块,所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块;The pre-function module search module is configured to search for a pre-function module that the target function module depends on in a preset second correspondence, and the second correspondence records the pre-function module and the post function Corresponding relationship between the modules, the operation of the post function module depends on the pre-function module;
前置功能模块代码读取模块,用于从所述代码库中读取所述前置功能模块的代码;a pre-function module code reading module, configured to read code of the pre-function module from the code base;
前置功能模块代码完整性判断模块,用于使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整;a pre-function module code integrity judgment module, configured to determine whether the code of the pre-function module is complete by using a message digest algorithm 5 or a secure hash algorithm;
前置功能模块代码添加模块,用于若所述前置功能模块的代码是完整的,则将所述前置功能模块的代码添加入所述目标程序的代码中。The pre-function module code adding module is configured to add the code of the pre-function module to the code of the target program if the code of the pre-function module is complete.
进一步地,所述计算机可读指令42中还可以包括:Further, the computer readable instructions 42 may further include:
替代功能模块获取模块,用于若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块,所述第三对应关系记录了功能相同的功能模块之间的对应关系;And an alternative function module acquiring module, configured to acquire the same function as the target function module from the preset third correspondence relationship if the conflict function module exists in each of the current function modules of the target program a module, wherein the third correspondence records a correspondence between functional modules having the same function;
第二判断模块,用于根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;a second determining module, configured to determine, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program;
替代功能模块代码读取模块,用于在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码;An alternative function module code reading module, configured to read, in the current function modules of the target program, a function module that conflicts with a running environment of the substitute function module, and read the replacement function from the code library Module code;
替代功能模块代码完整性判断模块,用于使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整;An alternative function module code integrity judging module, configured to determine whether the code of the substitute function module is complete by using an information digest algorithm 5 or a secure hash algorithm;
替代功能模块代码添加模块,用于若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。The substitute function module code adding module is configured to add the code of the substitute function module into the code of the target program to complete the update of the target program if the code of the substitute function module is complete.
进一步地,所述计算机可读指令42中还可以包括:Further, the computer readable instructions 42 may further include:
优先级获取模块,用于若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级;a priority obtaining module, configured to acquire a first priority corresponding to the target function module from a preset priority list, if the conflicting function module exists in each function module currently in the target program a second priority corresponding to the conflicting function module;
第一删除模块,用于若所述第一优先级高于所述第二优先级,则从所述目标程序中删除所述冲突功能模块的代码。The first deleting module is configured to delete the code of the conflicting function module from the target program if the first priority is higher than the second priority.
进一步地,所述计算机可读指令42中还可以包括:Further, the computer readable instructions 42 may further include:
运行模块,用于运行所述目标程序,并获取运行结果报告;Running a module for running the target program and obtaining a running result report;
运行判断模块,用于根据所述运行结果报告判断所述目标程序是否运行异常;a running judgment module, configured to determine, according to the running result report, whether the target program is abnormally operated;
异常模块获取模块,用于若所述目标程序运行异常,则从所述运行结果报告中查找出现异常时正在执行的功能模块;An abnormal module acquiring module, configured to: if the target program runs abnormally, search for a function module that is being executed when an abnormality occurs;
关系添加模块,用于将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中;a relationship adding module, configured to add, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module;
第二删除模块,用于从所述目标程序的代码中删除所述目标功能模块的代码。And a second deleting module, configured to delete code of the target function module from code of the target program.
Claims (20)
- 一种程序更新方法,其特征在于,包括:A program update method, comprising:获取待更新入目标程序的目标功能模块;Obtain a target function module to be updated into the target program;获取所述目标程序当前的各个功能模块;Obtaining each function module of the target program;根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;Determining, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first correspondence records a conflict of a running environment Correspondence between functional modules;若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;If the conflict function module does not exist in each function module currently in the target program, the code of the target function module is read from a preset code library;使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;Determining whether the code of the target function module is complete by using an information digest algorithm 5 or a secure hash algorithm;若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the target function module is complete, the code of the target function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求1所述的程序更新方法,其特征在于,在将所述目标功能模块的代码添加入所述目标程序的代码中之后,还包括:The program updating method according to claim 1, further comprising: after adding the code of the target function module to the code of the target program, further comprising:在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块,所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块;Searching, in a preset second correspondence, a pre-function module on which the target function module is operated, where the second correspondence records a correspondence between the pre-function module and the post-function module, The operation of the post function module depends on the pre-function module;从所述代码库中读取所述前置功能模块的代码;Reading the code of the pre-function module from the code base;使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整;Using the information digest algorithm 5 or the secure hash algorithm to determine whether the code of the pre-function module is complete;若所述前置功能模块的代码是完整的,则将所述前置功能模块的代码添加入所述目标程序的代码中。If the code of the pre-function module is complete, the code of the pre-function module is added to the code of the target program.
- 根据权利要求1所述的程序更新方法,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The program updating method according to claim 1, wherein it is determined whether there is a conflict between the respective functional modules currently in the target program and the running environment conflict with the target functional module according to the preset first correspondence relationship. After the function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块,所述第三对应关系记录了功能相同的功能模块之间的对应关系;If the conflicting function module exists in each of the current functional modules of the target program, obtaining an alternative function module that is the same as the function of the target function module from the preset third correspondence, the third correspondence Recording the correspondence between functional modules with the same function;根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;Determining, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program;若在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码;If there is no function module in the current function module of the target program that conflicts with the operating environment of the substitute function module, the code of the substitute function module is read from the code library;使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整;Determining whether the code of the substitute function module is complete by using the information digest algorithm 5 or the secure hash algorithm;若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the substitute function module is complete, the code of the substitute function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求1所述的程序更新方法,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The program updating method according to claim 1, wherein it is determined whether there is a conflict between the respective functional modules currently in the target program and the running environment conflict with the target functional module according to the preset first correspondence relationship. After the function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级;If the conflicting function module exists in each of the current function modules of the target program, the first priority level corresponding to the target function module and the conflict function module are respectively obtained from the preset priority list. Second priority若所述第一优先级高于所述第二优先级,则从所述目标程序中删除所述冲突功能模块的代码;If the first priority is higher than the second priority, deleting the code of the conflicting function module from the target program;从所述代码库中读取所述目标功能模块的代码;Reading the code of the target function module from the code base;将所述目标功能模块的代码添加入所述目标程序的代码中。The code of the target function module is added to the code of the target program.
- 根据权利要求1至4中任一项所述的程序更新方法,其特征在于,在完成对所述目标程序的更新之后,还包括:The program updating method according to any one of claims 1 to 4, further comprising: after completing the updating of the target program, further comprising:运行所述目标程序,并获取运行结果报告;Running the target program and obtaining a running result report;根据所述运行结果报告判断所述目标程序是否运行异常;Determining whether the target program is abnormal according to the operation result report;若所述目标程序运行异常,则从所述运行结果报告中查找出现异常时正在执行的功能模块;If the target program runs abnormally, the function result report is used to find a function module that is being executed when an abnormality occurs;将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中;Adding, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module;从所述目标程序的代码中删除所述目标功能模块的代码。The code of the target function module is deleted from the code of the target program.
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:A computer readable storage medium storing computer readable instructions, wherein the computer readable instructions, when executed by a processor, implement the following steps:获取待更新入目标程序的目标功能模块;Obtain a target function module to be updated into the target program;获取所述目标程序当前的各个功能模块;Obtaining each function module of the target program;根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;Determining, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first correspondence records a conflict of a running environment Correspondence between functional modules;若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;If the conflict function module does not exist in each function module currently in the target program, the code of the target function module is read from a preset code library;使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;Determining whether the code of the target function module is complete by using an information digest algorithm 5 or a secure hash algorithm;若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the target function module is complete, the code of the target function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求6所述的计算机可读存储介质,其特征在于,在将所述目标功能模块的代码添加入所述目标程序的代码中之后,还包括:The computer readable storage medium according to claim 6, wherein after the code of the target function module is added to the code of the target program, the method further comprises:在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块,所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块;Searching, in a preset second correspondence, a pre-function module on which the target function module is operated, where the second correspondence records a correspondence between the pre-function module and the post-function module, The operation of the post function module depends on the pre-function module;从所述代码库中读取所述前置功能模块的代码;Reading the code of the pre-function module from the code base;使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整;Using the information digest algorithm 5 or the secure hash algorithm to determine whether the code of the pre-function module is complete;若所述前置功能模块的代码是完整的,则将所述前置功能模块的代码添加入所述目标程序的代码中。If the code of the pre-function module is complete, the code of the pre-function module is added to the code of the target program.
- 根据权利要求6所述的计算机可读存储介质,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The computer readable storage medium according to claim 6, wherein it is determined whether there is a conflict with the running environment of the target function module in each of the current functional modules of the target program according to the preset first correspondence After the conflicting function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块,所述第三对应关系记录了功能相同的功能模块之间的对应关系;If the conflicting function module exists in each of the current functional modules of the target program, obtaining an alternative function module that is the same as the function of the target function module from the preset third correspondence, the third correspondence Recording the correspondence between functional modules with the same function;根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;Determining, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program;若在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码;If there is no function module in the current function module of the target program that conflicts with the operating environment of the substitute function module, the code of the substitute function module is read from the code library;使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整;Determining whether the code of the substitute function module is complete by using the information digest algorithm 5 or the secure hash algorithm;若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the substitute function module is complete, the code of the substitute function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求6所述的计算机可读存储介质,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The computer readable storage medium according to claim 6, wherein it is determined whether there is a conflict with the running environment of the target function module in each of the current functional modules of the target program according to the preset first correspondence After the conflicting function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级;If the conflicting function module exists in each of the current function modules of the target program, the first priority level corresponding to the target function module and the conflict function module are respectively obtained from the preset priority list. Second priority若所述第一优先级高于所述第二优先级,则从所述目标程序中删除所述冲突功能模块的代码;If the first priority is higher than the second priority, deleting the code of the conflicting function module from the target program;从所述代码库中读取所述目标功能模块的代码;Reading the code of the target function module from the code base;将所述目标功能模块的代码添加入所述目标程序的代码中。The code of the target function module is added to the code of the target program.
- 根据权利要求6至9中任一项所述的计算机可读存储介质,其特征在于,在完成对所述目标程序的更新之后,还包括:The computer readable storage medium according to any one of claims 6 to 9, wherein after the updating of the target program is completed, the method further comprises:运行所述目标程序,并获取运行结果报告;Running the target program and obtaining a running result report;根据所述运行结果报告判断所述目标程序是否运行异常;Determining whether the target program is abnormal according to the operation result report;若所述目标程序运行异常,则从所述运行结果报告中查找出现异常时正在执行的功能模块;If the target program runs abnormally, the function result report is used to find a function module that is being executed when an abnormality occurs;将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中;Adding, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module;从所述目标程序的代码中删除所述目标功能模块的代码。The code of the target function module is deleted from the code of the target program.
- 一种程序更新终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A program update terminal device comprising a memory, a processor, and computer readable instructions stored in the memory and operable on the processor, wherein when the processor executes the computer readable instructions Implement the following steps:获取待更新入目标程序的目标功能模块;Obtain a target function module to be updated into the target program;获取所述目标程序当前的各个功能模块;Obtaining each function module of the target program;根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;Determining, according to the preset first correspondence, whether there is a conflict function module that conflicts with the running environment of the target function module in each function module currently in the target program, where the first correspondence records a conflict of a running environment Correspondence between functional modules;若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;If the conflict function module does not exist in each function module currently in the target program, the code of the target function module is read from a preset code library;使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;Determining whether the code of the target function module is complete by using an information digest algorithm 5 or a secure hash algorithm;若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the target function module is complete, the code of the target function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求11所述的程序更新终端设备,其特征在于,在将所述目标功能模块的代码添加入所述目标程序的代码中之后,还包括:The program update terminal device according to claim 11, wherein after the code of the target function module is added to the code of the target program, the method further includes:在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块,所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块;Searching, in a preset second correspondence, a pre-function module on which the target function module is operated, where the second correspondence records a correspondence between the pre-function module and the post-function module, The operation of the post function module depends on the pre-function module;从所述代码库中读取所述前置功能模块的代码;Reading the code of the pre-function module from the code base;使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整;Using the information digest algorithm 5 or the secure hash algorithm to determine whether the code of the pre-function module is complete;若所述前置功能模块的代码是完整的,则将所述前置功能模块的代码添加入所述目标程序的代码中。If the code of the pre-function module is complete, the code of the pre-function module is added to the code of the target program.
- 根据权利要求11所述的程序更新终端设备,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The program updating terminal device according to claim 11, wherein it is determined whether there is a conflict with the running environment of the target function module in each of the current functional modules of the target program according to the preset first correspondence After the conflict function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块,所述第三对应关系记录了功能相同的功能模块之间的对应关系;If the conflicting function module exists in each of the current functional modules of the target program, obtaining an alternative function module that is the same as the function of the target function module from the preset third correspondence, the third correspondence Recording the correspondence between functional modules with the same function;根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;Determining, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program;若在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码;If there is no function module in the current function module of the target program that conflicts with the operating environment of the substitute function module, the code of the substitute function module is read from the code library;使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整;Determining whether the code of the substitute function module is complete by using the information digest algorithm 5 or the secure hash algorithm;若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。If the code of the substitute function module is complete, the code of the substitute function module is added to the code of the target program to complete the update of the target program.
- 根据权利要求11所述的程序更新终端设备,其特征在于,在根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块之后,还包括:The program updating terminal device according to claim 11, wherein it is determined whether there is a conflict with the running environment of the target function module in each of the current functional modules of the target program according to the preset first correspondence After the conflict function module, it also includes:若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级;If the conflicting function module exists in each of the current function modules of the target program, the first priority level corresponding to the target function module and the conflict function module are respectively obtained from the preset priority list. Second priority若所述第一优先级高于所述第二优先级,则从所述目标程序中删除所述冲突功能模块的代码;If the first priority is higher than the second priority, deleting the code of the conflicting function module from the target program;从所述代码库中读取所述目标功能模块的代码;Reading the code of the target function module from the code base;将所述目标功能模块的代码添加入所述目标程序的代码中。The code of the target function module is added to the code of the target program.
- 根据权利要求11至14中任一项所述的程序更新终端设备,其特征在于,在完成对所述目标程序的更新之后,还包括:The program updating terminal device according to any one of claims 11 to 14, wherein after the updating of the target program is completed, the method further comprises:运行所述目标程序,并获取运行结果报告;Running the target program and obtaining a running result report;根据所述运行结果报告判断所述目标程序是否运行异常;Determining whether the target program is abnormal according to the operation result report;若所述目标程序运行异常,则从所述运行结果报告中查找出现异常时正在执行的功能模块;If the target program runs abnormally, the function result report is used to find a function module that is being executed when an abnormality occurs;将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中;Adding, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module;从所述目标程序的代码中删除所述目标功能模块的代码。The code of the target function module is deleted from the code of the target program.
- 一种程序更新装置,其特征在于,包括:A program updating device, comprising:目标功能模块获取模块,用于获取待更新入目标程序的目标功能模块;a target function module acquiring module, configured to acquire a target function module to be updated into the target program;当前功能模块获取模块,用于获取所述目标程序当前的各个功能模块;a current function module acquiring module, configured to acquire each function module of the target program;第一判断模块,用于根据预设的第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述目标功能模块存在运行环境冲突的冲突功能模块,所述第一对应关系记录了存在运行环境冲突的功能模块之间的对应关系;a first determining module, configured to determine, according to the preset first correspondence, whether a conflicting function module that conflicts with a running environment of the target function module exists in each function module currently in the target program, the first correspondence relationship Recording the correspondence between functional modules that have conflicts in the operating environment;目标功能模块代码读取模块,用于若在所述目标程序当前的各个功能模块中不存在所述冲突功能模块,则从预设的代码库中读取所述目标功能模块的代码;a target function module code reading module, configured to read a code of the target function module from a preset code library if the conflict function module does not exist in each function module currently in the target program;目标功能模块代码完整性判断模块,用于使用信息摘要算法5或者安全哈希算法判断所述目标功能模块的代码是否完整;a target function module code integrity judging module, configured to determine whether the code of the target function module is complete by using an information digest algorithm 5 or a secure hash algorithm;目标功能模块代码添加模块,用于若所述目标功能模块的代码是完整的,则将所述目标功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。The target function module code adding module is configured to add the code of the target function module into the code of the target program to complete the update of the target program if the code of the target function module is complete.
- 根据权利要求16所述的程序更新装置,其特征在于,还包括:The program updating apparatus according to claim 16, further comprising:前置功能模块查找模块,用于在预设的第二对应关系中查找所述目标功能模块运行时所依赖的前置功能模块,所述第二对应关系记录了前置功能模块与后置功能模块之间的对应关系,所述后置功能模块的运行依赖于所述前置功能模块;The pre-function module search module is configured to search for a pre-function module that the target function module depends on in a preset second correspondence, and the second correspondence records the pre-function module and the post function Corresponding relationship between the modules, the operation of the post function module depends on the pre-function module;前置功能模块代码读取模块,用于从所述代码库中读取所述前置功能模块的代码;a pre-function module code reading module, configured to read code of the pre-function module from the code base;前置功能模块代码完整性判断模块,用于使用信息摘要算法5或者安全哈希算法判断所述前置功能模块的代码是否完整;a pre-function module code integrity judgment module, configured to determine whether the code of the pre-function module is complete by using a message digest algorithm 5 or a secure hash algorithm;前置功能模块代码添加模块,用于若所述前置功能模块的代码是完整的,则将所述前置功能模块的代码添加入所述目标程序的代码中。The pre-function module code adding module is configured to add the code of the pre-function module to the code of the target program if the code of the pre-function module is complete.
- 根据权利要求16所述的程序更新装置,其特征在于,还包括:The program updating apparatus according to claim 16, further comprising:替代功能模块获取模块,用于若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的第三对应关系中获取与所述目标功能模块的功能相同的替代功能模块,所述第三对应关系记录了功能相同的功能模块之间的对应关系;And an alternative function module acquiring module, configured to acquire the same function as the target function module from the preset third correspondence relationship if the conflict function module exists in each of the current function modules of the target program a module, wherein the third correspondence records a correspondence between functional modules having the same function;第二判断模块,用于根据所述第一对应关系判断在所述目标程序当前的各个功能模块中是否存在与所述替代功能模块存在运行环境冲突的功能模块;a second determining module, configured to determine, according to the first correspondence, whether a function module that conflicts with a running environment of the substitute function module exists in each function module currently in the target program;替代功能模块代码读取模块,用于在所述目标程序当前的各个功能模块中不存在与所述替代功能模块存在运行环境冲突的功能模块,则从所述代码库中读取所述替代功能模块的代码;An alternative function module code reading module, configured to read, in the current function modules of the target program, a function module that conflicts with a running environment of the substitute function module, and read the replacement function from the code library Module code;替代功能模块代码完整性判断模块,用于使用信息摘要算法5或者安全哈希算法判断所述替代功能模块的代码是否完整;An alternative function module code integrity judging module, configured to determine whether the code of the substitute function module is complete by using an information digest algorithm 5 or a secure hash algorithm;替代功能模块代码添加模块,用于若所述替代功能模块的代码是完整的,则将所述替代功能模块的代码添加入所述目标程序的代码中,以完成对所述目标程序的更新。The substitute function module code adding module is configured to add the code of the substitute function module into the code of the target program to complete the update of the target program if the code of the substitute function module is complete.
- 根据权利要求16所述的程序更新装置,其特征在于,还包括:The program updating apparatus according to claim 16, further comprising:优先级获取模块,用于若在所述目标程序当前的各个功能模块中存在所述冲突功能模块,则从预设的优先级列表中分别获取所述目标功能模块所对应的第一优先级及所述冲突功能模块所对应的第二优先级;a priority obtaining module, configured to acquire a first priority corresponding to the target function module from a preset priority list, if the conflicting function module exists in each function module currently in the target program a second priority corresponding to the conflicting function module;第一删除模块,用于若所述第一优先级高于所述第二优先级,则从所述目标程序中删除所述冲突功能模块的代码。The first deleting module is configured to delete the code of the conflicting function module from the target program if the first priority is higher than the second priority.
- 根据权利要求16至19中任一项所述的程序更新装置,其特征在于,还包括:The program updating apparatus according to any one of claims 16 to 19, further comprising:运行模块,用于运行所述目标程序,并获取运行结果报告;Running a module for running the target program and obtaining a running result report;运行判断模块,用于根据所述运行结果报告判断所述目标程序是否运行异常;a running judgment module, configured to determine, according to the running result report, whether the target program is abnormally operated;异常模块获取模块,用于若所述目标程序运行异常,则从所述运行结果报告中查找出现异常时正在执行的功能模块;An abnormal module acquiring module, configured to: if the target program runs abnormally, search for a function module that is being executed when an abnormality occurs;关系添加模块,用于将所述出现异常时正在执行的功能模块与所述目标功能模块之间存在的运行环境冲突的关系添加入所述第一对应关系中;a relationship adding module, configured to add, to the first correspondence relationship, a relationship between a function module that is being executed when the abnormality occurs and a running environment conflict between the target function module;第二删除模块,用于从所述目标程序的代码中删除所述目标功能模块的代码。And a second deleting module, configured to delete code of the target function module from code of the target program.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710804129.1A CN107832062B (en) | 2017-09-08 | 2017-09-08 | Program updating method and terminal equipment |
CN201710804129.1 | 2017-09-08 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019047480A1 true WO2019047480A1 (en) | 2019-03-14 |
Family
ID=61643289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/076522 WO2019047480A1 (en) | 2017-09-08 | 2018-02-12 | Program update method, computer-readable storage medium, terminal device and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107832062B (en) |
WO (1) | WO2019047480A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110442441A (en) * | 2019-08-07 | 2019-11-12 | 腾讯科技(深圳)有限公司 | Data processing method, device, readable storage medium storing program for executing and terminal device |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189411B (en) * | 2018-08-23 | 2022-02-01 | 爱尚游(北京)科技股份有限公司 | Cloud application installation method |
CN110162467B (en) * | 2019-04-23 | 2023-12-19 | 平安科技(深圳)有限公司 | Software testing method, device, computer equipment and readable storage medium |
CN110069279B (en) * | 2019-04-29 | 2023-08-08 | 南方电网科学研究院有限责任公司 | Method, device and storage medium for checking direct current control protection program |
CN110659081B (en) * | 2019-09-10 | 2022-12-27 | 北京达佳互联信息技术有限公司 | File processing method and device for program object and electronic equipment |
CN111078249B (en) * | 2019-11-08 | 2023-06-02 | 泰康保险集团股份有限公司 | Software updating method, system, equipment and storage medium |
CN111338688B (en) * | 2020-02-28 | 2023-12-08 | 深圳平安医疗健康科技服务有限公司 | Data long-acting caching method and device, computer system and readable storage medium |
US11150880B1 (en) | 2020-06-11 | 2021-10-19 | International Business Machines Corporation | Automating an adoption of cloud services |
CN112015640B (en) * | 2020-08-06 | 2024-04-05 | 京东科技控股股份有限公司 | Software testing method and system |
CN113535206B (en) * | 2021-07-23 | 2024-02-20 | 上海幻电信息科技有限公司 | Multi-version code upgrading method and system |
CN113886267A (en) * | 2021-10-25 | 2022-01-04 | 锐凌无线通讯科技(深圳)有限公司 | Software system detection method and device, electronic equipment and storage medium |
CN116225966B (en) * | 2023-04-25 | 2023-08-04 | 深圳曼瑞德科技有限公司 | Application evaluation method and system based on intelligent watch |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102081534A (en) * | 2009-11-30 | 2011-06-01 | 英特尔公司 | Automatic modular and secure boot firmware update |
CN102830995A (en) * | 2012-08-03 | 2012-12-19 | 广东欧珀移动通信有限公司 | Method for upgrading Android platform software with user data reserved |
US8561052B2 (en) * | 2008-12-08 | 2013-10-15 | Harris Corporation | Communications device with a plurality of processors and compatibility synchronization module for processor upgrades and related method |
CN103513999A (en) * | 2012-06-25 | 2014-01-15 | 联想(北京)有限公司 | Electronic device and method for updating system firmware |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101533356B (en) * | 2009-04-21 | 2013-02-27 | 华为技术有限公司 | A method, a device and a system for realizing software online upgrade |
US20130117738A1 (en) * | 2011-11-03 | 2013-05-09 | Microsoft Corporation | Server Upgrades with Safety Checking and Preview |
US9665359B2 (en) * | 2013-09-13 | 2017-05-30 | Microsoft Technology Licensing, Llc | Automatically resolving conflicts after installation of selected updates in a computer system |
CN105700919B (en) * | 2016-01-04 | 2019-04-30 | 惠州市蓝微新源技术有限公司 | A kind of BMS application program Rapid Updating and more new system |
-
2017
- 2017-09-08 CN CN201710804129.1A patent/CN107832062B/en active Active
-
2018
- 2018-02-12 WO PCT/CN2018/076522 patent/WO2019047480A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8561052B2 (en) * | 2008-12-08 | 2013-10-15 | Harris Corporation | Communications device with a plurality of processors and compatibility synchronization module for processor upgrades and related method |
CN102081534A (en) * | 2009-11-30 | 2011-06-01 | 英特尔公司 | Automatic modular and secure boot firmware update |
CN103513999A (en) * | 2012-06-25 | 2014-01-15 | 联想(北京)有限公司 | Electronic device and method for updating system firmware |
CN102830995A (en) * | 2012-08-03 | 2012-12-19 | 广东欧珀移动通信有限公司 | Method for upgrading Android platform software with user data reserved |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110442441A (en) * | 2019-08-07 | 2019-11-12 | 腾讯科技(深圳)有限公司 | Data processing method, device, readable storage medium storing program for executing and terminal device |
CN110442441B (en) * | 2019-08-07 | 2024-03-12 | 腾讯科技(深圳)有限公司 | Data processing method and device, readable storage medium and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107832062A (en) | 2018-03-23 |
CN107832062B (en) | 2020-04-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019047480A1 (en) | Program update method, computer-readable storage medium, terminal device and apparatus | |
US10785110B2 (en) | Automated change approval | |
US11163744B2 (en) | Test data generation and scale up for database testing using unique common factor sequencing | |
JP5644777B2 (en) | File group consistency verification system, file group consistency verification method, and file group consistency verification program | |
US6675180B2 (en) | Data updating apparatus that performs quick restoration processing | |
CN108319858B (en) | Data dependency graph construction method and device for unsafe function | |
WO2019237574A1 (en) | Method and device for identifying database differences | |
CN112579591B (en) | Data verification method, device, electronic equipment and computer readable storage medium | |
WO2015087509A1 (en) | State storage and restoration device, state storage and restoration method, and storage medium | |
WO2016177075A1 (en) | Method of checking associative relationship of service data, device and readable storage medium utilizing same | |
CN112783835A (en) | Index management method and device and electronic equipment | |
CN115952300A (en) | Dynamic map construction method, dynamic map construction apparatus, and readable storage medium | |
JP2004118553A (en) | Work flow execution method and system, and program for the same | |
CN115129704A (en) | Migration data verification method and system, electronic device and storage medium | |
WO2020199789A1 (en) | Information processing method and apparatus | |
CN111460436A (en) | Unstructured data operation method and system based on block chain | |
WO2020019418A1 (en) | Database configuration information adaptation method, apparatus, computer device, and storage medium | |
CN110347333A (en) | Improve method, apparatus, computer equipment and the storage medium of clone's mirror image performance | |
US12026181B2 (en) | Network environment synchronization apparatus and method | |
CN110795297B (en) | Electronic equipment testing method and device | |
KR102406242B1 (en) | Blockchain-based patch management device for patent specification management in patent brokering process | |
CN111079199B (en) | Enterprise credit data screenshot tamper-proofing method based on block chain technology | |
JP2010257226A (en) | Apparatus and method for processing information, program and recording medium | |
CN110781194B (en) | Application program table data processing method and device, electronic equipment and storage medium | |
CN114428956A (en) | File verification method, device and system based on extended attributes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18853244 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.09.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18853244 Country of ref document: EP Kind code of ref document: A1 |