Method, device, equipment and computer-readable medium for testing communication between virtual machines
Through the inter-VM communication testing method, the problem of real-time communication between real-time operating systems in the prior art is solved, and the security of industrial application scenarios is improved.
Patent Information
- Application Number
- CN202211573435.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-12-08
AI Technical Summary
The prior art lacks a method to determine the real-time communication between different real-time operating systems, which leads to the inability of industrial networks to meet the real-time requirements of operating systems, thereby reducing the security of industrial application scenarios.
Through the communication testing method between virtual machines, communication modules are used to establish a communication connection with the virtual machine to provide testing, data packets are sent and communication information is recorded, communication jitter and delay are determined, and communication test information is generated to evaluate the real-time communication between virtual machines.
This method can effectively determine the real-time communication between different real-time operating systems, improve the security of industrial application scenarios, and ensure that the operating system meets the real-time requirements of industrial networks.
Smart Images

Figure CN116192709B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, apparatus, device, and computer-readable medium for testing communication between virtual machines. Background Art
[0002] Industrial-grade virtualized real-time operating systems can host multiple real-time operating systems. These different real-time operating systems are hosted in different virtual machines. Different real-time operating systems can communicate through virtual networks. How to determine the real-time performance of communication between different real-time operating systems has become an important research topic. At present, there is a lack of methods to determine the real-time performance of communication between different real-time operating systems.
[0003] However, due to the lack of methods to determine the real-time nature of communication between different real-time operating systems, the following technical problems often occur:
[0004] Industrial networks have high requirements for the real-time performance of operating systems. If real-time testing cannot be performed, it will be impossible to determine whether the real-time performance of the real-time operating system meets the needs of industrial application scenarios, which will lead to lower security of industrial application scenarios. Summary of the invention
[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0006] Some embodiments of the present disclosure propose a method, apparatus, electronic device, computer-readable medium, and computer program product for testing communication between virtual machines to solve one or more of the technical problems mentioned in the above background technology section.
[0007] In a first aspect, some embodiments of the present disclosure provide a method for testing communication between virtual machines, the method comprising: establishing a communication connection with a test virtual machine through the communication module; sending data packets to the test virtual machine through the test module according to a preset number of packet sending times, and recording the sent data through the data recording module; determining a sending data set based on at least one sending data recorded by the data recording module; and generating communication test information based on the sending data set.
[0008] In a second aspect, some embodiments of the present disclosure provide a device for testing communication between virtual machines, the device comprising: a communication connection establishing unit, configured to establish a communication connection with the configured virtual machine through the above-mentioned communication module; a sending unit, configured to send data packets to the above-mentioned configured virtual machine through the above-mentioned test module according to a preset number of packet sending times, and to record the sent data through the above-mentioned data recording module; a determination unit, configured to determine a sending data set according to at least one sending data recorded by the above-mentioned data recording module; and a generation unit, configured to generate communication test information according to the above-mentioned sending data set.
[0009] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.
[0010] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.
[0011] In a fifth aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner of the above-mentioned first aspect when executed by a processor.
[0012] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the inter-virtual machine communication test method of some embodiments of the present disclosure, the real-time communication between different real-time operating systems is determined, and the security of industrial application scenarios is improved. Specifically, the reason for the low security of industrial application scenarios is that the industrial network has high requirements for the real-time performance of the operating system. If the real-time performance test cannot be performed, it will be impossible to determine whether the real-time performance of the real-time operating system meets the requirements of the industrial application scenario, thereby resulting in low security of the industrial application scenario. Based on this, the inter-virtual machine communication test method of some embodiments of the present disclosure, first, establishes a communication connection with the configuration virtual machine through the above-mentioned communication module. Thus, the communication test information between the test virtual machine and the configuration virtual machine can be determined. Secondly, according to the preset number of packet transmissions, the above-mentioned test module sends a data packet to the above-mentioned configuration virtual machine, and the above-mentioned data recording module records the transmission data. Thus, a data packet can be sent to the configuration virtual machine, and the communication information when the data packet is sent can be recorded. Then, according to at least one transmission data recorded by the above-mentioned data recording module, a transmission data set is determined. Thus, the communication jitter and communication delay between the test virtual machine and the configuration virtual machine can be determined. Finally, according to the above-mentioned transmission data set, communication test information is generated. Thus, the communication test information between the test virtual machine and the configuration test virtual machine is determined, and whether the real-time performance of the real-time operating system meets the requirements of the industrial application scenario is determined, thereby improving the security of the industrial application scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0014] Figure 1 is a schematic diagram of an application scenario of the inter-virtual machine communication testing method of some embodiments of the present disclosure;
[0015] Figure 2 is a flow chart of some embodiments of the inter-virtual machine communication testing method according to the present disclosure;
[0016] Figure 3 is a schematic diagram of the structure of some embodiments of the inter-virtual machine communication testing device according to the present disclosure;
[0017] Figure 4 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0019] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0020] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0021] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0023] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0024] Figure 1 It is a schematic diagram of an application scenario of the inter-virtual machine communication testing method of some embodiments of the present disclosure.
[0025] exist Figure 1 In the application scenario, first, the test virtual machine 101 establishes a communication connection with the test virtual machine 105 through the communication module 102; secondly, the test virtual machine 101 sends a data packet to the test virtual machine 105 through the test module 104 according to a preset number of packet sending times, and records the sent data through the data recording module 103; then, the test virtual machine 101 determines a sending data set according to at least one sending data recorded by the data recording module 103; finally, the test virtual machine 101 generates communication test information according to the sending data set.
[0026] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.
[0027] It should be understood that Figure 1 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.
[0028] Figure 2 The process 200 of some embodiments of the inter-virtual machine communication test method according to the present disclosure is shown. The inter-virtual machine communication test method includes the following steps:
[0029] Step 201: Establish a communication connection with a configuration virtual machine through a communication module.
[0030] In some embodiments, the execution subject (eg, Figure 1 The test virtual machine 101 shown can establish a communication connection with the test virtual machine through the communication module. In practice, the execution subject can establish a communication connection with the test virtual machine through the transceiver function driven by the virtual network (VNet, Virtual Network) included in the communication module. Among them, the execution subject can be a test virtual machine. The test virtual machine can be a virtual machine that needs to perform a communication test. The test virtual machine can be a virtual machine that cooperates with the test virtual machine to perform a communication test. Both the test virtual machine and the test virtual machine have a network tester. The network tester can include a communication module, a test module and a data recording module. The communication module can be a module for communication between virtual machines. The communication module includes a communication receiving function and a communication sending function. The communication receiving function is used to receive a data packet sent by an associated terminal or virtual machine. The communication sending function is used to send a data packet to an associated terminal or virtual machine. The test module can be a module for testing the communication jitter between different real-time operating systems carried by an industrial-grade virtualized real-time operating system. The data recording module can be a module for counting the communication jitter test results between different real-time operating systems. The test virtual machine and the configuration virtual machine may be virtual machines in the industrial-grade virtualized real-time operating system. For example, the industrial-grade virtualized real-time operating system may be an Intewell system.
[0031] Optionally, before step 202, a test mutex is created according to preset configuration information.
[0032] In some embodiments, the execution subject may create a test mutex according to preset configuration information, wherein the preset configuration information may be pre-set configuration information of the test mutex.
[0033] Optionally, before step 202, the test mutex is added to the communication module, so that the test mutex is adapted to the communication receiving function and the communication sending function included in the communication module.
[0034] In some embodiments, the execution entity may add the test mutex to the communication module so that the test mutex adapts to the communication receiving function and the communication sending function included in the communication module.
[0035] Step 202: according to a preset number of packet transmission times, a data packet is transmitted to the configured virtual machine through the test module, and the transmitted data is recorded through the data recording module.
[0036] In some embodiments, the execution subject may send a data packet to the test virtual machine through the test module according to a preset number of packet sending times, and record the sent data through the data recording module. The preset number of packet sending times may be a preset number of times that a data packet needs to be sent to the test virtual machine. For example, the preset number of packet sending times may be 10.
[0037] In practice, the execution subject may send a data packet to the configuration virtual machine through the following steps:
[0038] The first step is to perform the following processing steps based on the above-mentioned preset number of packet transmissions and the pre-acquired data packets:
[0039] The first processing step is to send the data packet to the test virtual machine through the test module and generate a first timestamp. The first timestamp may be a timestamp used to represent the time point when the test virtual machine sends the data packet. The timestamp may be a complete and verifiable data that indicates that a piece of data existed before a specific time, usually a character sequence.
[0040] The second processing step is to update the initial value of the number of packet transmissions and generate a second timestamp in response to the test virtual machine receiving the data packet. In practice, in response to receiving the data packet sent by the test virtual machine, the test virtual machine can control the included test module to block packet reception and return the data packet to the test virtual machine. The initial value of the number of packet transmissions is initially 0. The second timestamp can represent the time point when the data packet is received. As an example, in response to the initial value of the number of packet transmissions being 0 and the test virtual machine receiving the data packet, the initial value of the number of packet transmissions can be updated to 1.
[0041] The third processing step is to generate transmission data according to the first timestamp and the second timestamp, and to send the transmission data to the data recording module. In practice, the duration between the time point represented by the second timestamp and the time point represented by the first timestamp can be determined as the transmission data. Here, the state of the data recording module included in the configuration virtual machine is disabled.
[0042] The fourth processing step is to execute the above processing step again in response to the initial value of the number of packet sending times being less than the preset number of packet sending times.
[0043] The second step is to send a stop receiving message to the data recording module in response to the initial value of the number of packet transmissions being equal to the preset number of packet transmissions. The stop receiving message may indicate that the data recording module stops receiving the transmission data sent by the test module. For example, the stop receiving message may be "stop receiving transmission data".
[0044] Step 203: Determine a sending data set according to at least one sending data recorded by the data recording module.
[0045] In some embodiments, the execution subject may determine the transmission data set according to at least one transmission data recorded by the data recording module. In practice, the execution subject may determine each received transmission data as the transmission data set in response to receiving the stop receiving information.
[0046] Step 204: Generate communication test information according to the sent data set.
[0047] In some embodiments, the execution entity may generate communication test information based on the sent data set.
[0048] In practice, the execution subject may generate communication test information according to the sending data set through the following steps:
[0049] The first step is to sort the individual transmission data in the transmission data set to generate sorted transmission data as a transmission data sequence. In practice, the execution subject may sort the individual transmission data in the transmission data set according to the time when the data recording module receives the individual transmission data to generate sorted transmission data as a transmission data sequence.
[0050] In the second step, for each two adjacent transmission data in the transmission data sequence, a difference between the two adjacent transmission data is determined as a communication jitter value.
[0051] In the third step, the maximum value among the determined communication jitter values is determined as the maximum communication jitter value, and the minimum value among the determined communication jitter values is determined as the minimum communication jitter value.
[0052] In the fourth step, the maximum value of each transmission data in the above transmission data sequence is determined as the maximum communication delay value, and the minimum value of each transmission data in the above transmission data sequence is determined as the minimum communication delay value.
[0053] The fifth step is to determine the maximum communication jitter value, the minimum communication jitter value, the maximum communication delay value and the minimum communication delay value as communication test information.
[0054] Optionally, after step 102, a communication test image is generated according to the communication test information.
[0055] In some embodiments, the execution subject may generate a communication test image based on the communication test information. The communication test image may represent the relationship between the various numerical values included in the communication test information. For example, the communication test image may be a bar chart. In practice, the execution subject may generate the communication test image using various methods. For example, a drawing tool may be used to generate the communication test image.
[0056] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the inter-virtual machine communication test method of some embodiments of the present disclosure, the real-time communication between different real-time operating systems is determined, and the security of industrial application scenarios is improved. Specifically, the reason for the low security of industrial application scenarios is that the industrial network has high requirements for the real-time performance of the operating system. If the real-time performance test cannot be performed, it will be impossible to determine whether the real-time performance of the real-time operating system meets the requirements of the industrial application scenario, thereby resulting in low security of the industrial application scenario. Based on this, the inter-virtual machine communication test method of some embodiments of the present disclosure, first, establishes a communication connection with the configuration virtual machine through the above-mentioned communication module. Thus, the communication test information between the test virtual machine and the configuration virtual machine can be determined. Secondly, according to the preset number of packet transmissions, the above-mentioned test module sends a data packet to the above-mentioned configuration virtual machine, and the above-mentioned data recording module records the transmission data. Thus, a data packet can be sent to the configuration virtual machine, and the communication information when the data packet is sent can be recorded. Then, according to at least one transmission data recorded by the above-mentioned data recording module, a transmission data set is determined. Thus, the communication jitter and communication delay between the test virtual machine and the configuration virtual machine can be determined. Finally, according to the above-mentioned transmission data set, communication test information is generated. Thus, the communication test information between the test virtual machine and the configuration test virtual machine is determined, and whether the real-time performance of the real-time operating system meets the requirements of the industrial application scenario is determined, thereby improving the security of the industrial application scenario.
[0057] The technical details are further described below in conjunction with embodiments.
[0058] Example 1
[0059] The inter-virtual machine communication testing method disclosed in Example 1 may include the following steps:
[0060] The first step is to determine the Intewell system version, and run the Intewell system corresponding to the Intewell system version on a preset hardware platform. The Intewell system version may be V1.8.0_beta. The preset hardware platform may be a Loongson Pie 2 development board platform.
[0061] The second step is to create a Hypervisor project in IntewellDeveloper, configure two real-time operating systems, and configure the virtual network cards (VNET) separately.
[0062] The third step is to create two virtual machine projects in IntewellDeveloper, corresponding to the two configured real-time operating systems, and configure their respective IP addresses.
[0063] The fourth step is to compile, download, and run the RAWSOCKET communication test case in the two configured real-time operating systems to make the RAWSOCKET communication between the two real-time operating systems work.
[0064] Step 5: Design and add the RTCommTest communication real-time tester InterCom module in the real-time operating system. The InterCom module can be controlled to perform the following sub-steps:
[0065] In the first sub-step, the InterCom module is controlled to call the driver packet receiving functions ls2k1000_rx() and ls2k1000_tx() of the virtual network card driver of the Loongson Pi 2 to implement the communication receiving function InterCom_Hal_RX() and the communication sending function InterCom_Hal_TX().
[0066] The second sub-step is to control the InterCom module to lock the mutex for communication reception and transmission to ensure that resource reuse does not conflict.
[0067] Step 6: Design and add the RTCommTest_M communication real-time tester RTtest module in the real-time operating system. The RTCommTest_M communication real-time tester RTtest module can be controlled to perform the following sub-steps:
[0068] The first sub-step is to control RTtest to read the value of the macro configuration TestMode. If it is 1, RTtest_M is enabled to perform communication jitter testing.
[0069] The second sub-step is to control RTtest_M to cyclically call InterCom_Hal_TX() to send packets and record the timestamp as T0.
[0070] The third sub-step is to control RTtest_M to call InterCom_Hal_TX() to send a packet, and then immediately call InterCom_Hal_RX() to block the packet reception and record the timestamp as T1.
[0071] The fourth sub-step is to calculate the difference ΔT=T1-T0 between one transmission and reception, and pass it to the TestShow module for recording through a variable.
[0072] The fifth sub-step is to repeat the test in the loop according to the macro definition TESTCOUNT times.
[0073] Step 7: Design and add the RTCommTest_S communication real-time tester RTtest module in the real-time operating system. Among them, RTCommTest_S's RTtest mainly implements the test function, blocks the packet receiving in the loop, and sends the received packet back immediately. The specific sub-steps are as follows:
[0074] In the first sub-step, RTtest reads the value of the macro configuration TestMode. If it is 0, RTtest_S is enabled to test the communication jitter.
[0075] In the second sub-step, RTtest_S cyclically calls InterCom_Hal_RX() to block packet reception.
[0076] The third sub-step is to return the data packet after receiving the packet.
[0077] Step 8. Design and add the RTCommTest_M / S communication real-time tester TestShow module in the real-time operating system. The TestShow module is mainly run in the RTCommTest_M communication real-time tester and is disabled in the RTCommTest_S communication real-time tester. It mainly realizes reading the test results of the RTtest_M module and displaying them. In practice, the TestShow module can be controlled to execute the following sub-steps:
[0078] In the first sub-step, TestShow reads the value of the macro configuration TestMode. If it is 1, it is enabled, and if it is 0, it is disabled.
[0079] In the second sub-step, TestShow reads the test result ΔT in RTtest_M and records it. The interpolation of two ΔTs is ΔT_jitter, which is the communication jitter, and ΔT is the communication delay. Record the maximum and minimum values and other communication data.
[0080] In the ninth step, you can export the communication data and use the drawing tools to visually see the distribution of real-time indicators.
[0081] Further references Figure 3 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a virtual machine communication test device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the inter-virtual machine communication testing device can be specifically applied to various electronic devices.
[0082] like Figure 3As shown, some embodiments of the inter-virtual machine communication test device 300 include: a communication connection establishing unit 301, a sending unit 302, a determining unit 303 and a generating unit 304. The communication connection establishing unit 301 is configured to establish a communication connection with the configured virtual machine through the above-mentioned communication module; the sending unit 302 is configured to send a data packet to the above-mentioned configured virtual machine through the above-mentioned test module according to a preset number of packet sending times, and to record the sending data through the above-mentioned data recording module; the determining unit 303 is configured to determine a sending data set according to at least one sending data recorded by the above-mentioned data recording module; the generating unit 304 is configured to generate communication test information according to the above-mentioned sending data set.
[0083] It can be understood that the units recorded in the inter-virtual machine communication testing device 300 are similar to those in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the inter-virtual machine communication testing device 300 and the units included therein, and will not be described in detail here.
[0084] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 400 suitable for implementing some embodiments of the present disclosure. The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0085] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0086] Typically, the following devices may be connected to the I / O interface 405: input devices 405 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 408 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 409. The communication devices 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0087] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0088] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0089] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0090] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: establishes a communication connection with the test virtual machine through the communication module; sends a data packet to the test virtual machine through the test module according to a preset number of packet sending times, and records the sent data through the data recording module; determines a sent data set according to at least one sent data recorded by the data recording module; and generates communication test information according to the sent data set.
[0091] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0092] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The units described may also be provided in a processor, for example, may be described as: a processor including a communication connection establishing unit, a sending unit, a determining unit, and a generating unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the generating unit may also be described as "a unit for generating communication test information according to the above-mentioned sending data set".
[0094] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0095] Some embodiments of the present disclosure further provide a computer program product, including a computer program, which implements any of the above-mentioned inter-virtual machine communication testing methods when executed by a processor.
[0096] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.
Claims
1. A method for testing communication between virtual machines, applied to a test virtual machine, wherein a network tester is provided in the test virtual machine, and the network tester includes a communication module, a test module and a data recording module, and the method includes: Establishing a communication connection with the configuration and testing virtual machine through the communication module; According to a preset number of packet sending times, the test module sends a data packet to the test virtual machine, and the data recording module records the sent data; The step of sending a data packet to the test virtual machine through the test module according to a preset number of packet sending times, and recording the sent data through the data recording module, includes: Based on the preset number of packet transmissions and the pre-acquired data packets, the following processing steps are performed: Sending the data packet to the testing virtual machine through the testing module, and generating a first timestamp; In response to receiving a data packet sent by the configuration virtual machine, updating an initial value of the number of packet transmissions, and generating a second timestamp, wherein the initial value of the number of packet transmissions is initially 0; Generate sending data according to the first timestamp and the second timestamp, and send the sending data to the data recording module; In response to the initial value of the number of packet transmissions being less than the preset number of packet transmissions, executing the processing step again; Determine a sending data set according to at least one sending data recorded by the data recording module; Generate communication test information according to the sent data set; Wherein, generating communication test information according to the sending data set includes: Sorting each transmission data in the transmission data set to generate sorted transmission data as a transmission data sequence; For each two adjacent transmission data in the transmission data sequence, determining a difference between the two adjacent transmission data as a communication jitter value; Determining a maximum value among the determined communication jitter values as a maximum communication jitter value, and determining a minimum value among the determined communication jitter values as a minimum communication jitter value; Determine the maximum value of each transmission data in the transmission data sequence as the maximum communication delay value, and determine the minimum value of each transmission data in the transmission data sequence as the minimum communication delay value; The maximum communication jitter value, the minimum communication jitter value, the maximum communication delay value, and the minimum communication delay value are determined as communication test information.
2. The method according to claim 1, wherein: Before sending a data packet to the test virtual machine by the test module according to the preset number of packet sending times, and recording the sent data by the data recording module, the method further includes: Create a test mutex according to the preset configuration information; The test mutex is added to the communication module so that the test mutex is adapted to the communication receiving function and the communication sending function included in the communication module.
3. The method according to claim 1, wherein: The method further comprises: In response to the initial value of the number of packet sending times being equal to the preset number of packet sending times, a stop receiving message is sent to the data recording module.
4. The method according to claim 1, wherein: The method further comprises: A communication test image is generated according to the communication test information.
5. A virtual machine communication test device, the virtual machine communication test device is used to implement the virtual machine communication test method according to any one of claims 1 to 4, comprising: A communication connection establishing unit, configured to establish a communication connection with the configuration virtual machine through the communication module; A sending unit, configured to send a data packet to the test virtual machine through the test module according to a preset number of packet sending times, and to record the sent data through the data recording module; a determining unit, configured to determine a sending data set according to at least one sending data recorded by the data recording module; The generating unit is configured to generate communication test information according to the sending data set.
6. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
7. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
8. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Network monitoring method and equipment
CN109428782A
Test method and device
CN110351156A