Method, system and equipment for marking and tracking software version based on executable file

By extracting environment variable information, building JSON data structures and injecting front-end files, the problem of manual operation prone to errors and dependence on back-end service stability in software version tracking is solved, and automated and reliable version tracking is realized, which improves operation and maintenance efficiency and users. Experience.

CN119105964APending Publication Date: 2024-12-10CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411197844.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing technology has problems such as manual operations prone to errors and low efficiency in software version tracking, and relying on back-end services with high stability and fragility, which increases the difficulty of version tracking.

Method used

By extracting environment variable information, building a JSON data structure, injecting software version information into the front-end file, and using the JSON data structure to load and view version information during software execution, to achieve automated and reliable version tracking.

Benefits of technology

It improves operation and maintenance efficiency, reduces error rate, improves user experience, supports multiple viewing methods, has good compatibility and security, and is adapted to complex micro front-end structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105964A_ABST
    Figure CN119105964A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software version management, and provides a method, system and equipment for marking and tracking a software version based on an executable file, and the method comprises the steps: extracting environment variable information, constructing a JSON data structure according to the extracted environment variable information, and collecting software version information by adopting the constructed JSON data structure; checking whether a front-end file needs to be specified or not, obtaining a corresponding front-end file according to a checking result, and injecting the collected software version information into the corresponding front-end file according to an injection rule; and when the software is executed, the corresponding software version information is loaded and checked by executing the front-end file injected with the software version information. According to the method, the system and the equipment for marking and tracking the software version based on the executable file, the software version information can be marked and tracked efficiently and accurately, and developers can better manage and monitor version information of various delivery products including front-end applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software version management, and in particular to a method, system and device for marking and tracking software versions based on executable files. Background Art

[0002] Version tracking of software development products after deployment is one of the key tasks in the enterprise operation and maintenance management process. Effective version viewing and tracking methods can help developers or operation and maintenance personnel locate the source of software products and verify the effectiveness of software deployment, thereby providing strong support for further locating and solving software problems.

[0003] As the front-end and back-end collaboration models become increasingly mature, the concept of continuous delivery and deployment has become popular. The front-end version is independent of the back-end and frequent delivery and deployment have become a daily routine, which has greatly improved the overall software delivery efficiency. However, the modular and microservice software architecture has also made daily development and debugging, and the tracking of versions after product launch more difficult, and communication costs increased. Especially in the front-end field, it will be affected by factors such as browser cache, and the introduction of micro-front-end technology may further complicate the software model, thereby exacerbating the difficulty of tracking and viewing versions after front-end product deployment.

[0004] At present, version injection and tracking rely on manual injection of version information, using backend services to save version information, and using file names to save version information. In actual applications, manual injection of version information relies on manual operations, which is prone to errors and inefficient. The accuracy and consistency of version information are difficult to guarantee, and it is difficult to adapt to the rapid iteration development environment. Using backend services to save version information can be automated, but the stability and reliability of backend services become the key. Service failures or architectural changes may affect the acquisition of version information, increasing the vulnerability of the system. When using file names to save version information, micro-frontend technology makes the front-end architecture more modular, but it also increases the difficulty of version tracking because it is necessary to synchronize and track version information between multiple independent front-end modules.

[0005] Therefore, how to provide a more automated, reliable and easy-to-integrate version tracking solution to improve operation and maintenance efficiency, reduce error rates, and enhance user experience has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a method, system and device for marking and tracking software versions based on executable files.

[0007] According to a first aspect of the present invention, there is provided a method for marking and tracking software versions based on executable files, comprising:

[0008] Extracting environment variable information, constructing a JSON data structure according to the extracted environment variable information, and using the constructed JSON data structure to collect software version information;

[0009] Check whether a front-end file needs to be specified, obtain the corresponding front-end file based on the check result, and inject the collected software version information into the corresponding front-end file according to the injection rules;

[0010] When executing the software, the corresponding software version information is loaded and viewed by executing the front-end file that injects the software version information.

[0011] Preferably, the present invention extracts environment variable information based on a method for marking and tracking software versions of executable files, including: extracting environment variable information of the user in the compilation environment, the environment variable information including: build timestamp, version submission hash, build branch, product build pipeline sequence number and product build pipeline execution number.

