Information processing method and device, storage medium and computer program product
By determining the interaction level value based on the virtual machine's running parameters and transmission parameters in cloud computing, and establishing a keep-alive connection only when the interaction level is below a threshold, the problem of wasted bandwidth resources is solved and the network environment is simplified.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-10
AI Technical Summary
In cloud computing, the keep-alive connections between servers in existing technologies result in significant waste of bandwidth resources and complex network environments.
By receiving data transmission requests, the system obtains the transmission and operation parameters between the virtual machine and the server, determines the interaction level, and establishes a keep-alive connection only when the interaction level is less than or equal to a preset threshold, thereby reducing invalid connections.
It effectively reduces the number of invalid keep-alive connections, saves bandwidth resources, and simplifies the network environment.
Smart Images

Figure CN121644637A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cloud computing, and in particular, to an information processing method, device, storage medium and computer program product. BACKGROUND
[0002] In the field of cloud computing, in order to realize instant transmission of information, a keep-alive mechanism has been widely applied. At present, a plurality of virtual machines are usually deployed on a cloud server, and each virtual machine can communicate with an external server. However, in the related art, as long as there is data interaction between any virtual machine and a certain external server, a keep-alive connection between the cloud server and the external server is established, that is, the cloud server sends keep-alive packets to the external server at regular intervals to ensure that the two can normally communicate, which causes serious waste of bandwidth resources and makes the network environment more complex. SUMMARY
[0003] To solve the above technical problems, the embodiments of the present application aim to provide an information processing method, device, storage medium and computer program product, which solve the problem of serious waste of bandwidth resources in establishing a keep-alive connection between servers in the related art.
[0004] The technical scheme of the embodiments of the present application is as follows: An information processing method, the method comprising: receiving a data transmission request sent by a second server; wherein the second server is a server that does not have a keep-alive connection with the first server; obtaining transmission parameters between each virtual machine corresponding to the first server and the second server based on the data transmission request; wherein the transmission parameters represent the data transmission between the each virtual machine and the second server; obtaining running parameters of the each virtual machine; wherein the running parameters represent the running condition of the each virtual machine; determining an interaction degree value between the first server and the second server based on the running parameters and the transmission parameters; if the interaction degree value is less than or equal to a first preset threshold, establishing a keep-alive connection between the first server and the second server.
[0005] In the above scheme, the obtaining of the transmission parameters between each virtual machine corresponding to the first server and the second server comprises: obtaining the data transmission amount of the each virtual machine and the second server within a first time period; wherein the transmission parameters include the data transmission amount; Correspondingly, the obtaining of the running parameters of the each virtual machine comprises: acquire a running time length of each virtual machine and a usage frequency of each virtual machine in a second time period; wherein the running parameter comprises the usage frequency and the running time length.
[0006] In the above scheme, the determining of the interaction degree value between the first server and the second server based on the running parameter and the transmission parameter comprises: determining a first activity of each virtual machine based on the usage frequency and the running time length; determining the interaction degree value based on the first activity and the data transmission amount.
[0007] In the above scheme, the method further comprises: determining a target historical sending time at which the first server sends historical keep-alive data to a target server; wherein the target server is a server that has established a keep-alive connection with the first server; and the target historical sending time is the nearest sending time from a current time; determining a first number of virtual machines that have a connection relationship with the target server at the target historical sending time; determining a sending period of keep-alive data sent by the first server based on the first number and a preset value; sending the keep-alive data to the target server based on the sending period and the target historical sending time.
[0008] In the above scheme, the determining of the first number of virtual machines that have a connection relationship with the target server at the target historical sending time comprises: acquiring first address information of each virtual machine and second address information of the target server; processing the first address information, the second address information and the target historical sending time by using a target evaluation algorithm to obtain the first number.
[0009] In the above scheme, the determining of the sending period of keep-alive data sent by the first server based on the first number and a preset value comprises: determining a target value based on the first number and a first preset value; if the target value is greater than or equal to a second preset threshold, determining the sending period based on the target value and a second preset value; if the target value is less than the second preset threshold, determining the sending period based on a third preset value; wherein the preset value comprises the first preset value, the second preset value and the third preset value.
[0010] In the above scheme, sending the keep-alive data to the target server based on the sending period and the target historical sending time includes: Obtain the target data transmission volume between each virtual machine and the target server within the sending period; Determine a second number of virtual machines that have a connection with the target server within the sending period; Based on the target data transmission volume and the second quantity, the second activity level of the target server is determined; If the second activity level is less than the first preset threshold, the target sending time is determined based on the target historical sending time and the sending period, and the keep-alive data is sent to the target server at the target sending time.
[0011] The method in the above scheme further includes: If the second activity level is greater than or equal to the first preset threshold, disconnect the keep-alive connection between the first server and the target server.
[0012] An information processing apparatus, the apparatus comprising: A receiving unit is configured to receive a data transmission request sent by a second server; wherein the second server is a server that does not have a keep-alive connection with the first server; The first acquisition unit is configured to acquire, based on the data transmission request, transmission parameters between each virtual machine corresponding to the first server and the second server; wherein, the transmission parameters characterize the data transmission status between each virtual machine and the second server; The second acquisition unit is used to acquire the operating parameters of each virtual machine; wherein the operating parameters characterize the operating status of each virtual machine; The determining unit is configured to determine the interaction level value between the first server and the second server based on the operating parameters and the transmission parameters; The processing unit is configured to establish a keep-alive connection between the first server and the second server if the interaction level value is less than or equal to a first preset threshold.
[0013] A first server includes: a processor and a memory for storing computer programs capable of running on the processor; The processor is used to execute the steps of the above method when running a computer program.
[0014] A storage medium having a computer program stored thereon, the computer program being executed by a processor of the steps described above.
[0015] A computer program product includes a computer program that is executed by a processor using the steps of the above-described method.
[0016] The information processing method, device, storage medium, and computer program product provided in this application embodiment can receive data transmission requests sent by a second server that does not have a keep-alive connection with a first server; based on the data transmission request, obtain the transmission parameters between each virtual machine corresponding to the first server and the second server; obtain the running parameters of each virtual machine; determine the interaction level value between the first server and the second server based on the running parameters and the transmission parameters; if the interaction level value is less than or equal to a first preset threshold, establish a keep-alive connection between the first server and the second server. Thus, the keep-alive connection between the first server and the second server can be determined first based on the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server. The interaction level between the two servers is considered, and a keep-alive connection between the first server and the second server is only established when the interaction level is less than or equal to a first preset threshold. In other words, when establishing a keep-alive connection between the first server and the second server, the operating parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server are considered simultaneously. Instead of establishing a keep-alive connection between the first server and the second server as long as any virtual machine interacts with the second server, as in related technologies, this significantly reduces the number of invalid keep-alive connections and solves the problem of serious bandwidth waste when establishing keep-alive connections between servers in related technologies, thereby saving a lot of bandwidth resources. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating an information processing method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the connection architecture between servers corresponding to an information processing method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating another information processing method provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the determination of a first quantity in an information processing method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an information processing device provided during the implementation period of this application; Figure 6 This is a schematic diagram of the structure of a first server provided in an embodiment of this application. Detailed Implementation
[0018] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0019] It should be understood that the phrases "embodiments of this application" or "foreign embodiments" throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "embodiments of this application" or "in the foreign embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0020] Unless otherwise specified, any step in the embodiments of this application performed by the electronic device may be executed by the processor of the electronic device. It is also worth noting that the embodiments of this application do not limit the order in which the electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods. It should also be noted that any step in the embodiments of this application can be executed independently by the electronic device; that is, when the electronic device performs any step in the following embodiments, it may not depend on the execution of other steps.
[0021] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0022] This application provides a method, referring to... Figure 1 As shown, the method may include the following steps: Step 101: Receive the data transmission request sent by the second server.
[0023] The second server is a server that does not have a keep-alive connection with the first server.
[0024] In this embodiment, the keep-alive connection can be used to detect whether the transmission connection between the first server and the second server is valid; the transmission connection can refer to a Transmission Control Protocol (TCP) connection.
[0025] In this application embodiment, if this application is applied to a cloud computing scenario, such as Figure 2As shown, the first server can refer to a cloud PC server (hereinafter referred to as: cloud server), while the second server can be an external server that needs to interact with the first server but has not yet established a keep-alive connection with it. In one possible implementation, the second server can refer to an application server among multiple application servers that does not have a keep-alive connection with the first server. These multiple application servers can be the application servers corresponding to each application installed on the virtual machine corresponding to the first server.
[0026] Step 102: Based on the data transmission request, obtain the transmission parameters between each virtual machine corresponding to the first server and the second server.
[0027] The transmission parameters represent the data transmission between each virtual machine and the second server; multiple virtual machines are deployed on the first server.
[0028] In this embodiment of the application, the virtual machine may be deployed on a first server, and the first server may correspond to multiple virtual machines. For example... Figure 2 As shown, users can connect to the virtual machine via a personal computer (PC) to use the virtual machine.
[0029] In one feasible approach, the data transfer between the virtual machine and the second server can be represented by the amount of data transferred; that is, the transfer parameters can include the amount of data transferred between the virtual machine and the second server.
[0030] In this embodiment of the application, if a data transmission request is received from the second server, it indicates that there is a data transmission requirement between the second server and the first server. At this time, the data transmission volume between each virtual machine and the second server can be obtained to lay the groundwork for establishing a keep-alive connection between the first server and the second server.
[0031] Step 103: Obtain the running parameters for each virtual machine.
[0032] Among them, the running parameters characterize the running status of each virtual machine.
[0033] In this embodiment, the configuration file of each virtual machine can be obtained, and the running status of each virtual machine over a period of time can be obtained by parsing the configuration file. In one possible implementation, the running status of the virtual machine can be reflected by the number of times the virtual machine is used and its runtime; that is, the running parameters of the virtual machine can include the number of times the virtual machine is used and its runtime.
[0034] Step 104: Based on the operating parameters and transmission parameters, determine the interaction level between the first server and the second server.
[0035] In this embodiment, the interaction level value can characterize the frequency of interaction between the first server and the second server over a period of time. It can be understood that a higher interaction level value indicates more frequent interaction between the first server and the second server, and vice versa. Specifically, the activity level of each virtual machine can be determined based on its operating parameters, and combined with the transmission parameters, the frequency of interaction between the first server and the second server (i.e., the interaction level value) can be jointly determined.
[0036] Step 105: If the interaction level value is less than or equal to the first preset threshold, establish a keep-alive connection between the first server and the second server.
[0037] In this embodiment of the application, the first preset threshold may refer to a pre-set constant value.
[0038] In this embodiment, if the interaction level value is less than or equal to the first preset threshold, it indicates that the interaction frequency between the first server and the second server is low, meaning that the interaction between the two is not very frequent. In this case, it is necessary to establish a keep-alive connection between the first server and the second server to avoid sending a message that the transmission connection between the two is unavailable when the first server accesses the second server, thereby affecting the normal sending and receiving of information. Conversely, if the interaction level value is greater than the first preset threshold, it indicates that the interaction frequency between the two has exceeded the first preset threshold, meaning that the interaction level between the first server and the second server is very frequent. This means that the frequency of data transmission between the two will also be very high, which means that even if a keep-alive connection is established and keep-alive messages are sent periodically, it will not be very meaningful and will instead waste a lot of network bandwidth resources. At the same time, it will also make the entire network environment more complex, thereby affecting the efficiency of normal communication.
[0039] The information processing method provided in this application embodiment can first determine the interaction level between the first server and the second server based on the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server. Then, a keep-alive connection between the first server and the second server will only be established if the interaction level value is less than or equal to a first preset threshold. In other words, when establishing a keep-alive connection between the first server and the second server, the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server are considered simultaneously, instead of establishing a keep-alive connection between the first server and the second server as long as any virtual machine has data interaction with the second server, as in related technologies. This can significantly reduce the number of invalid keep-alive connections, thereby solving the problem of serious bandwidth resource waste in establishing keep-alive connections between servers in related technologies, and thus saving a lot of bandwidth resources.
[0040] Based on the foregoing embodiments, embodiments of this application provide an information processing method, which can be applied to a first server, referring to... Figure 3 As shown, the method may include the following steps: Step 201: The first server receives the data transmission request sent by the second server.
[0041] The second server is a server that does not have a keep-alive connection with the first server.
[0042] In this application embodiment, if this application is applied to a cloud computing scenario, such as Figure 2 As shown, the second server can refer to an application server that does not have a keep-alive connection with the first server. For example, the second server may include application server A and application server B.
[0043] It should be noted that there can be multiple second servers.
[0044] Step 202: The first server obtains the amount of data transmission between each virtual machine and the second server in the first time period based on the data transmission request.
[0045] The transmission parameters include the amount of data transmitted; multiple virtual machines are deployed on the first server.
[0046] In this embodiment of the application, the first time period can be set according to the user's actual needs.
[0047] In this embodiment, the data transfer volume between each virtual machine and the second server may include the amount of data sent and received by the virtual machine. It should be noted that if there are multiple second servers, each virtual machine has a data transfer volume between itself and each second server.
[0048] Step 203: The first server obtains the runtime of each virtual machine and the number of times each virtual machine is used in the second time period.
[0049] The operating parameters include the number of times it is used and the runtime.
[0050] In this embodiment, the second time period can also be set according to the user's actual needs. In one possible implementation, the first time period and the second time period are the same.
[0051] In this embodiment, runtime can refer to the online time of a virtual machine after it is powered on; usage count can refer to the number of times the virtual machine is logged in during the second time period. Specifically, the first server (i.e., the cloud server) can obtain the runtime logs of each virtual machine deployed on it, and analyze the runtime logs to obtain the runtime of each virtual machine and the number of times each virtual machine is logged in during the second time period.
[0052] Step 204: The first server determines the first activity level of each virtual machine based on the number of times it is used and the runtime.
[0053] In the embodiments of this application, the more times a virtual machine is used and the longer its runtime, the higher its activity level; conversely, the fewer times a virtual machine is used and the shorter its runtime, the lower its activity level.
[0054] It should be noted that each virtual machine corresponds to a first activity level, and the first activity level can be represented by a numerical value.
[0055] In this embodiment, T can represent the second time period, log_times can represent the number of uses, online_dur can represent the runtime, and act1 can represent the first activity level. Therefore, the first activity level act1 = online_dur * (log_times / T). A larger first activity level indicates a higher activity level for the corresponding virtual machine, and vice versa.
[0056] Step 205: The first server determines the interaction level value based on the first activity level and the amount of data transmission.
[0057] In this embodiment of the application, the interaction level value between the first server and the second server can characterize the connection activity between the first server and the second server. The higher the interaction level value, the higher the connection activity. Conversely, the lower the interaction level value, the lower the connection activity.
[0058] In this embodiment of the application, for each virtual machine, the first activity level of the virtual machine and the amount of data transmission between the virtual machine and the second server can be multiplied to obtain an intermediate value. Then, the intermediate values of all virtual machines corresponding to the first server can be summed to obtain the interaction level value between the first server and the second server.
[0059] In this embodiment of the application, if the data transmission volume between the virtual machine and the second server is represented by P, the first activity level of the virtual machine is represented by act1, and the interaction level value is represented by act2, then the calculation formula for the interaction level value can be shown in the following formula (1): Formula (1) Where i represents the virtual machine number and n represents the total number of virtual machines.
[0060] In this embodiment, if there are multiple second servers, each second server will have an interaction level value, i.e., an act2 value. It should be noted that the larger the act2 value, the higher the interaction level between the first server and the second server; conversely, the lower the act2 value, the lower the interaction level.
[0061] Step 206: If the interaction level value is less than or equal to the first preset threshold, the first server establishes a keep-alive connection between the first server and the second server.
[0062] In this embodiment, the first preset threshold can be preset according to actual needs. If the interaction level value is less than or equal to the first preset threshold, it indicates that the interaction level between the first server and the second server is poor (i.e., the interaction is infrequent). In order to ensure that the transmission connection between the first server and the second server is always available, it is necessary to establish a keep-alive connection between the first server and the second server so that the first server can send keep-alive data to the second server to ensure that the transmission connection between the first server and the second server is continuously available. In this way, only the second server that meets the conditions can establish a keep-alive connection with the first server, instead of establishing a keep-alive connection between the two servers as long as there is data interaction between the second server and the first server, as in related technologies, which would lead to a serious waste of network bandwidth resources and thus affect the normal communication between servers.
[0063] In other embodiments of this application, steps 207-210 may be performed after step 206.
[0064] Step 207: The first server determines the target historical transmission time when the first server sends historical keep-alive data to the target server.
[0065] Among them, the target server is the server that has established a keep-alive connection with the first server; the target historical sending time is the sending time most recently than the current time.
[0066] In this embodiment, the target server may include a second server and a third server that have established a keep-alive connection with the first server. The third server may be any of the multiple application servers corresponding to applications installed on multiple virtual machines, excluding the second server; that is, any application server among the multiple application servers that has already established a keep-alive connection with the first server. It should be noted that there may be multiple target servers.
[0067] For example, multiple application servers corresponding to applications installed on multiple virtual machines may include application server C, application server D, application server E, application server F, and application server G. Application servers C and D have already established keep-alive connections with the first server, while application servers E, F, and G have not yet established keep-alive connections with the first server. These three are the second servers. Subsequently, if a keep-alive connection is established between application server F and the first server according to steps 201-206, the target servers will include application servers C, D, and F.
[0068] In this embodiment, historical keep-alive data, also known as historical keep-alive messages, is data used to detect whether the transmission connection between the first server and the target server is available. The target historical transmission time can refer to the most recent historical transmission time when the first server sent historical keep-alive data to the target server. Specifically, the first server's operation log can be obtained and analyzed to obtain multiple historical transmission times when it sent historical keep-alive messages to the target server. Then, based on the difference between each historical transmission time and the current time, the historical transmission time closest to the current time can be determined as the target historical transmission time.
[0069] For example: If the first server sends historical keep-alive data to the target server at 13:30, 15:00 and 16:30 respectively, and the current time is 19:00, then the target historical sending time is 16:30.
[0070] It should be noted that if there are multiple target servers, then each target server corresponds to a target historical sending time.
[0071] Step 208: The first server determines the first number of virtual machines that have a connection relationship with the target server at the target historical transmission time.
[0072] In this embodiment of the application, after determining the target historical transmission time corresponding to the target server, a target estimation algorithm can be used to determine the number of peer connections of the target server at the target historical transmission time, that is, the first number of virtual machines that have a connection relationship with the target server.
[0073] In this embodiment of the application, step 208 can be implemented through steps 208a-208b: Step 208a: The first server obtains the first address information of each virtual machine and the second address information of the target server.
[0074] In this embodiment of the application, the first address information of the virtual machine may refer to the Internet Protocol Address (IP address) of the virtual machine; the second address information of the target server may refer to the Internet Protocol Address of the target server.
[0075] Step 208b: The first server uses a target estimation algorithm to process the first address information, the second address information, and the target historical transmission time to obtain the first quantity.
[0076] In this application embodiment, the target estimation algorithm may refer to the Sliding Rough and Linear Algorithm (SRLA algorithm) based on a Graphics Processing Unit (GPU). Specifically, when using this algorithm, such as... Figure 4 As shown, the parameters of the algorithm can be initialized first, and the first address information and the second address information can be input into the algorithm in the form of interactive IP address pairs, along with the target historical transmission time. Then, the algorithm can process the input interactive IP address pairs and the target historical transmission time to calculate the first number of virtual machines that have a connection relationship with the target server at the target historical transmission time, that is, the first number of peer virtual machines of the target server.
[0077] It should be noted that the SRLA algorithm typically converts data into matrix form for calculation. That is, the first quantity obtained by the algorithm can be represented by a matrix, where the rows of the matrix represent the target server, the columns of the matrix represent the target historical transmission time, and the specific value of the matrix is the first quantity.
[0078] In one feasible approach, if there are multiple target servers, and some of these target servers correspond to the same historical transmission time, then the second address information of each target server and the first address information of the first server can be combined into multiple sets of interactive IP address pairs. The SRLA algorithm is then used to process these multiple sets of interactive IP address pairs and the historical transmission time to obtain a multidimensional matrix. Each row of the matrix represents a target server, the columns still represent historical transmission times, and the values are the first number corresponding to each target server.
[0079] In this embodiment, the SRLA algorithm uses the sketch principle, requiring only a fixed amount of memory and constant-level operations to estimate the number of peer virtual machines on the target server. Compared to related technologies that use direct and intuitive methods like precise statistics to estimate the number of peer virtual machines, this algorithm has been proven to output results in real time in high-speed network environments with high accuracy. Unlike related technologies, where the memory size and access frequency on the server change with the application and the number of virtual machines, this algorithm avoids the delay in determining the number of peer virtual machines, thus failing to meet the real-time requirements of actual network environments.
[0080] Step 209: The first server determines the sending cycle of the keep-alive data sent by the first server based on the first quantity and the preset value.
[0081] In this embodiment, the sending period can refer to the time interval between the first server sending keep-alive data to the second server, that is, the time required from the last sending of keep-alive data to the next sending of keep-alive data. It should be noted that the preset value can include multiple different values.
[0082] It should be noted that historical keep-alive data is data that the first server sent to the second server in the past, but keep-alive data is real-time data that the first server is currently sending or will send to the second server in the future.
[0083] In this embodiment of the application, the target value can be determined first based on the first quantity and the first preset value, and then the sending cycle of the keep-alive data can be determined based on the target value and the preset value.
[0084] In the embodiments of this application, step 209 can be implemented through steps 209a-209c.
[0085] Step 209a: The first server determines the target value based on the first quantity and the first preset value.
[0086] In this embodiment, the first preset value can be a pre-set constant value. Specifically, the first preset value can be divided by the first quantity to obtain the target value. That is, if the first preset value is represented by C1, the first quantity by Va, and the target value by KAa, then KAa = C1 / Va.
[0087] Step 209b: If the target value is greater than or equal to the second preset threshold, the first server determines the sending period based on the target value and the second preset value.
[0088] In this embodiment, the second preset threshold can be preset according to the user's actual needs. In one possible implementation, the second preset threshold can be 0. In this case, if the target value is greater than or equal to the second preset threshold, the target value and the second preset value can be multiplied together to obtain the value that represents the transmission cycle of the keep-alive data.
[0089] It should be noted that if there are multiple target servers, each target server corresponds to a sending cycle.
[0090] Step 209c: If the target value is less than the second preset threshold, the first server determines the sending period based on the third preset value.
[0091] The preset values include a first preset value, a second preset value, and a third preset value.
[0092] In the embodiments of this application, the first preset value, the second preset value, and the third preset value may be the same or different, and no specific limitation is made here.
[0093] In this embodiment of the application, if the target value is less than the second preset threshold, the third preset value can be directly determined as the transmission period of the keep-alive data.
[0094] It should be noted that the sending cycles for different target servers can be the same (the initial number of virtual machines on the other end is the same) or different.
[0095] In this embodiment, the sending period of keep-alive data can be determined based on the first number of virtual machines connected to the target server (i.e., the number of peer virtual machines of the target server), rather than the higher the importance of the keep-alive connection, the shorter the sending period, as in related technologies. Although this method in related technologies ensures the timely transmission of information, it will seriously waste bandwidth resources and cause resource waste. In this application, by combining the first number to determine the sending period, keep-alive data can be sent according to the actual communication between the virtual machine and the target server. In this way, not only is the function of "keep-alive" achieved, but resource consumption can also be significantly reduced.
[0096] Step 210: The first server sends keep-alive data to the target server based on the sending period and the target's historical sending time.
[0097] In the embodiments of this application, step 210 can be implemented by steps 210a-210e.
[0098] Step 210a: The first server obtains the target data transmission volume between each virtual machine and the target server within the transmission period.
[0099] In this embodiment of the application, the target data transmission volume between each virtual machine corresponding to the first server and the target server can be obtained during the transmission period.
[0100] It should be noted that if there are multiple target servers, the target data transfer volume between each virtual machine and each server can be obtained within the sending cycle. Moreover, the target data transfer volume refers to the data transfer volume between the virtual machine and the server within the current or future sending cycle, while the data transfer volume in step 202 refers to the data transfer volume between the virtual machine and the server over a past period of time. That is, the data transfer volume and the target data transfer volume are not the same parameter.
[0101] Step 210b: The first server determines the second number of virtual machines that have a connection relationship with the target server within the sending period.
[0102] In this embodiment of the application, a second number of all virtual machines that have a connection relationship with the target server during the transmission period can be determined by using a target estimation algorithm (i.e., the SRLA algorithm) according to step 208 (i.e., steps 208a-208b).
[0103] It should be noted that each target server corresponds to a second quantity.
[0104] Step 210c: The first server determines the second activity level of the target server based on the target data transmission volume and the second quantity.
[0105] In this embodiment of the application, the second activity level of the target server can be represented by a numerical value.
[0106] In this embodiment of the application, since there are multiple virtual machines connected to the target server, the target data transfer volume between the target server and each virtual machine can be summed to obtain a sum value. Then, the sum value can be divided by a second quantity to obtain an average value. Further, the average value can be multiplied by the second quantity to obtain the second activity level of the target server. That is, if the second activity level is represented by act4, the average value is represented by act3, and the second quantity is represented by Vb, then act4 = act3 * Vb.
[0107] In this embodiment of the application, the larger the value of the second activity level, the higher the activity level of the target server.
[0108] In this embodiment of the application, step 210d or step 210e can be performed after step 210c.
[0109] Step 210d: If the second activity level is less than the first preset threshold, the first server determines the target sending time based on the target historical sending time and sending cycle, and sends keep-alive data to the target server at the target sending time.
[0110] In this embodiment of the application, if the second activity level of the target server is less than the first preset threshold, it means that the activity level of the target server is not high during the sending period. In order to ensure that the transmission connection between the first server and the target server is always available, the keep-alive connection between them needs to be maintained. That is, the first server needs to send keep-alive data (i.e., keep-alive message) to the target server according to the sending period. At this time, the target historical sending time (the keep-alive data sending time closest to the current time) and the sending period can be calculated to obtain the next time when the first server sends keep-alive data to the target server (i.e., the target sending time), and the keep-alive data is sent to the target server at the target sending time.
[0111] It should be noted that if there are multiple target servers, the target time for sending the keep-alive data for each target server can be the same or different.
[0112] Step 210e: If the second activity level is greater than or equal to the first preset threshold, the first server disconnects the keep-alive connection between the first server and the target server.
[0113] In this embodiment, if the activity level of the target server is greater than or equal to the first preset threshold, it means that the interaction between the target server and the first server is very frequent during the sending period. In this case, the keep-alive connection between them is meaningless. At this time, the keep-alive connection between the first server and the target server can be directly disconnected, that is, there is no need to send keep-alive data to the target server according to the sending period. In this way, unnecessary keep-alive message sending can be effectively reduced, thereby reducing the consumption of bandwidth resources.
[0114] In this embodiment, for actual application scenarios of cloud PC server products, multiple parameters such as the activity level of virtual machines and the activity level of application servers can be combined to determine whether to establish a keep-alive connection between the cloud server and the application server. First, the activity level of virtual machines is calculated based on the number of logins and online duration of virtual machines over a period of time. Then, for the same application, applications that need to establish a keep-alive connection are selected by combining parameters such as the number of virtual machines and the amount of data transmission. Furthermore, the number of peer virtual machine connections of the application server that has already established a keep-alive connection is estimated by using the SRLA algorithm. The time interval (i.e., the sending period) of sending keep-alive messages to the application server can be adjusted to reduce unnecessary keep-alive message sending. By adjusting the keep-alive time interval in real time, resource consumption is further reduced.
[0115] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0116] The information processing method provided in this application embodiment can first determine the interaction level between the first server and the second server based on the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server. Then, a keep-alive connection between the first server and the second server will only be established if the interaction level value is less than or equal to a first preset threshold. In other words, when establishing a keep-alive connection between the first server and the second server, the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server are considered simultaneously, instead of establishing a keep-alive connection between the first server and the second server as long as any virtual machine has data interaction with the second server, as in related technologies. This can significantly reduce the number of invalid keep-alive connections, thereby solving the problem of serious bandwidth resource waste in establishing keep-alive connections between servers in related technologies, and thus saving a lot of bandwidth resources.
[0117] Based on the foregoing embodiments, embodiments of this application provide an information processing apparatus that can be applied to... Figure 1 and Figure 3 In the information processing method provided in the corresponding embodiment, refer to Figure 5 As shown, the information processing device 3 may include: a receiving unit 31, a first acquiring unit 32, a second acquiring unit 33, a determining unit 34, and a processing unit 35, wherein: The receiving unit 31 is used to receive a data transmission request sent by the second server; wherein the second server is a server that does not have a keep-alive connection with the first server; The first acquisition unit 32 is used to acquire the transmission parameters between each virtual machine corresponding to the first server and the second server based on the data transmission request; wherein, the transmission parameters characterize the data transmission between each virtual machine and the second server; The second acquisition unit 33 is used to acquire the running parameters of each virtual machine; wherein, the running parameters represent the running status of each virtual machine; The determining unit 34 is used to determine the interaction level value between the first server and the second server based on the operating parameters and transmission parameters; The processing unit 35 is used to establish a keep-alive connection between the first server and the second server if the interaction level value is less than or equal to a first preset threshold.
[0118] In other embodiments of this application, the first acquisition unit 32 is further configured to perform the following steps: Obtain the data transfer volume between each virtual machine and the second server during the first time period; the transfer parameters include the data transfer volume.
[0119] In other embodiments of this application, the second acquisition unit 33 is further configured to perform the following steps: Obtain the runtime of each virtual machine and the number of times each virtual machine is used in the second time period; the runtime parameters include the number of times it is used and the runtime.
[0120] In other embodiments of this application, the determining unit 34 is further configured to perform the following steps: The initial activity level of each virtual machine is determined based on the number of times it is used and the runtime. The level of interaction is determined based on the initial activity level and the amount of data transmitted.
[0121] In other embodiments of this application, the processing unit 35 is further configured to perform the following steps: Determine the target historical transmission time when the first server sends historical keep-alive data to the target server; where the target server is the server that has established a keep-alive connection with the first server; the target historical transmission time is the transmission time closest to the current time; Determine the initial number of virtual machines that have a connection with the target server at the target historical transmission time; Based on the first quantity and the preset value, determine the sending cycle of the keep-alive data sent by the first server; Based on the sending cycle and the target's historical sending time, send keep-alive data to the target server.
[0122] In other embodiments of this application, the processing unit 35 is further configured to perform the following steps: Obtain the first address information of each virtual machine and the second address information of the target server; The first quantity is obtained by processing the first address information, the second address information, and the target historical transmission time using a target estimation algorithm.
[0123] In other embodiments of this application, the processing unit 35 is further configured to perform the following steps: The target value is determined based on the first quantity and the first preset value; If the target value is greater than or equal to the second preset threshold, the sending period is determined based on the target value and the second preset value. If the target value is less than the second preset threshold, the transmission period is determined based on the third preset value; wherein, the preset values include the first preset value, the second preset value and the third preset value.
[0124] In other embodiments of this application, the processing unit 35 is further configured to perform the following steps: Get the target data transfer volume between each virtual machine and the target server within the sending period; Determine the second number of virtual machines that have a connection with the target server within the sending period; The second activity level of the target server is determined based on the target data transfer volume and the second quantity. If the second activity level is less than the first preset threshold, the target sending time is determined based on the target's historical sending time and sending cycle, and keep-alive data is sent to the target server at the target sending time.
[0125] In other embodiments of this application, the processing unit 35 is further configured to perform the following steps: If the second activity level is greater than or equal to the first preset threshold, disconnect the keep-alive connection between the first server and the target server.
[0126] It should be noted that the specific implementation process of the steps performed by each unit in the embodiments of this application can be referred to Figure 1 and Figure 2 The implementation process of the information processing method provided in the corresponding embodiments will not be described in detail here.
[0127] The information processing apparatus provided in the embodiments of this application can first determine the interaction level between the first server and the second server based on the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server. Then, a keep-alive connection between the first server and the second server will only be established if the interaction level value is less than or equal to a first preset threshold. In other words, when establishing a keep-alive connection between the first server and the second server, the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server are considered simultaneously, instead of establishing a keep-alive connection between the first server and the second server as long as any virtual machine has data interaction with the second server, as in related technologies. This can significantly reduce the number of invalid keep-alive connections, thereby solving the problem of serious bandwidth resource waste in establishing keep-alive connections between servers in related technologies, and thus saving a lot of bandwidth resources.
[0128] Based on the foregoing embodiments, embodiments of this application provide a first server, which can be applied to... Figure 1 and Figure 3 In the information processing method provided in the corresponding embodiment, refer to Figure 6 As shown, the first server 4 may include: a processor 41 and a memory 42 for storing computer programs capable of running on the processor 41, and the first server 4 may also include a communication bus 43, wherein: Communication bus 43 is used to realize the communication connection between processor 41 and memory 42; The processor 41 is used to execute the information processing program in the memory 42 to perform the following steps: Receive data transmission requests sent by a second server; wherein the second server is a server that does not have a keep-alive connection with the first server; Based on the data transmission request, the transmission parameters between each virtual machine corresponding to the first server and the second server are obtained; wherein, the transmission parameters represent the data transmission situation between each virtual machine and the second server; Obtain the running parameters for each virtual machine; where the running parameters characterize the running status of each virtual machine. Based on the operating parameters and transmission parameters, determine the level of interaction between the first server and the second server; If the interaction level is less than or equal to the first preset threshold, a keep-alive connection is established between the first server and the second server.
[0129] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: Obtain the data transfer volume between each virtual machine and the second server during the first time period; the transfer parameters include the data transfer volume.
[0130] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: Obtain the runtime of each virtual machine and the number of times each virtual machine is used in the second time period; the runtime parameters include the number of times it is used and the runtime.
[0131] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: The initial activity level of each virtual machine is determined based on the number of times it is used and the runtime. The level of interaction is determined based on the initial activity level and the amount of data transmitted.
[0132] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: Determine the target historical transmission time when the first server sends historical keep-alive data to the target server; where the target server is the server that has established a keep-alive connection with the first server; the target historical transmission time is the transmission time closest to the current time; Determine the initial number of virtual machines that have a connection with the target server at the target historical transmission time; Based on the first quantity and the preset value, determine the sending cycle of the keep-alive data sent by the first server; Based on the sending cycle and the target's historical sending time, send keep-alive data to the target server.
[0133] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: Obtain the first address information of each virtual machine and the second address information of the target server; The first quantity is obtained by processing the first address information, the second address information, and the target historical transmission time using a target estimation algorithm.
[0134] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: The target value is determined based on the first quantity and the first preset value; If the target value is greater than or equal to the second preset threshold, the sending period is determined based on the target value and the second preset value. If the target value is less than the second preset threshold, the transmission period is determined based on the third preset value; wherein, the preset values include the first preset value, the second preset value and the third preset value.
[0135] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: Get the target data transfer volume between each virtual machine and the target server within the sending period; Determine the second number of virtual machines that have a connection with the target server within the sending period; The second activity level of the target server is determined based on the target data transfer volume and the second quantity. If the second activity level is less than the first preset threshold, the target sending time is determined based on the target's historical sending time and sending cycle, and keep-alive data is sent to the target server at the target sending time.
[0136] In other embodiments of this application, the processor 41 is used to execute an information processing program in the memory 42 to perform the following steps: If the second activity level is greater than or equal to the first preset threshold, disconnect the keep-alive connection between the first server and the target server.
[0137] It should be noted that a detailed description of the steps performed by the processor can be found in [reference needed]. Figure 1 and Figure 3 The information processing methods provided in the corresponding embodiments will not be described in detail here.
[0138] The first server provided in the embodiments of this application can first determine the interaction level between the first server and the second server based on the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server. Then, a keep-alive connection between the first server and the second server will only be established if the interaction level value is less than or equal to a first preset threshold. That is to say, when establishing a keep-alive connection between the first server and the second server, the running parameters of the virtual machine corresponding to the first server and the transmission parameters between the virtual machine and the second server are considered simultaneously, instead of establishing a keep-alive connection between the first server and the second server as long as any virtual machine has data interaction with the second server, as in related technologies. This can significantly reduce the number of invalid keep-alive connections, thereby solving the problem of serious bandwidth resource waste in establishing keep-alive connections between servers in related technologies, and thus saving a lot of bandwidth resources.
[0139] Based on the foregoing embodiments, embodiments of this application provide a storage medium storing a computer program, which is implemented when executed by a processor. Figure 1 and3 The corresponding embodiments provide the steps of the information processing method.
[0140] Based on the foregoing embodiments, embodiments of this application provide a computer program product, which includes a computer program that, when executed by a processor, implements... Figure 1 and 3 The corresponding embodiments provide the steps of the information processing method.
[0141] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0142] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0143] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0144] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes The steps of the function specified in one or more boxes.
[0145] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An information processing method characterized by comprising: The method is applied to a first server on which a plurality of virtual machines are deployed, and the method comprises: receiving a data transmission request sent by a second server; wherein the second server is a server that does not have a keep-alive connection with the first server; based on the data transmission request, obtaining a transmission parameter between each virtual machine corresponding to the first server and the second server; wherein the transmission parameter represents a data transmission condition between the each virtual machine and the second server; obtaining a running parameter of the each virtual machine; wherein the running parameter represents a running condition of the each virtual machine; based on the running parameter and the transmission parameter, determining an interaction degree value between the first server and the second server; if the interaction degree value is less than or equal to a first preset threshold, establishing a keep-alive connection between the first server and the second server.
2. The method of claim 1, wherein, The method further comprises: determining a target historical sending time at which the first server sends historical keep-alive data to a target server; wherein the target server is a server that has established a keep-alive connection with the first server; and the target historical sending time is the closest sending time to a current time; determining a first number of virtual machines that have a connection relationship with the target server at the target historical sending time; based on the first number and a preset value, determining a sending period of keep-alive data sent by the first server; 3. The method of claim 2, wherein, based on the sending period and the target historical sending time, sending the keep-alive data to the target server. The method further comprises: obtaining first address information of the each virtual machine and second address information of the target server; 4. The method of claim 1, wherein, processing the first address information, the second address information, and the target historical sending time by using a target evaluation algorithm to obtain the first number. The method further comprises: based on the first number and a first preset value, determining a target value; based on the target value, determining the sending period of the keep-alive data sent by the first server. 5. The method of claim 4, wherein, 6. The method of claim 4, wherein, If the target value is greater than or equal to a second preset threshold, determining the sending period based on the target value and a second preset value; If the target value is less than the second preset threshold, determining the sending period based on a third preset value; wherein the preset values include the first preset value, the second preset value and the third preset value.
7. The method of claim 4, wherein, The sending of the keep-alive data to the target server based on the sending period and the target historical sending time comprises: acquiring a target data transmission amount between each virtual machine and the target server within the sending period; determining a second number of virtual machines having a connection relationship with the target server within the sending period; determining a second activity degree of the target server based on the target data transmission amount and the second number; If the second activity degree is less than the first preset threshold, determining a target sending time based on the target historical sending time and the sending period, and sending the keep-alive data to the target server at the target sending time; Correspondingly, the method further comprises: If the second activity degree is greater than or equal to the first preset threshold, disconnecting the keep-alive connection between the first server and the target server.
8. A first server, characterized by, It comprises: a processor and a memory for storing a computer program capable of running on the processor; wherein the processor is used to run the computer program, and execute the steps of the method according to any one of claims 1 to 7.
9. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7. The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7.