CN111400102B - Method, device, equipment and storage medium for monitoring change of application program - Google Patents
Method, device, equipment and storage medium for monitoring change of application program Download PDFInfo
- Publication number
- CN111400102B CN111400102B CN202010195273.1A CN202010195273A CN111400102B CN 111400102 B CN111400102 B CN 111400102B CN 202010195273 A CN202010195273 A CN 202010195273A CN 111400102 B CN111400102 B CN 111400102B
- Authority
- CN
- China
- Prior art keywords
- file
- program
- application program
- updated
- fingerprint
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1433—Saving, restoring, recovering or retrying at system level during software upgrading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for monitoring the change of an application program, which are characterized in that when a file change instruction of a target application program is detected, a changed update program file is obtained, and the file checksum of the update program file is calculated and used as an update program file fingerprint; comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint; and when the target application program is detected to be updated, displaying a corresponding update reminding message through the change monitoring terminal. The invention accurately determines whether the target application program is updated, prevents the application program from uncontrollably updating, improves the reliability of the application program updating, and improves the updating efficiency of the application program in the production application server.
Description
Technical Field
The present invention relates to the technical field of financial science and technology (Fintech), and in particular, to a method, an apparatus, a device, and a computer readable storage medium for monitoring changes of an application program.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain Blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put on the information technology infrastructure library (Information Technology Infrastructure Library, ITIL) technology. Currently, in ITIL, the change procedure is a very important procedure. The ITIL defines the concrete flow of change management including change auditing, change implementation, validation, etc. In the actual production process of enterprises, the modification implementation generally synchronizes the developed and tested codes to an application server directly through a modification platform, and then executes a series of backup restart scripts and the like. However, in the update process on the production application server, uncontrolled changes exist in the application package of the production deployment, for example, IT personnel directly change the application configuration on the server in the event of a rapid emergency, or the application package is replaced with an error package on the change platform, so that the update abnormality of the application program in the production application server is easy to occur.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a computer readable storage medium for monitoring the change of an application program, and aims to solve the technical problem that the existing application program is easy to update in a production application server.
In order to achieve the above object, the present invention provides a method for monitoring the change of an application program, the method for monitoring the change of the application program comprising the steps of:
When a file change instruction of a target application program is detected, acquiring an updated program file corresponding to the changed target application program, and calculating a file checksum of the updated program file as an updated program file fingerprint;
Comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint;
And when the target application program is detected to be updated, displaying a corresponding update reminding message through the change monitoring terminal.
Optionally, when the file change instruction of the target application program is detected, acquiring an updated program file corresponding to the changed target application program, and calculating a file checksum of the updated program file, where the step of serving as the updated program file fingerprint specifically includes:
when a file change instruction of a target application program is detected, acquiring a target application program package corresponding to the changed target application program;
Acquiring a relative path of a non-log file in the target application program package, and acquiring all files under the relative path through multithreading polling;
And calculating each file checksum of all the files through a hash algorithm to obtain each file checksum set as the file fingerprint of the update program.
Optionally, the step of comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint specifically includes:
comparing the updated file checksum set in the updated program file fingerprint with the current file checksum set in the current program file fingerprint according to a preset path field;
and determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
Optionally, the step of determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set specifically includes:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
Optionally, the file change instruction includes a file compiling instruction and/or a file change instruction, and the update program file includes a compiler file and/or a change program file, and when the file change instruction of the target application program is detected, the step of obtaining an update program file corresponding to the changed target application program, and calculating a file checksum of the update program file, as an update program file fingerprint, specifically includes:
When a file compiling instruction and/or a file changing instruction of a target application program are detected, acquiring a compiler file and/or a changing program file corresponding to the changed target application program;
And calculating the file checksum of the compiler file and/or the change program file to be used as the fingerprint of the compiler file and/or the fingerprint of the change program file.
Optionally, the step of comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint specifically includes:
Comparing the compiler file fingerprint and/or the change program file fingerprint with the current program file fingerprint to obtain a first comparison result and/or a second comparison result, wherein the first comparison result and the second comparison result are comparison results of the current program file fingerprint with the compiler file fingerprint and the change program file fingerprint respectively;
When the first comparison result is different, determining that compiling updating of the target application program occurs; or (b)
And when the second comparison result is different, determining that the target application program is changed and updated.
Optionally, the method for monitoring the change of the application program further includes:
when the first comparison result and the second comparison result are different, determining that compiling update and changing update occur to the target application program;
Acquiring a first differentiation result of the compiler file fingerprint and the current program file fingerprint, and acquiring a second differentiation result of the changed program file fingerprint and the current program file fingerprint;
And generating an updating abnormal reminding message when the first differential result is different from the second differential result, and displaying the updating abnormal reminding message through the change monitoring terminal.
Optionally, after the step of displaying the corresponding update reminding message by the change monitoring terminal when the update of the target application program is detected, the method further includes:
And storing the update program file fingerprint and the update result of the target application program into a cache database, and setting the storage life of the update program file fingerprint and the update result of the target application program in the cache database.
In order to achieve the above object, the present invention also provides an application program modification monitoring device, including:
The file fingerprint calculation module is used for acquiring an updated program file corresponding to the changed target application program when a file change instruction of the target application program is detected, and calculating a file checksum of the updated program file as an updated program file fingerprint;
The file update detection module is used for comparing the update program file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the update program file fingerprint and the current program file fingerprint;
And the file updating reminding module is used for displaying a corresponding updating reminding message through the change monitoring terminal when the target application program is detected to be updated.
Optionally, the file fingerprint calculation module specifically includes:
The program package acquisition unit is used for acquiring a target application program package corresponding to the changed target application program when the file change instruction of the target application program is detected;
The file acquisition unit is used for acquiring the relative path of the non-log files in the target application program package and acquiring all files under the relative path through multi-thread polling;
And the fingerprint calculation unit is used for calculating the checksum of each file of all the files through a hash algorithm to obtain a checksum set of each file as the fingerprint of the updated program file.
Optionally, the file update detection module specifically includes:
The collection comparison unit is used for comparing the updated file checksum collection in the updated program file fingerprint with the current file checksum collection in the current program file fingerprint according to a preset path field;
And the updating determining unit is used for determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
Optionally, the update determining unit is further configured to:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
In addition, in order to achieve the above object, the present invention also provides an application program modification monitoring device, including: the method comprises the steps of a memory, a processor and a change monitoring program of an application program stored in the memory and capable of running on the processor, wherein the change monitoring program of the application program realizes the change monitoring method of the application program when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a change monitor program of an application program, which when executed by a processor, implements the steps of the change monitor method of an application program as described above.
The invention provides a change monitoring method of an application program, which comprises the steps of acquiring an updated program file corresponding to a changed target application program when a file change instruction of the target application program is detected, and calculating a file checksum of the updated program file to be used as an updated program file fingerprint; comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint; and when the target application program is detected to be updated, displaying a corresponding update reminding message through the change monitoring terminal. By means of the method, the updating program file fingerprint after each change of the target application program is compared with the current program file fingerprint before the change, so that whether the target application program is updated or not can be accurately determined, uncontrollable updating of the application program is prevented, the updating reliability of the application program is improved, updating abnormality of the application program in the production application server is prevented, the updating efficiency of the application program in the production application server is improved, and the technical problem that updating abnormality of the existing application program in the production application server is easy to occur is solved.
Drawings
FIG. 1 is a schematic diagram of a device architecture of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart of a first embodiment of a method for monitoring a change of an application program according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure of a hardware running environment according to an embodiment of the present invention.
The change monitoring device of the application program in the embodiment of the invention can be a PC or a server device, and a Java virtual machine is operated on the change monitoring device.
As shown in fig. 1, the change monitoring device of the application program may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the device structure shown in fig. 1 is not limiting of the device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a change monitor of an application program may be included in a memory 1005 as one type of computer storage medium.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call a change monitor of an application stored in the memory 1005 and perform operations in a change monitor method of the application described below.
Based on the above hardware structure, the embodiment of the method for monitoring the change of the application program is provided.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a method for monitoring change of an application program according to the present invention, where the method for monitoring change of an application program includes:
step S10, when a file change instruction of a target application program is detected, acquiring an updated program file corresponding to the changed target application program, and calculating a file checksum of the updated program file as an updated program file fingerprint;
The current implementation flow of the change is as follows:
1. After the application program is developed, a compiling tool is used for compiling and testing;
2. Pushing the application program to an application material warehouse after the test is completed;
3. And the IT personnel acquire the application program from the application material warehouse through the change platform, execute the change operation and update the application program to the production application server.
The above-mentioned procedure implements the update process of the application on the production application server, but in the update process on the production application server, there is uncontrolled modification of the application package of the production deployment, for example, IT personnel directly modify the application configuration on the server in the event of a rapid emergency, and the actual production is often happened, and the modification should be identified in time and iterated into the newly compiled application package. However, it is true that these changes are not controlled and recognized, resulting in changes that are not expected; or the application package is replaced by an error package when the change platform is changed, namely, when an actual IT personnel processes the change on the change platform, the error application package is selected (for example, the names of the two application packages are identical or similar but the contents are different), so that the application program is easy to update abnormally in the production application server, and the production accident of the application program is caused. In order to solve the problems, the invention compares the updated program file fingerprint after each change of the target application program with the current program file fingerprint before the change so as to accurately determine whether the target application program is updated, prevent the application program from being updated uncontrollably, improve the reliability of the application program update, prevent the application program in the production application server from being updated abnormally, and improve the update efficiency of the application program in the production application server. Specifically, the invention provides an interface in the form of a plug-in, can be simply integrated in a compiling tool and a changing platform through command parameter encapsulation or interface call, does not influence the main functions of the compiling tool and the changing platform after integration, and has simple tool and platform transformation. The cache database is adopted, so that the quick erasing is convenient, the data storage is provided with a valid period, and the resource occupation is relatively small. Wherein, change to: and when the program of one application system is iteratively developed according to the requirement, updating the iteratively developed application program to a server running corresponding to the application system and enabling a new application program to be effective. Typically, enterprises have a change platform to implement the changes. The changing platform is a platform for providing changing operation, updates the new application program to the server of the corresponding application system through the changing platform, and enables the new application program to run effectively through restarting the application program and the like. The method mainly comprises the steps of executing application package synchronization on a change platform, decompressing the application package to a server, and providing a plurality of scripts remotely executed on the server for backup restarting and the like. The invention can be integrated in the form of plug-in units in the enterprise changing platform for collecting the file fingerprint of the application material to be changed and the fingerprint of the current production application material. Compiling is a process of generating a target program from a source program written in a source language by using a compiler. Common compiling tools include GCC, java c commands, or jenkis, etc. to compile the integrated platform. The invention is integrated into a compiling tool or a compiling command in the form of a plug-in and is used for collecting file fingerprints of original application materials. The application material warehouse is a server for storing application program packages in a concentrated manner. The application ID is a unique identification of an application system in the enterprise, and is allocated in terms of the application system project. A plug-in is a program written by an application program interface conforming to a certain specification, and can run under a specified application system. The embodiment provides a plug-in based on file fingerprint identification, which is integrated in a compiling tool and a changing platform. The plug-in technology architecture adopts a C/S (server/client) architecture, the bottom database adopts a cache database, high-frequency dynamic acquisition and erasure are facilitated, and the data storage capacity is reduced and the resource occupation is reduced by making the data storage validity period. The client is integrated in a compiling tool and a changing platform and dynamically collects the fingerprint of an update program file in an application program package of a required target application program. And the client transmits the acquired fingerprint of the update program file to the server. In a specific embodiment, the client is divided into two configuration modes, namely a compiling mode and a changing mode, and a compiling tool adopts the compiling mode to collect and transmit file fingerprints to the server and stores the file fingerprints in a cache database; and the change platform transmits the acquired file fingerprints to the server by adopting a change mode and stores the acquired file fingerprints in a cache database. The file fingerprint is obtained by checking a specific file through a certain algorithm, so that a file checksum with a certain number of bits is obtained, the file name and the suffix name of the file to be checked can be changed, and the checksum is not affected. The file fingerprinting algorithm is a hash algorithm, including MD5, SHA256, etc.
Step S20, comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint;
In this embodiment, the server compares the updated file fingerprint of the target application program with the current file fingerprint of the current application program before updating (i.e., the file fingerprint corresponding to the latest version of application program stored in the current server), and automatically identifies whether the application package of the target application program is updated (i.e., whether the identified file is changed) according to the comparison result, specifically, determines whether the application program of the new version is updated compared with the application program of the previous version according to the differentiation result of the file fingerprint.
And step S30, when the update of the target application program is detected, displaying a corresponding update reminding message through the change monitoring terminal.
In this embodiment, when it is determined that the target application program is updated according to the comparison result, the updated program file and the change point of the program file before the update are generated to generate a corresponding update reminding message, and the update reminding message is displayed through the change monitoring terminal, so that a developer can know the change point of the application program in time.
Further, after the step S30, the method further includes:
And storing the update program file fingerprint and the update result of the target application program into a cache database, and setting the storage life of the update program file fingerprint and the update result of the target application program in the cache database.
In this embodiment, after detecting that the target application is updated, the update program file fingerprint and the update result of the target application, that is, the differentiation result, are recorded. And writing the differentiation result into the cache database in a corresponding field. Further, a storage validity period of the differentiation result may be set in the cache database, for example, 1 month), which is specifically shown in the following table:
the embodiment provides a method for monitoring the change of an application program, which comprises the steps of acquiring an updated program file corresponding to a changed target application program when a file change instruction of the target application program is detected, and calculating a file checksum of the updated program file to be used as an updated program file fingerprint; comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint; and when the target application program is detected to be updated, displaying a corresponding update reminding message through the change monitoring terminal. By means of the method, the updating program file fingerprint after each change of the target application program is compared with the current program file fingerprint before the change, so that whether the target application program is updated or not can be accurately determined, uncontrollable updating of the application program is prevented, the updating reliability of the application program is improved, updating abnormality of the application program in the production application server is prevented, the updating efficiency of the application program in the production application server is improved, and the technical problem that updating abnormality of the existing application program in the production application server is easy to occur is solved.
Further, based on the first embodiment of the change monitoring method of the application program of the present invention, a second embodiment of the change monitoring method of the application program of the present invention is provided.
In this embodiment, the step S20 specifically includes:
when a file change instruction of a target application program is detected, acquiring a target application program package corresponding to the changed target application program;
Acquiring a relative path of a non-log file in the target application program package, and acquiring all files under the relative path through multithreading polling;
And calculating each file checksum of all the files through a hash algorithm to obtain each file checksum set as the file fingerprint of the update program.
The step of comparing the updated program file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint specifically comprises the following steps:
comparing the updated file checksum set in the updated program file fingerprint with the current file checksum set in the current program file fingerprint according to a preset path field;
and determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
In this embodiment, the client plug-in is an executable file, and provides interface parameters, and the integration method includes a compiling tool, that is, adopting a command line to integrate with a compiling tool (commands such as gcc\ JAVAC) statement in a manner of server environment variables; the method also comprises a change platform, namely the change platform directly uses interface parameter call provided by the plug-in client. The client plug-in uses a unified version and executes different logic with different configurations. Specifically, the compiling tool integrates a cache type plug-in, and the implementation logic is as follows
(A) After the iterative development of the target application program is completed by using a compiling tool after integrating plug-ins, source code compiling (also can be first development);
(b) Acquiring a relative path of a non-log file in the application package compiled by the target application program (namely, a root path of a relative application package file);
(c) According to the acquired relative paths, files under all paths are polled through multiple threads, file fingerprints of all files are calculated through a hash algorithm (such as SHA 256), and a compiler file fingerprint set A (file checksum of the hash algorithm) is generated;
(d) The calculated fingerprint set of the compiler file and the relative path are combined (data) in the form of key-value pairs, and together with the name of the application package (namely the name of the relative path, namely the name app_name of the application), the application ID, the type of plugin (type bianyi represents a compiling mode plugin), the timestamp (time), the composition json request package http is sent to the plugin server, and the compiled application package is transmitted. The following is shown:
{"id":"5051","app_name":"bsp_env_check","type":"bianyi","data":"[{bsp_env_check/env_check.jar:ccccccccddddddddaaaaaaaaddddddddeeeeeeee},{....}.....]","time":"2019-12-31 13:59:36.886"}
(e) After receiving the results of the client and the application program package, the plug-in service receives the results json acquired by the file fingerprint, analyzes the data in the json according to specific numbers, stores the data in the json into a cache database in a certain field, and sets the storage validity period to be 1 year (can be customized according to the actual needs according to the iteration speed and the frequency). The stored fields and results are exemplified as follows, wherein the FLAG bit is whether the application package completes the change, and the complete change is Y, otherwise N.
Further, the step of determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set specifically includes:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
In this embodiment, if the compilation is not first developed, the plug-in server searches the current program file fingerprint set B of the application package after the last normal change (FLAG is Y) of the target application program in the cache database according to the application ID, if the set B is empty, it indicates that the application is not on production line, the current updated application package is the first online application package, and the change monitoring flow is ended. Otherwise, the comparison of sets A and B is performed as follows:
(1) Comparing the fields and files of the set A with the fields of the set B according to the path fields of the search path fields, wherein the fields and files of the set A are more than the fields and files of the set B, and the update type (the fields are change_type) is newly added (the update type value is 1);
(2) Comparing the sets A and B according to the path field, wherein the set A has fewer fields and files than the set B, and the update type (the field is change_type) is reduced (the value is 2) for the reduced application files;
(3) If the path fields are identical, comparing the set A with the set B, wherein the set A and the set B have files with different file fingerprints, recording the application files corresponding to the different fingerprints, and the update type (the field is change_type) is changed (the value is 3).
Further, based on the second embodiment of the method for monitoring the change of the application program of the present invention, a third embodiment of the method for monitoring the change of the application program of the present invention is provided.
In this embodiment, the file change instruction includes a file compiling instruction and/or a file change instruction, the update program file includes a compiler file and/or a change program file, and the step S20 specifically includes:
When a file compiling instruction and/or a file changing instruction of a target application program are detected, acquiring a compiler file and/or a changing program file corresponding to the changed target application program;
And calculating the file checksum of the compiler file and/or the change program file to be used as the fingerprint of the compiler file and/or the fingerprint of the change program file.
The step of comparing the updated program file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint specifically comprises the following steps:
Comparing the compiler file fingerprint and/or the change program file fingerprint with the current program file fingerprint to obtain a first comparison result and/or a second comparison result, wherein the first comparison result and the second comparison result are comparison results of the current program file fingerprint with the compiler file fingerprint and the change program file fingerprint respectively;
When the first comparison result is different, determining that compiling updating of the target application program occurs; or (b)
And when the second comparison result is different, determining that the target application program is changed and updated.
The process of updating the application program comprises a compiling process and a changing process, the program update of the compiling process described in the embodiment is removed, and after the development and compiling are completed, IT personnel need to go to a changing platform to update the application program package after the latest iterative development to the application server. In this embodiment, the client plug-in logic is as follows:
(a) When the change is started, IT personnel can input a changed subsystem ID, an application package name, a corresponding application package path which needs to be updated on an application server, an application server address (a change platform needs to know the conditions to know how to update), and other change conditions;
(b) The plug-in client obtains the relative paths of all files under the corresponding paths on the application server according to the address of the application server and the corresponding application program package paths needing to be updated;
(c) According to the acquired paths, multithreading polls files in all paths, a hash algorithm (such as SHA 256) is adopted, a file fingerprint set C (file checksum of the hash algorithm) of all files is calculated, the set C is the file fingerprint of the current application program, if the application program is deployed for the first time, the set C is empty, and the updating process is directly executed;
(d) The calculated file fingerprint and the path are combined (data) in the form of key-value pairs, and together with an application package name (namely, the name of the path, namely, the name app_name of the application), an application ID, a plug-in type (type, biangeng stands for change mode plug-in), and a timestamp (time), a json request package http is formed and sent to a plug-in server, and a compiled application package is transmitted, as follows:
{"id":"5051","app_name":"bsp_env_check","type":"biangeng","data":"[{bsp_env_check/env_check.jar:mmmmmmmmddddddddaaaaaaaaddddddddeeeeeeee},{....}.....]","time":"2019-12-31 18:59:36.886"};
(e) After receiving the results of the client and the application program package, the plug-in server analyzes the result json acquired by the file fingerprint, and analyzes the data in the json according to specific numbers when analyzing the result json;
(f) Taking account that the change stage is necessarily after compiling, the plug-in service original file fingerprint set B;
(g) The comparison of sets B and C is performed as follows:
(1) Comparing the sets B and C according to the path field, wherein B is more than C, and obtaining newly added application program files and file fingerprints in the corresponding set B;
(2) Comparing the sets B and C according to the path field, wherein B is less than C, and obtaining reduced application program files and file fingerprints in the corresponding set C;
(3) If the path fields are identical, the fingerprints of the comparison files are different, and the corresponding application program files and the fingerprints of the files in the corresponding collection C are recorded.
Further, the method for monitoring the change of the application program further comprises the following steps:
when the first comparison result and the second comparison result are different, determining that compiling update and changing update occur to the target application program;
Acquiring a first differentiation result of the compiler file fingerprint and the current program file fingerprint, and acquiring a second differentiation result of the changed program file fingerprint and the current program file fingerprint;
And generating an updating abnormal reminding message when the first differential result is different from the second differential result, and displaying the updating abnormal reminding message through the change monitoring terminal.
In this embodiment, a first comparison result of the compiled program file fingerprint and the current program file fingerprint is compared with a second comparison result of the changed program file fingerprint and the current program file fingerprint. And according to the difference result of the first comparison result and the second comparison result. If the two types of fingerprint collection table are consistent, the compiled compiler files of the compiling tool and the changed program files of the changing tool are the same, the application program package is updated to the application server, and the flag bit of the fingerprint record corresponding to the fingerprint collection table set A is modified to be Y. If the compiled compiler files are inconsistent, the compiled compiler files representing the compiling tool and the compiled change program files representing the changing tool are different, and mail informs IT personnel of the differentiated results of the compiling stage and the changing stage, and the changing platform terminates executing the changing. So as to uniformly compile and change the target application program corresponding to the developer, prevent the application program in the production application server from generating update abnormality, and improve the reliability of the application program update.
The invention also provides a change monitoring device of the application program, which comprises:
The file fingerprint calculation module is used for acquiring an updated program file corresponding to the changed target application program when a file change instruction of the target application program is detected, and calculating a file checksum of the updated program file as an updated program file fingerprint;
The file update detection module is used for comparing the update program file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the update program file fingerprint and the current program file fingerprint;
And the file updating reminding module is used for displaying a corresponding updating reminding message through the change monitoring terminal when the target application program is detected to be updated.
Further, the file fingerprint calculation module specifically includes:
The program package acquisition unit is used for acquiring a target application program package corresponding to the changed target application program when the file change instruction of the target application program is detected;
The file acquisition unit is used for acquiring the relative path of the non-log files in the target application program package and acquiring all files under the relative path through multi-thread polling;
And the fingerprint calculation unit is used for calculating the checksum of each file of all the files through a hash algorithm to obtain a checksum set of each file as the fingerprint of the updated program file.
Further, the file fingerprint calculation module specifically includes:
The program package acquisition unit is used for acquiring a target application program package corresponding to the changed target application program when the file change instruction of the target application program is detected;
The file acquisition unit is used for acquiring the relative path of the non-log files in the target application program package and acquiring all files under the relative path through multi-thread polling;
And the fingerprint calculation unit is used for calculating the checksum of each file of all the files through a hash algorithm to obtain a checksum set of each file as the fingerprint of the updated program file.
Further, the file update detection module specifically includes:
The collection comparison unit is used for comparing the updated file checksum collection in the updated program file fingerprint with the current file checksum collection in the current program file fingerprint according to a preset path field;
And the updating determining unit is used for determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
Further, the update determination unit is further configured to:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
Further, the file change instruction includes a file compiling instruction and/or a file change instruction, the update program file includes a compiler file and/or a change program file, and the file fingerprint calculation module is further configured to:
When a file compiling instruction and/or a file changing instruction of a target application program are detected, acquiring a compiler file and/or a changing program file corresponding to the changed target application program;
And calculating the file checksum of the compiler file and/or the change program file to be used as the fingerprint of the compiler file and/or the fingerprint of the change program file.
Further, the file fingerprint calculation module is further configured to:
Comparing the compiler file fingerprint and/or the change program file fingerprint with the current program file fingerprint to obtain a first comparison result and/or a second comparison result, wherein the first comparison result and the second comparison result are comparison results of the current program file fingerprint with the compiler file fingerprint and the change program file fingerprint respectively;
When the first comparison result is different, determining that compiling updating of the target application program occurs; or (b)
And when the second comparison result is different, determining that the target application program is changed and updated.
Further, the file fingerprint calculation module is further configured to:
when the first comparison result and the second comparison result are different, determining that compiling update and changing update occur to the target application program;
Acquiring a first differentiation result of the compiler file fingerprint and the current program file fingerprint, and acquiring a second differentiation result of the changed program file fingerprint and the current program file fingerprint;
And generating an updating abnormal reminding message when the first differential result is different from the second differential result, and displaying the updating abnormal reminding message through the change monitoring terminal.
Further, the method for monitoring the change of the application program further comprises an update result storage module, wherein the update result storage module is used for:
And storing the update program file fingerprint and the update result of the target application program into a cache database, and setting the storage life of the update program file fingerprint and the update result of the target application program in the cache database.
The method executed by each program module may refer to each embodiment of the change monitoring method of the application program of the present invention, and will not be described herein.
The invention also provides a computer readable storage medium.
The computer-readable storage medium of the present invention stores therein a change monitor program of an application program, which when executed by a processor, implements the steps of the change monitor method of an application program as described above.
The method implemented when the change monitoring program of the application running on the processor is executed may refer to various embodiments of the change monitoring method of the application of the present invention, which are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (11)
1. The method for monitoring the change of the application program is characterized by comprising the following steps:
When a file change instruction of a target application program is detected, acquiring an updated program file corresponding to the changed target application program, and calculating a file checksum of the updated program file as an updated program file fingerprint;
Comparing the updated program file fingerprint with the current program file fingerprint of the target application program, and determining whether the target application program is updated according to the comparison result of the updated program file fingerprint and the current program file fingerprint;
When the target application program is detected to be updated, a corresponding update reminding message is displayed through the change monitoring terminal;
The file change instruction includes a file compiling instruction and/or a file change instruction, the update program file includes a compiler file and/or a change program file, and when the file change instruction of the target application program is detected, the step of obtaining the update program file corresponding to the changed target application program, and calculating a file checksum of the update program file, as an update program file fingerprint, specifically includes:
When a file change instruction of a target application program is detected, acquiring a target application program package corresponding to the changed target application program; acquiring a relative path of a non-log file in the target application program package, and acquiring all files under the relative path through multithreading polling; calculating each file checksum of all the files through a hash algorithm to obtain each file checksum set as an updated program file fingerprint; or alternatively
When a file compiling instruction and/or a file changing instruction of a target application program are detected, acquiring a compiler file and/or a changing program file corresponding to the changed target application program; and calculating a file checksum of the compiler file and/or the change program file as a compiler file fingerprint and/or a change program file fingerprint, wherein the compiler file fingerprint and/or the change program file fingerprint are updated program file fingerprints.
2. The method for monitoring the change of an application program according to claim 1, wherein the step of comparing the update file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the update file fingerprint and the current program file fingerprint specifically comprises:
comparing the updated file checksum set in the updated program file fingerprint with the current file checksum set in the current program file fingerprint according to a preset path field;
and determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
3. The method for monitoring the change of the application program according to claim 2, wherein the step of determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set specifically comprises:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
4. The method for monitoring the change of an application program according to claim 1, wherein the step of comparing the update file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the update file fingerprint and the current program file fingerprint specifically comprises:
Comparing the compiler file fingerprint and/or the change program file fingerprint with the current program file fingerprint to obtain a first comparison result and/or a second comparison result, wherein the first comparison result and the second comparison result are comparison results of the current program file fingerprint with the compiler file fingerprint and the change program file fingerprint respectively;
When the first comparison result is different, determining that compiling updating of the target application program occurs; or (b)
And when the second comparison result is different, determining that the target application program is changed and updated.
5. The method for monitoring the change of an application according to claim 4, further comprising:
when the first comparison result and the second comparison result are different, determining that compiling update and changing update occur to the target application program;
Acquiring a first differentiation result of the compiler file fingerprint and the current program file fingerprint, and acquiring a second differentiation result of the changed program file fingerprint and the current program file fingerprint;
And generating an updating abnormal reminding message when the first differential result is different from the second differential result, and displaying the updating abnormal reminding message through the change monitoring terminal.
6. The method for monitoring the change of an application program according to any one of claims 1 to 5, wherein after the step of displaying a corresponding update reminder message by the change monitoring terminal when the update of the target application program is detected, further comprising:
And storing the update program file fingerprint and the update result of the target application program into a cache database, and setting the storage life of the update program file fingerprint and the update result of the target application program in the cache database.
7. An application program change monitoring device, characterized in that the application program change monitoring device comprises:
The file fingerprint calculation module is used for acquiring an updated program file corresponding to the changed target application program when a file change instruction of the target application program is detected, and calculating a file checksum of the updated program file as an updated program file fingerprint;
The file update detection module is used for comparing the update program file fingerprint with the current program file fingerprint of the target application program and determining whether the target application program is updated according to the comparison result of the update program file fingerprint and the current program file fingerprint;
the file updating reminding module is used for displaying corresponding updating reminding information through the change monitoring terminal when the target application program is detected to be updated;
Wherein, the file fingerprint calculation module is further used for:
When a file change instruction of a target application program is detected, acquiring a target application program package corresponding to the changed target application program; acquiring a relative path of a non-log file in the target application program package, and acquiring all files under the relative path through multithreading polling; calculating each file checksum of all the files through a hash algorithm to obtain each file checksum set as an updated program file fingerprint; or alternatively
The file change instruction comprises a file compiling instruction and/or a file changing instruction, the update program file comprises a compiler file and/or a change program file, and the file fingerprint calculation module is further used for:
When a file compiling instruction and/or a file changing instruction of a target application program are detected, acquiring a compiler file and/or a changing program file corresponding to the changed target application program; and calculating a file checksum of the compiler file and/or the change program file as a compiler file fingerprint and/or a change program file fingerprint, wherein the compiler file fingerprint and/or the change program file fingerprint are updated program file fingerprints.
8. The apparatus for monitoring and controlling the change of an application program according to claim 7, wherein the file update detection module specifically comprises:
The collection comparison unit is used for comparing the updated file checksum collection in the updated program file fingerprint with the current file checksum collection in the current program file fingerprint according to a preset path field;
And the updating determining unit is used for determining whether the target application program is updated according to the comparison result of the updated file checksum set and the current file checksum set.
9. The change monitoring device of an application program according to claim 8, wherein the update determining unit is further configured to:
when the file fields in the updated file checksum set are more than the file fields in the current file checksum set, determining that the target application program is updated in a newly added mode;
And determining that the target application program is updated in a reduced mode when the file fields in the updated file checksum set are less than the file fields in the current file checksum set.
10. An application program change monitoring device, characterized in that the application program change monitoring device comprises: memory, a processor and a change monitor of an application stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the change monitor method of an application according to any one of claims 1 to 6.
11. A computer-readable storage medium, wherein a change monitor of an application program is stored on the computer-readable storage medium, and the change monitor of the application program, when executed by a processor, implements the steps of the change monitor method of an application program according to any one of claims 1 to 6.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010195273.1A CN111400102B (en) | 2020-03-18 | 2020-03-18 | Method, device, equipment and storage medium for monitoring change of application program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010195273.1A CN111400102B (en) | 2020-03-18 | 2020-03-18 | Method, device, equipment and storage medium for monitoring change of application program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111400102A CN111400102A (en) | 2020-07-10 |
| CN111400102B true CN111400102B (en) | 2024-06-18 |
Family
ID=71431010
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010195273.1A Active CN111400102B (en) | 2020-03-18 | 2020-03-18 | Method, device, equipment and storage medium for monitoring change of application program |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111400102B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112051985B (en) * | 2020-07-23 | 2023-07-25 | 北京奇艺世纪科技有限公司 | Event triggering method, device, electronic equipment and readable storage medium |
| CN112269652A (en) * | 2020-09-07 | 2021-01-26 | 西安万像电子科技有限公司 | Application program storage method and device |
| CN112269651A (en) * | 2020-09-07 | 2021-01-26 | 西安万像电子科技有限公司 | Application running method and device |
| CN114578782B (en) * | 2020-12-01 | 2023-08-25 | 宇通客车股份有限公司 | Automatic calibration method and system for integrated controller program |
| CN112732314A (en) * | 2020-12-30 | 2021-04-30 | 北京一亩田新农网络科技有限公司 | Plug-in differential packaging method and device based on android, electronic equipment and computer readable medium |
| CN112947972B (en) * | 2021-03-31 | 2025-02-11 | 杭州和利时自动化有限公司 | A controller file updating method, device, electronic device and storage medium |
| CN113535230B (en) * | 2021-06-07 | 2022-09-23 | 上海古鳌电子科技股份有限公司 | Method and system for dynamically adapting engineering source code to different hardware resources |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104378397A (en) * | 2013-08-15 | 2015-02-25 | 世纪禾光科技发展(北京)有限公司 | Method and system for issuing incremental updating of program package |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105306434A (en) * | 2015-09-11 | 2016-02-03 | 北京金山安全软件有限公司 | Program file checking method and device, server and terminal |
-
2020
- 2020-03-18 CN CN202010195273.1A patent/CN111400102B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104378397A (en) * | 2013-08-15 | 2015-02-25 | 世纪禾光科技发展(北京)有限公司 | Method and system for issuing incremental updating of program package |
Non-Patent Citations (1)
| Title |
|---|
| 基于事件的文件备份方法研究与实现;李夷苒;李涛;胡晓勤;马晓旭;;计算机工程与设计;20100928(第18期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111400102A (en) | 2020-07-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111400102B (en) | Method, device, equipment and storage medium for monitoring change of application program | |
| CN110245089B (en) | Stress testing method, device, equipment and computer readable storage medium | |
| US11163731B1 (en) | Autobuild log anomaly detection methods and systems | |
| US9038030B2 (en) | Methods for predicting one or more defects in a computer program and devices thereof | |
| US20210326197A1 (en) | System And Method For Automatically Identifying And Resolving Computing Errors | |
| CN108959059B (en) | Test method and test platform | |
| CN111158741B (en) | Method and device for monitoring dependency relationship change of service module on third party class library | |
| JP2022100301A (en) | Method for determining potential impact on computing device by software upgrade, computer program, and update recommendation computer server (recommendation of stability of software upgrade) | |
| US20190116178A1 (en) | Application error fingerprinting | |
| CN109284106A (en) | Method for release management, electronic device and the readable storage medium storing program for executing of business rule | |
| CN113656183B (en) | Task processing method, device, equipment and storage medium | |
| US20170097812A1 (en) | Automated and heuristically managed solution to quantify cpu and path length cost of instructions added, changed or removed by a service team | |
| CN110543427B (en) | Test case storage method and device, electronic equipment and storage medium | |
| CN103186463B (en) | Determine the method and system of the test specification of software | |
| CN114490413A (en) | Test data preparation method and device, storage medium and electronic equipment | |
| US8782626B2 (en) | Search suggestions for static code analysis | |
| CN113419949B (en) | Anomaly detection methods, devices, equipment and storage media for data processing | |
| CN113672514A (en) | Test method, test device, server and storage medium | |
| CN117640359A (en) | Kubernetes cluster network link nano-tube method, device, equipment and storage medium | |
| US20210240596A1 (en) | Source code file retrieval | |
| CN113434189A (en) | Automatic code release method and system based on asynchronous deployment mode | |
| CN113419877A (en) | Implementation method and device of decision service interface, electronic equipment and storage medium | |
| US20250298594A1 (en) | Automated dependency management for application deployment | |
| JP6984120B2 (en) | Load compare device, load compare program and load compare method | |
| CN115576600B (en) | Difference handling methods, devices, terminals, and storage media based on code changes |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |