Traffic control method, computer equipment and storage medium
By sending the next acquisition request to the server after the client receives the request data and processes it, the problem of network blocking in KVM remote control is solved, and the accuracy of traffic control and the stability of remote control is improved.
Patent Information
- Application Number
- CN202311669192.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-06-10
AI Technical Summary
When using KVM to remotely control servers across regions, poor network environments may lead to network blockage, especially due to the large amount of video image frame data and the low accuracy of existing traffic control methods.
After the client receives the request data and processes it, it initiates the next acquisition request to the server, and controls the conditions for the client to initiate the acquisition request to control the traffic of the server transmitting data to the client.
It achieves improved the accuracy of traffic control, avoids network congestion, and improves the stability of remote control.
Smart Images

Figure CN120128537A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of remote control, and particularly to a method for controlling traffic, a computer device, and a storage medium. Background Art
[0002] A Baseboard Management Controller (BMC) Keyboard Video Mouse (KVM) is a way for system administrators to control one or more servers or computer hosts through a keyboard, mouse, and monitor.
[0003] However, when using KVM to remotely control servers across regions, problems such as network congestion may occur in case of a poor network environment. Especially, the main data in BMC KVM communication is video image frame data, and the data volume of each frame of image is relatively large, usually resulting in a relatively serious network congestion situation. Currently, when operators encounter a poor network environment, they usually set the network bandwidth of the server at the user end so that the server adjusts the data traffic sent to adapt to the current bandwidth, thereby avoiding the problem of network congestion caused by a large amount of data flooding into the client.
[0004] However, the above method for controlling traffic has the problem of low accuracy. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method for controlling traffic, a computer device, and a storage medium that can improve the accuracy of traffic control.
[0006] In a first aspect, the present application provides a method for controlling traffic, including:
[0007] In response to multiple acquisition requests triggered by a user on the current interface, sending a target acquisition request among the multiple acquisition requests to the server;
[0008] Receiving request data returned by the server based on the target acquisition request, and after processing the request data, sending other acquisition requests except the target acquisition request to the server.
[0009] The above method realizes a new method for controlling traffic. Compared with the existing method of manually setting the network bandwidth of the server at the client to control traffic, the above method is based on the client receiving request data and processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate acquisition requests, to control the traffic of data transmitted from the server to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0010] In one embodiment, sending other acquisition requests except the target acquisition request to the server includes:
[0011] Taking any one of the other acquisition requests except the target acquisition request as a new target acquisition request, and based on the new target acquisition request, returning to execute the step of sending the target acquisition request in the multiple acquisition requests to the server until all acquisition requests are sent to the server.
[0012] The traffic control method provided by this application controls the traffic of data transmitted from the server to the client based on sending acquisition requests to the server one by one, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0013] In one embodiment, the request data is image frame data, and the method for processing the request data includes:
[0014] Decoding the image frame data to obtain the decoded image frame data;
[0015] Displaying the decoded image frame data on the current interface.
[0016] The data display method provided by this application provides a basis for the client to determine the time to initiate the next acquisition request according to the display time of the image frame data based on decoding and displaying the image frame data.
[0017] In one embodiment, the above method further includes:
[0018] Responding to the close request triggered by the user on the current interface, and stopping sending other acquisition requests except the target acquisition request to the server.
[0019] The method for stopping sending acquisition requests provided by the embodiments of this application can stop sending acquisition requests to the server at any time by responding to the close request triggered by the user, and flexibly realizes a way to stop sending acquisition requests to the user side to a certain extent.
[0020] In a second aspect, this application provides a traffic control method, including:
[0021] Receiving a target acquisition request sent by the client; the target acquisition request is any one of multiple acquisition requests triggered and generated by the client;
[0022] Obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool;
[0023] Sending the request data to the client.
[0024] The above method realizes a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to control traffic, the above method is based on the client receiving request data, processing the request data, and then initiating the next acquisition request to the server. That is, by controlling the conditions for the client to initiate the acquisition request, the traffic of the server transmitting data to the client is controlled, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0025] In one embodiment, the above method further includes:
[0026] Receiving other acquisition requests sent by the client; the other acquisition requests are acquisition requests sent by the client after processing the request data;
[0027] Taking the other acquisition requests as new target acquisition requests, and returning to execute the step of obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool until all the request data corresponding to the acquisition requests are returned to the client.
[0028] The traffic control method provided by this application is based on sending request data to the server one by one to control the traffic of the server transmitting data to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0029] In one embodiment, the obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool includes:
[0030] Determining the target buffer area in the cache pool corresponding to the request data according to the preset memory mapping relationship;
[0031] Obtaining the request data corresponding to the target acquisition request from the target buffer area.
[0032] In the request data acquisition method provided by the embodiments of this application, the request data is pre-placed in the corresponding buffer area, so that when the target acquisition request is received, the request data can be directly obtained from the corresponding buffer area, and there is no need to search extensively in the cache pool to determine the location of the request data, further improving the query efficiency of the server data.
[0033] In one embodiment, the request data corresponding to the above multiple acquisition requests are all image frame data, and the method further includes:
[0034] Dividing the cache pool according to the resolutions of the image frame data corresponding to the multiple acquisition requests; the cache pool includes multiple buffer areas, and the multiple buffer areas correspond to the multiple image frame data one by one;
[0035] Storing each image frame data into the corresponding buffer area.
[0036] The method for storing data in a buffer provided by an embodiment of the present application divides a buffer pool based on the resolution of image frame data, and stores the image frame data in the buffer in advance. Since the image frame data is stored in the buffer in advance, when obtaining the image frame data in the buffer, only direct acquisition is required, without a large-scale search in the buffer pool. This will not cause lag even when the data processing speed in other links is very fast, thereby further improving the data transmission efficiency.
[0037] In a third aspect, the present application further provides a traffic control device, including:
[0038] A first sending module, configured to send a target acquisition request among a plurality of acquisition requests triggered by a user on a current interface to a server;
[0039] A second sending module, configured to receive request data returned by the server based on the target acquisition request, and after processing the request data, send other acquisition requests except the target acquisition request to the server;
[0040] In a fourth aspect, the present application further provides a traffic control device, including:
[0041] A receiving module, configured to receive a target acquisition request sent by a client; the target acquisition request is any one of a plurality of acquisition requests triggered and generated by the client;
[0042] An acquisition module, configured to acquire request data corresponding to the target acquisition request from a target buffer area in a buffer pool;
[0043] A sending module, configured to send the request data to the client.
[0044] In a fifth aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0045] Respond to a plurality of acquisition requests triggered by a user on a current interface, and send a target acquisition request among the plurality of acquisition requests to a server;
[0046] Receive request data returned by the server based on the target acquisition request, and after processing the request data, send other acquisition requests except the target acquisition request to the server.
[0047] In a sixth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0048] In response to multiple acquisition requests triggered by a user on the current interface, send the target acquisition request among the multiple acquisition requests to the server;
[0049] Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0050] In a seventh aspect, the present application also provides a computer program product, including a computer program, which when executed by a processor implements the following steps:
[0051] In response to multiple acquisition requests triggered by a user on the current interface, send the target acquisition request among the multiple acquisition requests to the server;
[0052] Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0053] The above-mentioned traffic control method, computer device, and storage medium implement a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, the above method is based on the client receiving the request data, processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate the acquisition request, to control the traffic of the data transmitted from the server to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0055] Figure 1 It is an application environment diagram of the traffic control method in an embodiment;
[0056] Figure 2 It is an application environment diagram of the traffic control method in an embodiment;
[0057] Figure 3 It is a flowchart of the traffic control method in an embodiment;
[0058] Figure 4 It is a flowchart of the traffic control method in another embodiment;
[0059] Figure 5 Schematic flowchart of the flow control method in another embodiment;
[0060] Figure 6 Schematic flowchart of the flow control method in another embodiment;
[0061] Figure 7 Schematic flowchart of the flow control method in another embodiment;
[0062] Figure 8 Schematic flowchart of the flow control method in another embodiment;
[0063] Figure 9 Schematic flowchart of the flow control method in another embodiment;
[0064] Figure 10 Schematic flowchart of the flow control method in another embodiment;
[0065] Figure 11 Schematic flowchart of the flow control method in another embodiment;
[0066] Figure 12 Schematic flowchart of the flow control method in another embodiment;
[0067] Figure 13 Block diagram of the structure of the flow control device in one embodiment;
[0068] Figure 14 Block diagram of the structure of the flow control device in one embodiment;
[0069] Figure 15 Internal structure diagram of a computer device in one embodiment. Detailed implementation manners
[0070] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above accompanying drawings are intended to cover non-exclusive inclusion.
[0072] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "a plurality" is more than two, unless otherwise specifically defined.
[0073] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0074] Baseboard Management Controller (BMC) Keyboard Video Mouse (KVM) is a way of a network-based remote operation server. It uses the network to transmit data of input and output devices such as keyboards, mice, and video images, and through steps such as setting BMC parameters, installing related software, and configuring the network, realizes remote access and control of the server by the local PC side. This enables administrators to manage and maintain the server at any time and any place, greatly improving flexibility. At the same time, KVM can also support multiple connections simultaneously, improving the ability to manage multiple users at the same time.
[0075] However, when using KVM to remotely control a server across regions, problems such as network congestion may occur if a poor network environment is encountered. In particular, the main data in BMC KVM communication is video image frame data, and the data volume of each frame of image is relatively large, usually resulting in a relatively serious situation of network congestion. Currently, when operators encounter a poor network environment, they usually set the network bandwidth of the server at the user side. For example, set the network bandwidth to 256K, 512K, 1M, 10M, 100M, etc., so that the server adjusts the data traffic sent to adapt to the current bandwidth, thereby avoiding the problem of network congestion caused by a large amount of data flooding into the client. As follows Figure 1 shown, provides a schematic diagram of avoiding network congestion by adjusting the network bandwidth, that is, when network congestion occurs in the image data sent from the KVM server to the KVM client, the administrator manually sets the network bandwidth of the KVM server at the KVM client, so that the KVM server saves the set network bandwidth and sends image data to the KVM client according to the network bandwidth.
[0076] However, since the main data for communication in BMC KVM is video image frame data and the data volume of each frame of image is relatively large, many server manufacturers have added a bandwidth setting function when implementing the BMC KVM function, allowing users to directly set the network bandwidth. However, for users, they only use the BMC KVM operation to manage the server and do not understand the principle of KVM bandwidth management, so they generally do not set the bandwidth. In the case of a relatively poor network environment or a large cross-regional network latency, if the user does not set the bandwidth in time, the KVM server will continuously send image frame data streams, eventually leading to network data congestion. Therefore, this mechanism that relies on user judgment and processing is not intelligent enough, and it is also inaccurate to adjust the data volume sent by the BMC KVM server. Hence, the above traffic control method has the problem of low accuracy. This application aims to solve this problem.
[0077] After introducing the background technology of the traffic control method provided by the embodiments of this application above, next, the implementation environment involved in the traffic control method provided by the embodiments of this application will be briefly described. The traffic control method provided by the embodiments of this application can be applied to a system composed of a client and a server as shown in Figure 2 The above system includes multiple clients 101 and a server 102, and each client 101 is communicatively connected to the server 102 through a network. Generally, a user manages and controls the server 102 through KVM on the client 101 (for example, the client 101 sends an instruction to request a video image frame to the server 102), so that the server 102 returns the video image frame data indicated by the request to the client 101). It should be noted that multiple clients 101 can simultaneously control the server 102 through KVM, and the embodiments of this application will be described for the case where one client 101 controls the server 102 through KVM.
[0078] Those skilled in the art can understand that Figure 2 The structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0079] After introducing the application scenario of the traffic control method provided by the embodiments of this application above, the traffic control method described in this application will be emphasized below.
[0080] In one embodiment, as shown in Figure 3 A traffic control method is provided. Taking the method applied to the client 101 in Figure 2 as an example, it includes the following steps:
[0081] S201. In response to multiple acquisition requests triggered by the user on the current interface, send the target acquisition request among the multiple acquisition requests to the server.
[0082] Herein, the current interface refers to the display interface of the client 101. The current interface may include a trigger window. The user can send multiple acquisition requests to the client 101 by triggering the trigger window on the current interface. The acquisition requests may include requests for acquiring video image frame data in the server 102. The video image frame data acquired by each acquisition request may be the same or different. The target acquisition request refers to any one of the multiple acquisition requests.
[0083] In the embodiment of the present application, when it is necessary to control the data traffic of the image frame data sent from the server 102 to the client 101, the user can first start the client 101, open the current interface according to the instructions of the client 101, then trigger multiple acquisition requests on the current interface of the client 101. The client 101 responds to the multiple acquisition requests triggered by the user on the current interface, selects one acquisition request from these multiple acquisition requests as the target acquisition request, and then sends the target acquisition request among the multiple acquisition requests to the server 102, so that the server 102 can return the video image frame data indicated by the target acquisition request to the client 101.
[0084] S202. Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0085] Herein, the request data may be the video image frame data requested by the target acquisition request. The processing includes decoding processing and display processing of the request data, etc. The other acquisition requests except the target acquisition request may include one acquisition request except the target acquisition request among the multiple acquisition requests, or may include multiple acquisition requests except the target acquisition request among the multiple acquisition requests.
[0086] In the embodiment of the present application, after the above-mentioned target acquisition request is sent to the server, the server can search for the request data indicated by the target acquisition request in a preset database according to the target acquisition request, and return the request data indicated by the target acquisition request to the client. The client receives the request data returned by the server based on the target acquisition request, processes the received request data, and after processing the received request data, sends the other acquisition requests except the target acquisition request among the multiple acquisition requests to the server, so that the server can return the video image frame data indicated by the other acquisition requests to the client. It should be noted that a large amount of request data is stored in the preset database.
[0087] The traffic control method provided by the embodiments of the present application is applied to a client. In response to multiple acquisition requests triggered by a user on the current interface, the target acquisition request among the multiple acquisition requests is sent to the server. The request data returned by the server based on the target acquisition request is received, and after processing the request data, the other acquisition requests except the target acquisition request are sent to the server. The above method realizes a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, the above method is based on the client receiving the request data and processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate the acquisition request, to control the traffic of the data transmitted from the server to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0088] In one embodiment, based on Figure 3 the embodiment shown, the process of sending the other acquisition requests to the server can be described. The above S202 "sending the other acquisition requests except the target acquisition request to the server" includes:
[0089] Taking any one of the other acquisition requests except the target acquisition request as a new target acquisition request, and based on the new target acquisition request, execute the step of sending the target acquisition request among the multiple acquisition requests to the server until all acquisition requests are sent to the server.
[0090] In the embodiments of the present application, after sending the target acquisition request among the multiple acquisition requests to the server, receiving the request data returned by the server based on the target acquisition request, and processing the request data, any one of the other acquisition requests except the target acquisition request among the multiple acquisition requests can be taken as a new target acquisition request, and the new target acquisition request is sent to the server, so that the server can return the video image frame data indicated by the new target acquisition request to the client. After the client receives the video image frame data sent by the server, the video image frame data is processed, and after processing the received video image frame data, the other acquisition requests except the target acquisition request and the new target acquisition request among the multiple acquisition requests are sent to the server one by one, so that the server can return the video image frame data indicated by the other acquisition requests to the client,..., until all acquisition requests are sent to the server.
[0091] The traffic control method provided by the present application controls the traffic of the data transmitted from the server to the client based on sending the acquisition requests to the server one by one, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0092] In one embodiment, based on the embodiment shown Figure 3 below, in the case where the request data is image frame data, the process of processing the request data can be described. As Figure 4 shown, the above-mentioned S202 "process the request data" includes:
[0093] S301. Decode the image frame data to obtain the decoded image frame data.
[0094] In the embodiment of the present application, after the client receives the request data returned by the server based on the target acquisition request, in the case where the request data is image frame data, the client can perform decoding processing on the image frame data based on a preset decoding method, so as to obtain the decoded image frame data.
[0095] S302. Display the decoded image frame data on the current interface.
[0096] Among them, the current interface may include a display area for the image frame data, which is used to display the decoded image frame data.
[0097] In the embodiment of the present application, after obtaining the decoded image frame data as described above, the decoded image frame data can be displayed on the display area of the image frame data in the current interface.
[0098] The data display method provided by the present application, based on decoding and displaying the image frame data, provides a basis for the client to determine the time to initiate the next acquisition request according to the display time of the image frame data.
[0099] In one embodiment, based on the embodiment shown Figure 3 below, as Figure 5 shown, the above method further includes:
[0100] S203. In response to a close request triggered by the user on the current interface, stop sending other acquisition requests except the target acquisition request to the server.
[0101] Among them, the current interface may include a close window, and the user can close the client by triggering the close window on the current interface. The close request refers to a request to close the client, or it can also be a request to stop the client from sending acquisition requests to the server.
[0102] In the embodiments of the present application, when the server 102 does not need to return image frame data to the client 101, the user can trigger the closing of the window on the current interface of the client 101, so that the client responds to the closing request triggered by the user on the current interface and stops sending other acquisition requests except the target acquisition request to the server. Optionally, the client 101 responds to multiple acquisition requests triggered by the user on the current interface, selects one acquisition request from these multiple acquisition requests as the target acquisition request, and then sends the target acquisition request among the multiple acquisition requests to the server 102, so that the server 102 can return the video image frame data indicated by the target acquisition request to the client 101. The client receives the request data returned by the server based on the target acquisition request, processes the received request data, and after processing the received request data, at this time, the user triggers the closing of the window on the current interface of the client 101, so that the client responds to the closing request triggered by the user on the current interface and stops sending other acquisition requests except the target acquisition request to the server.
[0103] The method for stopping sending acquisition requests provided by the embodiments of the present application can stop sending acquisition requests to the server at any time by responding to the closing request triggered by the user, and flexibly realizes a way of stopping sending acquisition requests to the user side to a certain extent.
[0104] In one embodiment, as Figure 6 shown, the embodiments of the present application also provide a complete flowchart (client) of a traffic control method, and the method includes:
[0105] S10. Respond to multiple acquisition requests triggered by the user on the current interface, and send the target acquisition request among the multiple acquisition requests to the server;
[0106] S11. Receive the request data returned by the server based on the target acquisition request, and decode the image frame data to obtain the decoded image frame data;
[0107] S12. Display the decoded image frame data on the current interface;
[0108] S13. Determine whether all acquisition requests have been sent to the server / whether the user triggers a closing request on the current interface. If so, go to S14; if not, go to S15;
[0109] S14. Use any one of the other acquisition requests except the target acquisition request as the new target acquisition request, and return to S11;
[0110] S15. Stop sending other acquisition requests except the target acquisition request to the server.
[0111] The above method realizes a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, based on the client receiving request data and processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate the acquisition request, the traffic of the server transmitting data to the client is controlled, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0112] In one embodiment, as Figure 7 shown, a traffic control method is provided. Taking the server 102 in Figure 2 as an example for illustration, the method includes the following steps:
[0113] S401. Receive the target acquisition request sent by the client.
[0114] Among them, the target acquisition request is any one of the multiple acquisition requests triggered and generated by the client.
[0115] In the embodiment of the present application, when it is necessary to control the data traffic of the image frame data sent from the server 102 to the client 101, the user can first trigger multiple acquisition requests on the current interface of the client 101. The client 101 responds to the multiple acquisition requests triggered by the user on the current interface, selects one acquisition request from these multiple acquisition requests as the target acquisition request, and then sends the target acquisition request among the multiple acquisition requests to the server 102, and the server receives the target acquisition request sent by the client.
[0116] S402. Obtain the request data corresponding to the target acquisition request from the target buffer area in the buffer pool.
[0117] Among them, the buffer pool refers to the area for storing request data. The buffer pool includes multiple buffer areas, and the sizes of the buffer areas can be the same or different.
[0118] In the embodiment of the present application, after the above server receives the target acquisition request sent by the client, it can first determine the target buffer area where the request data corresponding to the target acquisition request is located from the multiple buffer areas in the buffer pool of the server, and then obtain the request data corresponding to the target acquisition request from the target buffer area in the buffer pool. It should be noted that the request data corresponding to different acquisition requests is stored in different buffer areas.
[0119] S403. Send the request data to the client.
[0120] In an embodiment of the present application, after obtaining the request data corresponding to the target acquisition request, the request data may be sent to the client through network communication, so that the client receives the request data corresponding to the target acquisition request, decodes the received request data corresponding to the target acquisition request to obtain the decoded request data, and displays the decoded request data on the display interface of the client.
[0121] The traffic control method provided by the embodiment of the present application is applied to the server. The server receives a target acquisition request sent by the client. The target acquisition request is any one of multiple acquisition requests triggered and generated by the client. The server obtains the request data corresponding to the target acquisition request from the target buffer area in the cache pool and sends the request data to the client. The above method realizes a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, the above method is based on the client receiving the request data, processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate the acquisition request, to control the traffic of the data transmitted from the server to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0122] In one embodiment, on the basis of the Figure 7 embodiment shown, as Figure 8 shown, the above method further includes:
[0123] S404. Receive other acquisition requests sent by the client.
[0124] Among them, the other acquisition request is an acquisition request sent by the client after processing the request data.
[0125] In an embodiment of the present application, after the server sends the request data corresponding to the target acquisition request to the client, the client may also send other acquisition requests other than the target acquisition request among the multiple acquisition requests to the server, and the server receives the other acquisition requests sent by the client.
[0126] S405. Take the other acquisition request as a new target acquisition request, and return to execute the step of obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool until all the request data corresponding to the acquisition requests is returned to the client.
[0127] In an embodiment of the present application, after the server receives other acquisition requests sent by the client, the other acquisition requests can be used as new target acquisition requests, and the request data corresponding to the new target acquisition requests can be determined from the target buffer area in the buffer pool, and the request data indicated by the new target acquisition requests is returned to the client. After the client receives the request data indicated by the new target acquisition requests sent by the server, the client can process the request data indicated by the new target acquisition requests, and after processing the received request data, the other acquisition requests in the multiple acquisition requests except the target acquisition requests and the new target acquisition requests are sent to the server one by one, so that the server can return the request data indicated by the other acquisition requests to the client,..., until the server sends the request data corresponding to all the acquisition requests to the client.
[0128] The traffic control method provided by the present application controls the traffic of data transmitted from the server to the client based on sending request data to the server one by one, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0129] In one embodiment, on the basis of the embodiment shown in Figure 7 and Figure 8 the process of obtaining the request data corresponding to the target acquisition request can be described. As shown in Figure 9 above, step S402, "obtain the request data corresponding to the target acquisition request from the target buffer area in the buffer pool", includes:
[0130] S501. Determine the target buffer area in the buffer pool corresponding to the request data according to the preset memory mapping relationship.
[0131] The preset memory mapping relationship can be the corresponding relationship between the request data and the buffer areas in the buffer pool. Optionally, it can be a one-to-one corresponding relationship between the request data and the buffer areas in the buffer pool, or a corresponding relationship between multiple request data and one buffer area in the buffer pool. For example, request data 1 corresponds to buffer area 1 in the buffer pool, request data 2 corresponds to buffer area 2 in the buffer pool, and request data 3 corresponds to buffer area 3 in the buffer pool.
[0132] In an embodiment of the present application, after the server receives the target acquisition request sent by the client, the request data corresponding to the target acquisition request can be determined according to the target acquisition request, and then the target buffer area in the buffer pool corresponding to the request data corresponding to the target acquisition request is determined according to the preset memory mapping relationship between the request data and the buffer areas in the buffer pool. For example, it is determined that the target buffer area 1 in the buffer pool corresponding to the request data 1 corresponding to the target acquisition request.
[0133] S502. Obtain the request data corresponding to the target acquisition request from the target buffer.
[0134] In the embodiments of the present application, after determining the target buffer where the request data corresponding to the target acquisition request is located, the request data corresponding to the target acquisition request can be directly obtained from the target buffer. After obtaining the request data from the target buffer, the image frame data in the new server is filled into the target buffer so that each buffer is filled with image frame data before receiving the acquisition request. Alternatively, after obtaining the request data from the target buffer, check whether there is an idle buffer. If there is an idle buffer, fill the image frame data in the new server into the idle buffer so that each buffer is filled with image frame data before receiving the acquisition request. Continuing with the above example, directly obtain the request data 1 corresponding to the target acquisition request from the target buffer 1 in the buffer pool.
[0135] In the method for obtaining request data provided in the embodiments of the present application, the request data is pre-placed in the corresponding buffer so that when the target acquisition request is received, the request data can be directly obtained from the corresponding buffer, and there is no need to perform a large-scale search in the buffer pool to determine the location of the request data, further improving the query efficiency of the server data.
[0136] In one embodiment, on the basis of Figure 9 the embodiment shown, as Figure 10 shown, the above method further includes:
[0137] S406. Divide the buffer pool according to the resolutions of the image frame data corresponding to multiple acquisition requests.
[0138] Among them, the request data corresponding to multiple acquisition requests are all image frame data. The buffer pool includes multiple buffers, and the multiple buffers correspond to the multiple image frame data one by one. The resolution of the image frame data is stored in the KVM kernel driver of the server, and the server needs to first obtain the storage of the resolution of the image frame data from the KVM kernel driver. For example, the larger the resolution of the image frame data corresponding to the acquisition request, the larger the buffer where the image frame data is located.
[0139] In the embodiments of the present application, before obtaining the request data from the target buffer, it is also necessary to divide the buffers in the buffer pool. The following provides a method for dividing each buffer in the buffer pool. After the server receives the start request sent by the client, the server is started, and then the buffer pool is divided according to the resolutions of the image frame data corresponding to multiple acquisition requests. Optionally, calculate the size of the buffer in the buffer pool according to the resolution of the image frame data, then determine the number of buffers in the buffer pool according to experience, and divide the buffer pool according to the size of the buffer and the buffer.
[0140] S407. Store each image frame data into the corresponding buffer area.
[0141] In the embodiment of the present application, after the above-mentioned cache pool is partitioned into multiple buffer areas, each image frame data in the server can be stored into the corresponding buffer area.
[0142] The method for storing data into the buffer area provided by the embodiment of the present application partitions the cache pool based on the resolution of the image frame data, and pre-stores the image frame data in the buffer area. Since the image frame data is pre-stored in the buffer area, when obtaining the image frame data in the buffer area, only direct acquisition is required, without the need to search extensively in the cache pool. This will not cause lag even when the data processing speed in other links is very fast, thereby further improving the data transmission efficiency.
[0143] In one embodiment, as Figure 11 shown, the embodiment of the present application also provides a complete flowchart (server side) of a traffic control method, and the method includes:
[0144] S20. Partition the cache pool into multiple buffer areas according to the resolutions of the image frame data corresponding to multiple acquisition requests;
[0145] S21. Store each image frame data into the corresponding buffer area;
[0146] S22. Receive a target acquisition request sent by the client;
[0147] S23. Determine the target buffer area in the cache pool corresponding to the request data according to the preset memory mapping relationship;
[0148] S24. Obtain the request data corresponding to the target acquisition request from the target buffer area;
[0149] S25. Send the request data to the client;
[0150] S26. Determine whether all the request data corresponding to the acquisition requests have been returned to the client. If so, go to S27; if not, go to S28;
[0151] S27. Stop returning the request data;
[0152] S28. Receive other acquisition requests sent by the client, and use the other acquisition requests as new target acquisition requests, and return to execute S24 - S25;
[0153] The above method implements a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, the above method is based on the client receiving request data, processing the request data, and then initiating the next acquisition request to the server. That is, by controlling the conditions for the client to initiate the acquisition request, the traffic of the data transmitted from the server to the client is controlled, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0154] In summary of all the above embodiments, as Figure 12 shown, a traffic control method implemented by the interaction between the client and the server is also provided. The method includes:
[0155] S30. Divide the cache pool into multiple cache areas according to the resolution of the image frame data, and store each image frame data of the server in the corresponding cache area;
[0156] S31. Respond to multiple acquisition requests triggered by the user on the current interface;
[0157] S32. Send the target acquisition request in the multiple acquisition requests to the server;
[0158] S33. Receive the target acquisition request sent by the client, determine the target cache area in the cache pool corresponding to the request data according to the preset memory mapping relationship, and obtain the request data corresponding to the target acquisition request from the target cache area;
[0159] S34. Send the request data to the client;
[0160] S35. Receive the request data returned by the server based on the target acquisition request, and decode the request data to obtain the decoded request data and display it;
[0161] S36. Send the other acquisition requests in the multiple acquisition requests except the target acquisition request to the server;
[0162] S37. Receive the other acquisition requests sent by the client, determine the target cache area in the cache pool corresponding to the request data according to the preset memory mapping relationship, and obtain the request data corresponding to the other acquisition requests from the target cache area;
[0163] S38. Send the request data to the client;
[0164] S39. Receive the request data returned by the server based on the other acquisition requests, and decode the request data to obtain the decoded request data and display it;
[0165] S40. Whether all acquisition requests are sent to the server / whether the user triggers a close request on the current interface.
[0166] The traffic control method provided by the embodiment of the present application is applied to a client. In response to multiple acquisition requests triggered by a user on the current interface, the target acquisition request among the multiple acquisition requests is sent to the server, the request data returned by the server based on the target acquisition request is received, and after processing the request data, the other acquisition requests except the target acquisition request are sent to the server. The above method realizes a new traffic control method. Compared with the existing method of manually setting the network bandwidth of the server on the client to achieve traffic control, the above method is based on the client receiving the request data and processing the request data, and then initiating the next acquisition request to the server, that is, by controlling the conditions for the client to initiate the acquisition request, to control the traffic of the data transmitted from the server to the client, thereby fundamentally realizing traffic control, which improves the accuracy of traffic control to a certain extent.
[0167] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0168] Based on the same inventive concept, the embodiment of the present application also provides a traffic control device for implementing the above-mentioned traffic control method. The solution for solving the problem provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the traffic control device provided below can refer to the limitations on the traffic control method in the above text, and will not be repeated here.
[0169] In an exemplary embodiment, as Figure 13 shown, a traffic control device is provided, including: a first sending module 10 and a second sending module 11, where:
[0170] The first sending module 10 is configured to send the target acquisition request among the multiple acquisition requests to the server in response to multiple acquisition requests triggered by a user on the current interface.
[0171] The second sending module 11 is configured to receive the request data returned by the server based on the target acquisition request, and after processing the request data, send other acquisition requests except the target acquisition request to the server.
[0172] In an exemplary embodiment, the second sending module 11 is further configured to use any one of the other acquisition requests except the target acquisition request as a new target acquisition request, and based on the new target acquisition request, execute the step of sending the target acquisition request among the multiple acquisition requests to the server until all acquisition requests are sent to the server.
[0173] In an exemplary embodiment, the request data is image frame data, and the second sending module 11 includes: a decoding unit and a display unit, where:
[0174] The decoding unit is specifically configured to decode the image frame data to obtain the decoded image frame data;
[0175] The display unit is specifically configured to display the decoded image frame data on the current interface.
[0176] In an exemplary embodiment, the device further includes: a stop module, configured to respond to a close request triggered by the user on the current interface and stop sending other acquisition requests except the target acquisition request to the server.
[0177] In an exemplary embodiment, as Figure 14 shown, a traffic control device is provided, including: a receiving module 20, an acquisition module 21, and a sending module 22, where:
[0178] The receiving module 20 is configured to receive a target acquisition request sent by a client; the target acquisition request is any one of multiple acquisition requests triggered and generated by the client;
[0179] The acquisition module 21 is configured to acquire request data corresponding to the target acquisition request from the target buffer area in the cache pool;
[0180] The sending module 22 is configured to send the request data to the client.
[0181] In an exemplary embodiment, the device further includes: a receiving module and an acquisition module, where:
[0182] The receiving module is configured to receive other acquisition requests sent by the client; the other acquisition requests are acquisition requests sent by the client after processing the request data;
[0183] An acquisition module is configured to use other acquisition requests as new target acquisition requests, and return the steps of executing the acquisition of request data corresponding to the target acquisition requests from the target buffer areas in the cache pool until all the request data corresponding to the acquisition requests are returned to the client.
[0184] In an exemplary embodiment, the above acquisition module 21 includes: a determination unit and an acquisition unit, where:
[0185] The determination unit is specifically configured to determine the target buffer area in the cache pool corresponding to the request data according to a preset memory mapping relationship;
[0186] The acquisition unit is specifically configured to acquire the request data corresponding to the target acquisition requests from the target buffer areas.
[0187] In an exemplary embodiment, the request data corresponding to the above multiple acquisition requests are all image frame data, and the above acquisition module 21 further includes: a division unit and a storage unit, where:
[0188] The division unit is specifically configured to divide the cache pool according to the resolutions of the image frame data corresponding to the multiple acquisition requests; the cache pool includes multiple buffer areas, and the multiple buffer areas correspond to the multiple image frame data one by one;
[0189] The storage unit is specifically configured to store each image frame data into the corresponding buffer area.
[0190] Each module in the above traffic control device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form so that the processor can call and execute the operations corresponding to the above respective modules.
[0191] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 15As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for controlling traffic. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0192] Those skilled in the art can understand that Figure 15 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0193] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0194] In response to multiple acquisition requests triggered by the user on the current interface, send the target acquisition request among the multiple acquisition requests to the server;
[0195] Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0196] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0197] Take any one of the acquisition requests other than the target acquisition request as the new target acquisition request, and based on the new target acquisition request, return to execute the step of sending the target acquisition request among the multiple acquisition requests to the server until all the acquisition requests are sent to the server.
[0198] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0199] Decode the image frame data to obtain the decoded image frame data;
[0200] Display the decoded image frame data on the current interface.
[0201] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0202] In response to the close request triggered by the user on the current interface, stop sending the acquisition requests other than the target acquisition request to the server.
[0203] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0204] Receive the target acquisition request sent by the client; the target acquisition request is any one of the multiple acquisition requests triggered and generated by the client;
[0205] Obtain the request data corresponding to the target acquisition request from the target buffer area in the cache pool;
[0206] Send the request data to the client.
[0207] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0208] Receive other acquisition requests sent by the client; the other acquisition requests are the acquisition requests sent by the client after processing the request data;
[0209] Take the other acquisition requests as the new target acquisition request, and return to execute the step of obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool until all the request data corresponding to the acquisition requests are returned to the client.
[0210] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0211] According to the preset memory mapping relationship, determine the target buffer area in the cache pool corresponding to the request data;
[0212] Obtain the request data corresponding to the target acquisition request from the target buffer area.
[0213] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0214] Divide the cache pool according to the resolutions of the image frame data corresponding to multiple acquisition requests; the cache pool includes multiple buffer areas, and the multiple buffer areas correspond to the multiple image frame data one by one;
[0215] Store each image frame data into the corresponding buffer area.
[0216] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0217] In response to multiple acquisition requests triggered by the user on the current interface, send the target acquisition request among the multiple acquisition requests to the server;
[0218] Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0219] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0220] Take any one of the other acquisition requests except the target acquisition request as the new target acquisition request, and based on the new target acquisition request, execute the step of sending the target acquisition request among the multiple acquisition requests to the server until all acquisition requests are sent to the server.
[0221] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0222] Decode the image frame data to obtain the decoded image frame data;
[0223] Display the decoded image frame data on the current interface.
[0224] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0225] In response to the close request triggered by the user on the current interface, stop sending the other acquisition requests except the target acquisition request to the server.
[0226] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0227] Receive the target acquisition request sent by the client; the target acquisition request is any one of the multiple acquisition requests triggered and generated by the client;
[0228] Obtain the request data corresponding to the target acquisition request from the target buffer area in the cache pool;
[0229] Send the request data to the client.
[0230] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0231] Receive other acquisition requests sent by the client; the other acquisition requests are acquisition requests sent by the client after processing the request data;
[0232] Use the other acquisition requests as new target acquisition requests, and return to execute the step of obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool until all the request data corresponding to the acquisition requests are returned to the client.
[0233] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0234] Determine the target buffer area in the cache pool corresponding to the request data according to the preset memory mapping relationship;
[0235] Obtain the request data corresponding to the target acquisition request from the target buffer area.
[0236] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0237] Divide the cache pool according to the resolutions of the image frame data corresponding to multiple acquisition requests; the cache pool includes multiple buffer areas, and the multiple buffer areas correspond to the multiple image frame data one by one;
[0238] Store each image frame data into the corresponding buffer area.
[0239] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by the processor, the following steps are implemented:
[0240] In response to multiple acquisition requests triggered by the user on the current interface, send the target acquisition request among the multiple acquisition requests to the server;
[0241] Receive the request data returned by the server based on the target acquisition request, and after processing the request data, send the other acquisition requests except the target acquisition request to the server.
[0242] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented:
[0243] Take any one of the acquisition requests other than the target acquisition request as the new target acquisition request, and based on the new target acquisition request, return to execute the step of sending the target acquisition request among the multiple acquisition requests to the server until all acquisition requests are sent to the server.
[0244] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0245] Decode the image frame data to obtain the decoded image frame data;
[0246] Display the decoded image frame data on the current interface.
[0247] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0248] Respond to the close request triggered by the user on the current interface, and stop sending the acquisition requests other than the target acquisition request to the server.
[0249] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0250] Receive the target acquisition request sent by the client; the target acquisition request is any one of the multiple acquisition requests triggered and generated by the client;
[0251] Obtain the request data corresponding to the target acquisition request from the target buffer area in the cache pool;
[0252] Send the request data to the client.
[0253] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0254] Receive other acquisition requests sent by the client; the other acquisition requests are the acquisition requests sent by the client after processing the request data;
[0255] Take the other acquisition requests as the new target acquisition request, and return to execute the step of obtaining the request data corresponding to the target acquisition request from the target buffer area in the cache pool until the request data corresponding to all acquisition requests is returned to the client.
[0256] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0257] Determine the target buffer area in the cache pool corresponding to the request data according to the preset memory mapping relationship;
[0258] Obtain the request data corresponding to the target acquisition request from the target buffer area.
[0259] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0260] Divide the cache pool according to the resolutions of the image frame data corresponding to multiple acquisition requests; the cache pool includes a plurality of buffer areas, and the plurality of buffer areas correspond to the plurality of image frame data one by one;
[0261] Store each image frame data into the corresponding buffer area.
[0262] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0263] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0264] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0265] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for controlling traffic, characterized in that, the method is applied to a client, and the method includes: In response to multiple acquisition requests triggered by a user on the current interface, sending a target acquisition request among the multiple acquisition requests to a server; Receiving request data returned by the server based on the target acquisition request, and after processing the request data, sending other acquisition requests except the target acquisition request to the server.
2. The method according to claim 1, characterized in that, the sending other acquisition requests except the target acquisition request to the server includes: Taking any one of the other acquisition requests except the target acquisition request as a new target acquisition request, and based on the new target acquisition request, performing the step of sending the target acquisition request among the multiple acquisition requests to the server until all the acquisition requests are sent to the server.
3. The method according to claim 1 or 2, characterized in that, the request data is image frame data, and the method for processing the request data includes: Decoding the image frame data to obtain decoded image frame data; Displaying the decoded image frame data on the current interface.
4. The method according to claim 1, characterized in that, the method further includes: In response to a close request triggered by the user on the current interface, stopping sending other acquisition requests except the target acquisition request to the server.
5. A method for controlling traffic, characterized in that, the method is applied to a server, and the method includes: Receiving a target acquisition request sent by a client; the target acquisition request is any one of multiple acquisition requests triggered and generated by the client; Obtaining request data corresponding to the target acquisition request from a target buffer area in a cache pool; Sending the request data to the client.
6. The method according to claim 5, characterized in that, the method further includes: Receiving other acquisition requests sent by the client; the other acquisition requests are acquisition requests sent by the client after processing the request data; Taking the other acquisition requests as new target acquisition requests, and returning to perform the step of obtaining request data corresponding to the target acquisition request from the target buffer area in the cache pool until request data corresponding to all acquisition requests is returned to the client.
7. The method according to claim 5 or 6, characterized in that, the obtaining request data corresponding to the target acquisition request from the target buffer area in the cache pool includes: Determining a target buffer area in the cache pool corresponding to the request data according to a preset memory mapping relationship; Obtaining request data corresponding to the target acquisition request from the target buffer area.
8. The method according to claim 7, characterized in that, request data corresponding to the multiple acquisition requests are all image frame data, and the method further includes: Divide the cache pool according to the resolutions of the image frame data corresponding to the multiple acquisition requests; the cache pool includes a plurality of buffer areas, and the plurality of buffer areas correspond to the plurality of image frame data one by one; Store each of the image frame data into the corresponding buffer area.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium, having stored thereon a computer program, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.