Dyeing task processing method, dyeing terminal, proxy terminal and system

By comparing the target version data and historical information sent by the proxy terminal, if the comparison is successful, the log processing dyeing task will be performed according to the target task, which solves the problem of low processing efficiency of dyeing tasks in complex programming languages ​​or field-specific languages ​​in the prior art, and realizes efficient task management and automated processing.

CN119988223APending Publication Date: 2025-05-13CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510080681.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Existing staining task processing methods are inefficient in processing complex programming languages ​​or domain-specific languages.

Method used

By determining the pending staining information based on the target version data sent by the proxy terminal, comparing the pending information with the historical information, and if the comparison is successful, the log processing dyeing task will be performed according to the target task.

Benefits of technology

The efficiency of dyeing task processing for complex programming languages ​​or domain-specific languages ​​has been achieved, which significantly reduces manual intervention and improves the degree of automation of task management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988223A_ABST
    Figure CN119988223A_ABST
Patent Text Reader

Abstract

The invention discloses a dyeing task processing method, a dyeing terminal, an agent terminal and a system, and relates to the technical field of cloud computing big data edge computing, the dyeing task processing method is applied to the dyeing terminal, and the method comprises the following steps: determining corresponding to-be-processed dyeing information according to target version data sent by the agent terminal; comparing the to-be-processed dyeing information with historical dyeing information to obtain a dyeing information comparison result; and when the dyeing information comparison result is a comparison success result, performing dyeing task processing according to a target task execution log. When a tested service and a proxy terminal are started together, key metadata are read and reported to a dyeing terminal in real time. And the dyeing terminal judges whether to create or update the dyeing task according to the reported data, so that efficient task management is realized, manual intervention is remarkably reduced, and the problem that the dyeing task processing efficiency of a complex programming language or a domain specific language is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing, big data and edge computing technology, and in particular to a dyeing task processing method, a dyeing terminal, an agent terminal and a system. Background Art

[0002] Code coloring technology based on code execution coverage is a core technology used to identify code execution in software quality assurance and precision testing. It plays an important role in identifying hot code, improving test efficiency, and balancing test quality and cost. The current coloring system generally configures code rules through the front-end visual interface, fills in and transmits service deployment information, manually triggers the code coloring task, and then the back-end executes it by receiving the front-end instructions. These solutions generally need to complete the following points: 1. Code rules need to be configured on the front end; 2. The front-end visual interface needs to send a request to send the configured code rules to the back-end, and then the back-end service calls the compilation tool to compile the source code to obtain the compiled bytecode file; according to the code rules and the part of the bytecode file that hits, information is recorded to obtain code matching information; 3. It is necessary to send an HTTP protocol POST request through the front-end HTML page to send the deployment server information to the back-end server; 4. The code test coverage task is activated through the front-end H5 page. However, the above method has technical defects such as low automation, low efficiency, and performance impact. Therefore, how to solve the low processing efficiency of the existing coloring task processing method for complex programming languages ​​or domain-specific languages ​​has become an urgent problem to be solved. Summary of the invention

[0003] The main purpose of this application is to provide a dyeing task processing method, a dyeing terminal, an agent terminal and a system, aiming to solve the technical problem that the existing dyeing task processing method has low processing efficiency for complex programming languages ​​or domain-specific languages.

[0004] To achieve the above object, the present application proposes a dyeing task processing method, which is applied to a dyeing terminal and includes: Determine the corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; Comparing the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; When the dyeing information comparison result is a successful comparison result, the dyeing task is processed according to the target task execution log.

[0005] In one embodiment, when the coloring information comparison result is a successful comparison result, the step of processing the coloring task according to the target task execution log includes: When the dyeing information comparison result is a successful comparison result, determining the corresponding historical version batch according to the target task execution log; When the historical version batch is consistent with the current version batch, a dyeing task restart instruction is generated; Restart the dyeing task according to the dyeing task restart instruction.

[0006] In one embodiment, when the dyeing information comparison result is a successful comparison result, after the step of determining the corresponding historical version batch according to the target task execution log, the step further includes: When the historical version batch is inconsistent with the current version batch, the corresponding current creation time is determined according to the target version data; Compare the current creation time with the historical creation time to obtain a creation time comparison result; The dyeing task is processed according to the creation time comparison result.

[0007] In one embodiment, the step of processing the dyeing task according to the creation time comparison result includes: When the creation time comparison result is the first time comparison result, determining that the target version data is version contaminated data, and performing coloring task processing according to the version contaminated data; When the creation time comparison result is the second time comparison result, a dyeing task update instruction is generated, and the dyeing task is processed according to the dyeing task update instruction.