[0012] Preferably, the present invention is based on a method for marking and tracking software versions of executable files, constructs a JSON data structure according to the extracted environment variable information, and uses the constructed JSON data structure to collect software version information, including: constructing a JSON data structure according to the environment variable information in the order of build branch, build timestamp, version submission hash, product build pipeline execution number and product build pipeline sequence number, and using the constructed JSON data structure to collect data corresponding to the corresponding environment variable information.

[0013] Preferably, the present invention is based on a method for marking executable files and tracking software versions, checks whether it is necessary to specify a front-end file, and obtains the corresponding front-end file based on the check result, including: checking whether the user specifies the front-end file to be injected, when the user specifies the front-end file to be injected, obtaining the specified front-end file according to the user's specified information, when the user does not specify the front-end file to be injected, retrieving the front-end execution entry file in the execution directory, using the retrieved front-end execution entry file as the front-end file to be injected, and when the front-end execution entry file is not retrieved in the execution directory, creating a corresponding front-end file.

[0014] Preferably, the present invention is based on a method for marking and tracking software versions of executable files, and the front-end files include JavaScript files and HTML files.

[0015] Preferably, the present invention is based on a method for marking and tracking software versions of executable files, and injects the collected software version information into the corresponding front-end file according to the injection rules, including:

[0016] If the front-end file is a JavaScript file, create and initialize the global object, and set the storage attribute object in the initialized global object;

[0017] The version information collected through the JSON data structure is stored using the set storage attribute object;

[0018] Insert a global object containing version information at the end of your JavaScript file.

[0019] Preferably, the present invention is based on a method for marking executable files and tracking software versions, and injects the constructed JSON data structure as basic data into the corresponding front-end file according to the injection rules, including:

[0020] If the front-end file is an HTML file, create and initialize the global object, and set the storage attribute object in the initialized global object;

[0021] The version information collected through the JSON data structure is stored using the set storage attribute object;

[0022] The script tag of the HTML file is used to wrap the global object storing the version information, and the wrapped global object is inserted into the header of the HTML file.

[0023] Preferably, the present invention is based on a method for marking and tracking software versions of executable files. When executing the software, the corresponding software version information is loaded and viewed by executing a front-end file that injects the software version information, including: when executing the front-end file that injects the software version information, the corresponding software version information is loaded and viewed by calling a global variable that stores the software version information.

[0024] According to a second aspect of the present invention, there is provided a system for marking and tracking software versions based on executable files, the system comprising a marking and tracking server, the marking and tracking server being used to: extract environment variable information, construct a JSON data structure according to the extracted environment variable information, and collect software version information using the constructed JSON data structure; check whether a front-end file needs to be specified, obtain the corresponding front-end file according to the check result, and inject the collected software version information into the corresponding front-end file according to the injection rule; and load and view the corresponding software version information by executing the front-end file into which the software version information is injected when executing the software.

[0025] According to a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect of the present invention when executing the program.

[0026] The present invention is based on the method, system and device for marking and tracking software versions of executable files, and implements the injection of software version information based on binary executable front-end files. Through standard and compatible front-end files and unified software version information injection standards, the version information in different software architecture scenarios is unified, and the software version information is efficiently and accurately marked and tracked; flexible scalability and injection methods are provided, with good compatibility and micro-front-end compatibility, support for multiple viewing methods, and excellent maturity and security, which helps developers to better manage and monitor the version information of various delivered products including front-end applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 An example diagram of the architecture of a system for marking and tracking software versions based on executable files according to an embodiment of the present invention;

[0029] Figure 2 A flowchart of a method for marking and tracking software versions based on executable files according to an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of the structure of the device provided by the present invention. DETAILED DESCRIPTION

[0031] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0032] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.

[0033] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0034] Figure 1 FIG. 1 is an exemplary diagram of the architecture of a system for marking and tracking software versions based on executable files according to an embodiment of the present invention. Figure 1 As shown, the system may include a marking and tracking server 101, a communication network 102 and / or one or more marking and tracking clients 103. Figure 1 The example shown is a plurality of marking and tracking clients 103.

