Traffic statistics method and device of cloud virtual device and electronic device
Patent Information
- Application Number
- CN202511653473.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2045-11-12
AI Technical Summary
[0015] The traffic statistics method, apparatus, and electronic device for cloud virtual devices provided in this application monitor a first application and acquire its audio and video data. Based on the first application and the audio and video data, a target data packet to be pushed is determined. The target data packet is pushed to the client and a feedback data packet sent by the client is received. Based on the feedback data packet, the sending record is queried to obtain the traffic statistics for different applications. This provides a more granular acquisition of the traffic consumed by each application within the cloud virtual device and improves the accuracy of traffic statistics.
Smart Images

Figure CN121357066B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus and electronic device for traffic statistics of cloud virtual devices. Background Technology
[0002] A cloud phone is a virtual device built using virtualization technology. Multiple virtual containers are managed by cloud servers, each running a customized operating system, thus enabling the functionality of a virtual phone in the cloud. When using a cloud phone, because real-time video is required, data consumption is faster than normal. From the operator's perspective, by deeply analyzing the data consumption of various applications within the cloud phone, insights into user habits can be gained, providing a basis for subsequent service optimization and targeted marketing. Furthermore, personalized data plans can be customized based on statistical data, and suitable services can be recommended.
[0003] Currently, when using a cloud phone through a cloud phone client, if you want to know the cloud phone's data consumption, you can use the sub-band's data usage statistics tool or the software provided by the supplier to query it. However, this can only count the data consumption of the entire video stream of the cloud phone client and cannot achieve more granular data usage statistics queries. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art.
[0005] Therefore, the first objective of this application is to propose a traffic statistics method for cloud virtual devices, so as to enable more granular traffic statistics queries for cloud virtual devices.
[0006] The second objective of this application is to provide a traffic statistics device for cloud virtual devices.
[0007] The third objective of this application is to propose an electronic device.
[0008] The fourth objective of this application is to provide a computer-readable storage medium.
[0009] The fifth objective of this application is to provide a computer program product.
[0010] To achieve the above objectives, a first aspect of this application proposes a method for traffic statistics of cloud virtual devices, comprising: Monitor the first application currently running in the foreground of the cloud virtual device; Obtain the audio and video data of the first application; Based on the first application and the audio / video data, obtain the target data packet to be pushed; Send the target data packet to the client; Receive a feedback data packet from the target data packet sent by the client; Based on the feedback data packet, the traffic of the cloud virtual device under different applications is statistically analyzed.
[0011] To achieve the above objectives, a second aspect of this application provides a traffic statistics device for a cloud virtual device, comprising: The monitoring module is used to monitor the first application currently running in the foreground of the cloud virtual device; The first acquisition module is used to acquire the audio and video data of the first application; The second acquisition module is used to acquire the target data packet to be pushed based on the first application and the audio and video data; The sending module is used to send the target data packet to the client; A receiving module is used to receive a feedback data packet of the target data packet sent by the client; The statistics module is used to perform statistics on the traffic of the cloud virtual device under different applications based on the feedback data packet.
[0012] To achieve the above objectives, a third aspect of this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method described in the first aspect embodiment.
[0013] To achieve the above objectives, a fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, are used to implement the method described in the first aspect embodiment.
[0014] To achieve the above objectives, a fifth aspect of this application provides a computer program product including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] The traffic statistics method, apparatus, and electronic device for cloud virtual devices provided in this application monitor a first application and acquire its audio and video data. Based on the first application and the audio and video data, a target data packet to be pushed is determined. The target data packet is pushed to the client and a feedback data packet sent by the client is received. Based on the feedback data packet, the sending record is queried to obtain the traffic statistics for different applications. This provides a more granular acquisition of the traffic consumed by each application within the cloud virtual device and improves the accuracy of traffic statistics.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a traffic statistics method for a cloud virtual device provided in an embodiment of this application; Figure 2 This is a schematic diagram of a process for obtaining a target data packet to be pushed, provided in an embodiment of this application. Figure 3 This is a schematic diagram of a target data packet provided in an embodiment of this application; Figure 4 A flowchart illustrating another method for traffic statistics of cloud virtual devices provided in this application embodiment; Figure 5 This is a schematic diagram of a transmission record format provided in an embodiment of this application; Figure 6 This is a schematic diagram of a feedback data packet format provided in an embodiment of this application; Figure 7 This is a schematic diagram of a local database provided in an embodiment of this application; Figure 8 This is a schematic diagram of a target statistical record format provided in an embodiment of this application; Figure 9 An interactive schematic diagram illustrating a traffic statistics method for a cloud virtual device provided in an embodiment of this application; Figure 10 This application provides an example of an interaction logic diagram between modules. Figure 11 This is a schematic diagram of the structure of a traffic statistics device for a cloud virtual device provided in an embodiment of this application. Detailed Implementation
[0018] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0019] The following description, with reference to the accompanying drawings, outlines a method, apparatus, and electronic device for traffic statistics of cloud virtual devices according to embodiments of this application.
[0020] Figure 1This is a flowchart illustrating a traffic statistics method for a cloud virtual device provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps: S101 monitors the first application currently running in the foreground of the cloud virtual device.
[0021] Optionally, the cloud virtual device is a cloud phone, which is a virtual device built using virtualization technology; multiple virtual containers are managed through a cloud server, and each container runs a customized operating system, thereby realizing the function of a cloud-based virtual phone.
[0022] In this embodiment, the first application running in the foreground is the top application in the stack, and this embodiment can achieve monitoring through accessibility services.
[0023] S102, Obtain audio and video data from the first application.
[0024] Understandably, once the client successfully connects to the cloud virtual device, the audio and video processing unit in the cloud virtual device collects image and audio data from the cloud virtual device in real time to obtain the audio and video data for the first application. Correspondingly, when the client disconnects from the cloud virtual device, the collection of audio and video data stops to release resources.
[0025] S103: Obtain the target data packet to be pushed based on the first application and audio / video data.
[0026] Optionally, the identifier of the first application can be obtained, and the identifier of the first application and the audio and video data can be encapsulated to obtain the target data packet to be pushed.
[0027] Optionally, the timestamps corresponding to the audio and video data can also be obtained, and the target data packet can be formed together with the timestamps, the identifier of the first application, and the audio and video data.
[0028] In some embodiments, to improve streaming efficiency, audio and video data can be encoded, and target data packets can be constructed based on the encoded audio and video data.
[0029] S104, send the target data packet to the client.
[0030] Alternatively, the target data packets can be sent to the client via Web Real-Time Communications (WebRTC).
[0031] S105 receives a feedback data packet of the target data packet sent by the client.
[0032] The feedback packet is obtained by the client based on the target packet. The feedback packet may include the size of the target packet received by the client and the application identifier to avoid data replay.
[0033] S106, based on the feedback data packet, perform statistics on the traffic of cloud virtual devices under different applications.
[0034] Optionally, after receiving the feedback data packet, the application identifier can be obtained from the feedback data packet, and the corresponding sending record can be queried according to the application identifier. The sending record can be classified and statistically analyzed according to the sending time to obtain the traffic statistics of different applications at the same time point.
[0035] In this embodiment, by monitoring the first application and obtaining its audio and video data, the target data packet to be pushed is determined based on the first application and the audio and video data. The target data packet is pushed to the client and the feedback data packet sent by the client is received. Based on the feedback data packet, the sending record is queried to obtain the traffic of different applications, thereby obtaining the traffic consumed by each application inside the cloud virtual device in a more granular manner and improving the accuracy of traffic statistics.
[0036] Based on the above embodiments, Figure 2 This is a schematic diagram illustrating a process for obtaining a target data packet to be pushed, as provided in an embodiment of this application. Figure 2 As shown, the method includes the following steps: S201, Based on the identifier of the first application, determine the identifier of the first data packet corresponding to the target data packet.
[0037] In this embodiment, the identifier of the first application is the package name of the first application. The package name is a string used to uniquely identify an application, similar to a digital ID card, to ensure that applications within the device do not conflict.
[0038] Optionally, a mapping table between application identifiers and data packet identifiers can be obtained, and the mapping table can be queried according to the identifier of the first application; in this embodiment, the mapping table is a hash map, that is, the query is performed from the hash map.
[0039] In response to the existence of a second data packet identifier associated with the identifier of the first application in the mapping table, the second data packet identifier is determined as the first data packet identifier; that is, the associated second data packet identifier is found in the HashMap and the second data packet identifier is used as the first data packet identifier. In this embodiment, the second data packet identifier includes at least the primary identity identifier (ID), the application package name and the sequence number.
[0040] In response to the absence of a second data packet identifier in the mapping table, a first data packet identifier is generated based on the identifier of the cloud virtual device, the identifier of the first application, and a random number. That is, if no associated second data packet identifier is found in the HashMap, a first data packet identifier is generated. The generation rule for the main ID in the first data packet identifier is: cloud virtual device ID + packet name + random number, with the initial value of the sequence number being 1. The main ID and the sequence number are concatenated to generate the first data packet identifier.
[0041] Optionally, after generating the first data packet identifier, the mapping table can be updated based on the generated first data packet identifier. That is, the main ID and the sequence number are concatenated to generate the first data packet identifier, and the sequence number is incremented by 1 and then updated back to the HashMap.
[0042] S202, Obtain the target data packet based on the first data packet identifier and audio / video data.
[0043] Optionally, after acquiring the audio and video data, the audio and video data can be encoded to obtain encoded audio and video data.
[0044] Further, candidate data packets are created, including audio / video regions and data regions; encoded audio / video data is written into the audio / video regions, and a first data packet identifier is written into the data regions to obtain the target data packet; optionally, the target data packet may also include transmission control information, such as participant lists, packet loss information, network latency statistics, etc. In this embodiment, the target data packet may take the form of... Figure 3 As shown, the frame number is usually processed between the video encoder and decoder to identify and manage the order and type of video frames. In real-time web communication, audio and video data are encoded into a series of consecutive video frames and encapsulated into data packets for transmission. The decoder restores the order of video frames based on the sequence number to ensure continuous playback of the video. The first data packet identifier is a unique ID of the data packet, consisting of a main ID and a sequence number, used to prevent replay. The other data are other custom data that are saved.
[0045] In this embodiment, the identifier of the first application is used to determine the identifier of the first data packet corresponding to the target data packet, ensuring that there is no conflict between the traffic data of each application within the cloud virtual device. The data packet is encapsulated based on the identifier of the first application and the audio and video data. The audio and video data is encoded and written into the audio and video area, and the identifier of the first data packet is written into the data area to obtain the target data packet. This ensures that the target data packet has a strict correspondence with the first application, and provides users with more granular statistics on the traffic usage results of each application.
[0046] Based on the above embodiments, Figure 4 This is a flowchart illustrating another method for traffic statistics of cloud virtual devices provided in an embodiment of this application. Figure 4As shown, the method includes the following steps: S401 monitors the first application currently running in the foreground of the cloud virtual device.
[0047] In some embodiments, a window change monitoring service can be invoked; based on the pre-configured monitoring events of the monitoring service, the application running in the foreground is monitored to obtain the first application. In this embodiment, the monitoring service inherits from the Accessibility Service and is mainly used to monitor changes in various events, such as window event changes, view changes, notification events, etc. If it is a regular user, the accessibility service needs to be manually enabled; if it is a system-built-in application, the service can be started through code.
[0048] In response to changes in the listening window, the callback function of the listening service is triggered. It is determined whether the triggering event of the window change matches the pre-configured listening event. In this embodiment, the pre-configured listening event is the window change event, which means determining whether the callback triggering event is the window change event. In response to the triggering event matching the pre-configured listening event, the application at the top of the stack is obtained.
[0049] Further, based on the application at the top of the stack, determine the first application; determine whether the identifier of the application at the top of the stack is consistent with the application identifier currently stored in memory; in response that the identifier of the application at the top of the stack is consistent with the application identifier currently stored in memory, maintain the application identified by the application identifier currently stored in memory as the first application; in response that the identifier of the application at the top of the stack is inconsistent with the application identifier currently stored in memory, update the application at the top of the stack to the first application.
[0050] Specifically, when it is determined that the current triggering event is a window change event, the package name of the application at the top of the stack is obtained, and it is determined whether the content of the foreground application (foreground app) in memory is consistent with the package name of the application at the top of the stack. If they are inconsistent, the value of the foreground app variable in memory is updated, which is to say, the application identifier in memory is updated.
[0051] In some embodiments, before listening to the first application, a verification token sent by the client can also be received. The verification token is obtained during the client's authentication process with the cloud server. In response to the verification token being verified, a connection is established with the client.
[0052] Understandably, users can initiate authentication with the cloud server by entering information such as Subscriber Identity Module (SIM) authentication or SMS verification through the client. Upon successful authentication, the user obtains a verification token and a cloud virtual device example. The client then sends the verification token to the cloud virtual device indicated by the cloud virtual device example. When the verification token passes verification, a connection is established with the client for streaming.
[0053] S402, Obtain audio and video data from the first application.
[0054] In this application embodiment, the implementation method of step S402 can be implemented in any of the various embodiments of this disclosure, and no limitation is made here, nor will it be described in detail.
[0055] S403, determine the first data packet identifier corresponding to the target data packet based on the identifier of the first application.
[0056] In this application embodiment, the implementation method of step S403 can be implemented in any of the various embodiments of this disclosure, and no limitation is made here, nor will it be described in detail.
[0057] S404: Obtain the target data packet based on the first data packet identifier and the audio / video data.
[0058] In this embodiment of the disclosure, the method for implementing step S404 can be implemented in any of the various embodiments of the disclosure, and no limitation is made here, nor will it be described in detail.
[0059] S405 sends the target data packet to the client.
[0060] In some embodiments, key information of the target data packet can be determined. The key information includes at least one of the following: the first data packet identifier of the target data packet, the first data packet size, and the transmission time information. The transmission time information is determined by the current transmission timestamp, with the current timestamp used as the transmission timestamp, and the hour portion of the current time used as the transmission time point. For example, when the time is 8:59, the transmission time point is 8:00.
[0061] The feedback status of the target data packet is determined; in this embodiment, the feedback status is 0 by default. Based on the key information, the identifier of the first application, and the feedback status, a transmission record of the target data packet is generated. The transmission record can be in the following format: Figure 5 As shown.
[0062] S406, receives a feedback data packet from the target data packet sent by the client.
[0063] Optionally, after receiving the target data packet for the push stream, the client parses the audio and video data in the data packet, decodes it, and displays it on the client.
[0064] In some embodiments, after receiving the target data packet, the client can also parse the data area in the target data packet to obtain the data packet ID of the current target data packet, and at the same time calculate the size of the current User Datagram Protocol (UDP) data packet, which is the size of the target data packet in this embodiment, and package it into a feedback data packet.
[0065] Optionally, in this embodiment, the feedback data packet includes at least one of the following: a first data packet identifier of the target data packet and a second data packet size corresponding to the target data packet, wherein the second data packet size is calculated by the client after parsing the target data packet, and the form of the feedback data packet is as follows: Figure 6 As shown, the first data packet identifier is a unique ID of the data packet, consisting of a main ID and a sequence number, used to prevent replay. The size of the data packet is calculated by the client and stored in the feedback data packet.
[0066] S407, based on the feedback data packet, performs statistics on the traffic of cloud virtual devices under different applications.
[0067] Optionally, before performing traffic statistics, the feedback data packets can be parsed to obtain the first statistical result of the target data packets, and it can be determined whether the first statistical result is valid.
[0068] Optionally, the first data packet identifier of the target data packet can be determined based on the first statistical result; based on the first data packet identifier, the sending record of the target data packet is queried, that is, the sending record of the target data packet is queried based on the data packet ID. In response to the fact that no sending record is found, or the sending record is found and the target data packet is marked as the first feedback state in the sending record, the first statistical result is determined to be invalid; in this embodiment, the first feedback state is 1.
[0069] In response to the query of the sending record, and the target data packet marked as the second feedback state in the sending record, the first statistical result is determined to be valid. In this embodiment, the second feedback state is 0.
[0070] In response to the validity of the first statistical result, the sending record of the cloud virtual device is updated according to the first statistical result, the size of the second data packet in the sending record is updated, and the feedback status is updated to 1; based on the updated sending record, the traffic of the cloud virtual device under different applications is statistically analyzed.
[0071] Furthermore, based on the updated sending records, the traffic of the cloud virtual device under different applications is statistically analyzed; if the total number of sending records reaches a set threshold, the sending records are filtered according to the feedback status to obtain the first sending record; assuming the set threshold is 50,000, when the total number of sending records exceeds 50,000, the system reads according to the set threshold (50,000) configured by the platform, and filters out the sending records corresponding to the data with a feedback status of 1 (feedback has been received) to obtain the first sending record.
[0072] The first sending record is categorized according to sending time information and application identifier to obtain second sending records of different applications within the same time period. Based on the second sending records, traffic data of different applications corresponding to the cloud virtual device within the same time period is obtained. Optionally, the timestamp of the first second sending record can be used as the start time, and the timestamp of the last second sending record can be used as the end time.
[0073] Furthermore, after obtaining the second sending records of different applications within the same time period, the second sending records can be traversed to obtain the application identifier and sending time information recorded in the second sending records; based on the recorded application identifier and sending time information, the first statistical record is matched from the unuploaded statistical records, that is, the first statistical record with the same application identifier and sending time information is obtained; if the first statistical record exists, the traffic data corresponding to the second sending record is merged into the first statistical record; in response to the failure to match the first statistical record, a second statistical record corresponding to the second sending record is generated, the second statistical record is saved to the local database, and the statistical data that has been counted is deleted from the sending record table.
[0074] Optionally, invalid sending records on the cloud virtual device can be deleted periodically by a timer. Invalid sending records are determined by the following rule: the difference between the current timestamp and the sending timestamp is greater than the threshold configured by the platform (e.g., 5 seconds), and the feedback status is 0. Optionally, each type of statistical record on the cloud virtual device includes at least one of the following: packet identifier, application identifier, packet size, upload status of the statistical record, start time and end time of the statistical record, and packet sending time.
[0075] Furthermore, it is also possible to periodically send unuploaded statistical records to the cloud server to generate target statistical records on the cloud server side; the timer queries the local database at regular intervals (e.g., 1 hour) for unuploaded statistical results from a past time period (e.g., 1 hour), uploads the statistical results to the server, and marks the statistical records in the local database as uploaded after successful upload. The local database can be in the following format: Figure 7 As shown.
[0076] In response to the disconnection between the cloud virtual device and the client, the system sends the unuploaded statistical records to the cloud server to generate the target statistical records on the cloud server side; that is, when the cloud virtual device disconnects from the client, the timer is turned off and the unuploaded statistical results from the local device are uploaded to the cloud server to prevent data loss.
[0077] Optionally, after receiving the statistical results, the cloud server obtains information such as the user's mobile phone number and cloud machine ID that are currently calling the interface, saves this information and the statistical results together to the database, and returns a result to inform the cloud virtual device that the statistical results have been saved successfully. After receiving the response that the data has been saved successfully, the cloud virtual device marks the record in the local database as uploaded.
[0078] The target statistics record on the cloud server side includes at least one of the following: packet identifier, identifier of the client's device, identifier of the cloud virtual device, application identifier, packet size, start time and end time of the target statistics record, and the format of the target statistics record is as follows: Figure 8 As shown.
[0079] In this embodiment, by monitoring the first application and acquiring its audio and video data, the first data packet identifier corresponding to the target data packet is determined based on the identifier of the first application and the audio and video data. The target data packet is then encapsulated according to the first data packet identifier and the target data packet to obtain the target data packet to be pushed to the client. The target data packet is then pushed to the client. Furthermore, key information, sending time information, and feedback status of the target data packet can be determined, and a sending record is generated. After receiving the target data packet, the client parses the target data packet to obtain its size and encapsulates it into a feedback data packet. The feedback data packet is then sent to the cloud virtual device. The feedback data packet is parsed to obtain a first statistical result. The sending record is updated based on the first statistical result, and the traffic of the cloud virtual device under different applications is statistically analyzed based on the updated sending record. This provides a more granular understanding of the traffic consumed by each application within the cloud virtual device, improving the accuracy of traffic statistics. Users can analyze the traffic consumption of applications on the cloud virtual device through the statistical results, avoiding excessive use of traffic-intensive applications that could lead to exceeding traffic limits, thus improving the user experience.
[0080] Based on the above embodiments, Figure 9This is an interactive schematic diagram illustrating a traffic statistics method for a cloud virtual device provided in this application embodiment. It includes a cloud phone client, a cloud phone (cloud virtual device), and a cloud phone backend (cloud server). The cloud phone client is the terminal display entry point for the cloud phone screen, and its functions include applying for and connecting to the cloud phone, obtaining the cloud phone login token and cloud device information, sending local command streams, and receiving cloud video streams. The cloud server is mainly used for the management of cloud phone-related services, including authentication management and cloud device management, responsible for user account authentication services and cloud device instance allocation management services. This embodiment also includes an end-to-cloud transmission module, which comprises two parts: a cloud-side transmission module, which runs in the cloud phone system and is mainly responsible for receiving uplink command streams from the local device and distributing downlink audio and video streams from the cloud device; and an end-to-end transmission module, which runs in the local cloud phone APP and is mainly responsible for receiving downlink audio and video streams from the cloud device and sending uplink command streams from the local device. The system transmits data over a network; it also includes an audio / video stream processing module, comprising an image acquisition and processing module, a video encoder, a video decoder, an audio acquisition and processing module, an audio encoder, and an audio decoder; a monitoring module responsible for listening to the foreground application package name; an encapsulation module responsible for encapsulating audio / video data and data required for statistics into data packets; a feedback module responsible for receiving feedback information and transmitting it to the statistics module; and a statistics module responsible for statistically analyzing the feedback results received by the streaming module, saving them to a local database, and periodically pushing the statistical results to the cloud phone management platform for storage. Through the interaction of the cloud phone client, cloud phone (cloud virtual device), cloud phone backend (cloud server), end-to-cloud transmission module, audio / video stream processing module, monitoring module, encapsulation module, feedback module, and statistics module, traffic statistics for the cloud virtual device are achieved. Figure 10 This is a diagram illustrating the interaction logic between the modules.
[0081] To implement the above embodiments, this application also proposes a traffic statistics system for a cloud virtual device, comprising at least a client, a cloud virtual device, and a cloud server. The cloud virtual device is used to monitor a first application currently running in the foreground; acquire audio and video data of the first application; acquire a target data packet to be pushed based on the first application and the audio and video data; send the target data packet to the client and receive a feedback data packet of the target data packet sent by the client; and perform traffic statistics for the cloud virtual device under different applications based on the feedback data packet. The client is used to generate the feedback data packet, and the cloud server is used to receive the statistical results.
[0082] In this embodiment, by monitoring the first application and obtaining its audio and video data, the target data packet to be pushed is determined based on the first application and the audio and video data. The target data packet is pushed to the client and the feedback data packet sent by the client is received. Based on the feedback data packet, the sending record is queried to obtain the traffic of different applications, thereby obtaining the traffic consumed by each application inside the cloud virtual device in a more granular manner and improving the accuracy of traffic statistics.
[0083] To achieve the above embodiments, this application also proposes a traffic statistics device for cloud virtual devices. Figure 11 This is a schematic diagram of the structure of a traffic statistics device for a cloud virtual device provided in an embodiment of this application. Figure 11 As shown, the traffic statistics device 1100 of the cloud virtual device includes: The monitoring module 1101 is used to monitor the first application currently running in the foreground of the cloud virtual device; The first acquisition module 1102 is used to acquire audio and video data of the first application; The second acquisition module 1103 is used to acquire the target data packet to be pushed based on the first application and audio / video data; Sending module 1104 is used to send target data packets to the client; The receiving module 1105 is used to receive the feedback data packet of the target data packet sent by the client; The statistics module 1106 is used to perform statistics on the traffic of cloud virtual devices under different applications based on the feedback data packets.
[0084] Furthermore, in one possible implementation of this application embodiment, the second acquisition module 1103 is used for: Based on the identifier of the first application, determine the identifier of the first data packet corresponding to the target data packet; Obtain the target data packet based on the first data packet identifier and audio / video data.
[0085] Furthermore, in one possible implementation of this application embodiment, the second acquisition module 1103 is used for: Encode the audio and video data to obtain encoded audio and video data; Create candidate data packets, which include audio / video regions and data regions; Write encoded audio and video data into the audio and video area, and write the first data packet identifier into the data area to obtain the target data packet.
[0086] Furthermore, in one possible implementation of this application embodiment, the second acquisition module 1103 is used for: Obtain the mapping table between application identifiers and data packet identifiers; Based on the identifier of the first application, query the mapping table; In response to the existence of a second data packet identifier associated with the identifier of the first application in the mapping table, the second data packet identifier is determined to be the first data packet identifier; In response to the absence of a second data packet identifier in the mapping table, a first data packet identifier is generated based on the identifier of the cloud virtual device, the identifier of the first application, and a random number.
[0087] Furthermore, in one possible implementation of this application embodiment, the sending module 1104 is further configured to: Determine the key information of the target data packet, which includes at least one of the following: the first data packet identifier, the first data packet size, and the transmission time information of the target data packet; Determine the feedback status of the target data packet; Based on key information, the identifier of the first application, and the feedback status, a record of the target data packet's transmission is generated.
[0088] Furthermore, in one possible implementation of this application embodiment, the feedback data packet includes at least one of the following information: The first packet identifier of the target data packet; The size of the second data packet corresponding to the target data packet is determined by the client through parsing the target data packet.
[0089] Furthermore, in one possible implementation of this application embodiment, the monitoring module 1101 is also used for: The feedback data packet is parsed to obtain the first statistical result of the target data packet; Determine if the first statistical result of the target data packet is valid; In response to the validity of the first statistical result, the sending records of the cloud virtual device are updated according to the first statistical result; Traffic statistics for cloud virtual devices under different applications are calculated based on the updated sending records.
[0090] Furthermore, in one possible implementation of this application embodiment, the monitoring module 1101 is used for: Based on the first statistical result, the first data packet identifier of the target data packet is determined; Based on the first data packet identifier, query the sending record of the target data packet; In response to no sending record being found, or if a sending record is found and the target data packet is marked as the first feedback state in the sending record, the first statistical result is determined to be invalid. In response to the query finding a sending record, and the sending record marking the target data packet as the second feedback state, the first statistical result is determined to be valid.
[0091] Furthermore, in one possible implementation of this application embodiment, the statistics module 1106 is used for: In response to the total number of sent records reaching a set threshold, the sent records are filtered according to the feedback status to obtain the first sent record; The first transmission record is classified according to the transmission time information and application identifier to obtain the second transmission record of different applications within the same time period; Based on the second transmission record, obtain the traffic data of different applications corresponding to the cloud virtual device at the same time.
[0092] Furthermore, in one possible implementation of this application embodiment, the statistics module 1106 is also used for: Iterate through the second sending record to obtain the application identifier and sending time information recorded in the second sending record; Based on the recorded application identifier and sending time information, match the first statistical record from the statistical records that have never been uploaded; Merge the traffic data corresponding to the second sending record into the first statistics record; In response to the failure to match the first statistical record, a second statistical record corresponding to the second sent record is generated.
[0093] Furthermore, in one possible implementation of this application embodiment, the apparatus further includes at least one of the following operations: Periodically send unuploaded statistical records to the cloud server to generate target statistical records on the cloud server side; In response to the disconnection between the cloud virtual device and the client, the system sends the unuploaded statistical records to the cloud server to generate the target statistical records on the cloud server side. Periodically delete invalid sending records on cloud virtual devices.
[0094] It should be noted that the foregoing explanation of the traffic statistics method embodiment for cloud virtual devices also applies to the traffic statistics device for cloud virtual devices in this embodiment, and will not be repeated here.
[0095] In this embodiment, by monitoring the first application and acquiring its audio and video data, the first data packet identifier corresponding to the target data packet is determined based on the identifier of the first application and the audio and video data. The target data packet is then encapsulated according to the first data packet identifier and the target data packet to obtain the target data packet to be pushed to the client. The target data packet is then pushed to the client. Furthermore, key information, sending time information, and feedback status of the target data packet can be determined, and a sending record is generated. After receiving the target data packet, the client parses the target data packet to obtain its size and encapsulates it into a feedback data packet. The feedback data packet is then sent to the cloud virtual device. The feedback data packet is parsed to obtain a first statistical result. The sending record is updated based on the first statistical result, and the traffic of the cloud virtual device under different applications is statistically analyzed based on the updated sending record. This provides a more granular understanding of the traffic consumed by each application within the cloud virtual device, improving the accuracy of traffic statistics. Users can analyze the traffic consumption of applications on the cloud virtual device through the statistical results, avoiding excessive use of traffic-intensive applications that could lead to exceeding traffic limits, thus improving the user experience.
[0096] To implement the above embodiments, this application also proposes an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments. To implement the above embodiments, this application also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.
[0097] To implement the above embodiments, this application also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.
[0098] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this application comply with relevant laws and regulations and do not violate public order and good morals.
[0099] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.
[0100] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.
[0101] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0102] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0103] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0104] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0105] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0106] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0107] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0108] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for traffic statistics of cloud virtual devices, characterized in that, The method includes: Monitor the first application currently running in the foreground of the cloud virtual device; Obtain the audio and video data of the first application; Based on the first application and the audio / video data, obtain the target data packet to be pushed; Send the target data packet to the client; The client receives a feedback data packet of the target data packet, wherein the feedback data packet includes: the size of a second data packet corresponding to the target data packet, the size of which is determined by the client parsing the target data packet; Based on the feedback data packet, the traffic of the cloud virtual device under different applications is statistically analyzed; The step of obtaining the target data packet to be pushed based on the first application and the audio / video data includes: Based on the identifier of the first application, determine the first data packet identifier corresponding to the target data packet; The audio and video data are encoded to obtain encoded audio and video data; Create candidate data packets, which include audio / video regions and data regions; Encoded audio and video data are written in the audio and video area, and the first data packet identifier is written in the data area to obtain the target data packet.
2. The method according to claim 1, characterized in that, Determining the first data packet identifier corresponding to the target data packet based on the identifier of the first application includes: Obtain the mapping table between application identifiers and data packet identifiers; Based on the identifier of the first application, query the mapping table; In response to the existence of a second data packet identifier associated with the identifier of the first application in the mapping table, the second data packet identifier is determined to be the first data packet identifier; In response to the absence of the second data packet identifier in the mapping table, the first data packet identifier is generated based on the identifier of the cloud virtual device, the identifier of the first application, and a random number.
3. The method according to any one of claims 1-2, characterized in that, After sending the target data packet to the client, the method further includes: Determine the key information of the target data packet, wherein the key information includes at least one of the target data packet's first data packet identifier, first data packet size, and transmission time information; Determine the feedback status of the target data packet; Based on the key information, the identifier of the first application, and the feedback status, a transmission record of the target data packet is generated.
4. The method according to any one of claims 1-2, characterized in that, Before performing traffic statistics on the cloud virtual device under different applications based on the feedback data packet, the method further includes: The feedback data packet is parsed to obtain the first statistical result of the target data packet; Determine whether the first statistical result of the target data packet is valid; In response to the validity of the first statistical result, the sending record of the cloud virtual device is updated according to the first statistical result; Traffic statistics for cloud virtual devices under different applications are calculated based on the updated sending records.
5. The method according to claim 4, characterized in that, The determination of whether the first statistical result of the target data packet is valid includes: Based on the first statistical result, the first data packet identifier of the target data packet is determined; Based on the first data packet identifier, query the sending record of the target data packet; In response to the failure to find the sending record, or the finding of the sending record and the sending record marking the target data packet as a first feedback state, the first statistical result is determined to be invalid; In response to finding the sending record and marking the target data packet as a second feedback state in the sending record, the first statistical result is determined to be valid.
6. The method according to claim 4, characterized in that, The method of statistically analyzing the traffic of cloud virtual devices under different applications based on updated sending records includes: In response to the total number of sent records reaching a set threshold, the sent records are filtered according to the feedback status to obtain the first sent record; The first sending record is classified according to the sending time information and application identifier to obtain the second sending record of different applications within the same time period; Based on the second sending record, obtain the traffic data of different applications corresponding to the cloud virtual device at the same time.
7. The method according to claim 6, characterized in that, After classifying the first transmission record according to transmission time information and application identifier to obtain the second transmission record of different applications within the same time period, the method further includes: The second sending record is traversed to obtain the application identifier and sending time information recorded in the second sending record; Based on the recorded application identifier and sending time information, match the first statistical record from the statistical records that have never been uploaded; The traffic data corresponding to the second sending record is merged into the first statistical record; In response to the failure to match the first statistical record, a second statistical record corresponding to the second sending record is generated.
8. The method according to claim 7, characterized in that, The method further includes at least one of the following operations: Periodically send unuploaded statistical records to the cloud server to generate target statistical records on the cloud server side; In response to the disconnection between the cloud virtual device and the client, the unuploaded statistical records are sent to the cloud server to generate target statistical records on the cloud server side; Invalid sending records on the cloud virtual device are deleted periodically.
9. A traffic statistics device for a cloud virtual device, characterized in that, include: The monitoring module is used to monitor the first application currently running in the foreground of the cloud virtual device; The first acquisition module is used to acquire the audio and video data of the first application; The second acquisition module is used to acquire the target data packet to be pushed based on the first application and the audio and video data; The sending module is used to send the target data packet to the client; The receiving module is configured to receive a feedback data packet sent by the client to the target data packet, wherein the feedback data packet includes: the size of a second data packet corresponding to the target data packet, the size of the second data packet being determined by the client parsing the target data packet; The statistics module is used to perform traffic statistics on the cloud virtual device under different applications based on the feedback data packet; The step of obtaining the target data packet to be pushed based on the first application and the audio / video data includes: Based on the identifier of the first application, determine the first data packet identifier corresponding to the target data packet; The audio and video data are encoded to obtain encoded audio and video data; Create candidate data packets, which include audio / video regions and data regions; Encoded audio and video data are written in the audio and video area, and the first data packet identifier is written in the data area to obtain the target data packet.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Traffic counting method and system, client and server
CN108259207A
Video conference code stream feedback method, device and apparatus and computer readable storage medium
CN112565664A