[0008] In one embodiment, after the step of comparing the to-be-processed dyeing information with the historical dyeing information to obtain a dyeing information comparison result, the step further includes: When the dyeing information comparison result is a comparison failure result, creating a corresponding target dyeing task according to the dyeing information to be processed; The target dyeing task is executed to complete the processing of the dyeing task.

[0009] To achieve the above object, the present application proposes a coloring task processing method, which is applied to an agent terminal and includes: Parse the read metadata file to determine the code base address, target submission information, branch information, and submission time, wherein the metadata file is obtained through a compilation plug-in installed in the source code file; Determine the target version data according to the code library address, the target submission information, the branch information, the submission time, the application name and the environment information; The target version data is sent to the dyeing terminal so that the dyeing terminal performs dyeing task processing according to the target version data.

[0010] In one embodiment, after the step of sending the target version data to the dyeing terminal so that the dyeing terminal performs dyeing task processing according to the target version data, the step further includes: Dynamically insert code according to the package path range in the metadata file to determine the coverage data status; When the coverage data state is the target data state, the target change data is sent to the dyeing terminal.

[0011] In addition, to achieve the above-mentioned purpose, the present application also proposes a dyeing task processing device, the dyeing task processing device comprising: A receiving module, used to determine corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; A comparison module, used for comparing the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; The processing module is used to process the dyeing task according to the target task execution log when the dyeing information comparison result is a successful comparison result.

[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a dyeing task processing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the dyeing task processing method described above.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the dyeing task processing method described above are implemented.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the dyeing task processing method described above are implemented.

[0015] The present application determines the corresponding to-be-processed dyeing information according to the target version data sent by the proxy terminal; compares the to-be-processed dyeing information with the historical dyeing information to obtain a dyeing information comparison result; when the dyeing information comparison result is a successful comparison result, processes the dyeing task according to the target task execution log. When the tested service is started together with the proxy terminal, key metadata is read and reported to the dyeing terminal in real time. The dyeing terminal determines whether to create or update the dyeing task based on the reported data, thereby achieving efficient task management, significantly reducing manual intervention, and solving the problem of low efficiency in dyeing task processing for complex programming languages ​​or domain-specific languages. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] Figure 1 A schematic diagram of a process flow provided for Example 1 of the dyeing task processing method of the present application; Figure 2 A schematic diagram of the code coloring plug-in workflow provided in Example 1 of the coloring task processing method of this application; Figure 3 The overall process diagram provided for the first embodiment of the dyeing task processing method of the present application; Figure 4 A schematic diagram of a process flow provided for Example 2 of the dyeing task processing method of this application; Figure 5 This is a schematic diagram of the module structure of the dyeing terminal according to an embodiment of the present application; Figure 6 This is a schematic diagram of the module structure of the proxy terminal in the embodiment of the present application; Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the dyeing task processing method in the embodiment of the present application.

[0019] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0021] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0022] The main solution of the embodiment of the present application is: determine the corresponding coloring information to be processed according to the target version data sent by the proxy terminal; compare the coloring information to be processed with the historical coloring information to obtain the coloring information comparison result; when the coloring information comparison result is a successful comparison result, process the coloring task according to the target task execution log.

[0023] Code coloring technology based on code execution coverage is a core technology used to identify code execution status in software quality assurance and precision testing. It plays an important role in identifying hot code, improving test efficiency, and balancing test quality and cost. The current coloring system generally configures code rules through a front-end visual interface, fills in and transmits service deployment information, manually triggers code coloring tasks, and then the back-end executes by receiving front-end instructions. However, the above method has technical defects such as low automation, low efficiency, and performance impact. Therefore, how to solve the low efficiency of existing coloring task processing methods for complex programming languages ​​or domain-specific languages ​​has become an urgent problem to be solved.

[0024] The present application determines the corresponding to-be-processed dyeing information according to the target version data sent by the proxy terminal; compares the to-be-processed dyeing information with the historical dyeing information to obtain a dyeing information comparison result; when the dyeing information comparison result is a successful comparison result, processes the dyeing task according to the target task execution log. When the tested service is started together with the proxy terminal, key metadata is read and reported to the dyeing terminal in real time. The dyeing terminal determines whether to create or update the dyeing task based on the reported data, thereby achieving efficient task management, significantly reducing manual intervention, and solving the problem of low efficiency in dyeing task processing for complex programming languages ​​or domain-specific languages.

[0025] Based on this, the present application embodiment provides a dyeing task processing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the dyeing task processing method of the present application.