[0035] The tagging and tracking server 101 can be any appropriate server for storing information, data, programs and / or any other suitable type of content. In some embodiments, the tagging and tracking server 101 can perform appropriate functions. For example, in some embodiments, the tagging and tracking server 101 can be used to tag and track software versions based on executable files. As an optional example, in some embodiments, the tagging and tracking server 101 can be used to: extract environment variable information, construct a JSON data structure based on the extracted environment variable information, and use the constructed JSON data structure to collect software version information; check whether a front-end file needs to be specified, obtain the corresponding front-end file based on the check result, and inject the collected software version information into the corresponding front-end file according to the injection rule; when executing the software, the corresponding software version information is loaded and viewed by executing the front-end file that injects the software version information.

[0036] As another example, in some embodiments, the marking and tracking server 101 may send a method for marking and tracking software versions based on executable files to the marking and tracking client 103 for user use based on the request of the marking and tracking client 103 .

[0037] As an optional example, in some embodiments, the marking and tracking client 103 is used to provide a visual marking and tracking interface, which is used to receive a user's selection input operation based on an executable file marking and tracking software version, and, in response to the selection input operation, obtain the marking and tracking interface corresponding to the option selected by the selection input operation from the marking and tracking server 101 and display the marking and tracking interface, wherein the marking and tracking interface at least displays information based on the executable file marking and tracking software version and operation options based on the information based on the executable file marking and tracking software version.

[0038] It should be noted that in the system of this embodiment, the marking and tracking server 101 is used to insert code. When the terminal user checks the software version through the marking and tracking client 103, the inserted code is executed, and the code execution can be performed on the user's browser.

[0039] In some embodiments, the communication network 102 can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network 102 can include any one or more of the following: the Internet, an intranet, a wide area network (WAN), a local area network (LAN), a wireless network, a digital subscriber line (DSL) network, a frame relay network, an asynchronous transfer mode (ATM) network, a virtual private network (VPN), and / or any other suitable communication network. The tagging and tracking client 103 can be connected to the communication network 102 via one or more communication links (e.g., communication link 104), and the communication network 102 can be linked to the tagging and tracking service end 101 via one or more communication links (e.g., communication link 105). The communication link can be any communication link suitable for transmitting data between the tagging and tracking client 103 and the tagging and tracking service end 101, such as a network link, a dial-up link, a wireless link, a hard-wired link, any other suitable communication link, or any suitable combination of such links.

[0040] The marking and tracking client 103 may include any one or more clients that present an interface related to marking and tracking software versions based on executable files in an appropriate form for use and operation by a user. In some embodiments, the marking and tracking client 103 may include any suitable type of device. For example, in some embodiments, the marking and tracking client 103 may include a mobile device, a tablet computer, a laptop computer, a desktop computer, and / or any other suitable type of client device.

[0041] Although the tagging and tracking server 101 is illustrated as one device, in some embodiments, any suitable number of devices may be used to perform the functions performed by the tagging and tracking server 101. For example, in some embodiments, multiple devices may be used to implement the functions performed by the tagging and tracking server 101. Alternatively, the functions of the tagging and tracking server 101 may be implemented using a cloud service.

[0042] Based on the above system, an embodiment of the present invention provides a method for marking and tracking software versions based on executable files, which is described below through the following embodiments.

[0043] Figure 2 The following is a flowchart of a method for marking and tracking software versions based on executable files according to an embodiment of the present invention. The method for marking and tracking software versions based on executable files in this embodiment can be executed on a marking and tracking server, and the method for marking and tracking software versions based on executable files includes the following steps:

[0044] Step S201: extracting environment variable information, constructing a JSON data structure according to the extracted environment variable information, and using the constructed JSON data structure to collect software version information.

[0045] As an optional example, in the method of this embodiment, the environment variable information of the user in the compilation environment is extracted, and the environment variable information includes: build timestamp, version submission hash, build branch, product build pipeline sequence number and product build pipeline execution number. In this embodiment, a standard variable for tracking build version information is provided, and by setting and tracking these standard variables, modern enterprise software delivery version management and fault location optimization are facilitated.

[0046] After extracting the environment variable information, this embodiment constructs a JSON data structure with the environment variable information in the order of build branch, build timestamp, version submission hash, product build pipeline execution number and product build pipeline sequence number, and uses the constructed JSON data structure to collect data corresponding to the corresponding environment variable information.

