A blockchain-based test information processing method and device
Patent Information
- Application Number
- CN202211168118.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-09-23
AI Technical Summary
[0004]1、测试过程中的各类监控数据主要由测试实施人员手工进行收集,受限于测试人员技术能力,容易出现监控数据遗漏、错误、偏差等各类情况,影响最终生成的报告,造成测试结果准确程度降低
[0053]本发明实施例提供的基于区块链的测试信息处理方法及装置,根据测试场景信息和被测系统动态运行信息,确定与测试场景相对应的关联系统;根据所述关联系统分别对应的静态配置信息和动态运行信息生成测试报告;上传所述测试报告至区块链,并建立所述测试报告与所述测试场景之间的关联关系,能够真实有效地获取测试结果,且能够提高测试信息处理可靠性。
Smart Images

Figure CN115687089B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more specifically to a blockchain-based test information processing method and apparatus. Background Technology
[0002] With the rapid development of financial technology, the volume of business handled by banking systems has increased significantly. Performance testing of these systems has become particularly important. Ensuring the authenticity and validity of performance test results and improving their reliability has become an unavoidable issue in performance testing.
[0003] Currently, the generation and management of performance test results for the test environment are mainly carried out manually. After completing their testing tasks, testers manually collect test data, compile test reports, and submit them. In actual testing work, the existing process has the following main problems:
[0004] 1. During the testing process, various monitoring data are mainly collected manually by the test implementers. Due to the limitations of the testers' technical capabilities, various situations such as omissions, errors, and deviations in monitoring data are prone to occur, affecting the final report and reducing the accuracy of the test results.
[0005] 2. The process of collecting monitoring data and writing reports is completed independently by the test implementers, lacking an effective supervision and management mechanism. Test implementers may subjectively tamper with or adjust test monitoring data and reports, affecting the reliability of test results.
[0006] 3. For historical performance test projects, monitoring data and test reports cannot be retained securely and reliably, and there is no effective means of tracing the source when querying the test status of historical performance test projects. Summary of the Invention
[0007] To address the problems in the prior art, embodiments of the present invention provide a blockchain-based test information processing method and apparatus, which can at least partially solve the problems existing in the prior art.
[0008] On the one hand, this invention proposes a blockchain-based test information processing method, comprising:
[0009] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0010] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0011] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0012] The test scenario information includes the test time; correspondingly, determining the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test includes:
[0013] Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to each dynamic operating information of the system under test within the test period; the change amplitude value is the difference between adjacent collected data.
[0014] If it is determined that there is at least one target dynamic operation information whose change value is greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system.
[0015] The test scenario information also includes a pre-configured system for pre-entering test scenarios; correspondingly, the blockchain-based test information processing method also includes:
[0016] The pre-configured system is removed from the target system under test, and the remaining system and the pre-configured system are identified as the associated system.
[0017] The test report is generated based on the static configuration information and dynamic operation information corresponding to the associated systems, including:
[0018] The static configuration information and dynamic operation information are filled into the test report template according to the pre-set test report format to obtain the test report.
[0019] The blockchain-based test information processing method further includes the following during the testing process prior to generating the test report:
[0020] Anomaly detection is performed on the testing process based on smart contracts.
[0021] The step of performing anomaly detection during the testing process based on smart contracts includes:
[0022] If it is determined that each associated system has not restarted or the service is available, then compare the number of pre-configured systems and the number of target systems under test for all associated systems.
[0023] If it is determined that the product of the number of pre-configured systems and the preset percentage is greater than or equal to the number of target systems under test, then the first average utilization rate corresponding to each dynamic operation information of each associated system in the first preset time period is calculated respectively.
[0024] If it is determined that all first average utilization rates are less than or equal to the first preset utilization rate threshold, then the second average utilization rate corresponding to each dynamic operation information of each associated system in the second preset time period is calculated respectively.
[0025] If it is determined that all second average utilization rates are less than or equal to the second preset utilization rate threshold, then the proportion of garbage collection time consumed by each associated system is calculated respectively.
[0026] If it is determined that the proportion of time consumed in waste recycling is less than or equal to the preset proportion, then it is determined that there is no abnormal information in the test process;
[0027] Wherein, the first preset time period is longer than the second preset time period, and the first preset usage rate threshold is less than the second preset usage rate threshold;
[0028] The percentage of time consumed in waste recycling is the ratio of the waste recycling time within a preset duration to the preset duration.
[0029] The blockchain-based test information processing method further includes:
[0030] If it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, the number of network connections at the operating system level of each associated system is calculated respectively.
[0031] If it is determined that the number of network connections is less than the average number of network connections at the operating system level of each associated system during the test, then it is determined that there is no abnormal information in the test process.
[0032] The blockchain-based test information processing method further includes:
[0033] Periodically distribute test reports in batches to at least three reviewer terminals;
[0034] If the number of review results returned by the terminals of the at least three reviewers is less than or equal to 1, then the same test report is determined to have passed the review.
[0035] The information query method based on the aforementioned blockchain-based test information processing method includes:
[0036] Obtain target test scenario query information, and determine the target test report associated with the target test scenario corresponding to the target test scenario query information based on the association relationship;
[0037] The target block containing the target test report is obtained through a consensus algorithm, and the target test report query data is obtained from the target block.
[0038] On one hand, the present invention proposes a blockchain-based test information processing device, comprising:
[0039] The determination unit is used to determine the associated systems corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test;
[0040] The generation unit is used to generate a test report based on the static configuration information and dynamic operation information corresponding to the associated systems respectively;
[0041] The upload unit is used to upload the test report to the blockchain and establish the association between the test report and the test scenario.
[0042] In another aspect, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a bus, wherein,
[0043] The processor and the memory communicate with each other via the bus;
[0044] The memory stores program instructions that can be executed by the processor, and the processor can execute the following methods by calling the program instructions:
[0045] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0046] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0047] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0048] This invention provides a non-transitory computer-readable storage medium, comprising:
[0049] The non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the following methods:
[0050] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0051] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0052] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0053] The blockchain-based test information processing method and apparatus provided in this invention determines the associated system corresponding to the test scenario based on test scenario information and dynamic operation information of the system under test; generates a test report based on the static configuration information and dynamic operation information corresponding to the associated system; uploads the test report to the blockchain and establishes the association between the test report and the test scenario, which can obtain test results in a real and effective manner and improve the reliability of test information processing. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0055] Figure 1 This is a flowchart illustrating a blockchain-based test information processing method according to an embodiment of the present invention.
[0056] Figure 2 This is a flowchart illustrating a blockchain-based test information processing method provided in another embodiment of the present invention.
[0057] Figure 3 This is a schematic diagram of the modular structure of the blockchain-based test information processing method provided in this embodiment of the invention.
[0058] Figure 4 This is a schematic diagram of the structure of a blockchain-based test information processing device provided in an embodiment of the present invention.
[0059] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments and descriptions of the present invention are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.
[0061] Figure 1 This is a flowchart illustrating a blockchain-based test information processing method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the blockchain-based test information processing method provided in this embodiment of the invention includes:
[0062] Step S1: Based on the test scenario information and the dynamic operation information of the system under test, determine the associated system corresponding to the test scenario.
[0063] Step S2: Generate a test report based on the static configuration information and dynamic operation information corresponding to the associated systems.
[0064] Step S3: Upload the test report to the blockchain and establish the association between the test report and the test scenario.
[0065] In step S1 above, the device determines the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test. The device can be a computer device executing this method, such as a client. It should be noted that the acquisition and analysis of data involved in this embodiment of the invention are authorized by the user. The system under test refers to the system that serves as the test target, and can be a cluster composed of multiple systems under test.
[0066] The information to be collected about the system under test can include static configuration information and dynamic operation information of the system under test. The collected information is then uploaded to the blockchain, i.e., stored on the blockchain.
[0067] The static configuration information of the system under test may include, but is not limited to, the number of CPUs, CPU frequency, memory capacity, memory frequency, disk capacity, network card configuration, system-level parameter configuration, and application-level parameter configuration.
[0068] It can collect dynamic operating information of the tested system in 5-second increments, including but not limited to CPU utilization, memory utilization, IO utilization, network traffic, disk utilization, current indicators of various system-level parameters, and current indicators of various application-level parameters.
[0069] Test scenario information can be entered by testers, including but not limited to scenario name, application under test, test time, stress level, test performance, and systems involved.
[0070] The step of determining the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test includes:
[0071] Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to each dynamic operating information of the system under test within the test period; the change amplitude value is the difference between adjacent collected data; an example is given below:
[0072] There are a total of m systems under test, denoted as S1, S2...Sm. Each system under test has p dynamic operation information, denoted as S11, S12...S1p for example.
[0073] The test time can be set independently according to the actual situation, such as 1 hour. The sampling time can also be set independently according to the actual situation, and can be selected as 5 seconds.
[0074] Taking S11 as the CPU utilization rate as an example, which means that CPU utilization rate data is collected every 5 seconds, it can be represented as the following time series:
[0075] {20%, 22%, 19%, 55%...}.
[0076] The absolute value of the difference between adjacent collected data can be taken as the change range value, and if a negative number appears, it can be converted into a positive number.
[0077] Referring to the examples above, the change values are 2%, 3%, and 36%.
[0078] If it is determined that at least one target dynamic operation information has a change value greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system. The preset amplitude threshold can be set independently according to the actual situation. Different dynamic operation information can correspond to different preset amplitude thresholds. For example, for CPU utilization, the preset amplitude threshold can be selected as 30%; for memory utilization, the preset amplitude threshold can be selected as 40%.
[0079] Referring to the example above, 36% is greater than the preset threshold of 30%. At this point, we can disregard other dynamic operating information such as memory usage and directly use the CPU usage of S11 as the target dynamic operating information, thereby identifying S11 as the associated system. Similarly, we can traverse the other S2...Sm in sequence to obtain all associated systems.
[0080] The test scenario information also includes a pre-configured system for pre-entering test scenarios; correspondingly, the blockchain-based test information processing method also includes:
[0081] The pre-configured system is removed from the target system under test, and the remaining systems and the pre-configured system are identified as the associated systems. That is, testers can pre-specify the pre-configured systems as associated systems related to the test scenario. This step determines the associated systems based on human specification and the magnitude of change, and eliminates duplicate data, ensuring the uniqueness of the associated systems.
[0082] Referring to the example above, the n systems in the system under test are identified as related systems, denoted as S1, S2...Sn.
[0083] In step S2 above, the device generates a test report based on the static configuration information and dynamic operation information corresponding to the associated systems. Generating the test report based on the static configuration information and dynamic operation information corresponding to the associated systems includes:
[0084] The static configuration information and dynamic operation information are filled into the test report template according to the pre-defined test report format to obtain the test report. The field content in the test report template can correspond to the static configuration information and dynamic operation information respectively. The above information of n related systems is filled into the field content corresponding to the fields in the test report template, thereby automatically generating the test report.
[0085] In step S3 above, the device uploads the test report to the blockchain and establishes a link between the test report and the test scenario. That is, the test report can be stored on the blockchain, and the test report and the entered test scenario can be associated through a consensus algorithm. The consensus algorithm is a conventional method in blockchain technology and will not be elaborated further.
[0086] The blockchain-based test information processing method provided in this invention determines the associated system corresponding to the test scenario based on test scenario information and dynamic operation information of the system under test; generates a test report based on the static configuration information and dynamic operation information corresponding to the associated system; uploads the test report to the blockchain and establishes the association between the test report and the test scenario, which can obtain test results in a real and effective manner and improve the reliability of test information processing.
[0087] Among them, authenticity is manifested through the immutability of blockchain.
[0088] Effective: This is achieved through the selection of indicators that reflect test performance and the reasonable determination of related systems.
[0089] Reliability: Test reports are generated automatically, eliminating the need for human intervention.
[0090] Furthermore, the test scenario information includes the test time; correspondingly, determining the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test includes:
[0091] Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to the dynamic operating information of each system under test within the test period; the change amplitude value is the difference between adjacent collected data; please refer to the above description, and it will not be repeated here.
[0092] If it is determined that at least one target dynamic operation information has a change value greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system. This can be referred to the above explanation and will not be repeated here.
[0093] The blockchain-based test information processing method provided in this embodiment of the invention can further reasonably determine the associated systems.
[0094] Furthermore, the test scenario information also includes a pre-configured system for pre-entering test scenarios; correspondingly, the blockchain-based test information processing method also includes:
[0095] The pre-configured system is removed from the target system under test, and the remaining system and the pre-configured system are identified as the associated system. This can be referred to the above description and will not be repeated here.
[0096] The blockchain-based test information processing method provided in this invention eliminates duplicate data content and ensures the uniqueness of the associated system.
[0097] Furthermore, a test report is generated based on the static configuration information and dynamic operation information corresponding to the associated systems, including:
[0098] The static configuration information and dynamic operation information are filled into the test report template according to the pre-set test report format to obtain the test report. Refer to the above instructions; further details are omitted.
[0099] The blockchain-based test information processing method provided in this invention can obtain test reports simply and efficiently.
[0100] Furthermore, during the testing process prior to generating the test report, the blockchain-based test information processing method also includes:
[0101] Anomaly detection is performed during the testing process based on smart contracts. Smart contracts are a standard technology in blockchain and will not be elaborated upon further. Figure 2 As shown, the anomaly detection during the testing process based on the smart contract includes:
[0102] If it is determined that each associated system has not restarted or is in a service available state, then the number of pre-configured systems and the number of target systems under test of all associated systems are compared. Referring to the example above, the subsequent steps can be performed on each associated system one by one. Taking associated system S1 as an example, it is determined whether S1 has restarted or is unavailable. If S1 has restarted or is unavailable, it is directly determined that there is abnormal information in S1 during the test process. The specific abnormal information is that a restart or service unavailability has occurred, and an alarm message can be generated.
[0103] If the product of the pre-configured system quantity and the preset percentage is greater than or equal to the target number of systems under test, then the first average utilization rate corresponding to each dynamic operation information of each associated system in the first preset time period is calculated respectively; the preset percentage can be set independently according to the actual situation and can be selected as 50%. If the product of the pre-configured system quantity and the preset percentage is less than the target number of systems under test, then it is directly determined that there is abnormal information in the test process, specifically the abnormal information is an abnormal number of pre-configured systems, and an alarm message can be generated.
[0104] If it is determined that all first average utilization rates are less than or equal to the first preset utilization rate threshold, then the second average utilization rate corresponding to each dynamic operation information of each associated system in the second preset time period is calculated respectively; taking the CPU utilization rate of associated system S1 as an example, the CPU utilization rate in the first preset time period is determined. If the first average utilization rate of at least one dynamic operation information of associated system S1 is greater than the first preset utilization rate threshold, then it is directly determined that there is abnormal information in the test process. Specifically, the abnormal information is that the dynamic operation information with the first average utilization rate greater than the first preset utilization rate threshold is abnormal, and an alarm message can be generated.
[0105] If it is determined that all second average utilization rates are less than or equal to the second preset utilization rate threshold, then the garbage collection time consumption ratio of each associated system is calculated respectively; taking the CPU utilization rate of associated system S1 as an example, the CPU utilization rate in the second preset time period is determined. If the second average utilization rate of at least one dynamic operation information of associated system S1 is greater than the second preset utilization rate threshold, then it is directly determined that there is abnormal information in the test process. Specifically, the abnormal information is that the dynamic operation information with the second average utilization rate greater than the second preset utilization rate threshold is abnormal, and an alarm message can be generated.
[0106] If the percentage of time consumed by garbage collection is less than or equal to a preset percentage, then it is determined that there is no abnormal information in the test process; the preset percentage can be set independently according to the actual situation and can be selected as 5%. If the percentage of time consumed by garbage collection in the associated system S1 is greater than the preset percentage, then it is directly determined that there is abnormal information in the test process, specifically that the percentage of time consumed by garbage collection is abnormal, and an alarm message can be generated.
[0107] Wherein, the first preset time period is longer than the second preset time period, and the first preset utilization rate threshold is less than the second preset utilization rate threshold; refer to Figure 2 The first preset time period can be selected as 5 minutes, and the second preset time period can be selected as 1 minute; the first preset usage rate threshold can be selected as 70%, and the second preset usage rate threshold can be selected as 90%.
[0108] The garbage collection time consumption percentage is the ratio of the garbage collection time within a preset duration to the preset duration. The preset duration can be set independently according to actual conditions and can be selected as 1 minute. The garbage collection time consumption, i.e., GC, is specifically monitored using tools such as jvisualvm to measure the GC time of the Java Visual Machine.
[0109] The blockchain-based test information processing method also includes:
[0110] If it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, the number of network connections at the operating system level of each associated system is calculated respectively.
[0111] If the number of network connections is determined to be less than the average number of network connections at the operating system level for each associated system during the test, then it is determined that there is no abnormal information in the test process. The preset time interval can be set independently according to the actual situation, and can be selected as 24 hours.
[0112] The number of connections refers to the number of network connections at the operating system level. It can be obtained using commands such as netstat. During the test, the number of connections usually increases significantly. After 24 hours from the end of the test, the number of connections usually drops back down. That is, the number of network connections is less than the average number of network connections at the operating system level for each associated system during the test. Taking S1 as an example, it refers to the average number of network connections at the operating system level for S1 during the test.
[0113] If the number of network connections in S1 is greater than or equal to the average number of network connections at the operating system level during the test, it indicates that the number of connections has not decreased, directly confirming that there is an anomaly in the test process. The specific anomaly is that the number of connections has not decreased, which can further generate an alarm message.
[0114] The blockchain-based test information processing method provided in this invention can comprehensively detect test anomalies.
[0115] Furthermore, the anomaly detection during the testing process based on the smart contract includes:
[0116] If it is determined that each associated system has not been restarted or the service is available, then compare the number of pre-configured systems and the number of target systems under test for all associated systems; refer to the above explanation, which will not be repeated here.
[0117] If it is determined that the product of the number of pre-configured systems and the preset percentage is greater than or equal to the number of target systems under test, then the first average utilization rate corresponding to each dynamic operation information of each associated system in the first preset time period is calculated respectively; the above description is provided and will not be repeated here.
[0118] If it is determined that all first average utilization rates are less than or equal to the first preset utilization rate threshold, then the second average utilization rate corresponding to each dynamic operation information of each associated system in the second preset time period is calculated respectively; refer to the above description, and will not be repeated here.
[0119] If it is determined that all second average utilization rates are less than or equal to the second preset utilization rate threshold, then the proportion of garbage collection time consumed by each associated system is calculated respectively; refer to the above description, and will not be repeated here.
[0120] If it is determined that the proportion of time consumed in waste recycling is less than or equal to the preset proportion, then it is determined that there is no abnormal information in the test process; please refer to the above explanation, which will not be repeated here.
[0121] Wherein, the first preset time period is longer than the second preset time period, and the first preset usage rate threshold is less than the second preset usage rate threshold; please refer to the above description, and it will not be repeated here.
[0122] The percentage of time consumed in waste recycling is the ratio of the waste recycling time within a preset duration to the preset duration. This can be referred to the above explanation and will not be repeated here.
[0123] The blockchain-based test information processing method provided in this embodiment of the invention can further comprehensively detect test anomalies.
[0124] Furthermore, the blockchain-based test information processing method also includes:
[0125] If it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, the number of network connections at the operating system level of each associated system is calculated respectively; the above description is provided and will not be repeated here.
[0126] If the number of network connections is determined to be less than the average number of network connections at the operating system level for each associated system during the test, then it is determined that there is no abnormal information in the test process. This can be referred to the above explanation and will not be repeated here.
[0127] The blockchain-based test information processing method provided in this embodiment of the invention can further comprehensively detect test anomalies.
[0128] Furthermore, the blockchain-based test information processing method also includes:
[0129] Periodically distribute test reports in batches to at least three reviewer terminals; the execution cycle for periodically distributing test reports in batches can be set independently according to actual needs, and can be selected as 1 week. After receiving the batch test reports, each reviewer terminal can review each test report individually.
[0130] The system receives the review results returned from the terminals of at least three reviewers. If the number of reviewers who failed the review for the same test report is less than or equal to one, then the same test report is considered to have passed the review. That is, at least two reviewers selected "pass," and the number of reviewers who passed the review exceeds the number of reviewers who failed; therefore, the test report is considered to have passed the review.
[0131] If it is determined that the number of people whose reports for the same test report fail the review is greater than 1, then the same test report is deemed to have failed the review. Further feedback can be provided regarding the reasons for the failure and the proposed modifications, so that the testers can make the necessary changes.
[0132] The blockchain-based test information processing method provided in this embodiment of the invention further ensures the accuracy of test reports.
[0133] Furthermore, the information query method based on the above-mentioned blockchain-based test information processing method includes:
[0134] Obtain target test scenario query information, and determine the target test report associated with the target test scenario corresponding to the target test scenario query information based on the association relationship; the target test scenario query information may include the scenario name of the target test scenario to be queried, without specific limitation.
[0135] The target test report associated with the target test scenario to be queried is determined based on the scenario name.
[0136] The target block containing the target test report is obtained through a consensus algorithm, and the target test report query data is retrieved from the target block. The consensus algorithm is a standard method in blockchain technology and will not be elaborated further.
[0137] The blockchain-based test information processing method provided in this invention makes test reports and monitoring data traceable.
[0138] like Figure 3 As shown, the blockchain-based test information processing method provided in this embodiment of the invention can be implemented modularly, specifically including:
[0139] The system comprises an information collection unit, a report generation unit, a blockchain unit, an anomaly alarm unit, and a scenario tracing unit, among which:
[0140] The information collection unit is mainly responsible for configuring and managing the system under test, defining the monitoring scope, collecting static configuration information and dynamic operation information of the system under test, and storing the collected information on the blockchain.
[0141] The report generation unit is mainly responsible for inputting test scenarios, associating the input test scenarios with the information collected by the information collection unit to establish consensus, generating performance test reports, and storing the reports on the blockchain.
[0142] The blockchain unit is primarily responsible for establishing a blockchain network, calculating and storing the data on the chain.
[0143] The anomaly alarm unit is mainly responsible for using smart contracts to investigate abnormal information and pushing it to the relevant personnel through the alarm center.
[0144] The scenario tracing unit is mainly responsible for providing aggregated query functions, using consensus mechanisms to find related information, and having reviewers review the test scenarios.
[0145] The information collection unit is primarily responsible for configuring and managing the system under test, defining the monitoring scope, collecting static configuration information and dynamic operational information of the system under test, and storing the collected information on the blockchain. It includes the following modules: a system under test management module, a static configuration information collection module, and a dynamic operational information collection module.
[0146] The system under test management module inputs information about the system under test, including but not limited to reachable IP, username, password, system type, installed applications, application login information, etc., and establishes a ledger of the system under test for management.
[0147] The static configuration information collection module is responsible for collecting static configuration information of the hardware system under test, including but not limited to the number of CPUs, CPU frequency, memory capacity, memory frequency, disk capacity, network card configuration, system-level parameter configuration, and application-level parameter configuration.
[0148] The dynamic operation information collection module is responsible for collecting dynamic operation information of the system under test. It collects the system operation information in 5-second increments, including but not limited to CPU utilization, memory utilization, IO utilization, network traffic, disk utilization, current indicators of various system-level parameters, and current indicators of various application-level parameters.
[0149] The report generation unit is primarily responsible for inputting test scenarios, associating the input test scenarios with information collected by the information collection unit to establish consensus, generating a performance test report, and storing the report on the blockchain. It includes the following modules: scenario input module, system registration module, and report generation module; among which:
[0150] The scenario entry module allows testers to input performance test scenario information, including scenario name, application under test, test time, stress level, test performance, and systems involved.
[0151] The system registration module registers the corresponding system as an associated system of the test scenario based on the entered scenario information A. Simultaneously, based on the test time range in the scenario information completed by the testers, it iterates through all entered system information, retrieves systems whose resource usage changes exceed a threshold and are not present in the scenario information A entered by the testers, and registers these systems as associated systems of the same test scenario.
[0152] The report generation module calculates according to the pre-set format based on the entered scenario information and the corresponding system configuration and operation monitoring information, generates and outputs the test report for on-chain storage, and associates the test report with the entered test scenario through a consensus algorithm.
[0153] The blockchain unit is primarily responsible for establishing a blockchain network, calculating and storing data on the chain, and retrieving all related information based on the query input. It includes the following modules: a data calculation and storage module, and a traceability algorithm module. Upon receiving data to be uploaded to the chain, the data calculation and storage module calculates the hash value of the block using the following method:
[0154] H=Hash(H',timestamp,Hash(data))
[0155] Where H is the calculation result, H' is the hash value of the previous block, timestamp is the on-chain time, and Hash(data) is the hash value of the on-chain data.
[0156] The calculated hash value is then packaged with the on-chain data.
[0157] The tracing algorithm module uses the query information input by the aggregation query module to search for all related blocks through a consensus algorithm, thus completing the data tracing.
[0158] The anomaly alarm unit is primarily responsible for using smart contracts to investigate anomalies and pushing them to relevant personnel through the alarm center. It includes the following modules: anomaly detection module and alarm notification module; among which:
[0159] The anomaly detection module performs anomaly checks based on pre-defined conditions in the smart contract. For details on the alarm detection logic, please refer to [link / reference needed]. Figure 2 After detecting an alarm, the alarm notification module sends the alarm information via email, SMS, voice message, or other means according to the pre-entered communication method. After receiving the alarm processing result, the alarm information and processing result are stored on the blockchain for evidence.
[0160] The scenario tracing unit is primarily responsible for providing aggregated query functionality, utilizing a consensus mechanism to find related information, and having reviewers audit the test scenarios. It includes the following modules: aggregated query module and auditing module; among which:
[0161] The aggregated query module provides aggregated query functionality, allowing users to filter test scenarios and reports based on various inputs, including but not limited to test scenario name, test time, and application name.
[0162] After each testing cycle is completed, the review module automatically distributes all test reports within that cycle. Each report is sent to at least three reviewers. After review, the reviewers return the review results. If the number of unsuccessful reviews is less than or equal to 1, the test report is considered qualified and passes the review. Otherwise, the testers are notified to modify the report according to the review comments and resubmit it for review after modification.
[0163] The blockchain-based test information processing method provided in this embodiment of the invention is further described below:
[0164] 1. If this method is being executed for the first time, all information about the systems under test in the test environment will be entered into the system under test management module, including but not limited to reachable IP addresses, usernames, passwords, system types, installed applications, and application login information. The static configuration information collection module will be set to update every 6 hours, and the dynamic runtime information collection module will be set to update every 5 seconds. If this method is not being executed for the first time, proceed to step 2. If there is a need to add new systems under test in the future, follow step 1 as well.
[0165] 2. The static configuration information collection module collects the static configuration information of the hardware system under test at a set frequency, including but not limited to the number of CPUs, CPU frequency, memory capacity, memory frequency, disk capacity, network card configuration, system-level parameter configuration, and application-level parameter configuration.
[0166] 3. The dynamic operation information collection module collects the dynamic operation information of the system under test at a set frequency, with a granularity of 5 seconds. The collected information includes, but is not limited to, CPU utilization, memory utilization, IO utilization, network traffic, disk utilization, current indicators of various system-level parameters, and current indicators of various application-level parameters.
[0167] 4. Testers initiate stress tests according to the test procedure and complete the performance test.
[0168] 5. Testers enter performance test scenario information, including scenario name, application under test, test time, stress level, test performance, and systems involved.
[0169] 6. The system registration module registers the corresponding system as an associated system of the test scenario according to the entered scenario information A. Meanwhile, according to the test time range included in the scenario information completed by testers, all system information entered in step 1 is traversed to retrieve systems whose resource usage change exceeds the threshold and are not included in the scenario information A entered by the testers, and this part of systems B are also registered and used as associated systems of the test scenario.
[0170] 7. The report generation module obtains the test time range according to the scenario information entered in step 5, acquires the information of the associated systems obtained in step 6 according to the test time range, including the static configuration information and dynamic operation information of the associated systems, generates test documents in Word and HTML formats according to the preset test report format, and presents them to users through the front-end page. The test report is stored on-chain, and the test report and the entered test scenario are associated through a consensus algorithm.
[0171] 8. During the test process, the anomaly judgment module performs anomaly judgment according to the preset conditions in the smart contract. For the alarm judgment logic, see Figure 2 . After detecting alarm information, the alarm notification module sends alarm information by means of emails, short messages, voice messages and other modes according to the pre-entered communication methods, and stores the alarm information and the processing result on-chain as evidence after receiving the alarm processing result.
[0172] 9. After the test is completed, after each test cycle is finished, all test reports within this cycle are automatically distributed, and each report is sent to at least three auditors respectively. Auditors return audit results after auditing. When the number of unqualified audit results is less than or equal to 1, the test report is determined to be qualified and pass the audit; otherwise, testers are notified to modify the report according to audit opinions, and submit the modified report for auditing again. Meanwhile, relevant information of performance tests can also be queried through the aggregate query module at other times.
[0173] It should be noted that the blockchain-based test information processing method provided in the embodiment of the present invention can be applied to the financial field, and can also be applied to any technical field other than the financial field. The embodiment of the present invention does not limit the application field of the blockchain-based test information processing method.
[0174] Figure 4 is a schematic structural diagram of a blockchain-based test information processing apparatus provided by an embodiment of the present invention. As Figure 4 shown, the blockchain-based test information processing apparatus provided by the embodiment of the present invention includes a determining unit 401, a generating unit 402 and an uploading unit 403, wherein:
[0175] The determining unit 401 is used to determine the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test; the generating unit 402 is used to generate a test report based on the static configuration information and dynamic operation information corresponding to the associated system respectively; the uploading unit 403 is used to upload the test report to the blockchain and establish the association between the test report and the test scenario.
[0176] Specifically, the determining unit 401 in the device is used to determine the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test; the generating unit 402 is used to generate a test report based on the static configuration information and dynamic operation information corresponding to the associated system respectively; and the uploading unit 403 is used to upload the test report to the blockchain and establish the association between the test report and the test scenario.
[0177] The blockchain-based test information processing device provided in this embodiment of the invention determines the associated system corresponding to the test scenario based on test scenario information and dynamic operation information of the system under test; generates a test report based on the static configuration information and dynamic operation information corresponding to the associated system; uploads the test report to the blockchain and establishes the association between the test report and the test scenario, which can obtain test results in a real and effective manner and improve the reliability of test information processing.
[0178] Furthermore, the test scenario information includes the test time; correspondingly, the determining unit 401 is specifically used for:
[0179] Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to each dynamic operating information of the system under test within the test period; the change amplitude value is the difference between adjacent collected data.
[0180] If it is determined that there is at least one target dynamic operation information whose change value is greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system.
[0181] The blockchain-based test information processing device provided in this embodiment of the invention can further reasonably determine the associated systems.
[0182] Furthermore, the test scenario information also includes a pre-configuration system for pre-entering test scenarios; correspondingly, the blockchain-based test information processing device is also used for:
[0183] The pre-configured system is removed from the target system under test, and the remaining system and the pre-configured system are identified as the associated system.
[0184] The blockchain-based test information processing device provided in this embodiment of the invention eliminates duplicate data content and ensures the uniqueness of the associated system.
[0185] Furthermore, the generation unit 402 is specifically used for:
[0186] The static configuration information and dynamic operation information are filled into the test report template according to the pre-set test report format to obtain the test report.
[0187] The blockchain-based test information processing device provided in this embodiment of the invention can obtain test reports simply and efficiently.
[0188] Furthermore, during the testing process prior to generating the test report, the blockchain-based test information processing device is also used for:
[0189] Anomaly detection is performed on the testing process based on smart contracts.
[0190] The blockchain-based test information processing device provided in this embodiment of the invention can comprehensively detect test anomalies.
[0191] Furthermore, the blockchain-based test information processing device is also specifically used for:
[0192] If it is determined that each associated system has not restarted or the service is available, then compare the number of pre-configured systems and the number of target systems under test for all associated systems.
[0193] If it is determined that the product of the number of pre-configured systems and the preset percentage is greater than or equal to the number of target systems under test, then the first average utilization rate corresponding to each dynamic operation information of each associated system in the first preset time period is calculated respectively.
[0194] If it is determined that all first average utilization rates are less than or equal to the first preset utilization rate threshold, then the second average utilization rate corresponding to each dynamic operation information of each associated system in the second preset time period is calculated respectively.
[0195] If it is determined that all second average utilization rates are less than or equal to the second preset utilization rate threshold, then the proportion of garbage collection time consumed by each associated system is calculated respectively.
[0196] If it is determined that the proportion of time consumed in waste recycling is less than or equal to the preset proportion, then it is determined that there is no abnormal information in the test process;
[0197] Wherein, the first preset time period is longer than the second preset time period, and the first preset usage rate threshold is less than the second preset usage rate threshold;
[0198] The percentage of time consumed in waste recycling is the ratio of the waste recycling time within a preset duration to the preset duration.
[0199] The blockchain-based test information processing device provided in this embodiment of the invention is further capable of comprehensively detecting test anomalies.
[0200] Furthermore, the blockchain-based test information processing device is also specifically used for:
[0201] If it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, the number of network connections at the operating system level of each associated system is calculated respectively.
[0202] If it is determined that the number of network connections is less than the average number of network connections at the operating system level of each associated system during the test, then it is determined that there is no abnormal information in the test process.
[0203] The blockchain-based test information processing device provided in this embodiment of the invention is further capable of comprehensively detecting test anomalies.
[0204] Furthermore, the blockchain-based test information processing device is also specifically used for:
[0205] Periodically distribute test reports in batches to at least three reviewer terminals;
[0206] If the number of review results returned by the terminals of the at least three reviewers is less than or equal to 1, then the same test report is determined to have passed the review.
[0207] The blockchain-based test information processing device provided in this embodiment of the invention further ensures the accuracy of test reports.
[0208] Furthermore, the information query device of the aforementioned blockchain-based test information processing device is specifically used for:
[0209] Obtain target test scenario query information, and determine the target test report associated with the target test scenario corresponding to the target test scenario query information based on the association relationship;
[0210] The target block containing the target test report is obtained through a consensus algorithm, and the target test report query data is obtained from the target block.
[0211] The blockchain-based test information processing device provided in this embodiment of the invention enables test reports and monitoring data to be traceable.
[0212] The embodiments of the present invention provide a blockchain-based test information processing device that can be used to execute the processing flow of the above-described method embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above-described method embodiments.
[0213] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 5 As shown, the electronic device includes: a processor 501, a memory 502, and a bus 503;
[0214] The processor 501 and the memory 502 communicate with each other via the bus 503.
[0215] The processor 501 is used to call program instructions in the memory 502 to execute the methods provided in the above-described method embodiments, including, for example:
[0216] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0217] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0218] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0219] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments, such as:
[0220] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0221] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0222] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0223] This embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided in the above-described method embodiments, including, for example:
[0224] Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario;
[0225] A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively;
[0226] Upload the test report to the blockchain and establish a relationship between the test report and the test scenario.
[0227] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0228] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0229] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0230] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0231] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0232] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A blockchain-based test information processing method, characterized in that, include: Based on the test scenario information and the dynamic operation information of the system under test, determine the associated systems corresponding to the test scenario; A test report is generated based on the static configuration information and dynamic operation information of the associated systems respectively; The dynamic operating information includes CPU utilization, memory utilization, I / O utilization, network traffic, and disk utilization. Upload the test report to the blockchain and establish a link between the test report and the test scenario; The test scenario information includes the test time; correspondingly, determining the associated system corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test includes: Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to each dynamic operating information of the system under test within the test period; the change amplitude value is the difference between adjacent collected data. If it is determined that there is at least one target dynamic operation information whose change value is greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system; The test scenario information also includes a pre-configured system for pre-entering test scenarios; correspondingly, the blockchain-based test information processing method also includes: Remove the pre-configured system from the target system under test, and determine the remaining system and the pre-configured system as the associated system; During the testing process prior to generating the test report, the blockchain-based test information processing method further includes: If it is determined that each associated system has not restarted or the service is available, then compare the number of pre-configured systems and the number of target systems under test for all associated systems. If it is determined that the product of the number of pre-configured systems and the preset percentage is greater than or equal to the number of target systems under test, then the first average utilization rate corresponding to each dynamic operation information of each associated system in the first preset time period is calculated respectively. If it is determined that all first average utilization rates are less than or equal to the first preset utilization rate threshold, then the second average utilization rate corresponding to each dynamic operation information of each associated system in the second preset time period is calculated respectively. If it is determined that all second average utilization rates are less than or equal to the second preset utilization rate threshold, then the proportion of garbage collection time consumed by each associated system is calculated respectively. If it is determined that the proportion of time consumed in waste recycling is less than or equal to the preset proportion, then it is determined that there is no abnormal information in the test process; Wherein, the first preset time period is longer than the second preset time period, and the first preset utilization rate threshold is less than the second preset utilization rate threshold; the proportion of garbage collection time consumed is the ratio of garbage collection time consumed within a preset duration to the preset duration; The blockchain-based test information processing method further includes: If it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, the number of network connections at the operating system level of each associated system is calculated respectively. If it is determined that the number of network connections is less than the average number of network connections at the operating system level of each associated system during the test, then it is determined that there is no abnormal information in the test process.
2. The blockchain-based test information processing method according to claim 1, characterized in that, A test report is generated based on the static configuration information and dynamic operation information corresponding to the associated systems, including: The static configuration information and dynamic operation information are filled into the test report template according to the pre-set test report format to obtain the test report.
3. The blockchain-based test information processing method according to any one of claims 1 to 2, characterized in that, The blockchain-based test information processing method also includes: Periodically distribute test reports in batches to at least three reviewer terminals; If the number of review results returned by the terminals of the at least three reviewers is less than or equal to 1, then the test report is determined to have passed the review.
4. An information query method for a blockchain-based test information processing method according to claim 1, characterized in that, include: Obtain target test scenario query information, and determine the target test report associated with the target test scenario corresponding to the target test scenario query information based on the association relationship; The target block containing the target test report is obtained through a consensus algorithm, and the target test report query data is obtained from the target block.
5. A blockchain-based test information processing device, characterized in that, include: The determination unit is used to determine the associated systems corresponding to the test scenario based on the test scenario information and the dynamic operation information of the system under test; The generation unit is used to generate a test report based on the static configuration information and dynamic operation information corresponding to the associated systems respectively; The dynamic operating information includes CPU utilization, memory utilization, I / O utilization, network traffic, and disk utilization. An upload unit is used to upload the test report to the blockchain and establish a relationship between the test report and the test scenario; The test scenario information includes the test time; correspondingly, the determining unit is specifically used for: Within the test period, the dynamic operating information of the system under test is traversed to obtain the change amplitude value corresponding to each dynamic operating information of the system under test within the test period; the change amplitude value is the difference between adjacent collected data. If it is determined that there is at least one target dynamic operation information whose change value is greater than a preset amplitude threshold, then the target tested system corresponding to the target dynamic operation information is determined as the associated system; The test scenario information also includes a pre-configured system for pre-entering the test scenario; correspondingly, the blockchain-based test information processing device is also used to: remove the pre-configured system from the target system under test, and determine the remaining system and the pre-configured system as the associated system; During the testing process prior to generating the test report, the blockchain-based test information processing device is further configured to: if it is determined that each associated system has not restarted or is in an available state, compare the number of pre-configured systems and the number of target tested systems for all associated systems; if it is determined that the product of the number of pre-configured systems and a preset percentage is greater than or equal to the number of target tested systems, calculate the first average utilization rate corresponding to each dynamic operation information of each associated system in a first preset time period; if it is determined that all first average utilization rates are less than or equal to a first preset utilization rate threshold, calculate the second average utilization rate corresponding to each dynamic operation information of each associated system in a second preset time period; if it is determined that all second average utilization rates are less than or equal to a second preset utilization rate threshold, calculate the garbage collection consumption time percentage of each associated system; if it is determined that the garbage collection consumption time percentage is less than or equal to a preset percentage, determine that there is no abnormal information in the testing process; wherein, the first preset time period is longer than the second preset time period, and the first preset utilization rate threshold is less than the second preset utilization rate threshold; the garbage collection consumption time percentage is the ratio of garbage collection consumption time within a preset duration to the preset duration; The blockchain-based test information processing device is further specifically used to: if it is determined that the proportion of time consumed by garbage collection is less than or equal to the preset proportion, and the preset time interval is reached after the test is completed, calculate the number of network connections at the operating system level of each associated system respectively; if it is determined that the number of network connections is less than the average number of network connections at the operating system level of each associated system during the test, then determine that there is no abnormal information in the test process.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Monitoring alarm method, device and system for WebLogic server and computer storage medium
CN109726072A
Blockchain network test method and device, server and storage medium
CN112073269A
Memory leakage detection method, device and system and computer equipment
CN112346894A