[0026] In this embodiment, the dyeing task processing method is applied to a dyeing terminal, and the method includes steps S10 to S30: Step S10, determining the corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; It should be noted that this embodiment uses the dyeing terminal as an example for the execution subject. This embodiment is based on the Maven / Gradle compilation plug-in (used to extend functions through the plug-in mechanism), Java Agent (agent terminal) and the dyeing task platform (dyeing terminal) to automatically run the code dyeing method, effectively reducing manual intervention and improving the efficiency of code coverage testing. This method introduces a self-developed compilation plug-in, embeds key information (such as code library address, recent submission information, etc.) in the project source code, and stores it in the MANIFEST.MF file of the JAR package (a special file contained in each JAR file, located in the META-INF directory of the JAR package, which is used to store metadata information about the JAR package). After the service under test and the JavaAgent are started together, the Agent reads these metadata and dynamically inserts piles according to the specified package path, while monitoring the changes in line coverage and branch coverage data, and reports them to the background service in real time through the message queue. The background service determines whether it is necessary to create or update the dyeing task to ensure the efficiency of task management. The above method not only reduces the operational complexity of the operation and maintenance personnel, but also improves the stability of the system and the quality assurance of the code, which brings significant improvements to the software development process.

[0027] It can be understood that the target version data refers to the version data reported by the agent terminal, including but not limited to the code library address, the most recent submission information, branch information, submission time, application name and environment, and the pending coloring information refers to the data used to determine whether the coloring task exists, including but not limited to the code library address, application name and environment.

[0028] In the specific implementation, the dyeing terminal receives the version data (code base address, latest submission information, branch information, submission time, application name, environment) reported by the proxy terminal to determine whether the dyeing task exists, and then determines the code base address, application name and environment according to the version data reported by the proxy terminal, that is, the dyeing information to be processed.

[0029] Step S20, comparing the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; It can be understood that historical dyeing information refers to the code library address, application name and environment corresponding to the existing dyeing task, and the dyeing information comparison result refers to the comparison result of whether the dyeing information to be processed is consistent with the historical dyeing information, including comparison failure results and comparison success results.

[0030] In the specific implementation, the code library address, application name and environment reported by the proxy terminal are compared with the code library address, application name and environment corresponding to the existing dyeing task to determine whether there is a dyeing task, and then obtain a comparison failure result or a comparison success result, that is, the dyeing information comparison result.

[0031] In a feasible implementation, step S20 may include steps A21-A22: Step A21, when the dyeing information comparison result is a comparison failure result, creating a corresponding target dyeing task according to the dyeing information to be processed; It can be understood that the comparison failure result refers to the comparison result that the to-be-processed coloring information is inconsistent with the historical coloring information, and the target coloring task refers to the newly created code coloring task.

[0032] In the specific implementation, when the dyeing information comparison result is a comparison failure result, it indicates that the dyeing information to be processed is inconsistent with the historical dyeing information, that is, the dyeing task does not exist, and then the reported code library address, application name, environment and other information are used to create the dyeing task to obtain the target dyeing task.

[0033] Step A22, executing the target dyeing task to complete the processing of the dyeing task.

[0034] In the specific implementation, the dyeing terminal executes the newly created code dyeing task to automatically update the dyeing task, which no longer requires manual processing, greatly reducing the workload of operation and maintenance personnel.

[0035] Step S30, when the dyeing information comparison result is a successful comparison result, the dyeing task is processed according to the target task execution log.

[0036] It can be understood that the successful comparison result refers to the comparison result that the to-be-processed dyeing information is consistent with the historical dyeing information, and the target task execution log refers to the execution log of the most recent dyeing task.

[0037] In the specific implementation, when the dyeing information comparison result is a successful comparison result, it indicates that the dyeing information to be processed is consistent with the historical dyeing information, that is, the dyeing task already exists, and then the execution log of the most recent task of the dyeing task is obtained, that is, the target task execution log, and then according to the most recent task execution log of the dyeing task, it is determined whether to restart the dyeing task to complete the processing of the dyeing task.

[0038] In a feasible implementation, step S30 may include steps A31 to A33: Step A31, when the dyeing information comparison result is a successful comparison result, determining the corresponding historical version batch according to the target task execution log; It should be noted that the historical version batch refers to the execution version batch of the current coloring task.

[0039] In the specific implementation, when the dyeing information comparison result is a successful comparison result, it indicates that the dyeing information to be processed is consistent with the historical dyeing information, that is, the dyeing task already exists, and then the execution log of the most recent task of the dyeing task is obtained, and the corresponding execution version batch, that is, the historical version batch, is determined based on the execution log of the most recent task of the dyeing task.

[0040] In a feasible implementation, step A31 may include steps B311 to B313: Step B311, when the historical version batch is inconsistent with the current version batch, determine the corresponding current creation time according to the target version data; It is understandable that the current creation time refers to the creation time of the version batch reported by the proxy terminal.

