CN112988193B - Code update identification method and device, computer equipment and readable storage medium - Google Patents

Code update identification method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN112988193B
CN112988193B CN202110323332.3A CN202110323332A CN112988193B CN 112988193 B CN112988193 B CN 112988193B CN 202110323332 A CN202110323332 A CN 202110323332A CN 112988193 B CN112988193 B CN 112988193B
Authority
CN
China
Prior art keywords
code
package
log
library
information
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
Application number
CN202110323332.3A
Other languages
Chinese (zh)
Other versions
CN112988193A (en
Inventor
李安冉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen One Account Technology Co ltd
Original Assignee
Shenzhen One Account Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen One Account Technology Co ltd filed Critical Shenzhen One Account Technology Co ltd
Priority to CN202110323332.3A priority Critical patent/CN112988193B/en
Publication of CN112988193A publication Critical patent/CN112988193A/en
Application granted granted Critical
Publication of CN112988193B publication Critical patent/CN112988193B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a computer operation and maintenance technology, and discloses a code updating and identifying method, a device, computer equipment and a readable storage medium, which comprise the following steps: extracting an installation package from a code base; extracting a comparison package corresponding to the installation package from the code library, and identifying the difference between the installation package and the comparison package to obtain difference information; acquiring the type of the code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into an installation package to obtain a version update package, and storing the version update package into a code library; and classifying the detail information according to the type to obtain an analysis table, and sending the version update package and the analysis table to the user side. The invention constructs the detail information recording the difference between the installation package and the comparison package into the analysis table, so that the user at the user end can rapidly and intuitively obtain the upgrade detail of the version update package.

Description

Code update identification method and device, computer equipment and readable storage medium
Technical Field
The present invention relates to the field of computer operation and maintenance technologies, and in particular, to a code update identification method and apparatus, a computer device, and a readable storage medium.
Background
At present, various mirror image libraries in the market are diversified, including npm, maven and the like, and a user can search an installation package on the mirror image library to check the content description of the installation package, and install the installation package on a project or a product of the user for use;
however, the inventor finds that, when the version of the installation package (i.e. the data package used on the project or product) in the mirror library is upgraded, the upgraded content is often recorded in the installation package in the form of a code, so that it is difficult for the user at the user end to know the upgrade details of the installation package, and thus it is impossible to determine whether the version upgrade is needed or not, which affects the convenience of the user.
Disclosure of Invention
The invention aims to provide a code update identification method, a code update identification device, computer equipment and a readable storage medium, which are used for solving the problem that in the prior art, because the updated content is often recorded in an installation package in the form of codes, a user at a user end is difficult to learn the update details of the installation package.
In order to achieve the above object, the present invention provides a code update identification method, including:
when monitoring that a code library receives an installation package, extracting the installation package from the code library, wherein the installation package is a data package for upgrading a product;
extracting a comparison package corresponding to the installation package from the code library, and identifying the difference between the installation package and the comparison package to obtain difference information with at least one code log;
acquiring the type of a code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version update package, and storing the version update package into the code library;
when monitoring that the image library receives the version update package sent by the code library, extracting the version update package from the image library;
and classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version update package and the analysis table to a user side.
In the foregoing solution, before the extracting the comparison package corresponding to the installation package from the code library, the method further includes:
judging whether the installation package has detail information or not;
if so, setting the installation package as a version update package, and storing the version update package to the code library.
In the foregoing solution, the step of extracting the comparison package corresponding to the installation package from the code library, and analyzing a difference between the installation package and the comparison package to obtain difference information having at least one code log includes:
extracting the product name of the installation package, and identifying a data package consistent with the product name from the code library;
setting the version number of the installation package as a current version number, setting the version number of the data package as a historical version number, setting a sequential historical version number positioned above the current version number as a comparison version number, and setting the data package corresponding to the historical version number as a comparison package;
acquiring a first log set of the installation package, which at least comprises one code log, from the code library, and acquiring the code logs of the comparison package from the code library and summarizing to form a second log set;
exclusive-OR-ing the first log set and the second log set to identify a code log having a difference between the first log set and the second log set, and setting the code log having the difference as difference information.
In the foregoing solution, the summarizing the detail information of all the code logs in the difference information, and loading the summarized detail information into the installation package to obtain a version update package includes:
and summarizing the detail information of all the code logs in the difference information to form detail information stored in an array structure form, and loading the detail information into the installation package.
In the above scheme, the type of the code log in the difference information is obtained, and the label information is inserted into the code log according to the type to obtain the detail information,
the method comprises the following steps:
acquiring a regular expression, wherein keywords of the type of a code log are recorded in the regular expression;
performing regular matching on the regular expression and the content in the difference information to obtain the type of the code log;
and inserting the label information corresponding to the type into the code log, and converting the code log into a json format to obtain detailed information.
In the above solution, the step of extracting the version update package from the mirror image library when the mirror image library receives the version update package sent by the code library includes:
controlling the code library to release a version update package through an npm publishing method, enabling the mirror library to receive the version update package, monitoring whether the mirror library receives the version update package released by the code library through an AOP (automatic optical point protocol) assembly, and if so, intercepting and extracting the version update package of the mirror library.
In the foregoing solution, before the classifying the detail information according to the type, the method further includes:
judging whether the version updating package has detail information;
if not, generating prompt information, and sending the version update package and the prompt information to a user side;
after the version update package and the resolution table are sent to the user side, the method further includes:
and uploading the version updating package and the resolution table to a block chain.
In order to achieve the above object, the present invention further provides a code update identifying apparatus, operating in a code library and a mirror library, including:
the installation package extraction module is used for extracting an installation package from the code library when the code library is monitored to receive the installation package, wherein the installation package is a data package used for upgrading a product;
the difference identification module is used for extracting a comparison package corresponding to the installation package from the code library, and identifying the difference between the installation package and the comparison package to obtain difference information with at least one code log;
the version updating module is used for acquiring the type of the code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version updating package, and storing the version updating package to the code library;
the image extraction module is used for extracting the version update package from the image library when monitoring that the image library receives the version update package sent by the code library;
and the updating analysis module is used for classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version updating package and the analysis table to the user side.
To achieve the above object, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor of the computer device implements the steps of the code update identification method when executing the computer program.
To achieve the above object, the present invention further provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the code update identification method.
According to the code update identification method, the code update identification device, the computer equipment and the readable storage medium, the comparison package corresponding to the installation package is extracted from the code library, the difference between the installation package and the comparison package is identified to obtain the difference information, and after the label information is inserted into the code log to obtain the detail information, the detail information is constructed into the analysis table, so that a user at a user end can conveniently and visually obtain the update details of the version update package, and whether the version update package is used for updating the product in the version update package or not can be conveniently judged.
Drawings
FIG. 1 is a flowchart of a first embodiment of a code update identification method according to the present invention;
FIG. 2 is a schematic diagram of an environment application of a code update recognition method according to a second embodiment of the code update recognition method of the present invention;
FIG. 3 is a flowchart of a specific method of a code update recognition method according to a second embodiment of the code update recognition method of the present invention;
FIG. 4 is a block diagram of a third embodiment of a code update recognition apparatus according to the present invention;
fig. 5 is a schematic diagram of a hardware structure of a computer device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a code updating and identifying method, a code updating and identifying device, computer equipment and a readable storage medium, which are suitable for the technical field of computer operation and maintenance and are used for providing a code updating and identifying method based on an installation package extraction module, a difference identification module, a version updating module, a mirror image extraction module and an updating and analyzing module. The invention extracts the installation package from the code library, extracts the comparison package corresponding to the installation package from the code library, and identifies the difference between the installation package and the comparison package to obtain the difference information with at least one code log. Inserting label information into the code logs according to the types of the code logs in the difference information to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version update package, and storing the version update package into the code library; extracting the version update package from the mirror library; and classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version update package and the analysis table to a user side.
The first embodiment is as follows:
referring to fig. 1, a code update identification method of the present embodiment includes:
s101: when monitoring that a code library receives an installation package, extracting the installation package from the code library, wherein the installation package is a data package for upgrading a product;
s103: extracting a comparison package corresponding to the installation package from the code library, and identifying the difference between the installation package and the comparison package to obtain difference information with at least one code log;
s105: according to the type of the code log in the difference information, inserting label information into the code log to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version update package, and storing the version update package into the code library;
s107: when monitoring that the image library receives the version update package sent by the code library, extracting the version update package from the image library;
s109: and classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version update package and the analysis table to a user side.
In an exemplary embodiment, by setting the operation of extracting the installation package from the code library at the time of receiving the installation package by setting: when the development end updates the developed installation package to the code base, because the code base does not issue the installation package at the moment, sufficient calculation power and time are provided at the moment to extract the installation package and generate detailed information, the calculation power of the server is used at a wrong peak, the technical effect of timely generating the detailed information of the installation package is ensured, and further the operation burden on the server and the interference of the code base are reduced.
According to the type of the code log, label information is inserted into the code log to obtain detailed information, the detailed information of all the code logs in the difference information is collected, the collected detailed information is loaded into the installation package to obtain a version update package, and the updated content and type of the version update package relative to the comparison package are subjected to identification management so as to be convenient for classifying the code log subsequently.
And monitoring whether the image library receives the version update package issued by the code library or not through an AOP component, and if so, intercepting and extracting the version update package of the image library.
All the detail information in the version updating package is classified according to types, the detail information with the consistent types is gathered to form a detail set, and a table interface (such as an excel interface) is called to construct the detail set into an analysis table, so that a user at a user end can quickly and intuitively acquire the upgrading details of the version updating package, and the user can conveniently judge whether to upgrade the product in the version updating package.
The second embodiment:
the embodiment is a specific application scenario of the first embodiment, and the method provided by the present invention can be more clearly and specifically explained through the embodiment.
The method provided in this embodiment will be specifically described below by taking as an example that, in a server running a code update identification method, a difference between an installation package and a comparison package is identified and a version update package is obtained, and an analysis table is generated when a version update package is received by a mirror library. It should be noted that the present embodiment is only exemplary, and does not limit the protection scope of the embodiments of the present invention.
Fig. 2 schematically shows an environment application diagram of a code update identification method according to the second embodiment of the present application.
In an exemplary embodiment, the server 2 in which the code update identification method is located is respectively connected with the code library 3, the mirror library 4 and the user side 5 through a network; the server 2 may provide services through one or more networks, which may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. The network may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like. The network may include wireless links, such as cellular links, satellite links, wi-Fi links, and/or the like; the user terminal 5 may be a computer device such as a smart phone, a tablet computer, a notebook computer, and a desktop computer.
Fig. 3 is a flowchart of a specific method of a code update identification method according to an embodiment of the present invention, where the method specifically includes steps S201 to S210.
S201: when monitoring that a code library receives an installation package, extracting the installation package from the code library, wherein the installation package is a data package for upgrading a product;
in order to reduce the operation burden on the server and the interference of the code library, the operation of extracting the installation package from the code library is set to be when the installation package is received by the code library, namely: when the development end updates the developed installation package to the code base, because the code base does not issue the installation package at the moment, sufficient calculation power and time are provided at the moment to extract the installation package and generate the detail information, the calculation power of the server is used at a wrong peak, and the technical effect of generating the detail information of the installation package in time is ensured.
In this embodiment, the code library is a git system, which is an open-source distributed version control system, and is a version control software of open source code for managing the versions of the project and the product.
The product is developed according to the requirements of users and is provided with application software with specified functions (such as an APP, a functional component and the like).
In this embodiment, whether the code library receives the installation package uploaded by the development terminal is monitored through the AOP component, and if yes, the installation package of the code library is intercepted and extracted.
It should be noted that the AOP (Aspect organized Programming) component is a technique that is Oriented to the tangent plane Programming, and implements unified maintenance of program functions through a pre-compiling mode and a dynamic proxy during running.
S202: and judging whether the installation package has detail information.
In this step, whether the installation package has the detail information is searched through a preset detail regular expression, and the detail regular expression records keywords in the file name of the detail information.
S203: if not, extracting a comparison package corresponding to the installation package from the code library, identifying the difference between the installation package and the comparison package to obtain difference information with at least one code log, and executing S205.
In this step, the code log is used to describe the codes in the installation package and the comparison package, and includes: log name, code author, modification time, and code description, for example:
the log name: commit de24f6c0c0d003ceccefb814b80ff2f5f94ea6bb
The code author: author < test @ test. Com. Cn >
Modification time: date: thu Aug 27 09
Code description: optimizing scrollbar styles
In a preferred embodiment, the step of extracting a comparison package corresponding to the installation package from the code library, and analyzing a difference between the installation package and the comparison package to obtain difference information with at least one code log includes:
s31: extracting the product name of the installation package, and identifying a data package consistent with the product name from the code library;
illustratively, the installation package has a product name ABCD, and the data package having the product name ABCD is identified from the code library.
S32:
Setting the version number of the installation package as a current version number, setting the version number of the data package as a historical version number, setting a sequential historical version number positioned above the current version number as a comparison version number, and setting the data package corresponding to the historical version number as a comparison package;
illustratively, a data packet a is obtained with a product name ABCD and a version number V2.0; a data packet B with a product name ABCD and a version number of V1.0; the product name of the installation package is ABCD, and the version number is V3.0; therefore, the current version number is V3.0, and the immediately previous historical version number is V2.0, so the data packet a is set as a comparison packet.
S33: and acquiring a first log set of the installation package, which at least comprises one code log, from the code library, and acquiring the code logs of the comparison package from the code library and summarizing to form a second log set.
In the step, code logs of the installation package are obtained from the git system through a git log command and are summarized to form a first log set, and code logs of the comparison package are obtained from the git system and are summarized to form a second log set.
S34: exclusive-OR-ing the first log set and the second log set to identify a code log having a difference between the first log set and the second log set, and setting the code log having the difference as difference information.
The method comprises the steps of calculating the difference between a first log set and a second log set by adopting an exclusive-or function ^ and identifying the code log with the difference between the first log set and the second log set so as to identify the difference between the installation package and the comparison treasure, and summarizing the code log corresponding to the difference to obtain the difference information with at least one code log.
Illustratively, the second log set corresponding to the comparison package (V2.0) is determined by comparing the first log set corresponding to the installation package (version number is V3.0)
The obtained code log is as follows:
code log A:
commit de24f6c0c0d003ceccefb814b80ff2f5f94ea6bb
Author:test<test@test.com.cn>
Date:Thu Aug 27 09:25:46 2020+0800
optimizing scrollbar styles
Code log B:
commit de25f6c0c0d003cdeedfb814b80ff2f5f94ea6bb
Author:test<test@test.com.cn>
Date:Thu Aug 27 09:4531 2020+0800
newly added help key
Alternatively, the present step may be arranged to set, as the difference information, only the code logs that exist in the first log set and do not exist in the second log set.
It should be noted that the xor function is a computer function for calculating a difference between two objects, such as: c = a ^ b, which means that after a and b are converted into binary form, XOR operation is carried out according to bit, and when the same bit is taken as 0, different bits are taken as 1. The a and the b are two different objects respectively, the c marks the same and different parts between the a and the b, and the corresponding data of the part with the value of 1 in the c in the a and the b is set as difference information. For example: p1: false q1: false p ^ q =0, p2: false q2: true p ^ q =1, p3: true q3 is null p ^ q =1, p4: true q4: true p ^ q =0, then p2 and q2, and p3 and q3, respectively, are difference information.
S204: if yes, the installation package is set as a version update package, and S206 is executed.
The method provides the detail information for the installation package without the detail information in the code library, and forms the version update package to record the specific upgrade details, so that any version update package in the system calling code library can directly obtain which functions or contents are updated by the version update package compared with the previous upgrade.
S205: and acquiring the type of the code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version update package, and storing the version update package into the code library.
In order to identify the type of the code log so as to classify the code log, according to the type of the code log, label information is inserted into the code log to obtain detail information, the detail information of all the code logs in the difference information is summarized, the summarized detail information is loaded into the installation package to obtain a version update package, and the update content and the type of the version update package compared with a comparison package are identified and managed so as to classify the code log subsequently.
In this embodiment, the detail information of all the code logs in the difference information is collected to form the detail information stored in the form of an array structure, and the detail information is loaded into the installation package.
The array structure is characterized in that a continuous space with a fixed number is opened in a memory, and the detail information is stored in the space.
In a preferred embodiment, the step of obtaining a type of a code log in the difference information and inserting tag information into the code log according to the type to obtain the detail information includes:
s51: and acquiring a regular expression, wherein the regular expression records the keywords of the code log type.
Regular expression (regular expression) describes a pattern (pattern) for matching a character string, which can be used to check whether a string contains a certain substring, to replace the matching substring, or to extract a substring that meets a certain condition from a certain string, etc.
Illustratively, the regular expressions include a first expression, a second expression, and a third expression;
the keywords in the first expression include: the Chinese characters corresponding to 'repair' and 'solution', which reflect that the type of the code log is repair (HOTFIX), and the corresponding tag information is type HOTFIX;
the keywords in the second expression include: the Chinese characters corresponding to optimization and UPDATE reflect that the type of the code log is UPDATE (UPDATE), and the corresponding tag information is type UPDATE;
the keywords in the third expression include: the Chinese characters corresponding to the NEW addition and the addition reflect that the type of the code log is NEW addition (NEW), and the corresponding label information is type: NEW.
S52: performing regular matching on the regular expression and the content in the difference information to obtain the type of the code log;
illustratively, based on the above example, the code log a has a keyword "optimize", and it is determined that the second expression matches the code log a; the code log B has a keyword 'newly added', and the third expression is judged to be matched with the code log B.
S53: and inserting the label information corresponding to the type into the code log, and converting the code log into a json format to obtain detailed information.
In this step, the JSON format is a lightweight data storage format unrelated to the development language, and is called JavaScript Object notification, which is a standard specification of a data format, and because of its easy-to-read characteristic, the efficiency of reading detailed information content by the user side is improved.
Illustratively, based on the above example, the tag information type UPDATE is inserted into the code log a, and js parsing is performed on the code log a to obtain the detail information a:
{ commit _ id: "de24f6c0c0d003ceccefb814b80ff2f5f94ea6bb", author: "test < test @ test.com. Cn >", date: "Thu Aug 27 09
Inserting the type of the label information NEW into a code log B, and performing js analysis on the code log B to obtain detail information B:
{ commit _ id: "de25f6c0c0d003cdeedfb814b80ff2f5f94ea6bb", author: "test < test @ test.com.cn >", date: "Thu Aug 27 09
S206: and saving the version update package into a code library.
The method comprises the steps of providing detail information for an installation package without the detail information in a code library, and enabling the installation package to form a version update package to record specific upgrading details, so that the version update package in any system call code library can directly obtain which functions or contents are updated by the version update package compared with the previous upgrading.
S207: when monitoring that a mirror image library receives a version update package sent by the code library, extracting the version update package from the mirror image library; in this step, the code library is controlled to release a version update package by an npm publish method, so that the image library receives the version update package, whether the image library receives the version update package released by the code library is monitored by an AOP component, and if yes, the version update package of the image library is intercepted and extracted.
It should be noted that the AOP (Aspect organized Programming) component is a technique that is Oriented to the tangent plane Programming, and implements unified maintenance of program functions through a pre-compiling mode and a dynamic proxy during running. Docker Registry or VMware Harbor was used as the mirror library.
npm (node package manager) publish refers to npm distribution, and refers to a computer method for distributing a version update package from an npm repository of a code library to the mirror library, wherein npm is a package management tool developed by an auxiliary front end, and is used for managing distribution, installation, abandonment, uninstallation, update, search and the like of the package (i.e., the version update package); the npm repository is a storage module running in the code base for saving the package (i.e. the version update package).
S208: and judging whether the version updating package has detail information.
In this step, whether the version update package has the detail information is searched through a preset detail regular expression, and the detail regular expression records keywords in the file name of the detail information.
S209: if yes, classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version update package and the analysis table to a user side.
In order to facilitate a user at a user end to quickly acquire upgrade details of a version update package, the method classifies all detail information in the version update package according to types, summarizes the detail information with consistent types to form a detail set, and invokes a table interface (such as an excel interface) to construct the detail set into an analysis table, so that the user at the user end can quickly and intuitively acquire the upgrade details of the version update package, and the user can conveniently judge whether to use the version update package to upgrade products therein.
After the sending the version update package and the parsing table to the user side, the method further includes:
and uploading the version updating package and the resolution table to a block chain.
It should be noted that, corresponding summary information is obtained based on the version update package and the parsing table, specifically, the summary information is obtained by performing hash processing on the version update package and the parsing table, for example, by using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user equipment may download the summary information from the blockchain to verify whether the version update package and the resolution table are tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
S210: if not, prompt information is generated, and the version updating package and the prompt information are sent to the user side.
In this step, a prompt message with a content of 'no detail display' is generated, and the prompt message is loaded into the version update package and sent to the user side to remind that the user side is difficult to automatically generate the detail information and needs to be manually set by a developer of the user side to ensure reliability.
Example three:
referring to fig. 4, a code update recognition apparatus 1 of the present embodiment, which runs in a code library and a mirror library, includes:
the installation package extracting module 11 is configured to extract an installation package from the code library when the code library receives the installation package, where the installation package is a data package used for upgrading a product;
a difference identification module 13, configured to extract a comparison package corresponding to the installation package from the code library, and identify a difference between the installation package and the comparison package to obtain difference information with at least one code log;
the version updating module 15 is configured to obtain a type of a code log in the difference information, insert tag information into the code log according to the type to obtain detail information, summarize the detail information of all the code logs in the difference information, load the summarized detail information into the installation package to obtain a version updating package, and store the version updating package in the code library;
the mirror image extraction module 17 is configured to, when the mirror image library receives the version update package sent by the code library, extract the version update package from the mirror image library;
and the update analysis module 19 is configured to classify the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and send the version update package and the analysis table to the user side.
Optionally, the code update identifying device 1 further includes:
and the installation detail judging module 12 is used for judging whether the installation package has the detail information.
Optionally, the code update identifying device 1 further includes:
and the detail confirming module 14 is used for setting the installation package as a version update package and calling the update saving module 16.
Optionally, the code update identifying device 1 further includes:
and an update saving module 16, configured to save the version update package into a code library.
Optionally, the code update identifying device 1 further includes:
and an update detail judging module 18, configured to judge whether the version update package has the detail information.
Optionally, the code update identifying device 1 further includes:
and the prompt module 20 is configured to generate prompt information, and send the version update package and the prompt information to a user side.
Optionally, the difference identification module 13 includes:
a name extracting unit 131, configured to extract a product name of the installation package, and identify a data package that is consistent with the product name from the code library;
a comparison identification unit 132, configured to obtain a version number of the data packet, where a data packet whose version number is closest to the installation packet is set as a comparison packet;
a log set unit 133, configured to obtain, from the code base, a first log set of the installation package that at least has one code log, and obtain, from the code base, the code logs of the comparison package, and aggregate the code logs to form a second log set.
A difference identifying unit 134 configured to perform an exclusive or operation on the first log set and the second log set to identify a code log having a difference between the first log set and the second log set, and set the code log having the difference as difference information.
Optionally, the version update module 15 includes:
the regular extraction unit 151 is configured to obtain a regular expression, where a keyword of a code log type is recorded in the regular expression.
A type matching unit 152, configured to perform regular matching on the regular expression and the content in the difference information to obtain a type of the code log;
and the tag marking unit 153 is configured to insert tag information corresponding to the type into the code log, and convert the code log into a json format to obtain the detail information.
Optionally, the image extraction module 17 includes:
the update issuing unit 171 is configured to control the code library to issue a version update package by an npm publish method, so that the image library receives the version update package;
and a monitoring interception unit 172, configured to monitor, through the AOP component, whether the version update package issued by the code library is received by the mirror library, and if so, intercept and extract the version update package of the mirror library and extract the version update package.
The technical scheme is applied to the field of process optimization of computer operation and maintenance, a comparison package corresponding to the installation package is extracted from the code library, the difference between the installation package and the comparison package is identified to obtain difference information, label information is inserted into the code log to obtain detail information, and then the detail information is constructed into an analysis table, so that a user at a user end can rapidly and visually obtain the upgrading details of the version updating package, the user can conveniently judge whether to upgrade a product in the version updating package, and the optimization of the operation experience of the mobile terminal is realized.
Example four:
in order to achieve the above object, the present invention further provides a computer device 6, in which components of the code updating and recognizing apparatus in the third embodiment can be distributed in different computer devices, and the computer device 6 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster formed by multiple application servers) for executing programs, and the like. The computer device of the embodiment at least includes but is not limited to: a memory 61, a processor 62, which may be communicatively coupled to each other via a system bus, as shown in FIG. 5. It should be noted that fig. 5 only shows a computer device with components, but it should be understood that not all of the shown components are required to be implemented, and more or fewer components may be implemented instead.
In the present embodiment, the memory 61 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 61 may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the memory 61 may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device. Of course, the memory 61 may also include both internal and external storage devices of the computer device. In this embodiment, the memory 61 is generally used for storing an operating system and various application software installed in the computer device, for example, the program code of the code update identifying apparatus in the third embodiment. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 generally functions to control the overall operation of the computer device. In this embodiment, the processor 62 is configured to run the program codes stored in the memory 61 or process data, for example, run a code update recognition device, so as to implement the code update recognition method of the first embodiment and the second embodiment.
Example five:
to achieve the above objects, the present invention also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App, etc., having stored thereon a computer program, which when executed by a processor 62, implements corresponding functions. The computer-readable storage medium of the present embodiment is used for storing a code update recognition apparatus, and when being executed by the processor 62, implements the code update recognition method of the first embodiment and the second embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present invention or directly or indirectly applied to other related technical fields are also included in the scope of the present invention.

Claims (8)

1. A code update recognition method, comprising:
when monitoring that a code library receives an installation package, extracting the installation package from the code library, wherein the installation package is a data package for upgrading a product;
searching whether the installation package has detail information or not through a preset detail regular expression; if so, setting the installation package as a version update package, and storing the version update package to the code library;
extracting the product name of the installation package, and identifying a data package consistent with the product name from the code library;
setting the version number of the installation package as a current version number, setting the version number of the data package as a historical version number, setting a sequential historical version number positioned above the current version number as a comparison version number, and setting the data package corresponding to the historical version number as a comparison package;
acquiring a first log set of the installation package, which at least comprises one code log, from the code library, and acquiring the code logs of the comparison package from the code library and summarizing to form a second log set;
performing an exclusive-or operation on the first log set and the second log set to identify code logs having differences between the first log set and the second log set, and setting the code logs having differences as difference information;
acquiring the type of a code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version update package, and storing the version update package into the code library;
when monitoring that a mirror image library receives a version update package sent by the code library, extracting the version update package from the mirror image library;
and classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version update package and the analysis table to a user side.
2. The method according to claim 1, wherein the step of summarizing the detail information of all code logs in the difference information and loading the summarized detail information into the installation package to obtain a version update package comprises:
and summarizing the detail information of all the code logs in the difference information to form detail information stored in an array structure form, and loading the detail information into the installation package.
3. The method according to claim 1, wherein the step of obtaining a type of the code log in the difference information and inserting tag information into the code log according to the type to obtain the detail information comprises:
acquiring a regular expression, wherein keywords of the type of a code log are recorded in the regular expression;
performing regular matching on the regular expression and the content in the difference information to obtain the type of the code log;
and inserting the label information corresponding to the type into the code log, and converting the code log into a json format to obtain detailed information.
4. The method for identifying code update according to claim 1, wherein the step of extracting the version update package from the mirror library when the monitoring mirror library receives the version update package sent by the code library comprises:
controlling the code library to release a version update package through an npm publishing method, enabling the mirror library to receive the version update package, monitoring whether the mirror library receives the version update package released by the code library through an AOP (automatic optical point protocol) assembly, and if so, intercepting and extracting the version update package of the mirror library.
5. The code update recognition method of claim 1, wherein prior to said classifying the detail information by the type, the method further comprises:
judging whether the version updating package has detail information;
if not, generating prompt information, and sending the version update package and the prompt information to a user side;
after the sending the version update package and the parsing table to the user side, the method further includes:
and uploading the version updating package and the analysis table to a block chain.
6. A code update recognition apparatus, which is connected to a code library and a mirror library respectively, includes:
the device comprises an installation package extracting module, a code library updating module and a code library updating module, wherein the installation package extracting module is used for extracting an installation package from the code library when monitoring that the code library receives the installation package, and the installation package is a data package used for updating a product;
the installation detail judging module is used for searching whether the installation package has detail information or not through a preset detail regular expression;
the difference identification module is used for extracting a comparison package corresponding to the installation package from the code library, and identifying the difference between the installation package and the comparison package to obtain difference information with at least one code log;
the difference identification module comprises:
the name extraction unit is used for extracting the product name of the installation package and identifying a data package consistent with the product name from the code library;
the comparison identification unit is used for acquiring the version number of the data packet, and the data packet with the version number closest to the installation packet is set as a comparison packet;
the log set unit is used for acquiring at least one first log set with at least one code log of the installation package from the code library, acquiring the code logs of the comparison package from the code library and summarizing to form a second log set;
a difference identifying unit configured to perform an exclusive or operation on the first log set and the second log set to identify a code log having a difference between the first log set and the second log set, and set the code log having the difference as difference information;
the detail confirming module is used for setting the installation package as a version updating package to call the updating and storing module;
the update storage module is used for storing the version update package into a code library; the version updating module is used for acquiring the type of the code log in the difference information, inserting label information into the code log according to the type to obtain detail information, summarizing the detail information of all the code logs in the difference information, loading the summarized detail information into the installation package to obtain a version updating package, and storing the version updating package into the code library;
the image extraction module is used for extracting the version update package from the image library when the image library is monitored to receive the version update package sent by the code library;
and the updating analysis module is used for classifying the detail information according to the type to obtain at least one analysis table recording the detail information of the same type, and sending the version updating package and the analysis table to the user side.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the code update recognition method according to any one of claims 1 to 5 are implemented by the processor of the computer device when the computer program is executed.
8. A computer-readable storage medium, on which a computer program is stored, wherein the computer program stored in the computer-readable storage medium, when being executed by a processor, implements the steps of the code update identification method according to any one of claims 1 to 5.
CN202110323332.3A 2021-03-26 2021-03-26 Code update identification method and device, computer equipment and readable storage medium Active CN112988193B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110323332.3A CN112988193B (en) 2021-03-26 2021-03-26 Code update identification method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110323332.3A CN112988193B (en) 2021-03-26 2021-03-26 Code update identification method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112988193A CN112988193A (en) 2021-06-18
CN112988193B true CN112988193B (en) 2023-04-07

Family

ID=76333723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110323332.3A Active CN112988193B (en) 2021-03-26 2021-03-26 Code update identification method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112988193B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156198A (en) * 2013-05-14 2014-11-19 广东电网公司信息中心 Method and device for automatically generating software integration version updating description
CN104182241A (en) * 2013-05-24 2014-12-03 华为终端有限公司 Webpage application program (Web App) update method and communication device
US10042626B2 (en) * 2015-06-29 2018-08-07 Verizon Patent And Licensing Inc. Software updates using client self-reporting and a hierarchical data structure
CN106484771B (en) * 2016-09-09 2018-09-04 腾讯科技(深圳)有限公司 Different information file generated and application process, device
CN106919382A (en) * 2017-01-22 2017-07-04 百度在线网络技术(北京)有限公司 For generating the method and apparatus that application updates bag
CN110865842B (en) * 2018-08-28 2023-11-03 成都鼎桥通信技术有限公司 OTA upgrading method and equipment
CN109857431B (en) * 2019-01-11 2022-06-03 平安科技(深圳)有限公司 Code modification method and device, computer readable medium and electronic equipment
CN111107133A (en) * 2019-11-08 2020-05-05 京东数字科技控股有限公司 Generation method of difference packet, data updating method, device and storage medium

Also Published As

Publication number Publication date
CN112988193A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN102254111B (en) Malicious site detection method and device
CN111694592A (en) Management method and system for project version release
CN112559354A (en) Front-end code specification detection method and device, computer equipment and storage medium
CN110895472A (en) Method and device for identifying service change
CN106843976B (en) Method and apparatus for generating image file
CN107506256B (en) Method and device for monitoring crash data
CN112784298A (en) Log desensitization method and device, computer equipment and storage medium
CN113157315A (en) Method, device, equipment and medium for identifying difference information of different versions of software
CN112764792B (en) Method and device for upgrading associated server version application and electronic equipment
US10365910B2 (en) Systems and methods for uninstalling or upgrading software if package cache is removed or corrupted
CN110245059B (en) Data processing method, device and storage medium
CN111240730A (en) Application program updating method and device
CN113434254B (en) Client deployment method, client deployment apparatus, computer device, and storage medium
CN111666087A (en) Operation rule updating method and device, computer system and readable storage medium
CN111367531A (en) Code processing method and device
CN112364022B (en) Information deduction management method, device, computer equipment and readable storage medium
CN113535677A (en) Data analysis query management method and device, computer equipment and storage medium
CN112988193B (en) Code update identification method and device, computer equipment and readable storage medium
CN111782244A (en) Configuration file updating method and device, computer equipment and storage medium
CN112817935A (en) Data processing method, device and equipment based on field type and storage medium
CN112052256A (en) Multi-version request returning method and device, computer equipment and readable storage medium
CN109739868B (en) Data processing method and related equipment thereof
CN111273920A (en) Method and device for writing data into installation package and storage medium
CN116700751A (en) Upgrading method of server firmware and computing device
CN113791809B (en) Application exception handling method and device and computer readable storage medium

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