[0047] The JSON data structure constructed in this embodiment has elements wrapped in curly braces or square brackets, and contains a collection of key-value pairs of object, array, string, number, Boolean value, and null value types.

[0048] For example, the JSON data structure constructed according to the method of this embodiment is as follows:

[0049] {

[0050] buildBranch:'',

[0051] buildTimeStamp:'',

[0052] commitId:'',

[0053] pipelineBuildNum:'',

[0054] pipelineId:''

[0055] }

[0056] In the above JSON data structure, buildBranch refers to the build branch (compile branch), which is of string type; buildTimeStamp is the build timestamp, which is of string type; commitId is the version commit hash, which is of string type; pipelineBuildNum is the product build pipeline execution number, which is of string type; pipelineId is the product build pipeline sequence number, which is of string type.

[0057] Step S202: Check whether a front-end file needs to be specified, obtain the corresponding front-end file according to the check result, and inject the collected software version information into the corresponding front-end file according to the injection rule.

[0058] As an optional example, in the method of this embodiment, it is checked whether the user specifies the front-end file to be injected. When the user specifies the front-end file to be injected, the specified front-end file is obtained according to the user's specified information. When the user does not specify the front-end file to be injected, the front-end execution entry file is retrieved in the execution directory, and the retrieved front-end execution entry file is used as the front-end file to be injected. When the front-end execution entry file is not retrieved in the execution directory, a new corresponding front-end file is created. The front-end files in this embodiment include JavaScript files and HTML files. It should be noted that in the method of this embodiment, the front-end execution entry file includes the index.html file, the plugin-entry.js file, and the app.js file. In actual applications, other front-end execution entry files can also be selected according to the actual application scenario. This embodiment does not limit this.

[0059] As an optional example, in this embodiment, if the front-end file is a JavaScript file, create and initialize a global object, set a storage property object in the initialized global object; use the set storage property object to store version information collected through the JSON data structure; and insert the global object storing the version information into the end of the JavaScript file.

[0060] The method of this embodiment is further described below in an actual application scenario:

[0061] Collect version information through the constructed JSON data structure and inject the collected version information into the front-end file. Specifically, if the front-end file is a JavaScript file, insert the following content at the end of the JavaScript file:

[0062] window.versionInfo=window.versionInfo||{};

[0063] window.versionInfo['console_plugin_message_center']={

[0064] commitId:'78c5440',

[0065] buildBranch:'master',

[0066] buildTimeStamp:'1722539727424',

[0067] pipelineId:'1650410165526798338',

[0068] pipelineBuildNum:'2818'

[0069] }

[0070] The purpose of the above content is to create and initialize a global object versionInfo, which is used to store version information related to a software module (console_plugin_message_center). In actual applications, the name of the software module can be specifically set according to business requirements.

[0071] This application scenario first creates and initializes the global object. The meaning of window.versionInfo = window.versionInfo||{} is: if window.versionInfo already exists, keep the original value; if it does not exist, initialize it to an empty object {}, thereby ensuring that versionInfo is a usable object for storing subsequent information.

[0072] This application scenario then stores the software version information. The function of window.versionInfo['console_plugin_message_center'] = {...} is to add an attribute console_plugin_message_center to the versionInfo object. The value of this attribute is an object containing multiple key-value pairs. This object stores the version information of the plug-in, including:

[0073] commitId: represents the unique identifier of the code commit ('78c5440'), that is, the version commit hash.

[0074] buildBranch: represents the branch used for building ('master'), that is, the product compilation branch.

[0075] buildTimeStamp: represents the timestamp of the build ('1722539727424'), which is used to record the specific time of the build.

[0076] pipelineId: represents the unique identifier of the build pipeline ('1650410165526798338'), that is, the product build pipeline sequence number.

[0077] pipelineBuildNum: represents the build number in the pipeline ('2818'), i.e. the execution number of the product build pipeline.