[0041] In the specific implementation, the creation time of the version batch, that is, the current creation time, is determined according to the version data reported by the proxy terminal (code base address, latest submission information, branch information, submission time, application name, environment, etc.).

[0042] Step B312, comparing the current creation time with the historical creation time to obtain a creation time comparison result; It can be understood that the historical creation time refers to the creation time of the execution version batch of the current dyeing task, and the creation time comparison result refers to the comparison result between the current creation time and the historical creation time, including the first time comparison result and the second time comparison result.

[0043] In the specific implementation, the creation time of the version batch reported by the agent terminal is compared with the creation time of the execution version batch of the current dyeing task, and then the comparison result between the current creation time and the historical creation time, that is, the creation time comparison result, is determined.

[0044] Step B313, processing the dyeing task according to the creation time comparison result.

[0045] In the specific implementation, the comparison result between the current creation time and the historical creation time is used to determine whether the data reported by the proxy terminal is dirty data, or to determine whether to trigger the update process, and then the coloring task is processed according to different creation time comparison results.

[0046] In a feasible implementation, step B313 may include steps C3131-C3132: Step C3131, when the creation time comparison result is the first time comparison result, determining that the target version data is version contaminated data, and processing the coloring task according to the version contaminated data; It can be understood that the first time comparison result refers to the comparison result that the reported version batch is earlier than the creation time of the execution version batch of the current existing dyeing task, and the version pollution data refers to the historical dirty data.

[0047] In a specific implementation, when the creation time comparison result is the first time comparison result, it indicates that the reported version batch is earlier than the creation time of the execution version batch of the current dyeing task, and then determines that the data reported by the proxy terminal is historical dirty data, and then discards the historical dirty data.

[0048] Step C3132, when the creation time comparison result is the second time comparison result, generate a dyeing task update instruction, and process the dyeing task according to the dyeing task update instruction.

[0049] It can be understood that the second time comparison result refers to the comparison result that the reported version batch is later than the creation time of the execution version batch of the currently existing dyeing task, and the dyeing task update instruction refers to the instruction to update the currently existing dyeing task.

[0050] In the specific implementation, when the creation time comparison result is the second time comparison result, it indicates that the reported version batch is later than the creation time of the execution version batch of the current existing dyeing task, and then it is determined that the update process needs to be triggered, that is, an instruction to update the current existing dyeing task is generated, the dyeing task needs to be re-analyzed, and a new dyeing task batch is created to carry the new dyeing data.

[0051] Step A32, when the historical version batch is consistent with the current version batch, generating a dyeing task restart instruction; It can be understood that the current version batch refers to the version batch received by the dyeing terminal, and the dyeing task restart instruction refers to the instruction to restart the dyeing task.

[0052] In a specific implementation, when the execution version batch of the current dyeing task is consistent with the version batch received by the dyeing terminal, it indicates that the current dyeing task needs to be restarted, and then an instruction to restart the dyeing task, ie, a dyeing task restart instruction, is generated.

[0053] Step A33, restarting the dyeing task according to the dyeing task restart instruction.

[0054] In a specific implementation, the currently existing dyeing task is restarted according to the instruction of restarting the dyeing task to complete the processing of the dyeing task.

[0055] It should be noted that this embodiment dynamically inserts the tested service through the javaagent mode, and automatically generates the insertion configuration by compiling the plug-in. This solution can automatically generate the configuration, automatically insert the system according to the configuration, and automatically create and start the code coloring task. The specific process is as follows Figure 2 and Figure 3 shown.

[0056] In order to achieve an efficient code coloring process, this embodiment first introduces the self-developed maven / grade compilation plug-in. By introducing this plug-in in the source code of the project under test, multiple key operations can be automatically performed during the compilation phase. The plug-in will use the methods in the org.eclipse.jgit package to obtain key information such as the address of the code base, the most recent submission information, the status of the current branch, and the submission time in real time. This information will be resolved by calling the custom basePackage method to resolve the package path range of the project. Subsequently, all this data will be embedded in the MANIFEST.MF file of the JAR package to ensure that all relevant metadata is effectively stored and managed.

[0057] In the code dyeing agent service, the Java Agent will be started together with the application under test to ensure the mining of the application's running context. After the agent is started, it will first read its configuration file and extract information such as the application name and running environment. Next, through the getResources method under java.lang.ClassLoader, the agent will access the MANIFEST.MF file of the service under test and parse out information such as the code base address, commit information, branch, timestamp, and package path range.

