Probe injection method, apparatus, device, medium, and program product
By performing probe integrity verification and status diagnosis during container startup, the problem of abnormal risks during probe injection is solved, ensuring successful probe injection and improving the effectiveness of probe injection and the reliability of stress testing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2026-02-09
- Publication Date
- 2026-06-26
AI Technical Summary
The lack of monitoring in the probe injection process in existing technologies poses anomaly risks and affects the effectiveness of business monitoring.
Successful probe injection is ensured by performing probe integrity verification and status diagnostics during container startup. This includes using probe integrity anchors, environment parameter injection, and business middleware process diagnostics. A second container image is then built to enable probe replication and status diagnostics.
It improves the effectiveness of probe injection, detects anomalies in a timely manner, avoids invalid monitoring, ensures that probes take effect after the business middleware is started, and guarantees the effectiveness of load testing.
Smart Images

Figure CN122285172A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of distributed computing and cloud computing, and more specifically to a probe injection method, apparatus, device, medium, and program product. Background Technology
[0002] The end-to-end load testing solution is a performance testing solution designed for distributed architecture business systems. It uses load testing probes to collect business performance indicators and report them to the load testing platform to achieve performance monitoring of the business system.
[0003] In related technologies, probe deployment and load testing parameter configuration are mainly achieved through two methods: static injection and manual configuration. Static injection involves pre-setting load testing probes and configuration files in the business container image, while manual configuration involves manually modifying the startup command or environment variables of the business container and injecting probe parameters.
[0004] However, the above configuration method lacks monitoring of the probe injection process, which poses a risk of probe injection anomalies and affects subsequent business monitoring. Summary of the Invention
[0005] In view of the above problems, embodiments of this application provide a probe injection method, apparatus, device, medium, and program product.
[0006] According to a first aspect of this application, a probe injection method is provided, the method comprising: responding to a first start command of a first container, starting the first container to copy at least one probe deployed on a shared path to a pre-configured installation path, and verifying a probe integrity anchor point indicated by at least one probe, the probe integrity anchor point representing the integrity verification benchmark of at least one probe; if the verification passes, responding to a second start command of the first container, executing a business middleware startup script to obtain environment parameters and inject them into the environment variables of the first container, the environment parameters indicating the stress testing parameters of at least one probe; responding to the completion of execution of the business middleware startup script, performing a status diagnosis on at least one probe based on the process of the business middleware, obtaining a diagnosis result, the process indicating the injection status of at least one probe.
[0007] According to embodiments of this application, at least one probe includes multiple probe files, each with a matching importance level and grayscale grouping label. Verifying the probe integrity anchor point indicated by at least one probe includes: calculating the hash values of multiple probe files sequentially based on the verification order indicated by multiple importance levels; filtering multiple sets of configuration information indicated by multiple grayscale grouping labels among the probe integrity anchor points to obtain multiple target verification benchmarks, each probe integrity anchor point including multiple candidate verification benchmarks, each candidate verification benchmark having a matching grayscale grouping label; and comparing multiple hash values and corresponding multiple target verification benchmarks sequentially based on the verification order to obtain a verification result.
[0008] According to an embodiment of this application, in response to the completion of the execution of the business middleware startup script, a status diagnosis of at least one probe based on the process of the business middleware includes: filtering multiple processes based on a preset network port and / or middleware identifier to obtain multiple candidate processes, each of which has a matching network port and / or middleware identifier; obtaining multiple matching scores based on the similarity between a preset fingerprint template and multiple multidimensional fingerprints indicated by the multiple candidate processes, where the fingerprint template indicates the operating baseline of the process to be diagnosed and the multidimensional fingerprint indicates the operating conditions of the corresponding candidate process; obtaining a target process based on the multiple matching scores and the process derivation relationship between the multiple candidate processes, where the process derivation relationship indicates the creation lineage between the multiple candidate processes; and sending a diagnostic command to the target process to determine whether the target process contains a probe identifier.
[0009] According to embodiments of this application, obtaining multiple matching scores based on the similarity between a preset fingerprint template and multiple multidimensional fingerprints indicated by multiple candidate processes includes: extracting keywords from multiple process files corresponding to multiple candidate processes based on a preset regular expression to obtain multiple multidimensional fingerprints, where the multidimensional fingerprints include at least one of startup parameters, file handles, thread models, and memory modes; calculating multiple cosine similarities between the preset fingerprint template and the multiple multidimensional fingerprints to obtain multiple matching scores. According to embodiments of this application, obtaining a target process based on multiple matching scores and the process derivation relationships between multiple candidate processes includes: forming a directed graph of process relationships with multiple candidate processes as nodes, multiple matching scores as node attributes, and the process derivation relationships between multiple candidate processes as directed edges; filtering the directed graph of process relationships based on preset filtering rules to obtain the target process, where the filtering rules indicate the filtering conditions for the process to be diagnosed.
[0010] According to an embodiment of this application, a second container image is constructed. The second container image includes at least one probe and at least one of a preprocessing script and a health check script. The preprocessing script is used to copy at least one probe deployed on a shared path to a pre-configured installation path. The health check script is used to perform status diagnosis on at least one probe based on the process of the business middleware to obtain a diagnosis result. In response to the start command of the second container, at least one probe and at least one of the preprocessing script and the health check script are copied to a shared path, which is a storage path in a shared volume.
[0011] According to an embodiment of this application, a target probe version is obtained by screening multiple candidate probe versions, and the image label of the second container is updated based on the target probe version; in response to the start command of the second container, at least one updated probe is copied to a shared path.
[0012] According to an embodiment of this application, in the event of a diagnostic failure, the rollback interface of the operation and maintenance platform is invoked to trigger a rollback command to shut down the process and restart the first container.
[0013] According to a second aspect of this application, a probe injection apparatus is provided, comprising: a first startup module, configured to, in response to a first startup command of a first container, start the first container to copy at least one probe deployed on a shared path to a pre-configured installation path, and verify a probe integrity anchor point indicated by at least one probe, the probe integrity anchor point representing the integrity verification benchmark of at least one probe; a second startup module, configured to, in response to a second startup command of the first container, execute a business middleware startup script, obtain environmental parameters and inject them into the environment variables of the first container if the verification passes, the environment parameters indicating the stress testing parameters of at least one probe; and a health check module, configured to, in response to the completion of the execution of the business middleware startup script, perform a status diagnosis on at least one probe based on the process of the business middleware, and obtain a diagnosis result, the process indicating the injection status of at least one probe.
[0014] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0015] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0016] According to a fifth aspect of this application, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0017] According to the probe injection method, apparatus, device, medium and program product provided in one or more embodiments of this application, when the first container is started, the probes deployed on the shared path are mounted to the first container and their integrity is verified. There is no need to reconstruct the image. After the business middleware startup script is executed, the injected probes are diagnosed to monitor whether they have been successfully injected. This introduces integrity verification and status diagnosis into the probe injection process, which facilitates timely detection of anomalies in the probe injection process, improves the effectiveness of probe injection, and avoids the execution of invalid monitoring. Attached Figure Description
[0018] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0019] Figure 1 The illustrations depict application scenarios of probe injection methods, apparatus, devices, media, and program products according to embodiments of this application.
[0020] Figure 2 A flowchart illustrating a probe injection method according to an embodiment of this application is shown schematically.
[0021] Figure 3 This schematically illustrates a flowchart of performing integrity verification on probe integrity anchors according to an embodiment of this application;
[0022] Figure 4 A flowchart illustrating the target selection process according to an embodiment of this application is shown schematically;
[0023] Figure 5 A schematic block diagram of a probe injection apparatus according to an embodiment of this application is shown.
[0024] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a probe injection method according to an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0029] Figure 1 The diagram illustrates an application scenario of the probe injection method according to an embodiment of this application. For example... Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.
[0030] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal devices. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, and it can include, but is not limited to, applications, mini-programs, etc., installed on the terminal devices, and can also be in the form of web pages.
[0031] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be the backend server of the aforementioned target application, used to provide backend services to the clients of the target application.
[0032] It should be noted that the probe injection method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-103. Accordingly, the probe injection device provided in this application embodiment can generally be disposed in server 105 and / or terminal devices 101-103.
[0033] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0034] Figure 2 A flowchart illustrating a probe injection method according to an embodiment of this application is shown schematically. Figure 2 As shown, the probe injection method 200 according to an embodiment of this application may include steps S210 to S230.
[0035] In step S210, in response to the first start command of the first container, the first container is started to copy at least one probe deployed on the shared path to the pre-configured installation path and verify the probe integrity anchor point indicated by at least one probe.
[0036] According to an embodiment of this application, a first startup command is used to instruct a first container to perform a copy operation on at least one probe. The shared path may refer to a storage path shared by the first container and the second container. The probe refers to a load testing probe, a lightweight component used to collect business performance metrics (such as TPS, latency) and report them to the load testing platform. The probe integrity anchor characterizes the integrity verification benchmark of at least one probe and is used to perform integrity verification on at least one probe. The first container may be a business container, which may refer to a container in a container group that runs core business applications, such as a container running business middleware.
[0037] For example, a first container is started, and since a first startup command instructs a copy operation of at least one probe, the first container copies at least one probe deployed on a shared path to a pre-configured installation path and decompresses it.
[0038] The probe integrity anchor can be a probe media package that has been pre-encrypted using an encryption algorithm to ensure the immutability of the data. The probe media packages of at least one probe copied to the installation path are encrypted using the same encryption algorithm, and the encryption result is compared to the probe integrity anchor.
[0039] If the encryption result matches the probe integrity anchor point, the integrity check passes, and step S210 is executed. If the encryption result does not match the probe integrity anchor point, the integrity check fails, and the copying operation for at least one probe is re-executed.
[0040] In step S220, if the verification passes, in response to the second startup command of the first container, the business middleware startup script is executed to obtain environment parameters and inject them into the environment variables of the first container.
[0041] According to an embodiment of this application, the second startup command is used to instruct the first container to perform a business middleware startup operation. The environment parameters indicate the load testing parameters of at least one probe, such as the console address, distributed cluster address, etc.
[0042] For example, the business middleware startup script is executed to obtain the load testing platform address and distributed cluster address from the system parameters of the Platform as a Service (PAAS) platform and inject them into the environment variables of the first container.
[0043] In step S230, in response to the completion of the business middleware startup script, a status diagnosis is performed on at least one probe based on the process of the business middleware to obtain a diagnosis result.
[0044] According to an embodiment of this application, the process indicates the injection status of at least one probe.
[0045] For example, after the business middleware is started, a status diagnosis is performed based on whether the process of the business middleware contains a probe identifier that indicates at least one probe injection status.
[0046] The diagnostic result is successful if the process in the business middleware contains a probe identifier indicating at least one probe injection status. The diagnostic result is unsuccessful if the process in the business middleware does not contain a probe identifier indicating at least one probe injection status.
[0047] Through steps S210-S230 above, after at least one probe is copied to the installation path in the first container, an integrity check is performed to promptly detect situations such as probes not being completely copied or probes being tampered with, ensuring the integrity and security of data transmission and preventing probes from suddenly failing during runtime. After the business middleware starts, a status diagnosis is performed to ensure that the probes are actually effective, guaranteeing the effectiveness of subsequent load testing, identifying failed probes in advance, and avoiding the execution of invalid load testing tasks.
[0048] To improve probe injection efficiency by promptly re-injecting the probe in case of injection failure, in some embodiments, if the diagnostic result is unsuccessful, the rollback interface of the operation and maintenance platform is invoked to trigger a rollback command to shut down the process and restart the first container.
[0049] For example, in the event of a diagnostic failure, the rollback interface of the operations and maintenance platform is invoked via a command. The operations and maintenance platform triggers a rollback instruction to perform a rollback operation on the first container based on the container identifier indicated by the invocation instruction, thereby shutting down the process being executed by the first container and restarting the first container.
[0050] Here, "operations platform" can refer to a PaaS platform. The command could be "curl -XPUT ${PAAS_API} / rollback-agent?pod=${HOSTNAME}", where PAAS_API can refer to the rollback interface, a proxy service used to handle rollback operations, pod=${HOSTNAME} can refer to query parameters to tell the PaaS platform which container to operate on, and ${HOSTNAME} can refer to an environment variable.
[0051] In the embodiments of this application, the probe injection operation is quickly restored by restarting the container through a rollback operation. The operation is simple and allows for rapid recovery of the probe injection operation.
[0052] Figure 3 The flowchart illustrating the integrity verification of probe integrity anchors according to an embodiment of this application is shown in the illustration.
[0053] Next, combined Figure 3 The above step S220 will be further explained. In some embodiments, step S220 specifically includes:
[0054] First, based on the verification order of multiple importance level indicators, the hash values 302 of multiple probe files 301 are calculated sequentially.
[0055] According to embodiments of this application, at least one probe includes multiple probe files, each of which has a matching importance level and a grayscale grouping label. The multiple importance levels indicate the importance of the probe file that matches each of the multiple importance levels. The verification order may refer to verifying the probe files in descending order of importance level.
[0056] For example, the hash value 302 of each probe file is obtained sequentially in the verification order using the same encryption algorithm as the computational integrity anchor, such as a hash algorithm.
[0057] For example, multiple importance levels may include P2, P1, and P0; P2 level corresponds to the highest importance and may include core executable files (such as agent.bin), key dependency libraries (such as libcore.so), etc.; P1 level corresponds to medium importance and may include configuration files (such as config.yaml) and plugin modules; P0 level corresponds to the lowest importance and may include resource files (such as icons, documents), log templates, etc.
[0058] Then, multiple sets of configuration information indicated by multiple grayscale grouping labels are filtered in probe integrity anchor point 303 to obtain multiple target verification benchmarks 304.
[0059] According to embodiments of this application, the grayscale group label may include at least one of probe version, file type and client attributes, and environment context. The environment context may include region / data center, operating environment, and distributed cluster name. The probe integrity anchor 303 includes multiple candidate verification benchmarks 304, each of which has a matching grayscale group label.
[0060] For example, the probe integrity anchor can be a probe media package pre-encrypted using an encryption algorithm, i.e., the hash values of multiple probe files in the probe media package, stored in the metadata file of the shared volume. The hash value of each probe file is used as a candidate verification benchmark.
[0061] For example, multiple candidate verification benchmarks that match each of the multiple sets of configuration information are used as multiple target verification benchmarks 304.
[0062] Finally, based on the verification order, multiple hash values 302 and their corresponding target verification benchmarks 304 are compared sequentially to obtain the verification result 305.
[0063] For example, if multiple hash values 302 are consistent with the corresponding multiple target verification benchmarks 304, the verification result is passed; if multiple hash values 302 are inconsistent with the corresponding multiple target verification benchmarks 304, the verification result is failed.
[0064] For example, if the hash value of the P2 level is inconsistent with the corresponding target verification benchmark, the verification is terminated and the copying operation of at least one probe is directly re-executed.
[0065] Through the above steps, the probe media packages are grouped according to their importance level, and hash values are calculated and compared in the order of verification. At the same time, for each probe file, its corresponding verification benchmark is pre-selected for targeted comparison, which improves the response speed and efficiency of integrity verification and reduces the consumption of computing resources.
[0066] Figure 4 A flowchart illustrating the target selection process according to an embodiment of this application is shown.
[0067] Next, combined Figure 4 The above step S230 will be further described. In some embodiments, step S230 specifically includes:
[0068] First, based on the preset network port and / or middleware identifier, multiple processes 401 are filtered to obtain multiple candidate processes 402.
[0069] According to embodiments of this application, each of the plurality of candidate processes 402 has a network port and / or middleware identifier that matches the plurality of candidate processes 402.
[0070] For example, processes that match a network port or middleware identifier among multiple processes 401 are selected as multiple candidate processes. For instance, the network port could be 9080, the middleware identifier could be application middleware, and the process matching the network port could be a process listening on port 9080.
[0071] Secondly, based on the similarity between the preset fingerprint template 403 and the multiple multidimensional fingerprints indicated by multiple candidate processes 402, multiple matching scores 404 are obtained.
[0072] According to embodiments of this application, the fingerprint template indicates the operating baseline of the process to be diagnosed, and the multidimensional fingerprint indicates the operating conditions of the corresponding candidate process.
[0073] For example, the cosine similarity between the fingerprint template and multiple multidimensional fingerprints is calculated, and the multiple cosine similarities are used as multiple matching scores.
[0074] Then, based on the process derivation relationship between multiple matching scores 404 and multiple candidate processes 402, the target process 405 is obtained.
[0075] According to embodiments of this application, the process derivation relationship indicates the creation lineage among multiple candidate processes, that is, which candidate process is the parent process and which candidate process is the child process.
[0076] Finally, a diagnostic command is sent to the target process to determine whether the target process contains a probe identifier.
[0077] For example, if the target process contains a probe identifier, the diagnostic result is that the injection was successful; otherwise, the diagnostic result is that the injection failed.
[0078] In the embodiments of this application, to address the problem that relying solely on network port monitoring for process identification in complex deployment environments can easily lead to interference and inaccurate target process identification; firstly, a comprehensive initial screening of processes is performed using network port and / or middleware identifiers; then, preliminary matching of processes is performed using runtime conditions, and the target process is determined based on the matching score and the process derivation relationship between multiple candidate processes; thereby ensuring that the process used for status diagnosis is related to probe injection, improving the accuracy of target process identification, and ensuring the security and stability of diagnostic operations.
[0079] In some embodiments, obtaining multiple matching scores based on the similarity between a preset fingerprint template and multiple multidimensional fingerprints indicated by multiple candidate processes includes: extracting keywords from multiple process files corresponding to multiple candidate processes based on a preset regular expression to obtain multiple multidimensional fingerprints; and calculating multiple cosine similarities between the preset fingerprint template and the multiple multidimensional fingerprints to obtain multiple matching scores.
[0080] According to embodiments of this application, the fingerprint template indicates the baseline operating conditions of the process associated with probe injection. The multidimensional fingerprint may include at least one of startup parameters, file handles, thread models, and memory patterns.
[0081] For example, startup parameters can be JVM startup parameters, such as the -D parameter, -X parameter, or classpath. File handles can include network sockets, file paths, such as the listening port number or log file path. Thread models can include thread stack snapshots obtained through diagnostic interfaces. Memory models can be memory usage patterns.
[0082] For example, firstly, multiple startup parameters, multiple file handles, multiple thread models, and multiple memory modes corresponding to multiple process files are extracted using regular expressions and concatenated accordingly to form multiple multidimensional fingerprints; then, the cosine similarity between the preset fingerprint template and the multiple multidimensional fingerprints is calculated, and the multiple cosine similarities are used as multiple matching scores.
[0083] In the embodiments of this application, a multidimensional fingerprint of the candidate process is determined from multiple dimensions such as startup parameters, file handle, thread model and memory mode, so that the multidimensional fingerprint can comprehensively reflect the running conditions of the candidate process.
[0084] In some embodiments, obtaining the target process based on multiple matching scores and the process derivation relationship between multiple candidate processes includes: forming a directed graph of process relationships with multiple candidate processes as nodes, multiple matching scores as node attributes, and the process derivation relationship between multiple candidate processes as directed edges; and filtering the process relationship directed graph based on preset filtering rules to obtain the target process.
[0085] According to embodiments of this application, the screening rules indicate the screening criteria for the process to be diagnosed.
[0086] For example, the filtering rules may include: if a candidate process has a matching score greater than a preset score threshold and there is no direct process derivation relationship (or parent-child relationship) between it and other candidate processes with matching scores greater than the score threshold in the process relationship directed graph, then the candidate process is the target process; if there are multiple candidate processes with matching scores greater than the score threshold and the difference in matching scores among the multiple candidate processes is less than 0.1, the candidate process with the largest depth in the process relationship directed graph is selected as the target process; if there are two candidate processes with matching scores greater than the score threshold and there is a parent-child relationship between the two candidate processes, the target process is selected according to the type of the candidate process, such as using a business process as the target process.
[0087] Through the above steps, the characteristics of multiple candidate processes are comprehensively and visually displayed in the form of a graph structure. Combined with the process derivation relationship between processes, the target process can be accurately identified.
[0088] In some embodiments, the method further includes: building a second container image and, in response to a startup instruction of the second container, copying at least one probe and at least one of a preprocessing script and a health check script to a shared path.
[0089] According to embodiments of this application, the second container image includes at least one probe and at least one of a preprocessing script and a health check script. The preprocessing script is used to copy at least one probe deployed on a shared path to a pre-configured installation path. The health check script is used to perform status diagnostics on at least one probe based on a process of the business middleware, obtaining a diagnostic result indicating that the shared path is a storage path within a shared volume.
[0090] For example, the second container is an Init container, which is used to complete preprocessing tasks (such as file copying and environment preparation) before the business container starts.
[0091] In the embodiments of this application, addressing the issue that adding probe files in related technologies requires modifying the business image and is highly intrusive, a second container image containing at least one probe, a preprocessing script, and a health check script is constructed. By starting the second container, at least one probe, along with the preprocessing script and health check script, are copied to a shared path on a shared volume. This allows the first container to mount and activate the probe upon startup, achieving probe injection without modifying the first container image or the build process. Encapsulating the probe copying operation and the status diagnosis operation into the preprocessing script and health check script within the image, respectively, improves the response efficiency of the probe copying and status diagnosis operations.
[0092] In some embodiments, the method further includes: filtering among multiple candidate probe versions to obtain a target probe version, and updating the image label of the second container based on the target probe version; and copying at least one updated probe to a shared path in response to a startup command of the second container.
[0093] For example, the target probe version can be obtained by filtering among multiple candidate probe versions through the PAAS platform, and the corresponding target probe can be called based on the target probe version to update the probe version and update the image label of the second container; in response to the startup command of the second container, at least one updated probe is copied to the shared path.
[0094] Based on this, flexible selection and updating of probe versions can be achieved.
[0095] Based on the above-described probe injection method, embodiments of this application also provide a probe injection device. The following will be combined with... Figure 5 The device is described in detail.
[0096] Figure 5 A schematic block diagram of a probe injection device according to an embodiment of this application is shown.
[0097] like Figure 5 As shown, the probe injection device 500 of this embodiment includes a first startup module 510, a second startup module 520, and a health check module 530.
[0098] The first startup module 510 is configured to start the first container in response to a first startup command from the first container, to copy at least one probe deployed on a shared path to a pre-configured installation path, and to verify the probe integrity anchor point indicated by at least one probe, wherein the probe integrity anchor point characterizes the verification benchmark of at least one probe. In one embodiment, the first startup module 510 may be used to perform step S25 described above, which will not be repeated here.
[0099] The second startup module 520, upon successful verification, responds to the second startup command of the first container, executes the business middleware startup script, obtains environment parameters, and injects them into the environment variables of the first container. The environment parameters indicate the load testing parameters of at least one probe. In one embodiment, the second startup module 520 can be used to execute step S220 described above, which will not be repeated here.
[0100] The health check module 530, in response to the completion of the business middleware startup script, performs status diagnosis on at least one probe based on the process of the business middleware, obtains a diagnostic result, and the process indicates the injection status of at least one probe. In one embodiment, the health check module 530 can be used to execute step S230 described above, which will not be repeated here.
[0101] According to an embodiment of this application, the first startup module 510 includes a verification submodule. The verification submodule is used to calculate the hash values of multiple probe files sequentially based on the verification order indicated by multiple importance levels; filter multiple sets of configuration information indicated by multiple grayscale grouping labels in the probe integrity anchor points to obtain multiple target verification benchmarks. The probe integrity anchor points include multiple candidate verification benchmarks, and each of the multiple candidate verification benchmarks has a matching grayscale grouping label; compare the multiple hash values and the corresponding multiple target verification benchmarks to obtain the verification result.
[0102] According to an embodiment of this application, the health check module 530 includes a screening submodule, a matching submodule, an acquisition submodule, and a diagnosis submodule. The screening submodule is used to screen multiple processes based on a preset network port and / or middleware identifier to obtain multiple candidate processes, each of which has a matching network port and / or middleware identifier. The matching submodule is used to obtain multiple matching scores based on the similarity between a preset fingerprint template and multiple multidimensional fingerprints indicated by the multiple candidate processes. The fingerprint template indicates the operating baseline of the process to be diagnosed, and the multidimensional fingerprint indicates the operating conditions of the corresponding candidate process. The acquisition submodule is used to obtain the target process based on the multiple matching scores and the process derivation relationship between the multiple candidate processes. The process derivation relationship indicates the creation lineage between the multiple candidate processes. The diagnosis submodule is used to send a diagnosis instruction to the target process to determine whether the process contains a probe identifier.
[0103] According to an embodiment of this application, the matching submodule is specifically used to extract keywords from multiple process files corresponding to multiple candidate processes based on a preset regular expression to obtain multiple multidimensional fingerprints. The multidimensional fingerprints include at least one of startup parameters, file handles, thread models, and memory modes. Multiple cosine similarities between the preset fingerprint template and the multiple multidimensional fingerprints are calculated to obtain multiple matching scores.
[0104] According to an embodiment of this application, the acquisition submodule is specifically used to form a process relationship directed graph with multiple candidate processes as nodes, multiple matching scores as node attributes, and process derivation relationships between multiple candidate processes as directed edges; and to filter the process relationship directed graph based on preset filtering rules to obtain the target process, wherein the filtering rules indicate the filtering conditions for the process to be diagnosed.
[0105] According to an embodiment of this application, the apparatus further includes a deployment module for constructing a second container image. The second container image includes at least one probe and at least one of a preprocessing script and a health check script. The preprocessing script is used to copy at least one probe deployed on a shared path to a pre-configured installation path. The health check script is used to perform status diagnosis on at least one probe based on the process of the business middleware to obtain a diagnosis result. In response to the start command of the second container, at least one probe and at least one of the preprocessing script and the health check script are copied to a shared path, where the shared path is a storage path in a shared volume.
[0106] According to an embodiment of this application, the device further includes an update module, which is used to filter among multiple candidate probe versions to obtain a target probe version, so as to update the image label of the second container based on the target probe version; and in response to the start command of the second container, to copy at least one updated probe to a shared path.
[0107] According to embodiments of this application, any plurality of modules among the first startup module 510, the second startup module 520, and the health check module 530 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the first startup module 510, the second startup module 520, and the health check module 530 can be at least partially implemented as a hardware circuit, such as a field-programmable gate array, a programmable logic array, a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit, or any other reasonable means of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any one of the three implementation methods, or in a suitable combination of any of them. Alternatively, at least one of the first startup module 510, the second startup module 520, and the health check module 530 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0108] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a probe injection method according to an embodiment of this application.
[0109] like Figure 6 As shown, an electronic device 600 according to an embodiment of this application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory 602 or a program loaded from a storage portion 608 into a random access memory 603. The processor 601 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0110] Random access memory 603 stores various programs and data required for the operation of electronic device 600. Processor 601, read-only memory 602, and random access memory 603 are interconnected via bus 604. Processor 601 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 602 and / or random access memory 603. It should be noted that the programs may also be stored in one or more memories other than read-only memory 602 and random access memory 603. Processor 601 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0111] According to embodiments of this application, the electronic device 600 may further include an input / output interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card, such as a local area network card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.
[0112] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0113] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 602 described above, and / or random access memory 603, and / or one or more memories other than read-only memory 602 and random access memory 603.
[0114] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0115] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0116] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by processor 601, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0117] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0119] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A probe injection method, characterized in that, The method includes: In response to a first start command of the first container, the first container is started to copy at least one probe deployed on a shared path to a pre-configured installation path and to verify the probe integrity anchor point indicated by the at least one probe, the probe integrity anchor point representing the integrity verification benchmark of the at least one probe. If the verification passes, in response to the second startup command of the first container, the business middleware startup script is executed to obtain environment parameters and inject them into the environment variables of the first container. The environment parameters indicate the stress test parameters of the at least one probe. In response to the completion of the business middleware startup script, a status diagnosis is performed on the at least one probe based on the process of the business middleware to obtain a diagnosis result, wherein the process indicates the injection status of the at least one probe.
2. The method according to claim 1, characterized in that, The at least one probe includes multiple probe files, each of which has a matching importance level and grayscale grouping label. The verification of probe integrity anchors indicated by the at least one probe includes: Based on the verification order of multiple importance level indicators, the hash values of the multiple probe files are calculated sequentially; Multiple sets of configuration information indicated by multiple grayscale grouping labels are filtered in the probe integrity anchor point to obtain multiple target verification benchmarks. The probe integrity anchor point includes multiple candidate verification benchmarks, and each candidate verification benchmark has a matching grayscale grouping label. Based on the verification order, multiple hash values and corresponding target verification benchmarks are compared sequentially to obtain the verification result.
3. The method according to claim 1, characterized in that, The step of performing status diagnosis on the at least one probe in response to the completion of the execution of the business middleware startup script, based on the process of the business middleware startup script, includes: Based on preset network port and / or middleware identifiers, multiple processes are filtered to obtain multiple candidate processes, each of which has a matching network port and / or middleware identifier; Based on the similarity between the preset fingerprint template and the multiple multidimensional fingerprints indicated by the multiple candidate processes, multiple matching scores are obtained. The fingerprint template indicates the operating benchmark of the process to be diagnosed, and the multidimensional fingerprint indicates the operating conditions of the corresponding candidate process. Based on the multiple matching scores and the process derivation relationships between the multiple candidate processes, the target process is obtained, wherein the process derivation relationships indicate the creation lineage among the multiple candidate processes; A diagnostic command is sent to the target process to determine whether the target process contains a probe identifier.
4. The method according to claim 3, characterized in that, The similarity between the preset fingerprint template and the multiple multidimensional fingerprints indicated by the multiple candidate processes yields multiple matching scores, including: Based on a preset regular expression, keywords are extracted from multiple process files corresponding to the multiple candidate processes to obtain multiple multidimensional fingerprints. The multidimensional fingerprints include at least one of startup parameters, file handles, thread models, and memory modes. Multiple cosine similarities between the preset fingerprint template and the multiple multidimensional fingerprints are calculated to obtain multiple matching scores.
5. The method according to claim 3, characterized in that, The process of obtaining the target process based on the multiple matching scores and the process derivation relationships between the multiple candidate processes includes: A directed graph of process relationships is formed by using multiple candidate processes as nodes, the multiple matching scores as node attributes, and the process derivation relationships between multiple candidate processes as directed edges. Based on preset filtering rules, the target process is obtained by filtering in the directed graph of process relationships. The filtering rules indicate the filtering conditions for the process to be diagnosed.
6. The method according to claim 1, characterized in that, The method further includes: Construct a second container image, which includes at least one probe and at least one of a preprocessing script and a health check script. The preprocessing script is used to copy at least one probe deployed on a shared path to a pre-configured installation path. The health check script is used to start a process of the script based on the business middleware, perform status diagnosis on the at least one probe, and obtain a diagnosis result. In response to the startup command of the second container image, at least one of the at least one probe, as well as at least one of the preprocessing script and the health check script, is copied to the shared path, which is a storage path in the shared volume.
7. The method according to claim 6, characterized in that, The method further includes: The target probe version is obtained by filtering among multiple candidate probe versions, and the image label of the second container is updated based on the target probe version; In response to the startup command of the second container, the updated at least one probe is copied to the shared path.
8. The method according to claim 1, characterized in that, The method further includes: If the diagnostic result is unsuccessful, the rollback interface of the operation and maintenance platform is invoked to trigger a rollback command to shut down the process and restart the first container.
9. A probe injection device, characterized in that, The device includes: A first startup module is configured to start the first container in response to a first startup command of the first container, to copy at least one probe deployed on a shared path to a pre-configured installation path, and to verify the probe integrity anchor point indicated by the at least one probe, wherein the probe integrity anchor point characterizes the integrity verification benchmark of the at least one probe. The second startup module is used to execute the business middleware startup script in response to the second startup command of the first container when the verification is passed, obtain environment parameters and inject them into the environment variables of the first container, wherein the environment parameters indicate the stress test parameters of the at least one probe. A health check module is used to perform status diagnosis on at least one probe in response to the completion of the business middleware startup script, based on the process of the business middleware, and obtain a diagnosis result, wherein the process indicates the injection status of at least one probe.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.