[0078] In practical applications, it is possible to offset conflicts in the same project. That is, if multiple versions of information are mistakenly injected into a project (or someone else's build process deliberately injects version information again due to active behavior), the characteristics of the front-end file content itself injected by the method of this embodiment will always be able to access the latest content in the versionInfo object in chronological order, thereby maintaining the latest injected version information, and at the same time being able to quickly locate the relevant CI / CD process (generally the pipeline) where the source of the version information is located through the piplineNum identifier. According to the method of this embodiment, when facing multiple different projects, as long as their own module names are different and the same logic is executed, the information set in the global object can also not interfere with each other.

[0079] As an optional example, in this embodiment, if the front-end file is an HTML file, a global object is created and initialized, and a storage attribute object is set in the initialized global object; the set storage attribute object is used to store the version information collected through the JSON data structure; the script tag of the HTML file is used to wrap the global object storing the version information, and the wrapped global object is inserted into the header of the HTML file.

[0080] The method of this embodiment is further described below in an actual application scenario:

[0081] If the front-end file is an HTML file, that is, a Hypertext Markup Language (HTML) file ending with "HTM" or "HTML", the global object storing the version information is used to <script>标签包裹,然后插入到HTML文件的<head>部分,如果<head>部分不存在,则通过语法分析HTML DOM结构并新建<head>元素,最终插入的内容如下所示:

[0082] <head>

[0083] <script>

[0084] window.versionInfo=window.versionInfo||{};

[0085] window.versionInfo['console_plugin_message_center']={

[0086] commitId:'78c5440',

[0087] buildBranch:'master',

[0088] buildTimeStamp:'1722539727424',

[0089] pipelineId:'1650410165526798338',

[0090] pipelineBuildNum:'2818'

[0091] }

[0092] < / script>

[0093]

[0094] It should be noted that the method of this embodiment can flexibly implement the injection of metadata and environment variables. Although the number of total keys is fixed, through custom values, developers can inject different metadata and environment variables as needed to meet the needs of different scenarios.

[0095] Step S203: When executing the software, the corresponding software version information is loaded and viewed by executing the front-end file injected with the software version information.

[0096] As an optional example, in this embodiment, when executing the front-end file for injecting software version information, the corresponding software version information is loaded and viewed by calling the global variable storing the software version information.

[0097] The method of this embodiment is described in detail in a specific scenario as follows:

[0098] When a user opens a web application corresponding to a software application, the web application sequentially executes the front-end files (including JavaScript, HTML, css and other files) injected with the software version information. In this embodiment, during the software version information injection process, it is necessary to first determine whether there is a versionInfo variable on the global window object. If not, ensure that it is initialized to an empty JS object ({}) to ensure that the software version information can be mounted on the global window object. After initializing the versionInfo object, the version information of the corresponding name of the application will be mounted on the versionInfo variable located on the global window object. The user can press the F12 key on the keyboard of the browser, enter versionInfo in the console and press Enter to view the currently loaded and viewable system component version information.

[0099] According to the method of this embodiment, when a product with front-end page capability is running, the beneficial effects of the product versions of each software component can be viewed in real time in the F12 console tab of the browser without logging into the cluster or viewing the background.

[0100] It should be noted that the method of this embodiment can also obtain the full set of version information of the software modules that are actually in effect by viewing the execution results of the injected JavaScript fragment in the debugging console provided by the browser.

[0101] In practical applications, the method and system of this embodiment can support additional extended functions in multiple ways. Users can extend npm packages, including additional extended binary files under virtual modules, and provide different viewing options by including static files, console forced output, and console viewing variables, so that users can choose the appropriate way to view version information according to specific needs, so as to flexibly apply to different extension needs and meet the version viewing requirements in different scenarios. Since the method of this embodiment has good compatibility when viewing software version information, it is not restricted by the build tool and can be compatible with different build tools such as node-webpack and node-vite. This compatibility allows developers to use the method of this embodiment to implement version injection and viewing when using different build tools.

[0102] In practical applications, the method of this embodiment is suitable for complex micro-frontend structures, that is, it has advantages in micro-frontend compatibility. For each application, its independence can be guaranteed without affecting other applications. At the same time, it has advantages in the scenarios of dual-frontend projects for the same application and multiple-frontend projects for the same application. It can provide customized compatibility while maintaining ease of use to adapt to different project configurations.

[0103] The method and system for marking and tracking software versions based on executable files in this embodiment implement the injection of software version information based on binary executable front-end files, and unify version information in different software architecture scenarios through standard and compatible front-end files and unified software version information injection standards, thereby achieving efficient and accurate marking and tracking of software version information.

[0104] The method and system of this embodiment provide flexible scalability and injection methods, have good compatibility and micro-frontend compatibility, support multiple viewing methods, and have excellent maturity and security, which helps developers better manage and monitor version information of various deliverables including front-end applications.

[0105] like Figure 3 As shown, the present invention also provides a device, including a processor 310, a communication interface 320, a memory 330 for storing a processor executable computer program, and a communication bus 340. The processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 implements the above-mentioned method of marking and tracking software versions based on executable files by running the executable computer program.

[0106] Among them, the computer program in the memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0107] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected based on actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0109] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for marking and tracking software versions based on executable files, characterized in that: The method comprises: Extracting environment variable information, constructing a JSON data structure according to the extracted environment variable information, and using the constructed JSON data structure to collect software version information; Check whether a front-end file needs to be specified, obtain the corresponding front-end file based on the check result, and inject the collected software version information into the corresponding front-end file according to the injection rules; When executing the software, the corresponding software version information is loaded and viewed by executing the front-end file that injects the software version information.