[0058] Modify the source code file of jacoco, add dynamic insertion or dynamic unloading insertion methods by specifying the package name in the source code, and after the Agent is started, call the newly added dynamic insertion method to implement dynamic insertion within the parsed package path range. While inserting the code, the Agent will also report all the collected metadata to the background service through the message queue to ensure real-time monitoring and feedback. After the insertion is completed, the Agent will continue to monitor the changes in line coverage data and branch coverage data, and automatically report the change results to the dyeing platform when the data changes. In addition, the Agent will start a scheduled task to report the coverage data in full at a scheduled time, so that the development team can better understand the test status of the code.

[0059] As the core management module of the system, the background service (dyeing terminal) will be responsible for receiving and processing version data. After receiving the version data, the service will determine whether the relevant task already exists based on the application and probe grouping. If the task does not exist yet, the background will automatically add a code dyeing task. In addition, the service will compare the data status or version and branch of the previous version to trigger the execution and management of subsequent tasks to ensure the effectiveness of code coverage testing.

[0060] By introducing the dynamic plug-in Java Agent and its supporting plug-ins and background services, developers only need to start the compiled jar package through the code coloring javaagent to automatically implement Jacoco plug-in, automatically start the coloring task on the platform, and automatically update the coloring data to the code coloring platform when the line coverage data and branch coverage data change. This not only greatly reduces the complexity of manual configuration, but also improves the real-time feedback capability during the development process, thereby providing software development teams with better code quality assurance.

[0061] This embodiment determines the corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; compares the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; when the dyeing information comparison result is a successful comparison result, the dyeing task is processed according to the target task execution log. When the service under test is started together with the proxy terminal, the key metadata is read and reported to the dyeing terminal in real time. The dyeing terminal determines whether to create or update the dyeing task based on the reported data, thereby achieving efficient task management, significantly reducing manual intervention, and solving the problem of low efficiency in dyeing task processing for complex programming languages ​​or domain-specific languages.

[0062] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 Before step S10, the dyeing task processing method is applied to the agent terminal, and the method further includes steps S11 to S13: Step S11, parsing the read metadata file to determine the code base address, target submission information, branch information and submission time, wherein the metadata file is obtained through a compilation plug-in installed in the source code file; It can be understood that this embodiment is illustrated by taking the agent terminal (javaagent) as the execution subject, the metadata file refers to the MANIFEST.MF file in the jar package of the tested service, and the target submission information refers to the most recent submission information.

[0063] In the specific implementation, after the Agent is started, the MANIFEST.MF file in the jar package of the service under test is obtained through the getResources method under java.lang.ClassLoader (a method that searches and returns all URLs of resources with a specified name through a class loader), and then the MANIFEST.MF file in the jar package of the service under test is parsed to obtain the code base address, the most recent submission information, branch information, submission time, and package path range. In this embodiment, the plug-in of Maven and Grade is written in Java code. The plug-in mainly records the code base address, the most recent submission information, branch information and submission time, the package path range and other data of the project under test, and then introduces the code coloring plug-in into the source code of the project under test, and ensures the validity and compatibility of the plug-in through the configuration file.

[0064] Step S12, determining the target version data according to the code library address, the target submission information, the branch information, the submission time, the application name and the environment information; It can be understood that the code base address, the most recent submission information, the branch information, the submission time, the application name and the environment information are summarized to obtain the target version data.

[0065] Step S13, sending the target version data to the dyeing terminal, so that the dyeing terminal performs dyeing task processing according to the target version data.

[0066] In a specific implementation, the proxy terminal sends the parsed target version data to the dyeing terminal, so that the dyeing terminal can automatically process the dyeing task.

[0067] In a feasible implementation, step S13 may include steps A131-A132: Step A131, dynamically insert code according to the package path range in the metadata file to determine the coverage data state; It can be understood that the packet path range is used to determine the insertion range of the current dyeing task, and the coverage data state refers to the state of whether the coverage data has changed.

[0068] In the specific implementation, by modifying the source code file of jacoco (an open source code coverage tool designed for Java applications), add dynamic coding or dynamic unloading coding methods by specifying the package name in the source code. After the Agent is started, the newly added dynamic coding method is called to implement dynamic coding within the parsed package path range to determine the coverage data status.

[0069] Step A132, when the coverage data state is the target data state, sending the target change data to the dyeing terminal.

[0070] In a specific implementation, the target data state refers to a state in which the coverage data has changed. When the coverage data state is a changed state, the proxy terminal reports the changed data to the dyeing terminal.

