CN112988193A - 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 PDFInfo
- Publication number
- CN112988193A CN112988193A CN202110323332.3A CN202110323332A CN112988193A CN 112988193 A CN112988193 A CN 112988193A CN 202110323332 A CN202110323332 A CN 202110323332A CN 112988193 A CN112988193 A CN 112988193A
- Authority
- CN
- China
- Prior art keywords
- code
- package
- library
- information
- log
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
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
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 are layered on the market, including npm, maven and the like, and a user can search an installation package on the mirror image library to view the content description of the installation package, and install the installation package on the project or 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 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.
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 base.
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 the detail information.
In the above scheme, the step of extracting the version update package from the mirror library when the monitoring that the mirror 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 or not;
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.
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 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 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.
In order 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 intuitively obtain the update details of the version update package, and whether the version update package is used for updating products in the version update package is 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 base, extracts the comparison package corresponding to the installation package from the code base, and identifies the difference between the installation package and the comparison package to obtain the difference information with at least one code log. 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; 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 a mirror image library receives a version update package sent by the code library, extracting the version update package from the mirror 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 logs, inserting label information into the code logs 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 performing identification management on the updated content and type of the version update package relative to the comparison package so as to classify the code logs 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.
Example two:
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 base, the operation of extracting the installation package from the code base is set to be when the installation package is received by the code base, 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 open-source version control software for managing versions of projects and products.
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 programming) component is a technique for implementing unified maintenance of program functions by means of a pre-compiling mode and a dynamic agent during running, and is Oriented to the facet programming.
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 name of the log: commit de24f6c0c0d003ceccefb814b80ff2f5f94ea6bb
The code author: author < test @ test. com. cn >
And (3) modifying time: date: Thu Aug 2709: 25: 462020 +0800
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 having 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 the product name ABCD and the version number 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 history version number located immediately above the current 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: and c is a ^ b, which means that a and b are converted into a binary form and then are subjected to exclusive OR operation according to bits, and when the same bit is encountered, the bit is 0 and the other bit is 1. And b are two different objects respectively, c marks the same and different parts between a and b, and the data corresponding to the part with the value of 1 in c in a and 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 empty p ^ q ^ 1, p4 True q4 True p ^ q ^ 0, then p2 and q2, and p3 and q3 are difference information respectively.
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 subjected to identification management 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, the detail information stored in the form of an array structure is formed, 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 expression includes 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' 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 label 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 the detail 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 2709: 25: 462020 +0800", type: "UPDATE", message: "optimized scroll bar style" }
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 2709: 45312020 +0800", type: "NEW", message: "New Help Key" }
S206: and saving the version update package into a code library.
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.
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 programming) component is a technique for implementing unified maintenance of program functions by means of a pre-compiling mode and a dynamic agent during running, and is Oriented to the facet programming. Docker Registry or VMware Harbor is used as the mirror library.
npm (node package manager) publish refers to npm publishing, refers to a computer method for publishing a version update package to a code library from a npm repository of the code library, wherein npm is a package management tool for assisting front-end development, and is used for managing publishing, installation, abandonment, uninstallation, update, search and the like of a package (i.e., the version update package); npm the repository is a storage module running in the code base for holding 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 analysis table to a block chain.
It should be noted that, based on the version update package and the parsing table, corresponding digest information is obtained, specifically, the digest information is obtained by hashing 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 parsing 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 a 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 image extraction module 17 is configured to, when the image library receives the version update package sent by the code library, extract the version update package from the 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 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 identifying module 13 includes:
a name extraction 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;
the log set unit 133 is configured to obtain, from the code library, a first log set of the installation package, which has at least one code log, and obtain, from the code library, 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 in which a keyword of a code log type is recorded.
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 quickly and visually obtain the upgrade details of the version update package, the user can conveniently judge whether to upgrade a product in the version update package, and the operation experience of the mobile terminal is optimized.
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 is typically used 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 application store, etc., on which a computer program is stored, 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 above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
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;
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 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 code update recognition method of claim 1, wherein before the extracting the comparison package corresponding to the installation package from the code library, the method further comprises:
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 base.
3. The method according to claim 1, wherein 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 having at least one code log comprises:
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.
4. 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.
5. The method according to claim 1, wherein 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 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 the detail information.
6. 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.
7. The code update recognition method of claim 1, wherein before said classifying said detail information by said type, said method further comprises:
judging whether the version updating package has detail information or not;
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.
8. 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 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.
9. 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 7 are implemented by the processor of the computer device when the computer program is executed.
10. 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 7.
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 true CN112988193A (en) | 2021-06-18 |
CN112988193B 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) |
Citations (8)
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 |
US20140351807A1 (en) * | 2013-05-24 | 2014-11-27 | Huawei Device Co., Ltd. | Method and communication device for updating web application |
US20160378454A1 (en) * | 2015-06-29 | 2016-12-29 | Verizon Patent And Licensing Inc. | Software updates using client self-reporting and a hierarchical data structure |
CN106484771A (en) * | 2016-09-09 | 2017-03-08 | 腾讯科技(深圳)有限公司 | 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 |
CN109857431A (en) * | 2019-01-11 | 2019-06-07 | 平安科技(深圳)有限公司 | Code revision method and device, computer-readable medium and electronic equipment |
CN110865842A (en) * | 2018-08-28 | 2020-03-06 | 成都鼎桥通信技术有限公司 | OTA (over the air) upgrading method and device |
CN111107133A (en) * | 2019-11-08 | 2020-05-05 | 京东数字科技控股有限公司 | Generation method of difference packet, data updating method, device and storage medium |
-
2021
- 2021-03-26 CN CN202110323332.3A patent/CN112988193B/en active Active
Patent Citations (8)
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 |
US20140351807A1 (en) * | 2013-05-24 | 2014-11-27 | Huawei Device Co., Ltd. | Method and communication device for updating web application |
US20160378454A1 (en) * | 2015-06-29 | 2016-12-29 | Verizon Patent And Licensing Inc. | Software updates using client self-reporting and a hierarchical data structure |
CN106484771A (en) * | 2016-09-09 | 2017-03-08 | 腾讯科技(深圳)有限公司 | 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 |
CN110865842A (en) * | 2018-08-28 | 2020-03-06 | 成都鼎桥通信技术有限公司 | OTA (over the air) upgrading method and device |
CN109857431A (en) * | 2019-01-11 | 2019-06-07 | 平安科技(深圳)有限公司 | Code revision 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 |
---|---|
CN112988193B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102254111B (en) | Malicious site detection method and device | |
CN112559354A (en) | Front-end code specification detection method and device, computer equipment and storage medium | |
CN111694592A (en) | Management method and system for project version release | |
CN107506256B (en) | Method and device for monitoring crash data | |
CN105389177A (en) | Software version confirmation method, device and system | |
CN110895472A (en) | Method and device for identifying service change | |
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 | |
CN110866258A (en) | Method for quickly positioning bug, electronic device and storage medium | |
US10365910B2 (en) | Systems and methods for uninstalling or upgrading software if package cache is removed or corrupted | |
CN111666087A (en) | Operation rule updating method and device, computer system and readable storage medium | |
CN112817935A (en) | Data processing method, device and equipment based on field type and storage medium | |
CN113535677A (en) | Data analysis query management method and device, computer equipment and storage medium | |
CN112965721A (en) | Android-based project compiling method and device, computer equipment and storage medium | |
CN110245059B (en) | Data processing method, device and storage medium | |
CN112579958A (en) | Webpage conversion method and device, computer equipment and readable storage medium | |
CN112052256A (en) | Multi-version request returning method and device, computer equipment and readable storage medium | |
CN111367531A (en) | Code processing method and device | |
CN113434254B (en) | Client deployment method, client deployment apparatus, computer device, and storage medium | |
CN112364022B (en) | Information deduction management method, device, computer equipment and readable storage medium | |
CN112988193B (en) | Code update identification method and device, computer equipment and readable storage medium | |
CN112749124A (en) | Page information management method and device, computer equipment and readable storage medium | |
CN111782244A (en) | Configuration file updating method and device, computer equipment and storage medium | |
CN111240730A (en) | Application program updating method and device | |
CN115658084A (en) | Web front-end architecture and page deployment method, device, equipment and medium thereof |
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 |