2. The method for marking and tracking software versions based on executable files according to claim 1, characterized in that: Extracting environment variable information includes: extracting environment variable information of the user in the compilation environment, wherein the environment variable information includes: a build timestamp, a version submission hash, a build branch, a product build pipeline sequence number, and a product build pipeline execution number.

3. According to the method for marking and tracking software versions based on executable files as described in claim 1, a JSON data structure is constructed according to the extracted environment variable information, and the software version information is collected using the constructed JSON data structure, including: The environment variable information is constructed into a JSON data structure in the order of build branch, build timestamp, version submission hash, product build pipeline execution number and product build pipeline sequence number, and the constructed JSON data structure is used to collect data corresponding to the corresponding environment variable information.

4. The method for marking and tracking software versions based on executable files according to claim 1, characterized in that: Check whether it is necessary to specify the front-end file, and obtain the corresponding front-end file according to the check result, including: checking whether the user specifies the front-end file to be injected. When the user specifies the front-end file to be injected, obtain the specified front-end file according to the user's specified information. When the user does not specify the front-end file to be injected, retrieve the front-end execution entry file in the execution directory, and use the retrieved front-end execution entry file as the front-end file to be injected. When the front-end execution entry file is not retrieved in the execution directory, create a new corresponding front-end file.

5. The method for marking and tracking software versions based on executable files according to claim 4, characterized in that: Front-end files include JavaScript files and HTML files.

6. The method for marking and tracking software versions based on executable files according to claim 1, characterized in that: Inject the collected software version information into the corresponding front-end file according to the injection rules, including: If the front-end file is a JavaScript file, create and initialize the global object, and set the storage attribute object in the initialized global object; The version information collected through the JSON data structure is stored using the set storage attribute object; Insert a global object containing version information at the end of your JavaScript file.

7. The method for marking and tracking software versions based on executable files according to claim 1, characterized in that: According to the injection rules, the constructed JSON data structure is injected into the corresponding front-end file as basic data, including: If the front-end file is an HTML file, create and initialize the global object, and set the storage attribute object in the initialized global object; The version information collected through the JSON data structure is stored using the set storage attribute object; The script tag of the HTML file is used to wrap the global object storing the version information, and the wrapped global object is inserted into the header of the HTML file.

8. The method for marking and tracking software versions based on executable files according to claim 1, characterized in that: When executing the software, the corresponding software version information is loaded and viewed by executing the front-end file injected with the software version information, including: when executing the front-end file injected with the software version information, the corresponding software version information is loaded and viewed by calling the global variable storing the software version information.

9. A system for marking and tracking software versions based on executable files, characterized in that: The system includes a marking and tracking server, which is used to: extract environment variable information, construct a JSON data structure according to the extracted environment variable information, and collect software version information using the constructed JSON data structure; check whether a front-end file needs to be specified, obtain the corresponding front-end file according to the check result, and inject the collected software version information into the corresponding front-end file according to the injection rule; When executing the software, the corresponding software version information is loaded and viewed by executing the front-end file that injects the software version information.

10. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the program.