[0071] It should be noted that the overall process of this embodiment is as follows: Step 1, the developer introduces the maven / grade plug-in into the source code of the system under test, and then automatically parses the code base address, the most recent submission information, branch information and submission time, and the package path range during the jar package compilation process and stores them in the MF file of the jar package (MANIFEST.MF file); Step 2, the service under test and the javaagent are started together, and the javaagent automatically reads the data written by the plug-in to the jar package, and then inserts the code into the system under test according to the package path range. At the same time, the code base address, the most recent submission information, branch information, and submission time and other information are reported to the code coloring platform. After the insertion is completed, the javaagent will monitor the line coverage data and branch coverage data of the code coloring. If the data is sent and changed, the coloring data will be reported to the platform in real time; Step 3, after the platform receives the reported version data information, it determines whether it is necessary to add or modify the coloring task, and then automatically merges the subsequent reported coloring data into the corresponding coloring task.

[0072] It should be noted that the code coloring plug-in: Step 1. Initialize the data structure and code base information: used to store the code base address, the most recent submission information, the branch information and the submission time of the project under test. Package path range: parse the package path range under the current project; Step 2. Introduce the self-developed maven / grade compilation plug-in, use java code to write maven and grade plug-ins, which mainly record the code repository address, the latest commit information, branch information and commit time, package path range and other data of the project under test, and then introduce the code coloring plug-in in the source code of the project under test, and ensure the validity and compatibility of the plug-in through the configuration file; Step 3. Compile the project, and trigger the calling process of the code coloring plug-in during the compilation of the project under test; Step 4. Get the code repository information, call the relevant methods under the org.eclipse.jgit package, and get the following information: code repository address (Repository Address) (used to automatically create coloring tasks on the platform), the latest commit information (Last Commit Info) (used to determine whether the coloring task is newly created or updated), branch information (Branch Info) (used to automatically create coloring tasks), commit time (Commit Time) (used to determine whether it is dirty data, and the commit time is too early to be determined as abnormal data); Step 5. Parse the package path, call the original basePackage method, and parse the package path range under the current project; Step 6. After compiling the jar package, write the obtained code base information and package path range into the MANIFEST.MF file of the jar package. After completing the above operations, ensure that the build process ends and the final jar package is generated. Repeat the above process to update the relevant information each time you compile the project.

[0073] It can be understood that the code dyeing agent service in this embodiment is specifically as follows: Step 1. Initialize data structure and configuration file: used to store application name and environment information. MANIFEST.MF information: used to store the code base address, the most recent submission information, branch information, submission time and package path range; Step 2. Start the Agent, use the javaagent form to start the stub program together with the system under test; Step 3. Get the configuration file. After the Agent is started, get its own configuration file to get the application name and environment information; Step 4. Read the MANIFEST.MF file. After the Agent is started, get the MANIFEST.MF file in the jar package of the service under test through the getResources method under java.lang.ClassLoader; Step 5. Parse the MF file information. After obtaining the data in the MF file, parse the following information: code base address (used to automatically create dyeing tasks on the platform), the most recent submission information (used to determine whether the dyeing task is newly created or updated), branch information (used to automatically create dyeing tasks), submission time (used to determine whether it is dirty data, and submission time too early is determined to be abnormal data), package path range (used to determine the plug-in code range of the current dyeing task); Step 6. Dynamic insertion, by modifying the source code file of jacoco, adding dynamic insertion or dynamic uninstallation insertion methods by specifying the package name in the source code, after the Agent is started, calling the newly added dynamic insertion method, dynamic insertion will be implemented within the parsed package path range; Step 7. Report information, through the message queue, report the following information to the code dyeing background service: code library address, the latest submission information, branch information, submission time, application name, environment; Step 8. Check coverage data, after the Agent completes the insertion, it starts to check the coverage data of jacoco. When the coverage data changes, the change data is reported to the dyeing platform; Step 9. Scheduled full report, after the Agent completes the insertion, it starts a scheduled task, and reports the coverage data once in a while.

[0074] It should be noted that the code dyeing background service (dyeing terminal) in this embodiment is specifically as follows: Step 1. Receive reported version data, receive version data reported by the external system (code base address, latest submission information, branch information, submission time, application name, environment) for subsequent processing; Step 2. Process the dyeing task, and determine whether the dyeing task exists according to the reported code base address, application name, and environment. If the dyeing task does not exist, create the dyeing task using the reported code base address, application name, environment and other information. If the dyeing task already exists, obtain the execution log of the most recent task of the dyeing task; Step 3 Whether to restart the dyeing task, obtain whether the execution version batch of the current existing dyeing task is consistent with the version batch received this time. If consistent, restart the dyeing task. If inconsistent, it is necessary to determine the relationship between the creation time of the reported version batch and the execution version batch of the current existing dyeing task. If the reported version batch is earlier than the creation time of the execution version batch of the current existing dyeing task, the data is deemed to be historical dirty data and discarded. If the reported version batch is later than the creation time of the execution version batch of the current dyeing task, it is determined that the update process needs to be triggered, the dyeing task needs to be re-analyzed, and a new dyeing task batch is created to carry the new dyeing data.

