A method and apparatus for distributed service auto-ping
By configuring dial-up testing information and consistency verification, the problem of anomaly detection in the scenario of distributed system service interface docking in complex network environment is solved, and flexible and reliable dial-up testing alarms and system stability improvement are achieved.
Patent Information
- Application Number
- CN202311702658.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-12-12
AI Technical Summary
In complex network environments and distributed system service interface integration scenarios, it is impossible to detect in a timely manner anomalies where interface access is normal but the returned results are not as expected, resulting in poor service quality.
By configuring probing information, probing tasks are executed, the returned content is obtained and parsed, and consistency verification is performed. If inconsistency is found, an alarm notification is issued. The probing frequency can be optimized through machine learning models. HTTP/HTTPS request methods and multiple authentication methods are supported, and string hashing is used to reduce matching complexity.
It improves the system's flexibility and reliability, enables timely detection of anomalies, reduces resource consumption, and enhances the efficiency of alarm detection and system stability.
Smart Images

Figure CN117857381B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of IT and software development, in particular to a method and device for automatically dialing a distributed service. BACKGROUND
[0002] The self-developed console of Tianyi cloud provides the ability of self-service opening and managing cloud resources for users. The distributed service system it interfaces with is very numerous. The SSO of Tianyi cloud is connected to realize user single sign-on. The BSS system of Tianyi cloud is connected to realize order charging. The PAAS platform is connected to provide a variety of PAAS products. The more systems connected, the more interfaces involved. How to complete the interface dialing of each system, ensure the availability of the interface, and improve the user experience is a pressing problem in front of us. At the same time, dialing also needs to consider how to verify the correctness of the interface return content and obtain the expected return result. Due to the difference of the network between different systems, the complexity of the network increases the difficulty of interface dialing.
[0003] Patent CN114760235A discloses a dialing task execution method and device, storage medium and electronic device, relating to the technical field of smart home. The dialing task execution method includes: obtaining a dialing task to be executed transmitted by a first device, wherein the dialing task includes a first device identifier of the first device and task information; based on the first device identifier, searching for a second device identifier of a second device corresponding to the first device identifier from a preset database; according to the second device identifier and the task information, searching for configuration information of the second device from the preset database; generating a dialing instruction according to the configuration information of the second device; and based on the second device identifier, sending the dialing instruction to the second device to instruct the second device to execute the dialing task. This patent focuses on the execution of the task by the second device through the first device identifier task, and cannot solve the problem of verifying the correctness of the interface return content encountered at present.
[0004] Patent CN114584760A discloses a media dialing method and related equipment. The present application provides a media dialing method and related equipment applied to a computer terminal. The method includes: obtaining a dialing task, wherein the dialing task is provided with dialing parameters corresponding to target media, and the dialing parameters include dialing platform information, which is used to indicate that the target media is dialed on at least one target dialing platform; according to the dialing platform information, respectively establishing a connection with each target dialing platform; and dialing the target media on each target dialing platform according to the dialing parameters to obtain a dialing result corresponding to the target dialing platform. This patent focuses on media system dialing and simulates page jumping, and cannot solve the problem of verifying the correctness of the interface return content encountered at present.
[0005] In summary, in the complex network multi-distributed system service interface docking scene, how to timely discover the docking system service exception is not only realized by the user perception through the fuse mechanism, but also needs to be discovered through the stress test means to find the alarm notification, especially involving the interface access normal, the return result is not as expected and the scene of the complex network environment. SUMMARY
[0006] The purpose of the present application is to provide a distributed service automatic stress test method and device to solve the problem of the complex network environment multi-distributed system service interface docking scene, which cannot timely discover the docking system service exception, especially involving the interface access normal, the return result is not as expected, resulting in poor service quality in the complex network environment multi-system interface docking scene.
[0007] In one aspect, the present application provides a distributed service automatic stress test method, comprising:
[0008] The stress test information is configured, and the stress test task execution is performed according to the configured stress test information;
[0009] The stress test return content in the stress test task execution is obtained, and the analysis result of the stress test return content is analyzed according to the stress test return content;
[0010] The consistency verification is performed between the analysis result of the stress test return content and the expected result of the stress test return content, wherein;
[0011] If the analysis result of the stress test return content is consistent with the expected result of the stress test return content, the analysis result of the stress test return content is stored;
[0012] If the analysis result of the stress test return content is inconsistent with the expected result of the stress test return content, the analysis result of the stress test return content is stored, and the consistency verification is performed again between the analysis result of the stress test return content and the expected result of the stress test return content according to the alarm strategy configuration condition, wherein,
[0013] If the analysis result of the stress test return content is inconsistent with the expected result of the stress test return content, and the consistency verification reaches the preset number of times, the stress test alarm notification is sent.
[0014] Optionally, in the above embodiment, the stress test result can be input into a machine learning model to predict, and the stress test frequency can be increased in the period when the stress test alarm may occur, to improve the stress test alarm accuracy, or the stress test frequency can be reduced in the period without alarm, to reduce resource consumption.
[0015] Further, when the stress test information is configured, it comprises:
[0016] The type of the probe, the authentication mode of the probe, the rule of the probe and the task of the probe are configured;
[0017] The resolution engine, the comparison mode of the result of the probe and the task executor are configured.
[0018] Optionally, the type of the probe supports HTTP / HTTPS request mode, and can be extended to DNS, FTP and other service probes.
[0019] Optionally, the authentication mode of the probe includes supporting username / password authentication and ak / sk authentication, and can be extended to support more authentication modes.
[0020] Optionally, the rule of the probe includes probe address, probe service name, belonging network segment, whether the rule is effective, timeout time, creator, request header, request type, authentication mode, request content, expected return code, expected return result, retry number, alarm group, probe frequency and note.
[0021] Optionally, the task of the probe includes task number, task name, task state, task corresponding probe rule, task start time, task end time, probe return state code, probe return content, retry number and maximum retry number.
[0022] Optionally, the resolution engine refers to a script or code segment for resolving return result, which can resolve the required field content from HTML, XML, JSON, pure text and other return contents, and the resolution result can be used for matching with the expected result.
[0023] Optionally, the comparison mode of the result of the probe is not configured and is set as the default probe task comparison mode. The default mode is that the state is equal to the expected state code, and the return result is equal to the expected return result. If the expected return result is set to empty, the state code is equal, which means that the probe result is consistent with the expectation. Complex probe result comparison can be compared by script, which can parse the return content and obtain the expected result field or content through the resolution engine, and compare with the set expected result.
[0024] Optionally, the task executor is configured in different network environments, and at least three executors are configured under each network environment. The executor needs to access the probe center, send a heartbeat request, obtain a probe task and return a probe result.
[0025] Further, when the probe task is executed according to the configured probe information, it includes:
[0026] Obtaining the task type of the online task executor and the task information of the probe;
[0027] extracting a type of the penetration testing task in the penetration testing task information;
[0028] obtaining an execution strategy of the configured penetration testing task, and matching the penetration testing task and the online task executor based on the type of the penetration testing task according to the execution strategy of the penetration testing task;
[0029] scheduling the penetration testing task to the online task executor matched with the penetration testing task according to the matching result, and controlling the task executor to perform the penetration testing task;
[0030] obtaining a penetration testing result of the task executor, and returning the penetration testing result to the penetration testing platform.
[0031] Further, when the penetration testing return content in the penetration testing task execution is obtained, and the analysis result of the penetration testing return content is analyzed according to the penetration testing return content, the analysis result comprises:
[0032] establishing a penetration testing result string hash of the penetration testing result returned to the penetration testing platform;
[0033] constructing a string hash of an expected result and an actual result, and obtaining a consistency verification result according to an equal formula between the established penetration testing result string hash and the constructed string hash of the expected result and the actual result.
[0034] Further, when the penetration testing result string hash of the penetration testing result returned to the penetration testing platform is established, the method comprises:
[0035] Given a return penetration testing result S, the type is a string, S is composed of characters S=s1s2s3...sn, each si is a letter, and given idx(si)=ascii(si)+1, wherein ascii(si) represents the ASCII code value of the letter si;
[0036] obtaining the length limit and small change characteristics of the penetration testing result, and constructing the penetration testing result string hash by using a natural overflow method, wherein the penetration testing result string hash function is: H[i]=(H[i-1]*Base+idx(si))%MOD, wherein H represents a hash function, and H[i] represents the hash value of the [0-i] string.
[0037] Further, when the string hash of the expected result and the actual result is constructed, the method comprises:
[0038] Obtaining the hash value of the returned string S=s1s2s3...sn of the string of the test result, hash[i], i∈[0,n], the actual result is a substring thereof, and S=sls2s3...sr is set, wherein l is a starting position, and r is an ending position, and the hash value is taken MOD;
[0039] According to subH= ((H[r]-H[l-r]*Baser-l+1) %MOD+MOD+1) %MOD, the hash value of the actual returned result is calculated;
[0040] Obtaining the expected return result configuration in the rule of the test, and obtaining the hash value of the expected result string according to the expected return result configuration in the rule of the test.
[0041] On the other hand, the application provides an implementation device of a method for distributed service automatic test based on the above-mentioned embodiments, comprising:
[0042] A configuration management module is configured to configure test-related configurations and test task management.
[0043] A task scheduling module is electrically connected to the configuration management module, and the task scheduling device is configured to schedule the test tasks.
[0044] A task execution module is electrically connected to the task scheduling module, and the task execution module is configured to perform task execution according to the test tasks scheduled by the task scheduling module.
[0045] A storage module is electrically connected to the configuration management module and the task scheduling module, and the storage module is configured to store configuration information and task, notification, result and other information.
[0046] A notification module is configured to send notification information in the case of test result triggering alarm.
[0047] Further, the task scheduling module is further configured to select a suitable test task execution module to execute a test task according to a test rule.
[0048] Further, the task execution module is further configured to receive tasks scheduled by the task scheduling device and test tasks in a complex network environment, and the task execution module is further configured to execute test tasks and return test results.
[0049] Further, the configuration management module comprises:
[0050] A rule management unit is configured to manage the configuration of the test rule.
[0051] A type management unit is configured to manage the configuration of the test type.
[0052] An authentication management unit is configured to manage the authentication mode of the designed stress test.
[0053] A task management unit is configured to manage the configuration of the stress test task.
[0054] A result comparison mode unit is configured to manage the configuration of the analysis engine of the stress test task return result.
[0055] A notification management unit is configured to manage the configuration of the alarm information notification.
[0056] An alarm contact / group management unit is configured to manage the contact and group responsible for accepting the alarm information.
[0057] An analysis engine management unit is configured to manage the analysis engine for analyzing the return content of the stress test.
[0058] Compared with the prior art, the method and device for distributed service automatic stress test according to the embodiments of the present application have the following beneficial effects: By configuring stress test information, a specific stress test task can be executed, which enhances the flexibility and customizability of the stress test. Meanwhile, during the execution of the stress test task, the return content of the stress test is obtained, and the analysis result is analyzed according to the content. Then, the stress test process can effectively understand and process a large amount of stress test data, thereby improving the data processing capability. In addition, not only the return content of the stress test is obtained and analyzed, but also the analysis result of the content is verified with the expected result for consistency. This design ensures that data anomalies can be found in time, thereby improving the stability and reliability of the system. Subsequently, during the consistency verification of the stress test result, when the verification result and the expected result are inconsistent, real-time alarm is performed according to the alarm rule setting, and the verification efficiency is higher than that of the traditional analysis method. The return result is constructed by using the string hash method, the time complexity of the string matching work is reduced from linear order to constant order, the time efficiency of the abnormal result alarm is improved, and the interface abnormal condition can be found in time. Finally, compared with the traditional stress test method, the stress test result can be supported for machine learning training and prediction, the intelligent variable interval stress test strategy is generated according to the prediction result, the system pressure is reduced, and the stress test alarm efficiency is further improved effectively. BRIEF DESCRIPTION OF DRAWINGS
[0059] Figure 1 is a flow block diagram of a method for distributed service automatic stress test according to an embodiment of the present application.
[0060] Figure 2 is a structural block diagram of an implementation device for a method for distributed service automatic stress test according to an embodiment of the present application.
[0061] Figure 3is a connection relationship schematic diagram of an implementation device of a method for automatic dialing test based on distributed services according to an embodiment of the present application. DETAILED DESCRIPTION
[0062] Exemplary embodiments of the present disclosure will be described in detail with reference to the drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly understood, and the scope of the present disclosure can be accurately conveyed to those skilled in the art. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.
[0063] As shown in Figure 1 a method for automatic dialing test of distributed services according to an embodiment of the present application, comprising:
[0064] Step S100, configure dialing test information, and perform dialing test task according to the configured dialing test information.
[0065] Step S200, obtain dialing test return content in dialing test task execution, and parse the dialing test return content to obtain a parsing result of the dialing test return content.
[0066] Step S300, perform consistency verification between the parsing result of the dialing test return content and an expected result of the dialing test return content, wherein if the parsing result of the dialing test return content is consistent with the expected result of the dialing test return content, the parsing result of the dialing test return content is stored.
[0067] Step S400, if the parsing result of the dialing test return content is inconsistent with the expected result of the dialing test return content, store the parsing result of the dialing test return content, and perform consistency verification again between the parsing result of the dialing test return content and the expected result of the dialing test return content according to the alarm strategy configuration condition, wherein if the parsing result of the dialing test return content is inconsistent with the expected result of the dialing test return content, and the consistency verification reaches a preset number of times, a dialing test alarm notification is sent.
[0068] It can be seen that, by step S100, the stress test task is executed according to the stress test information configured by the user. Thus, the stress test task can be flexibly customized according to the user's needs. Secondly, in step S200, the return content in the stress test task execution is obtained, and the analysis result is parsed according to the content. This design takes advantage of the powerful data processing capability of the computer, and can quickly and effectively process a large amount of stress test data. Then, in step S300, the consistency verification is performed according to the analysis result and the expected result. If the analysis result is consistent with the expected result, the analysis result is stored, which provides support for subsequent data analysis and reporting. This design ensures that the system can timely discover and record normal data results. If the analysis result is inconsistent with the expected result, the consistency verification is performed again in step S400. Self-detection and repair can be performed when an abnormal situation occurs. If the consistency verification fails for a preset number of times, a stress test alarm notification is sent. This design enables the user to timely understand and handle abnormal situations, thereby improving stability and reliability.
[0069] It can be understood that, by step S100, the stress test task can be executed according to the stress test information configured by the user, which enhances the flexibility and customizability of the system, and the user can set the stress test task according to actual needs. Secondly, in step S200, the return content in the stress test task execution is obtained, and the analysis result is parsed according to the content. This design enables the system to effectively understand and process a large amount of stress test data, and improves the data processing capability. Then, in steps S300 and S400, the consistency verification is performed according to the analysis result and the expected result. If the analysis result is consistent with the expected result, the analysis result is stored; if the analysis result is inconsistent with the expected result, the analysis result is also stored, and the consistency verification is performed again according to the alarm strategy configuration condition. This design ensures that self-detection and repair can be performed when an abnormal situation occurs, thereby improving the self-repairing capability. Finally, if the consistency verification fails for a preset number of times, the system sends a stress test alarm notification. This design ensures that the user can be timely notified when abnormal situations occur continuously, thereby improving the effectiveness and practicality of the system. The user can discover and solve problems in a timely manner, thereby ensuring the stability and reliability of the stress test system.
[0070] Specifically, in some embodiments of the present application, the above embodiments can be input into a machine learning model type prediction by collecting stress test results, and the stress test frequency can be increased during a period when a stress test alarm may occur, to improve the stress test alarm accuracy, or the stress test frequency can be reduced during a period without an alarm, to reduce resource consumption.
[0071] It can be seen that by inputting the collected dial test results into the machine learning model for prediction, the accuracy of the dial test alarm is further improved. Specifically, the dial test frequency can be increased during the period when the dial test alarm is likely to occur, so as to more accurately detect abnormal conditions and issue alarms in a timely manner. During the period without alarm, the dial test frequency can be reduced to reduce resource consumption. By utilizing the prediction ability of the machine learning and the intelligent scheduling algorithm, a more efficient and accurate dial test monitoring and alarm system is further realized.
[0072] It can be understood that by the prediction ability of the machine learning model, abnormal conditions can be more accurately detected and alarms can be issued in a timely manner, thereby improving the accuracy of the alarms. Furthermore, according to the prediction results and actual conditions, the dial test frequency is dynamically adjusted, which can reduce unnecessary resource consumption while ensuring the accuracy of the alarms, realizing intelligent scheduling and optimization. Secondly, by the intelligent scheduling algorithm, the dial test frequency can be reduced during the period without alarm, thereby reducing resource consumption and realizing rational utilization of resources. Finally, by the prediction ability of the machine learning model and the intelligent scheduling algorithm, a more efficient and accurate dial test monitoring and alarm system can be realized, improving the performance and response capability of the entire system.
[0073] Specifically, in some embodiments of the present application, when configuring the dial test information, the type of dial test, the authentication method of dial test, the rules of dial test and the task of dial test are configured. The parsing engine, the result comparison method of dial test and the task executor are configured.
[0074] Specifically, in some embodiments of the present application, the type of dial test is to support HTTP / HTTPS request method, which can be extended to dial test of DNS, FTP and other services.
[0075] Specifically, in some embodiments of the present application, the authentication method of dial test includes supporting username / password authentication and ak / sk authentication, which can be extended to support more authentication methods.
[0076] Specifically, in some embodiments of the present application, the rules of dial test include dial test address, dial test service name, belonging network segment, whether the rule is effective, timeout time, creator, request header, request type, authentication method, request content, expected return code, expected return result, retry number, alarm group, dial test frequency, note, etc.
[0077] Specifically, in some embodiments of the present application, the task of dial test includes task number, task name, task state, dial test rule corresponding to the task, task start time, task end time, dial test return status code, dial test return content, retry number, maximum retry number.
[0078] Specifically, in some embodiments of the application, the parsing engine refers to a script or code segment that parses the return result. The field content required for content parsing can be returned from HTML, XML, JSON, plain text, etc. The parsing result can be used to match the expected result.
[0079] Specifically, in some embodiments of the application, the comparison mode of the test result is not configured, and the default test task comparison mode is set. The default mode is that the state is equal to the expected state code, and the return result is equal to the expected return result. If the expected return result is set to empty, the state code is equal, which means that the test result is consistent with the expectation. Complex test result comparison can be compared by script analysis. The return content can be parsed, and the expected result field or content can be obtained by the parsing engine, and compared with the expected result.
[0080] Specifically, in some embodiments of the application, the task executor is configured in different network environments. At least three executors are configured under each network environment. The executors need to access the test center, send heartbeat requests, obtain test tasks, and return test results.
[0081] It can be seen that by providing a user interface, the user is allowed to configure the relevant information of the stress test task, including the stress test type, the authentication method, the stress test rule and the task, etc. Through the configuration interface, the user can specify the type of stress test task, the authentication method, the rule and the task, etc. information, to realize flexible customization and management. By supporting HTTP / HTTPS request mode, it can be extended to DNS, FTP and other service stress testing. By configuring the stress test type, the user can select the corresponding stress test service to meet the needs of different scenarios. Secondly, by supporting username / password authentication and ak / sk authentication, more authentication methods can be supported. By configuring the authentication method, the user can select the corresponding authentication method to ensure the security and reliability of the stress test. At the same time, by providing the configuration function of the stress test rule, including the stress test address, the service name, the network segment, whether the rule is effective, the timeout time, the request header, the request type, the authentication method, the request content, the expected return code, the expected return result, etc. By configuring the stress test rule, the user can define the stress test behavior and the expected result that meet the actual needs. Then, by providing the configuration function of the task executor, it allows to configure the executor in different network environments. At least 3 executors are configured under each network environment, and the executor needs to access the stress test center, send a heartbeat request, get the stress test task, and return the stress test result. By configuring the task executor, distributed and high-concurrency stress test task execution can be realized. Finally, by providing the configuration function of the analysis engine and the result comparison method. The analysis engine is used to analyze the stress test return result, which can parse the required field content from HTML, XML, JSON, plain text, etc. The result comparison method can be matched and analyzed by default or script to determine whether the stress test result is consistent with the expectation. Through the analysis engine and the result comparison method, the system can accurately detect abnormal conditions and issue alarms in a timely manner.
[0082] It can be understood that by configuring the dial test information, the user can flexibly customize and manage the dial test task according to the actual needs, including dial test type, authentication method, rule and task, etc., to meet the needs in different scenarios. Secondly, by supporting HTTP / HTTPS request mode, and can be extended to DNS, FTP and other service dial test, the applicability of the system is improved. By supporting username / password authentication and ak / sk authentication and other methods, and can be extended to support more authentication methods, the security and reliability of the dial test are ensured. In addition, by defining the dial test rule, the user can clearly define the detailed requirements and expected results of each dial test task, so that the task execution is more clear and accurate. By configuring the task executor in different network environments, at least 3 executors are configured under each network environment, which can execute the dial test task in a distributed and high-concurrency manner, improving the processing capacity and efficiency of the system. Finally, the parsing engine can parse various types of return results, and can be used for comparison with the expected results, which helps to accurately detect abnormal situations and issue alarms in time, improves the intelligent level of the system, and also provides a default dial test task comparison method, and supports complex result comparison through script, making the result comparison more flexible and accurate.
[0083] Specifically, in some embodiments of the present application, when performing the dial test task according to the configured dial test information, the task type of the online task executor and the dial test task information are obtained. The type of the dial test task in the dial test task information is extracted. The execution strategy of the configured dial test task is obtained, and the dial test task and the online task executor are matched based on the type of the dial test task according to the execution strategy of the dial test task. According to the matching result, the dial test task is scheduled to the online task executor matched with the dial test task, and the task executor is controlled to perform the dial test task. The dial test result of the task executor is obtained, and the dial test result is returned to the dial test platform.
[0084] It can be seen that the task type of the online task executor and the dial test task information are obtained, the task type in the dial test task information is extracted, the execution strategy of the configured dial test task is obtained, the task is matched and scheduled according to the execution strategy, the task executor is controlled to perform the dial test task, the dial test result is obtained and returned to the dial test platform, etc. Thus, flexible dial test task execution and management are realized, the dial test task can be matched and scheduled with the appropriate online task executor according to different task types and execution strategies, thereby realizing distributed and efficient execution of the task. At the same time, by obtaining and returning the dial test result, the user or other parts of the system can conveniently analyze and process the result, and timely discover and solve the problems in the network or application program. This technical solution has high flexibility and expandability, and can be customized and extended according to actual needs.
[0085] It can be understood that by obtaining the task type of the online task executor and the task information of the stress test, the tasks can be flexibly matched and scheduled according to actual needs to meet the stress test needs in different scenarios. Secondly, by scheduling the stress test task to the online task executor matched with the task, the distributed execution of the task can be realized, the processing capacity and efficiency of the system are improved, and the load of a single executor is avoided. Subsequently, by obtaining the execution strategy of the configured stress test task, only the tasks meeting the execution strategy can be scheduled and executed, ensuring the safety and reliability of the system. At the same time, by controlling the online task executor to perform the stress test task and obtaining the stress test result of the task executor, more accurate and reliable stress test results can be obtained, facilitating the result analysis and processing of the user or other parts of the system. Further, customization and extension can be performed according to actual needs, such as adding new task types, execution strategies and task executors, etc.
[0086] Specifically, in some embodiments of the present application, the stress test return content in the stress test task execution is obtained, and the analysis result of the stress test return content is analyzed according to the stress test return content, including: establishing a stress test result string hash for the stress test result returned to the stress test platform. The string hash of the expected result and the actual result is constructed, and the consistency verification result is obtained according to the equal formula between the established stress test result string hash and the constructed string hash of the expected result and the actual result.
[0087] It can be understood that by using the string hash, the stress test result can be quickly compared with the expected result, thereby improving the detection efficiency. Secondly, since the string hash is a digest algorithm, it can convert complex strings into shorter fixed-length hash values, so the calculation amount can be significantly reduced. At the same time, by comparing the hash values according to the equal formula, it can more accurately determine whether the stress test result is consistent with the expected result, thereby improving the detection accuracy. Finally, since the hash value is fixed-length, it can be conveniently stored and tracked, thereby facilitating the monitoring and management of the stress test task execution process.
[0088] Specifically, in some embodiments of the present application, when the test result returned to the test platform is established, the test result string hash includes: given the return test result: S, the type is a string, S is composed of characters S=s1s2s3...sn, for each si is a letter, given idx(si)=ascii(si)+1, wherein ascii(si) represents the ASCII code value of the letter si. The length of the test result is obtained and the characteristics of the small change are obtained, and the natural overflow method is used to construct the test result string hash, wherein the test result string hash function is: H[i]=(H[i-1]*Base+idx(si))%MOD, wherein H represents the hash function, H[i] represents the hash value of the [0-i] string.
[0089] Specifically, in some embodiments of the present application, when the test result returned to the test platform is established, the test result string hash includes: given the return test result: S, the type is a string, S is composed of characters S=s1s2s3...sn, for each si is a letter, given idx(si)=ascii(si)+1, wherein ascii(si) represents the ASCII code value of the letter si. The length of the test result is obtained and the characteristics of the small change are obtained, and the natural overflow method is used to construct the test result string hash, wherein the test result string hash function is: H[i]=(H[i-1]*Base+idx(si))%MOD, wherein H represents the hash function, H[i] represents the hash value of the [0-i] string.
[0090] In summary, the embodiment of the present application provides a distributed service automatic test method, which can be executed for specific test tasks by configuring test information, which enhances the flexibility and customizability of the test. At the same time, during the execution of the test task, the content returned by the test is obtained, and the parsing result is parsed according to the content. Further, the test process can effectively understand and process a large amount of test data, thereby improving the data processing capability. Secondly, not only the content returned by the test is obtained and parsed, but also the parsing result of the content is consistent with the expected result. This design ensures that data anomalies can be discovered in time, thereby improving the stability and reliability of the system. Subsequently, in the consistency verification of the test result, when the verification result and the expected result are inconsistent, real-time alarm is set according to the alarm rule, and the verification efficiency is higher than that of the traditional parsing method. The returned result is constructed by using the string hash method, the time complexity of the string matching work is reduced from linear order to constant order, the alarm timeliness of the abnormal result is improved, and the interface abnormal situation is discovered in time. Finally, compared with the traditional test method, the test result can be supported for machine learning training prediction, intelligent variable interval test strategy is generated according to the prediction result, system pressure is reduced, and test alarm efficiency is further improved effectively.
[0091] As shown in Figure 2 and Figure 3 In some embodiments of the present application, an implementation device based on a method of automatic dialing test of a distributed service is also provided, comprising a configuration management module, a task scheduling module, a task execution module, a storage module and a notification module. The configuration management module is used for configuring dialing test related configurations and dialing test task management. The task scheduling module is electrically connected with the configuration management module, and the task scheduling device is used for scheduling dialing test tasks. The task execution module is electrically connected with the task scheduling module, and the task execution module is used for performing tasks according to the dialing test tasks scheduled by the task scheduling module. The storage module is electrically connected with the configuration management module and the task scheduling module respectively, and the storage module is used for storing configuration information and task, notification, result and other information. The notification module is used for sending notification information in the case of dialing test result triggering alarm.
[0092] It can be understood that the configuration management module can conveniently configure dialing test related configurations and dialing test task management, so that the device can flexibly adapt to different test requirements. Secondly, the task scheduling module can schedule dialing test tasks according to the configuration of the configuration management module, so that the device can efficiently process test tasks. At the same time, the task execution module can perform tasks according to the dialing test tasks scheduled by the task scheduling module, so that the device can accurately execute test tasks. In addition, the storage module can store configuration information and task, notification, result and other information, so that the device can conveniently trace and query the test process and result. Finally, the notification module can send notification information in the case of dialing test result triggering alarm, so that the device can timely send alarm information, which is convenient for test personnel to timely find and handle problems.
[0093] Specifically, in some embodiments of the present application, the task scheduling module is also used for selecting a suitable dialing test task execution module to execute dialing test tasks according to dialing test rules.
[0094] It can be understood that the task scheduling module can flexibly select a suitable dialing test task execution module according to the dialing test rule. Different dialing test task execution modules can be optimized and implemented for different dialing test types, authentication methods, and the like, so as to meet the dialing test task execution under different scenes and requirements. At the same time, by assigning the dialing test task to a suitable dialing test task execution module, it can be avoided that a single executor is overloaded, and the processing capacity and efficiency of the system are improved. At the same time, different execution modules can be executed in parallel, further improving the concurrent processing capacity of the system. Secondly, by modularizing the dialing test task execution module, each module is implemented and optimized for a specific dialing test task, so that the system structure is more clear and easy to maintain. At the same time, this design also facilitates the extension and addition of new functions, and reduces the coupling of the system. Finally, by selecting a suitable dialing test task execution module according to the dialing test rule, the system can more efficiently execute the dialing test task. Each execution module is optimized for a specific dialing test type and authentication method, which can complete task execution faster and improve the execution efficiency of the system.
[0095] Specifically, in some embodiments of the present application, the task execution module is also used to receive tasks scheduled by the task scheduling device, and perform task dialing in a complex network environment. The task execution module is also used to execute the dialing test task and return the dialing test result.
[0096] It can be understood that the task execution module can automatically receive tasks scheduled by the task scheduling device and automatically execute the dialing test task without human intervention, thereby improving the automation and efficiency of the system. Secondly, the task execution module performs the dialing test task in a complex network environment and returns the dialing test result, which adapts to different network environments and complex network conditions, so that the system can better meet the actual demand. In addition, by receiving and executing tasks scheduled by the task scheduling device in real time, and returning the dialing test result in real time, the system can quickly respond to and solve problems in the network or application program, thereby improving the real-time performance and response speed of the system. Finally, through the automatic execution and real-time return of the task execution module, human operation errors and mistakes can be reduced, and the reliability and stability of the system can be improved. At the same time, the system can automatically analyze and process the dialing test result, and provide more accurate and reliable monitoring and management data.
[0097] Specifically, in some embodiments of the present application, the configuration management module comprises a rule management unit, a type management unit, an authentication management unit, a task management unit, a result comparison method unit, a notification management unit, an alarm contact / group management unit, and a parsing engine management unit. The rule management unit is configured to manage the configuration of the rules of the stress test. The type management unit is configured to manage the configuration of the types of the stress test. The authentication management unit is configured to manage the authentication method of the design of the stress test. The task management unit is configured to manage the configuration of the tasks of the stress test. The result comparison method unit is configured to manage the configuration of the parsing engine of the returned results of the tasks of the stress test. The notification management unit is configured to manage the configuration of the alarm information notification. The alarm contact / group management unit is configured to manage the contacts and groups responsible for accepting the alarm information. The parsing engine management unit is configured to manage the parsing engine for parsing the returned content of the stress test.
[0098] It can be understood that, through the configuration management of each unit, different user needs and use scenarios can be more flexibly met. The rule management unit, the type management unit, the authentication management unit, the task management unit, and the like are respectively configured to manage different configuration items, so that the user can customize and configure according to own needs. Secondly, by dividing the configuration management module into multiple units, the user can more conveniently manage and operate. Each unit has a specific function and responsibility, and the user can quickly find and configure the corresponding unit according to needs, improving the management efficiency. In addition, the multi-unit and multi-module design makes the configuration management module have good expansibility. If new configuration items or functions need to be added, only the corresponding new unit or module needs to be added, without the need to make large-scale modifications and upgrades to the entire system, reducing the coupling and complexity of the system. Finally, through the authentication management unit, the authentication method of the design of the stress test is managed, which can ensure that only authorized users or groups can configure and manage the stress test tasks, improving the security and reliability of the system.
[0099] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented 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.
[0100] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0101] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0102] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0103] Finally, it should be noted that the above-mentioned embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the technical solutions of the present application. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or equivalent replaced without departing from the spirit and scope of the present application, and any modification or equivalent replacement should be covered in the protection scope of the present application.
Claims
1. A method for automatic testing of distributed services, characterized in that, include: Configure the dial-up test information and execute the dial-up test task according to the configured dial-up test information; Obtain the test return content during the execution of the test task, and parse the test return content to obtain the parsing result; A consistency check is performed between the parsed results of the test return content and the expected results of the test return content, wherein; If the parsing result of the test returned content is consistent with the expected result of the test returned content, then the parsing result of the test returned content is stored. If the parsed result of the test response is inconsistent with the expected result of the test response, the parsed result of the test response is stored, and a consistency check is performed again between the parsed result of the test response and the expected result of the test response according to the alarm policy configuration conditions. If the parsing result of the test returned is inconsistent with the expected result of the test returned, and the consistency verification reaches a preset number of times, a test alarm notification will be issued. When configuring dial-up test information, the following should be included: Configure the type of dial test, the authentication method of the dial test, the rules of the dial test, and the task of the dial test; The parsing engine, the comparison method of the test results, and the task executor are configured. When executing a dial-up test task based on the configured dial-up test information, it includes: Obtain the task type of the online task executor and the task information of the probe; Extract the type of the dialing task from the dialing task information; Obtain the configured execution strategy of the test task, and match the test task with the online task executor based on the type of the test task according to the execution strategy of the test task; Based on the matching results, the testing task is scheduled to the online task executor that successfully matches the testing task, and the task executor is controlled to perform the testing task. Obtain the test results of the task executor and return the test results to the test platform.
2. The method for automatic testing of distributed services as described in claim 1, characterized in that, When obtaining the test return content during the execution of the test task, and parsing the test return content to obtain the parsing result, the process includes: A hash of the test result string is created for the test results returned to the test platform; Construct string hashes for the expected and actual results, and obtain the consistency verification results between the constructed string hashes of the test results and the constructed string hashes of the expected and actual results according to the equality formula.
3. The method for automatic testing of distributed services as described in claim 2, characterized in that, When creating a hash of the test result string returned to the test platform, the following steps are included: Given the return test result: S, the type is string, S is composed of characters S = s1 s2 s3 ... sn, for each si is a letter, given idx(si) = ascii(si) + 1, where ascii(si) represents the ASCII code value of the letter si; The test results are characterized by limited length and small variation. The test result string hash is constructed using the natural overflow method. The hash function of the test result string is: H[i] = (H[i-1]*Base + idx(si))%MOD, where H represents the hash function and H[i] represents the hash value of the string from 0 to i.
4. The method for automatic testing of distributed services as described in claim 3, characterized in that, When constructing the string hashes of the expected and actual results, the following is included: Obtain the string hash value of the returned test result S = s1 s2 s3 ... sn, H[i], i∈[0,n], the actual result is its substring, set as S = sls2s3 ... sr, where l is the start position and r is the end position. The hash value needs to be MODed. The hash value of the actual returned result is calculated based on subH = ((H[r] - H[lr] * Base - l + 1) % MOD + MOD + 1) % MOD; Obtain the expected return result configuration in the test rules, and obtain the hash value of the expected result string according to the expected return result configuration in the test rules.
5. An apparatus for implementing the method for automatic distributed service testing as described in any one of claims 1-4, characterized in that, include: The configuration management module is used to configure probing-related settings and manage probing tasks; The task scheduling module is electrically connected to the configuration management module, and the task scheduling module is used to schedule the dial-up test tasks; The task execution module is electrically connected to the task scheduling module, and the task execution module is used to execute the test task scheduled by the task scheduling module. The storage module is electrically connected to the configuration management module and the task scheduling module respectively. The storage module is used to store configuration information and information such as tasks, notifications, and results. The notification module is used to send notification information when an alarm is triggered by the test results.
6. The apparatus for implementing the distributed service automatic testing method as described in claim 5, characterized in that, The task scheduling module is also used to select a suitable task execution module to execute the test task according to the test rules.
7. The apparatus for implementing the method of automatic distributed service testing as described in claim 6, characterized in that, The task execution module is also used to receive tasks scheduled by the task scheduling device and to perform task probing in a complex network environment. The task execution module is also used to execute probing tasks and return probing results.
8. The apparatus for implementing the method of automatic distributed service testing as described in claim 5, characterized in that, The configuration management module includes: The rule management unit is used to manage the configuration of the rules for the dialing test; A type management unit is used to manage the configuration of the dial-up test type; The authentication management unit is used to manage the authentication method of the dial-up test design. The task management unit is used to manage the configuration of the tasks being tested; The result comparison unit is used to manage the configuration of the parsing engine for the test task return results; The notification management unit is used to manage the configuration of alarm information notifications; The alarm contact / group management unit is used to manage the contacts and groups responsible for receiving alarm information; The parsing engine management unit is used to manage the parsing engine that parses the returned content of the test.
Citation Information
Patent Citations
Automatic testing method, testing terminal and communication system
CN101729681A
Filtering network quality alarm method, apparatus and device and medium
CN108206769A