A distributed dial-up monitoring method, system, electronic device, and storage medium
By using the NIO non-blocking I/O model and zero-copy technology in a distributed system, the problems of low data transmission efficiency, high latency, and high resource consumption in traditional methods are solved, achieving efficient and real-time distributed probing and monitoring, and improving server resource utilization and monitoring accuracy.
Patent Information
- Application Number
- CN202311671545.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-12-06
AI Technical Summary
Traditional performance testing methods suffer from low data transmission efficiency, high latency, and high resource consumption in distributed environments, failing to meet the requirements for high-performance, real-time, and accurate monitoring.
By adopting NIO's non-blocking I/O model and zero-copy method, connection and data read events are registered and processed through an event multiplexer. Combined with a data read thread pool and direct buffer technology, asynchronous data interaction is achieved and the number of data copies is reduced.
It improves the data transmission efficiency and performance between distributed testing nodes, reduces latency, enhances server resource utilization and monitoring accuracy, and enables timely detection of anomalies and alerts.
Smart Images

Figure CN117632683B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a distributed dialing monitoring method, system, electronic device and storage medium. Background Technology
[0002] Performance testing is crucial for evaluating the capabilities and limitations of various systems and applications. Traditional performance testing methods typically employ blocking I / O and data copying for data interaction, which can lead to performance bottlenecks and increased latency in distributed environments. This approach is no longer sufficient to meet the demands for high-performance, real-time, and accurate monitoring. The problems faced by traditional monitoring methods include the following:
[0003] (1) Inefficient data transmission: Traditional methods may require multiple data copies during data transmission, from the disk to the memory buffer and then to the network buffer, resulting in low data transmission efficiency.
[0004] (2) High latency: In traditional methods, the use of blocking I / O models may lead to thread blocking, thereby increasing the latency of data transmission. In a distributed environment, since data needs to be transmitted between multiple nodes, the latency problem of traditional methods is particularly obvious.
[0005] (3) High resource consumption of data interaction between testing node systems: Data interaction between traditional distributed testing node systems consumes a lot of system resources, affecting the operation of normal testing and monitoring tasks.
[0006] In summary, traditional monitoring methods suffer from problems such as high latency, low concurrency efficiency, and high resource consumption. Summary of the Invention
[0007] The main purpose of this application is to propose a real-time, efficient, and high-performance distributed dial-up monitoring method, system, electronic device, and storage medium.
[0008] To achieve the above objectives, one aspect of this application proposes a distributed dial-up monitoring method, the method comprising:
[0009] When a test request node initiates a test, it registers the test request connection event with the connection request event multiplexer to obtain the first event set;
[0010] The first connection event is determined by polling the first event set through the connection request event multiplexer;
[0011] Register the first connection event to the data read event multiplexer to obtain the second event set;
[0012] The second event set is polled by the data read event multiplexer to determine ready data read events;
[0013] Based on the zero-copy method, the test response data is read through the data reading thread pool according to the ready data read event;
[0014] The dial test response data is encapsulated, and a data analysis and processing module connection event is created based on the encapsulated dial test response data.
[0015] The data analysis and processing module connection event is registered to the connection request event multiplexer to obtain a third event set;
[0016] The connection request event multiplexer polls the third event set to determine the ready data analysis and processing module connection events.
[0017] Based on the ready data analysis and processing module connection event, the dial-up response data is sent to the data analysis and processing module;
[0018] The data analysis and processing module performs data analysis and processing on the dialing response data to obtain data analysis results.
[0019] In some embodiments, determining the first connection event by polling the first event set through the connection request event multiplexer includes:
[0020] Poll the first event set and determine the connected test request connection event as the first connection event.
[0021] In some embodiments, after determining the first connection event, the current time and the connection start time of the first connection event are obtained; the connection time of the first connection event is calculated based on the current time and the connection start time; wherein the connection time is used as one of the dial-up response data.
[0022] In some embodiments, the zero-copy method, based on the ready data read event, reads the probing response data through a data read thread pool, including:
[0023] Create a data reading thread pool and a direct buffer type object, and create a thread task class object to read the dial response data;
[0024] Based on the ready data read event, the thread task class object is submitted to the data read thread pool for asynchronous execution;
[0025] The dial response data is read into the direct buffer using the read function of the direct buffer type object.
[0026] In some embodiments, the step of performing data analysis and processing on the dial-up response data through the data analysis and processing module to obtain data analysis results includes:
[0027] The connection request monitoring event is registered to the connection request event multiplexer to obtain the fourth event set; wherein, the connection request monitoring event is used to monitor the dialing test results sent by the dialing test target node;
[0028] The fourth event set is polled by the connection request event multiplexer to determine the ready listening connection request event;
[0029] Based on the ready listening connection request event, a dial test result read event is generated, and the dial test result read event is registered to the data read event multiplexer to obtain the fifth event set;
[0030] The fifth event set of results is polled by the data read event multiplexer to determine the ready test result read event;
[0031] Based on the zero-copy method, the test results are read through the data reading thread pool according to the ready test results reading event.
[0032] The test results are analyzed and processed to obtain data analysis results.
[0033] In some embodiments, the method further includes:
[0034] Receive and save the dialing information of the dialing objects to be monitored;
[0035] When the test information is updated, the test information is resent to the test request node.
[0036] In some embodiments, the method further includes:
[0037] An alarm is triggered for the test objects whose data analysis results show abnormalities.
[0038] To achieve the above objectives, another aspect of this application proposes a distributed dial-up monitoring system, the system comprising:
[0039] The first module is used to register the dial test request connection event to the connection request event multiplexer when the dial test request node initiates dial test, so as to obtain the first event set;
[0040] The second module is used to poll the first event set through the connection request event multiplexer to determine the first connection event;
[0041] The third module is used to register the first connection event to the data read event multiplexer to obtain the second event set;
[0042] The fourth module is used to poll the second event set through the data read event multiplexer to determine ready data read events;
[0043] The fifth module is used to read the test response data through the data reading thread pool based on the ready data read event using the zero-copy method.
[0044] The sixth module is used to encapsulate the dial test response data and create a data analysis and processing module connection event based on the encapsulated dial test response data.
[0045] The seventh module is used to register the connection events of the data analysis and processing module to the connection request event multiplexer to obtain the third event set;
[0046] The eighth module is used to poll the third event set through the connection request event multiplexer to determine the ready data analysis and processing module connection events;
[0047] The ninth module is used to send the dial-up response data to the data analysis and processing module based on the ready data analysis and processing module connection event;
[0048] The data analysis and processing module is used to perform data analysis and processing on the dialing response data to obtain data analysis results.
[0049] It should be noted that, in some embodiments, the system may further include at least one of the following modules:
[0050] The central node management module is used to receive and save the testing information of the testing objects to be monitored; when the testing information is updated, the testing information is resent to the testing request node.
[0051] The alarm module is used to process alarms for test objects whose data analysis results show abnormalities.
[0052] To achieve the above objectives, another aspect of the embodiments of this application provides an electronic device, including: a processor and a memory; the memory is used to store a program; the processor executes the program to implement the method described above.
[0053] To achieve the above objectives, another aspect of the embodiments of this application provides a computer storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the methods described above.
[0054] The embodiments of this application include at least the following beneficial effects: This application provides a distributed dial-up monitoring method, system, electronic device, and storage medium. This solution can achieve asynchronous data interaction by registering events to an event multiplexer and polling to determine the specific process of the events, thereby improving thread blocking and resource waste. By using a zero-copy method for data reading, the number of data copies in the distributed dial-up monitoring process can be reduced, thereby improving the data transmission efficiency and performance between dial-up nodes, reducing latency, and achieving the beneficial effects of real-time efficiency. Attached Figure Description
[0055] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0056] Figure 1 This is a flowchart of the distributed dial-up monitoring method provided in the embodiments of this application;
[0057] Figure 2 yes Figure 1 The flowchart of step S102 in the document;
[0058] Figure 3 yes Figure 1 The flowchart of step S105 in the process;
[0059] Figure 4 yes Figure 1 The flowchart of step S110 in the middle;
[0060] Figure 5 This is a flowchart of step S120 provided in the embodiments of this application;
[0061] Figure 6 This is a flowchart of step S130 provided in the embodiments of this application;
[0062] Figure 7 This is a data processing flowchart of the central node management module and the test node module provided in the embodiments of this application;
[0063] Figure 8 This is a data processing flowchart of the data processing and analysis module provided in the embodiments of this application;
[0064] Figure 9 This is a schematic diagram of one implementation of the distributed dial-up monitoring system provided in this application.
[0065] Figure 10 This is a schematic diagram of another implementation of the distributed dial-up monitoring system provided in this application;
[0066] Figure 11This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0068] Although functional modules are divided in the system diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S101," "second / S102," etc., in the specification, claims, and the aforementioned figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0069] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0070] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0071] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0073] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0074] (1) NIO: Synchronous Non-blocking IO, where IO represents input and output;
[0075] (2) Zero-copy: The CPU does not need to consume resources for copying data between memory. The main technologies used to achieve zero-copy are DMA data transfer technology and memory region mapping technology.
[0076] (3) Reactor pattern: The Reactor pattern or Responder pattern is an event-driven design pattern.
[0077] (4) Event Multiplexer: Its more detailed full name is Event Reactor Thread Multiplexer. In this application embodiment, a connection request event multiplexer and a data read event multiplexer are involved; wherein, the connection request event multiplexer, that is, the Reactor thread multiplexer for connection events, is used to register each connection event and perform polling and distribution processing on the corresponding connection events; the data read event multiplexer, that is, the Reactor thread multiplexer for data read events, is used to register data read events and perform polling and distribution processing on the corresponding data read events.
[0078] (5) HTTP (Hypertext Transfer Protocol): Hypertext Transfer Protocol.
[0079] (6) DirectByteBuffer: Direct buffer, or direct memory.
[0080] Traditional monitoring methods suffer from problems such as low system efficiency, high latency, low concurrency efficiency, and high resource consumption. In view of this, this application provides a distributed dial-up testing monitoring method, system, electronic device, and storage medium. This solution uses the NIO non-blocking I / O model and zero-copy method to monitor and manage each node object and data transmission process in distributed dial-up testing, which helps improve server resource utilization, reduce data transmission latency, and improve the accuracy of performance measurements.
[0081] The distributed dial-up testing and monitoring method provided in this application relates to the field of computer technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited thereto. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the distributed dial-up testing and monitoring method, but is not limited to the above forms.
[0082] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0083] Figure 1 This is an optional flowchart of the distributed dial-up monitoring method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S110.
[0084] S101. When a test request node initiates a test, it registers the test request connection event with the connection request event multiplexer to obtain the first event set.
[0085] S102. Poll the first event set through the connection request event multiplexer to determine the first connection event.
[0086] S103. Register the first connection event to the data read event multiplexer to obtain the second event set.
[0087] S104. Poll the second event set through the data read event multiplexer to determine the ready data read event.
[0088] S105. Based on the zero-copy method, according to the ready data read event, read the dial-up response data through the data read thread pool.
[0089] S106. Encapsulate the dial test response data and create a data analysis and processing module connection event based on the encapsulated dial test response data.
[0090] S107. Register the data analysis and processing module connection event to the connection request event multiplexer to obtain a third event set.
[0091] S108. Poll the third event set through the connection request event multiplexer to determine the ready data analysis and processing module connection event.
[0092] S109. Based on the ready data analysis and processing module connection event, send the dial-up response data to the data analysis and processing module.
[0093] S110. The data analysis and processing module performs data analysis and processing on the dialing response data to obtain data analysis results.
[0094] Steps S101 to S110 shown in this embodiment employ a non-blocking I / O model of NIO to generate corresponding events based on the connection and data reading process of distributed probing. These events are then distributed and executed through polling multiplexers, enabling asynchronous data interaction and significantly reducing thread blocking and resource waste. Furthermore, by using a zero-copy method, this embodiment also reduces the number of data copies during distributed probing monitoring, thereby improving the efficiency and performance of data transmission between probing nodes and further enhancing server resource utilization.
[0095] Please see Figure 2 In some embodiments, step S102 may include, but is not limited to, step S201.
[0096] S201. Poll the first event set and determine the connected dial-up test request connection event as the first connection event.
[0097] In step S201 of some embodiments, after determining the first connection event, the current time and the connection start time of the first connection event can be further obtained; the connection time of the first connection event is calculated based on the current time and the connection start time; wherein, the connection time is used as one of the probe response data. Taking the JAVA language implementation as an example, the connection start time stored in the attachment attribute of SelectionKey can be read, and the connection time between the probe node and the probe object (i.e., the monitoring object) can be calculated in combination with the current time.
[0098] Calculating connection time based on the current time and the connection start time of the first connection event allows for a more accurate calculation of connection time, providing a numerical basis for subsequent data analysis and processing.
[0099] In step S201 of some embodiments, the Reactor thread multiplexer for connection events (i.e., the connection request event multiplexer) will poll all the probe connection events registered therein, return the connected probe connection events and obtain the current time and the connection start time of the probe connection event; calculate the connection time based on the current time and the connection start time, and distribute the probe connection events to the Reactor thread multiplexer for data read events.
[0100] Step S102 in this embodiment polls the first event set and determines the connected test request event, which is beneficial for further processing of the test request.
[0101] Please see Figure 3 In some embodiments, step S105 may include, but is not limited to, the following steps S301 to S303.
[0102] S301. Create a data reading thread pool and a direct buffer type object, and create a thread task class object for reading the dial-up response data.
[0103] S302. Based on the ready data read event, submit the thread task class object to the data read thread pool for asynchronous execution.
[0104] S303. The dial response data is read into the direct buffer using the read function of the direct buffer type object.
[0105] In step S301 of some embodiments, taking the implementation in JAVA language as an example, a data reading thread pool can be created using the ThreadPoolExecute class in JAVA language, and then an object of the thread task class DataReadTask for reading dial-up response data can be created. When the DataReadTask task class is created, it receives the ready event clientChannel parameter.
[0106] In step S302 of some embodiments, the DataReadTask task class is submitted to the data read thread pool for asynchronous execution based on the ready data read event.
[0107] In step S303 of some embodiments, the run() method in the DateReadTask task class is used to implement the creation of a DirectByteBuffer type object buffer (a direct memory object in JAVA) using the allocateDirect() method in the ByteBuffer class, and clientChannel.read(buffer) is used to directly read the dial-up response data into direct memory, thereby realizing the application of zero-copy technology.
[0108] Step S105 of this embodiment performs asynchronous data reading based on a zero-copy method, which can read the response data of the receiving and processing test node object more quickly.
[0109] Please see Figure 4 In some embodiments, step S110 may include, but is not limited to, the following steps S401 to S406.
[0110] S401. Register the listening connection request event to the connection request event multiplexer to obtain the fourth event set; wherein, the listening connection request event is used to listen to the dialing test results sent by the dialing test target node.
[0111] S402. Poll the fourth event set through the connection request event multiplexer to determine the ready listening connection request event.
[0112] S403. Based on the ready listening connection request event, generate a dial test result read event, and register the dial test result read event to the data read event multiplexer to obtain the fifth event set.
[0113] S404. Poll the fifth event set of results through the data read event multiplexer to determine the ready test result read event.
[0114] S405. Based on the zero-copy method, according to the ready test result read event, the test result is read through the data read thread pool.
[0115] S406. Perform result analysis and processing on the dialing test results to obtain data analysis results.
[0116] In step S401 of some embodiments, the Reactor thread multiplexer of the connection event is used to register a connection request for listening to the test results sent by the test node.
[0117] In steps S402 to S403 of some embodiments, after the Reactor thread multiplexer of the connection event polls for a ready test result read event, it connects the test results sent by the test node to generate a read event, registers it to the Reactor thread multiplexer of the data read event, and obtains the fifth event set.
[0118] In step S404 of some embodiments, the Reactor thread multiplexer of the data read event polls the registered data read events and returns ready probing result read events, which are then handed over to the data read thread pool to read the probing result data.
[0119] In step S405 of some embodiments, the data read thread pool uses a zero-copy method similar to that described in step S105 to asynchronously read the data of the probing results based on the read event of the ready probing results.
[0120] In step S406 of some embodiments, the test result data sent by the test node is analyzed and processed.
[0121] Step S110 of this embodiment is based on the idea of NIO synchronous non-blocking model. It uses NIO and master-slave Reactor multi-threaded mode to achieve faster response to the test result request initiated by the test node, and uses zero copy method to improve the reading, receiving and processing speed of the data analysis and processing module for the test data results sent by a large number of test nodes.
[0122] Please see Figure 5 The distributed dialing monitoring method of this application embodiment may further include the following step S120.
[0123] S120. Receive and save the testing information of the testing object to be monitored; when the testing information is updated, resend the testing information to the testing request node.
[0124] Saving test information and resending it when there are updates (including but not limited to additions, deletions, modifications, etc.) can reduce unnecessary information transmission, improve monitoring efficiency, and reduce resource consumption.
[0125] Please see Figure 6 The distributed dialing monitoring method of this application embodiment may further include the following step S130.
[0126] S130. Issue an alarm for the test object whose data analysis results show abnormalities.
[0127] The monitoring process of this application is highly efficient and performs well. It can accurately monitor the anomalies of the test object and handle alarms for the test object, which helps the test object to make timely adjustments and reduce the losses caused by the anomalies.
[0128] The following section provides a detailed description and explanation of the solutions in the embodiments of this application, using specific application examples:
[0129] This application provides a distributed dial-up testing and monitoring method, which can be applied to distributed dial-up testing and monitoring scenarios for system performance testing. (Refer to...) Figure 7 A central node management module, a test node module, and a data analysis and processing module can be constructed to implement the method of the embodiments of this application.
[0130] The central node management module is used to receive and store persistent testing information of the objects that users need to monitor. When the testing information is updated (including but not limited to addition, deletion, modification, etc.), the new testing information is sent to the testing request node.
[0131] In the test node module, the test requests are mainly processed in the master-slave Reactor multi-threaded test initiation module as follows:
[0132] (1) Use the Reactor thread multiplexer of the connection event to register the dial test request connection event with the Reactor thread multiplexer of the connection event when the dial test is initiated.
[0133] (2) The Reactor thread multiplexer for connection events will poll all the connection events registered therein, return the connected test connection events and get the connection start time and current time, calculate the connection time, and distribute the test connection events to the Reactor thread multiplexer for data read events.
[0134] (3) The Reactor thread multiplexer for data read events will poll the registered read events and return ready test response data read events, which will be handed over to the data read thread pool to perform the task of reading test response data.
[0135] (4) The data reading thread pool uses DirectByteBuffer to implement zero-copy technology and asynchronously reads dial-up response data. —A thread pool is created using the ThreadPoolExecutor class in Java, and an object of the DataReadTask class is created to read the dial-up response data. This DataReadTask class receives the ready event clientChannel parameter upon creation. The DataReadTask class is then submitted to the thread pool for asynchronous execution. In the run() method implementation of the DataReadTask class, the allocateDirect() method of the ByteBuffer class is used to create a DirectByteBuffer type object buffer (a direct memory object in Java). clientChannel.read(buffer) is used to directly read the dial-up response data into direct memory, thus implementing zero-copy technology.
[0136] (5) After performing preliminary processing and encapsulation on the dial-up response data, create an event to connect to the data analysis and processing module, register it with the Reactor thread multiplexer of the connection event, and send the pre-processed and encapsulated dial-up response data to the data analysis and processing module.
[0137] (6) After the Reactor thread multiplexer of the connection event polls for the ready connection data analysis and processing module event, it returns the ready connection data analysis and processing module event connection and registers it with the Reactor thread multiplexer of the data sending event.
[0138] (7) When the Reactor thread multiplexer of the data sending event polls for a ready dial response data sending event, it hands it over to the sending worker thread pool to perform the sending work.
[0139] (8) The data sending thread pool uses the `allocateDirect()` method of `ByteBuffer` to create a `DirectByteBuffer`. Data is written to the `DirectByteBuffer`, and its underlying address is obtained using the `address()` method. This underlying address is then passed to the underlying network library or the operating system's sending method to achieve zero-copy, and the data is sent to the data analysis and processing module.
[0140] In addition, caching technology can be used to configure relevant monitoring information of the test object in the test node module, which can reduce unnecessary data interaction between the test object and the central node module.
[0141] Reference Figure 8The data analysis and processing module also primarily uses a master-slave Reactor multi-threaded probing module model. However, it differs from the master-slave Reactor multi-threaded probing module in the registration of events, the data read, and the processing of that data. Specifically, the data analysis and processing module performs processes including, but not limited to, the following:
[0142] (1) Use the Reactor thread multiplexer of the connection event to register with it to listen for connection requests for the test results sent by the test node.
[0143] (2) After the Reactor thread multiplexer of the connection event polls for a ready test result connection, it registers the test result connection generated by the test node to the Reactor thread multiplexer of the data read event.
[0144] (3) The Reactor thread multiplexer of the data read event polls the registered data read events and returns ready test result data read events, which are then handed over to the data read thread pool to perform the task of reading test result data.
[0145] (4) The data reading thread pool uses DirectByteBuffer to implement zero-copy technology and asynchronously reads the test results data.
[0146] (5) Analyze and process the test result data sent by the test node, and issue alarms for abnormal test objects that require alarms.
[0147] Please see Figure 9 This application also provides a distributed dial-up monitoring system, which includes:
[0148] The first module is used to register the dial test request connection event to the connection request event multiplexer when the dial test request node initiates dial test, so as to obtain the first event set;
[0149] The second module is used to poll the first event set through the connection request event multiplexer to determine the first connection event;
[0150] The third module is used to register the first connection event to the data read event multiplexer to obtain the second event set;
[0151] The fourth module is used to poll the second event set through the data read event multiplexer to determine ready data read events;
[0152] The fifth module is used to read the test response data through the data reading thread pool based on the ready data read event using the zero-copy method.
[0153] The sixth module is used to encapsulate the dial test response data and create a data analysis and processing module connection event based on the encapsulated dial test response data.
[0154] The seventh module is used to register the connection events of the data analysis and processing module to the connection request event multiplexer to obtain the third event set;
[0155] The eighth module is used to poll the third event set through the connection request event multiplexer to determine the ready data analysis and processing module connection events;
[0156] The ninth module is used to send the dial-up response data to the data analysis and processing module based on the ready data analysis and processing module connection event;
[0157] The data analysis and processing module is used to perform data analysis and processing on the dialing response data to obtain data analysis results.
[0158] It should be noted that, in some embodiments, the system may further include at least one of the following modules:
[0159] The central node management module is used to receive and save the testing information of the testing objects to be monitored; when the testing information is updated, the testing information is resent to the testing request node.
[0160] The alarm module is used to process alarms for test objects whose data analysis results show abnormalities.
[0161] It should be further explained that, referring to Figure 10 This is another implementation of the system embodiment. The first to ninth modules of the system described above can be integrated and encapsulated into the master-slave Reactor multi-threaded dialing initiation module in the dialing node module described above.
[0162] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0163] Please see Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0164] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0165] The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the distributed dialing monitoring method of the embodiments of this application.
[0166] The input / output interface 903 is used to implement information input and output;
[0167] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0168] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0169] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0170] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described distributed dialing and monitoring method.
[0171] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0172] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0173] The distributed dialing and monitoring method, system, electronic device, and storage medium provided in this application have, in general, the following beneficial effects, including but not limited to:
[0174] 1. Improved Server Resource Utilization: Traditional blocking I / O models require waiting for data to arrive or be sent before processing I / O operations. In contrast, the non-blocking I / O model of this application's NIO embodiment enables asynchronous data interaction, avoiding thread blocking and resource waste. Combined with zero-copy technology, it reduces the number of data copies, thereby improving the efficiency and performance of data transmission between nodes and further enhancing server resource utilization.
[0175] 2. Reduce latency: By adopting NIO's synchronous non-blocking I / O and zero-copy technology, the embodiments of this application can reduce intermediate steps and copy operations in the data transmission process, thereby reducing latency, improving the timeliness of monitoring the monitored objects, and timely detecting system faults.
[0176] 3. More Accurate Performance Measurement: The method in this application employs NIO synchronous non-blocking and zero-copy methods in many places, combined with a master-slave Reactor multi-threaded mode, to avoid the impact of system IO blocking and other resource consumption factors on the accuracy of the test results. By parsing and processing the transmitted data, various performance indicators, such as response time and throughput, can be calculated and recorded in conjunction with other custom data processors and measurement algorithms, providing an accurate measurement and analysis basis for performance testing.
[0177] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0178] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0179] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0180] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0181] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0182] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0183] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0184] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0185] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0186] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0187] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A distributed dial-up monitoring method, characterized in that, include: When a test request node initiates a test, it registers the test request connection event with the connection request event multiplexer to obtain the first event set; The first connection event is determined by polling the first event set through the connection request event multiplexer; Register the first connection event to the data read event multiplexer to obtain the second event set; The second event set is polled by the data read event multiplexer to determine ready data read events; Based on the zero-copy method, the test response data is read through the data reading thread pool according to the ready data read event; The dial test response data is encapsulated, and a data analysis and processing module connection event is created based on the encapsulated dial test response data. Register the data analysis and processing module connection event to the connection request event multiplexer to obtain a third event set; The connection request event multiplexer polls the third event set to determine the ready data analysis and processing module connection events. Based on the ready data analysis and processing module connection event, the dial-up response data is sent to the data analysis and processing module; The data analysis and processing module performs data analysis and processing on the dialing response data to obtain data analysis results.
2. The distributed dial-up monitoring method according to claim 1, characterized in that, The step of polling the first event set through the connection request event multiplexer to determine the first connection event includes: Poll the first event set and determine the connected test request connection event as the first connection event.
3. A distributed dialing monitoring method according to claim 1 or 2, characterized in that, After determining the first connection event, the current time and the connection start time of the first connection event are obtained; the connection time of the first connection event is calculated based on the current time and the connection start time; wherein, the connection time is used as one of the dial-up response data.
4. The distributed dial-up monitoring method according to claim 1, characterized in that, The zero-copy-based method, based on the ready data read event, reads the probing response data through a data read thread pool, including: Create a data reading thread pool and a direct buffer type object, and create a thread task class object to read the dial response data; Based on the ready data read event, the thread task class object is submitted to the data read thread pool for asynchronous execution; The dial response data is read into the direct buffer using the read function of the direct buffer type object.
5. The distributed dial-up monitoring method according to claim 1, characterized in that, The process of analyzing and processing the dial-up response data through the data analysis and processing module to obtain data analysis results includes: The connection request listening event is registered to the connection request event multiplexer to obtain the fourth event set; wherein, the connection request listening event is used to listen for the test results sent by the test target node; The fourth event set is polled by the connection request event multiplexer to determine the ready listening connection request event; Based on the ready listening connection request event, a dial test result read event is generated, and the dial test result read event is registered to the data read event multiplexer to obtain the fifth event set; The fifth event set of results is polled by the data read event multiplexer to determine the ready test result read event; Based on the zero-copy method, the test results are read through the data reading thread pool according to the ready test results reading event. The test results are analyzed and processed to obtain data analysis results.
6. The distributed dial-up monitoring method according to claim 1, characterized in that, The method further includes: Receive the dialing information of the dialing object to be monitored, and save the dialing information to the database; When the test information is updated, the test information is resent to the test request node.
7. The distributed dial-up monitoring method according to claim 1, characterized in that, The method further includes: An alarm is triggered for the test objects whose data analysis results show abnormalities.
8. A distributed dial-up monitoring system, characterized in that, include: The first module is used to register the dial test request connection event to the connection request event multiplexer when the dial test request node initiates dial test, so as to obtain the first event set; The second module is used to poll the first event set through the connection request event multiplexer to determine the first connection event; The third module is used to register the first connection event to the data read event multiplexer to obtain the second event set; The fourth module is used to poll the second event set through the data read event multiplexer to determine ready data read events; The fifth module is used to read the test response data through the data reading thread pool based on the ready data read event using the zero-copy method. The sixth module is used to encapsulate the dial test response data and create a data analysis and processing module connection event based on the encapsulated dial test response data. The seventh module is used to register the connection events of the data analysis and processing module to the connection request event multiplexer to obtain the third event set; The eighth module is used to poll the third event set through the connection request event multiplexer to determine the ready data analysis and processing module connection events; The ninth module is used to send the dial-up response data to the data analysis and processing module based on the ready data analysis and processing module connection event; The data analysis and processing module is used to perform data analysis and processing on the dialing response data to obtain data analysis results.
9. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 7.
10. A computer storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
SSL (Secure Sockets Layer) nonblocking communication method and server therefor
CN102811201A
System and method for supporting work sharing muxing in a cluster
CN104769553A