[0075] It should be noted that in the original manual configuration and start and stop tasks, operation and maintenance personnel often forget to start and stop tasks, or adjust the plug-in configuration. After adopting the automatic mode, the operation and maintenance personnel only need to update the jar package to start the coloring task, and no manual processing is required, which greatly reduces the workload of operation and maintenance personnel and ensures the stable operation of the system.

[0076] This embodiment parses the read metadata file to determine the code base address, target submission information, branch information and submission time, and the metadata file is obtained through the compilation plug-in installed in the source code file; the target version data is determined according to the code base address, the target submission information, the branch information, the submission time, the application name and the environment information; the target version data is sent to the dyeing terminal, so that the dyeing terminal performs dyeing task processing according to the target version data. By realizing the method of automatically running dyeing tasks based on the maven / grade compilation plug-in, javaagent, and dyeing task platform, it is achieved to reduce the manual participation in configuring code dyeing task related information and the start and stop of manual operation tasks, and ensure the efficient operation of the generation dyeing task.

[0077] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the dyeing task processing method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0078] This application also provides a dyeing terminal, please refer to Figure 5 , the dyeing terminal comprises: A receiving module 10, configured to determine corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; A comparison module 20 is used to compare the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; The processing module 30 is used to process the dyeing task according to the target task execution log when the dyeing information comparison result is a successful comparison result.

[0079] Optionally, the processing module 30 is further used for: When the dyeing information comparison result is a successful comparison result, determining the corresponding historical version batch according to the target task execution log; When the historical version batch is consistent with the current version batch, a dyeing task restart instruction is generated; Restart the dyeing task according to the dyeing task restart instruction.

[0080] Optionally, the processing module 30 is further used for: When the historical version batch is inconsistent with the current version batch, the corresponding current creation time is determined according to the target version data; Compare the current creation time with the historical creation time to obtain a creation time comparison result; The dyeing task is processed according to the creation time comparison result.

[0081] Optionally, the processing module 30 is further used for: When the creation time comparison result is the first time comparison result, determining that the target version data is version contaminated data, and performing coloring task processing according to the version contaminated data; When the creation time comparison result is the second time comparison result, a dyeing task update instruction is generated, and the dyeing task is processed according to the dyeing task update instruction.

[0082] Optionally, the processing module 30 is further used for: When the dyeing information comparison result is a comparison failure result, creating a corresponding target dyeing task according to the dyeing information to be processed; The target dyeing task is executed to complete the processing of the dyeing task.

[0083] This application also provides a proxy terminal, please refer to Figure 6 , the proxy terminal comprises: The parsing module 101 is used to parse the read metadata file to determine the code base address, target submission information, branch information and submission time. The metadata file is obtained through a compilation plug-in installed in the source code file; A summary module 102, configured to determine target version data according to the code base address, the target submission information, the branch information, the submission time, the application name, and the environment information; The sending module 103 is used to send the target version data to the dyeing terminal, so that the dyeing terminal performs dyeing task processing according to the target version data.

[0084] Optionally, the sending module 103 is further configured to: Dynamically insert code according to the package path range in the metadata file to determine the coverage data status; When the coverage data state is the target data state, the target change data is sent to the dyeing terminal.

[0085] The dyeing task processing device provided by the present application adopts the dyeing task processing method in the above embodiment, which can solve the technical problem of low processing efficiency of the existing dyeing task processing method for complex programming languages ​​or domain-specific languages. Compared with the prior art, the beneficial effects of the dyeing task processing device provided by the present application are the same as the beneficial effects of the dyeing task processing method provided by the above embodiment, and the other technical features in the dyeing task processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0086] The present application provides a dyeing task processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the dyeing task processing method in the above-mentioned embodiment one.

[0087] Reference below Figure 7 , which shows a schematic diagram of the structure of a dyeing task processing device suitable for implementing the embodiment of the present application. The dyeing task processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7The dyeing task processing equipment shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0088] like Figure 7 As shown, the dyeing task processing device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the dyeing task processing device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. Communication device 1009 can allow dyeing task processing equipment to communicate with other equipment wirelessly or wired to exchange data. Although dyeing task processing equipment with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or less systems can be implemented or have alternatively.

[0089] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0090] The dyeing task processing device provided by the present application adopts the dyeing task processing method in the above embodiment, which can solve the technical problem of low processing efficiency of the existing dyeing task processing method for complex programming languages ​​or domain-specific languages. Compared with the prior art, the beneficial effects of the dyeing task processing device provided by the present application are the same as the beneficial effects of the dyeing task processing method provided by the above embodiment, and the other technical features in the dyeing task processing device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0091] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0092] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0093] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the dyeing task processing method in the above-mentioned embodiment.

[0094] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0095] The computer-readable storage medium may be included in the dyeing task processing device; or may exist independently without being assembled into the dyeing task processing device.

[0096] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the dyeing task processing device, the dyeing task processing device: determines the corresponding dyeing information to be processed according to the target version data sent by the agent terminal; compares the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; when the dyeing information comparison result is a successful comparison result, processes the dyeing task according to the target task execution log.

[0097] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0100] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned dyeing task processing method, and can solve the technical problem that the existing dyeing task processing method has low processing efficiency for complex programming languages ​​or domain-specific languages. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the dyeing task processing method provided by the above-mentioned embodiment, and will not be repeated here.

[0101] The present application also provides a computer program product, including a computer program, which implements the steps of the dyeing task processing method as described above when executed by a processor.

[0102] The computer program product provided by the present application can solve the technical problem that the existing dyeing task processing method has low processing efficiency for complex programming languages ​​or domain-specific languages. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the dyeing task processing method provided by the above embodiment, which will not be described in detail here.

[0103] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A dyeing task processing method, characterized in that: The dyeing task processing method is applied to a dyeing terminal, and the method comprises: Determine the corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; Comparing the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; When the dyeing information comparison result is a successful comparison result, the dyeing task is processed according to the target task execution log.

2. The method according to claim 1, characterized in that When the dyeing information comparison result is a successful comparison result, the step of processing the dyeing task according to the target task execution log includes: When the dyeing information comparison result is a successful comparison result, determining the corresponding historical version batch according to the target task execution log; When the historical version batch is consistent with the current version batch, a dyeing task restart instruction is generated; Restart the dyeing task according to the dyeing task restart instruction.

3. The method according to claim 2, characterized in that After the step of determining the corresponding historical version batch according to the target task execution log when the dyeing information comparison result is a successful comparison result, the method further includes: When the historical version batch is inconsistent with the current version batch, the corresponding current creation time is determined according to the target version data; Compare the current creation time with the historical creation time to obtain a creation time comparison result; The dyeing task is processed according to the creation time comparison result.

4. The method according to claim 3, characterized in that The step of processing the dyeing task according to the creation time comparison result includes: When the creation time comparison result is the first time comparison result, determining that the target version data is version contaminated data, and performing coloring task processing according to the version contaminated data; When the creation time comparison result is the second time comparison result, a dyeing task update instruction is generated, and the dyeing task is processed according to the dyeing task update instruction.

5. The method according to claim 1, characterized in that After the step of comparing the dyeing information to be processed with the historical dyeing information to obtain the dyeing information comparison result, the method further includes: When the dyeing information comparison result is a comparison failure result, creating a corresponding target dyeing task according to the dyeing information to be processed; The target dyeing task is executed to complete the processing of the dyeing task.

6. A dyeing task processing method, characterized in that: The dyeing task processing method is applied to an agent terminal, and the method comprises: Parse the read metadata file to determine the code base address, target submission information, branch information, and submission time, wherein the metadata file is obtained through a compilation plug-in installed in the source code file; Determine the target version data according to the code library address, the target submission information, the branch information, the submission time, the application name and the environment information; The target version data is sent to the dyeing terminal so that the dyeing terminal performs dyeing task processing according to the target version data.

7. The method according to claim 6, characterized in that After the step of sending the target version data to the dyeing terminal so that the dyeing terminal performs dyeing task processing according to the target version data, the method further includes: Dynamically insert code according to the package path range in the metadata file to determine the coverage data status; When the coverage data state is the target data state, the target change data is sent to the dyeing terminal.

8. A dyeing terminal, characterized in that: The dyeing terminal comprises: A receiving module, used to determine corresponding dyeing information to be processed according to the target version data sent by the proxy terminal; A comparison module, used for comparing the dyeing information to be processed with the historical dyeing information to obtain a dyeing information comparison result; The processing module is used to process the dyeing task according to the target task execution log when the dyeing information comparison result is a successful comparison result.

9. An agent terminal, characterized in that: The agent terminal comprises: A parsing module is used to parse the read metadata file to determine the code base address, target submission information, branch information and submission time. The metadata file is obtained through a compilation plug-in installed in the source code file; A summary module, used to determine the target version data according to the code library address, the target submission information, the branch information, the submission time, the application name and the environment information; The sending module is used to send the target version data to the dyeing terminal, so that the dyeing terminal performs dyeing task processing according to the target version data.

10. A dyeing task processing system, characterized in that: The dyeing task processing system includes a dyeing terminal and an agent terminal, the dyeing terminal executes the dyeing task processing method as described in any one of claims 1 to 5, and the agent terminal executes the dyeing task processing method as described in claim 6 or 7.