CN107888550B - Performance index data acquisition method and device and strategy sending method and device - Google Patents

Performance index data acquisition method and device and strategy sending method and device Download PDF

Info

Publication number
CN107888550B
CN107888550B CN201610875487.7A CN201610875487A CN107888550B CN 107888550 B CN107888550 B CN 107888550B CN 201610875487 A CN201610875487 A CN 201610875487A CN 107888550 B CN107888550 B CN 107888550B
Authority
CN
China
Prior art keywords
client
performance index
fps
data
time period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610875487.7A
Other languages
Chinese (zh)
Other versions
CN107888550A (en
Inventor
曹爽
张丹
郝晶晶
张长
王月超
廖绪磷
何照达
熊林博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610875487.7A priority Critical patent/CN107888550B/en
Publication of CN107888550A publication Critical patent/CN107888550A/en
Application granted granted Critical
Publication of CN107888550B publication Critical patent/CN107888550B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a performance index data acquisition method and device and a strategy sending method and device. The method provided by the embodiment of the invention comprises the following steps: acquiring an acquisition strategy sent by a server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears for indicating a client; when a specific scene in the preset interactive application is detected to appear, collecting the data of the performance index of the client in a target time period according to the collection strategy, wherein the target time period is a time period from appearance to end of the specific scene; and reporting the collected performance index data.

Description

Performance index data acquisition method and device and strategy sending method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for acquiring performance index data and a method and a device for sending strategies.
Background
In some interactive applications, the user experience is very important to the operation of the interactive application. However, different terminals have different performances and different display effects when the interactive application is run, and developers of the interactive application need to know the influence of the performances of the different terminals on the display effect of the interactive application, but in the prior art, only a scheme for detecting the performances of the terminal in a certain or certain working states is provided, and data detected by the scheme is difficult to reflect the actual performance condition of the terminal when the interactive application is run.
Disclosure of Invention
The embodiment of the invention provides a performance index data acquisition method and device and a strategy transmission method and device, which can improve the effectiveness of acquired data.
In a first aspect, an embodiment of the present invention provides a performance index data acquisition method, including:
acquiring an acquisition strategy sent by a server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears for indicating a client;
when a specific scene in the preset interactive application is detected to appear, collecting the data of the performance index of the client in a target time period according to the collection strategy, wherein the target time period is a time period from appearance to end of the specific scene;
and reporting the collected performance index data.
In a second aspect, an embodiment of the present invention provides a policy sending method, including:
acquiring an acquisition strategy, wherein the acquisition strategy is used for indicating a performance index to be acquired by a client in a specific scene of a preset interactive application;
sending the acquisition strategy to the client, wherein the acquisition strategy is used for acquiring the data of the performance index of the client in a target time period according to the acquisition strategy when the client detects that a specific scene in the preset interactive application appears, wherein the target time period is the time period from appearance to completion of the specific scene;
and receiving the collected performance index data sent by the client.
In a third aspect, an embodiment of the present invention provides a performance index data acquisition apparatus, including:
the acquisition module is used for acquiring an acquisition strategy sent by the server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears for indicating the client;
the acquisition module is used for acquiring the data of the performance index of the client within a target time period according to the acquisition strategy when a specific scene in the preset interactive application is detected to appear, wherein the target time period is a time period from appearance to completion of the specific scene;
and the reporting module is used for reporting the collected performance index data.
In a fourth aspect, an embodiment of the present invention provides a policy sending apparatus, including:
the acquisition module is used for acquiring an acquisition strategy, wherein the acquisition strategy is used for indicating a performance index to be acquired by a client in a specific scene of a preset interactive application;
a sending module, configured to send the collection policy to the client, where the collection policy is used for the client to collect, according to the collection policy, data of the performance index of the client within a target time period when the client detects that a specific scene in the preset interactive application appears, where the target time period is a time period from appearance of the specific scene to completion of the specific scene;
and the receiving module is used for receiving the collected performance index data sent by the client.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the invention, the acquisition strategy sent by the server is acquired, the performance indexes included in the acquisition strategy are acquired in the time period between the occurrence and the end of the specific scene in the preset interactive application, and the data are reported, so that the acquired data can more accurately reflect the actual condition of the client when the preset interactive application is operated, the effectiveness of the data is improved, and the preset interactive application is convenient to optimize according to the data.
Drawings
FIG. 1 is a structural view of one embodiment of the system of the present invention;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a performance index data collection method of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of a policy sending method according to the present invention;
FIG. 4 is a schematic block and flow diagram of one embodiment of a system of the present invention;
FIG. 5 is a schematic flow chart diagram illustrating one embodiment of a performance index data collection apparatus of the present invention;
FIG. 6 is a flow chart illustrating an embodiment of a policy routing apparatus according to the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a terminal of the present invention;
fig. 8 is a schematic structural diagram of an embodiment of a server of the present invention.
Detailed Description
The embodiment of the invention provides a performance index data acquisition method, which is mainly used in a system shown in figure 1, wherein the system comprises a server 10 and at least one client 11. Fig. 1 illustrates a system including two clients 11, which is only an example and is not a limitation to the present invention.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a performance index data collection method according to an embodiment of the present invention. The performance index data acquisition method in this embodiment is a method executed by any one of the clients in the system shown in fig. 1, and specifically, the performance index data acquisition method includes:
101. acquiring an acquisition strategy sent by a server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears for indicating a client.
In this embodiment, a preset interactive application is installed in the client, where the client may be a mobile phone, a tablet computer, or another terminal capable of installing the preset interactive application, and the interactive application may be a game or another terminal, which is not limited herein. The specific scene of the preset interactive application refers to some scenes where the preset interactive application interacts with the user during the running process, for example, a Player battle (hereinafter, referred to as "Player over Player" for short, PVP ") scene or a Player VS Environment (hereinafter, referred to as" Player VS Environment "for short, PVE) scene in the game may be used, and is not limited herein.
In this embodiment, there are various methods for the client to obtain the acquisition policy sent by the server. For example, the client generates a request parameter, and the request parameter is used for requesting the acquisition policy and is sent to the server. And after receiving the request parameters, the server sends the acquisition strategy to the client.
Optionally, in this embodiment, the request parameter includes information of a user account used for logging in the preset interactive application in the client, where the information of the user account is used for the server to determine whether to send the acquisition policy to the client. Therefore, the collection strategy issued by the server can improve the validity of the data collected according to the collection strategy aiming at the user account.
Wherein, the information of the user account may be various, for example, the information includes a user identifier (Identity, abbreviated as ID) for uniquely identifying the user account, a system platform (for example, Android system or IOS system) when the user logs in a preset interactive application, a type of the user account, an item identifier (that is, APPid of the preset interactive application), wherein, since the user can log in the preset interactive application by using the account of other platform, the type of the user account refers to the type of the platform to which the user account belongs, for example, the user account may be of the type WeChat, QQ, guest or the preset interactive application, the type of the user account is the preset interactive application, which means that the user applies for registering a new account in the preset interactive application, but does not adopt accounts of other platforms to log in the preset interactive application. In the case where the preset interactive application is a game, optionally, the information of the user account includes an ID of a game zone where the user player is currently located.
There are various methods for the client to generate the request parameters. For example, when detecting that the application starts, a preset interactive application module in the client acquires information of a user account of the preset interactive application which is logged in by the user, and sends the information of the user account to a request module in the client, and the request module generates request parameters according to the information of the user account and sends the request parameters to the server. Specifically, the request module generates an HTTP request and a POST request, and sends the HTTP request and the POST request to the server, wherein the information of the user account is encapsulated in the POST request as at least part of the request parameters.
Preferably, the request module in the client encrypts the request parameter before the request parameter occurs, so as to ensure the secure transmission of the user account. There are various methods of encryption. For example, the Encryption algorithm adopted by the client is an Advanced Encryption Standard (Advanced Encryption Standard, AES), the mode is a Cipher Block Chaining (CBC), and the padding mode is ZeroPadding, that is, a part less than 16 bytes is padded with 0. The encryption algorithm can be realized on a full platform, and the realization method is simple and high in safety. Of course, the client may also use other Encryption algorithms, such as Data Encryption Standard (DES), without limitation.
Optionally, the client receives the encrypted data packet sent by the server, and the client decrypts the encrypted data packet to obtain the acquisition policy. In this way, secure transmission of the acquisition strategy can be ensured.
In this embodiment, the performance index to be collected may be various. For example, the performance index to be collected includes a number of Frames Per Second (full english: Frames Per Second, abbreviated english: FPS), a Central Processing Unit (full english: Central Processing Unit, abbreviated english: CPU) occupancy rate of the preset interactive application, and at least one of a CPU occupancy rate, a memory usage amount, a consumption flow, a consumption electric quantity, and a network delay of the client. In the embodiment, in the case that the performance index to be collected includes the CPU occupancy of the preset interactive application and the CPU occupancy of the client, compared with the case that only the CPU occupancy of the preset interactive application is collected in the prior art, the CPU occupancy of the client at the same time is also collected, and the performance index to be collected can be used for comparing with the CPU occupancy of the preset interactive application, and can more objectively reflect the performance condition occupied by the preset interactive application. In the prior art, if the number of CPU cores of a client is N, the total occupancy rate of the N-core CPU is represented by N × 100%. Preferably, in this embodiment, the total collected CPU occupancy of the preset interactive application and the total CPU occupancy of the client are both represented by 100%, which is favorable for subsequent data mining and performance evaluation display.
In this embodiment, the collection policy further includes indication information of the specific scenario to indicate a target time period for the client to collect data, or the specific scenario may also be set by default in the preset interactive application, which is not limited herein. Optionally, the acquisition policy further includes a data acquisition method for the performance index to be acquired included in the acquisition policy, or the data acquisition method for each performance index may also be preset in the client, and after receiving the acquisition policy, the client acquires the performance index to be acquired in the acquisition policy by using the preset acquisition method, which is not limited herein.
102. And when detecting that a specific scene in the preset interactive application appears, collecting the data of the performance index in a target time period according to the collection strategy, wherein the target time period is a time period from appearance to end of the specific scene.
In this embodiment, there are various methods for detecting the occurrence and the end of a specific scene in the preset interactive application. Taking the preset interactive application as an example of a game, a start interface function and an end interface function are provided in a Software Development Kit (SDK) of the preset interactive application, and when the two functions are respectively called in code logic for starting and exiting the specific scene, the appearance and the end of the specific scene can be determined.
After acquiring the acquisition strategy, the client acquires data according to the acquisition strategy in a time period (namely a target time period) from the occurrence of the specific scene to the end of the specific scene. How to perform data collection according to the collection strategy will be described in detail below with reference to several examples of performance indicators included in the collection strategy.
When the performance index to be acquired in the acquisition strategy comprises the FPS, acquiring the FPS of the client according to a preset frequency (for example, every 20ms) in the target time period; and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS jitter frequency according to the acquired FPSs, wherein the FPS jitter frequency is the frequency of occurrence of difference between two adjacent acquired FPSs in the target time period being greater than a threshold value. Optionally, the FPS jitter times includes FPS severe jitter times and/or FPS slight jitter times, where the FPS severe jitter times refers to times that a difference between two adjacent acquired FPSs within a target time period is greater than a first threshold (for example, 10 frames), and the FPS slight jitter times refers to times that a difference between two adjacent acquired FPSs within the target time period is greater than a second threshold (for example, 4 frames) and is less than or equal to the first threshold (for example, 10 frames). Optionally, the FPS dithering number includes an FPS custom dithering number, that is, a number of times that a difference between two adjacent acquired FPSs within a target time period is within a custom range. Optionally, in this embodiment, the FPS acquisition module is set in the SDK of the preset interactive application, and then the client notifies the FPS acquisition module in the SDK of the preset interactive application when determining that the data to be acquired in the acquisition policy includes FPS; and the FPS acquisition module acquires data after receiving the notification and sends the acquired data to a data packaging module in the client so that the data packaging module acquires and reports the data. For example, when the SDK in the preset interactive application is a Unity engine, a collection script is mounted on the Game Object, an update () method in the script is triggered and called according to the preset frequency, and the number of times that the method is called in a preset time (for example, 1s) is the FPS.
When the performance index to be collected comprises the network time delay, sending a test data packet to a server by adopting a User Datagram (UDP) protocol at a first moment in a target time period; receiving a response data packet from the server; and calculating the network time delay according to the time of receiving the response data packet and the first time. Specifically, the network delay is a time length of a distance between a time when the response packet is received and the first time. Optionally, in the target time period, the network delay is collected according to a preset frequency, and at least one of an average network delay, a maximum network delay, and a minimum network delay is calculated according to each collected network delay. In the prior art, Ping calculation is generally adopted to acquire network delay, but part of Android platforms do not have root models and do not have Ping permission, so that the network delay cannot be acquired; in the implementation, due to the adoption of the UDP technology, the whole model of the whole platform can be covered, the network interaction condition in the actual process of the hand trip is closer, and the data acquired by the network delay is more referential.
When the performance indexes to be acquired comprise the CPU occupancy rate of the preset interactive application and the CPU occupancy rate of the client, acquiring a first time length, wherein the first time length is the time length occupied by the preset interactive application to the CPU in the target time period; acquiring a second duration, wherein the second duration is the duration occupied by the client to the CPU in the target time period; and calculating the CPU occupancy rate of the preset interactive application and the CPU occupancy rate of the client, wherein the CPU occupancy rate of the preset interactive application is the ratio of the first time length to the time length of the target time period, and the CPU occupancy rate of the client is the ratio of the second time length to the time length of the target time period. In practical applications, the CPU usage by the operating system is time-sliced, for example, a process takes 10ms, then a process takes 30ms, and then idles for 60 ms. Specifically, the current system time from the client startup can be obtained by respectively obtaining data of the type of thread _ basic _ info _ t when the specific scene appears and ends, and the current system time includes three times: the idle time, the kernel time and the user time are added, namely the total time of the CPU. Therefore, the duration of the target time period can be obtained by subtracting the total CPU time acquired respectively when the specific scene appears and ends. The second duration may be obtained by subtracting (kernel time + user time-idle time) obtained at the end of the specific scene from (kernel time + user time-idle time) obtained at the start of the specific scene. The first time duration can be obtained by obtaining the sum of time slices occupied by all processes of the preset interactive application in the target time period.
When the performance index to be collected comprises the memory usage amount of the preset interactive application, acquiring a process ID of the preset interactive application; acquiring process information according to the process ID; calling a task _ info function; and acquiring the memory usage amount corresponding to the preset interactive process according to the task _ info function and the process information. . Specifically, the process ID of the preset interactive application may be obtained by a system method of the client, map _ task _ self (). And after a task _ info function is called, storing the process information into variable task info of a task _ info _ t structure type, and reading a residual _ size value in the task info to obtain the current memory usage of the preset interactive application.
Optionally, the method may further include storing the information of the client to a variable vmstart of the host _ info _ t structure type by calling a host _ statistics function, and reading a free _ count value in the vmstart, where the free _ count value is a currently available memory usage amount of the client.
When the performance index to be collected comprises consumption flow, reading network interface information of the client; acquiring flow data of the client when the specific scene appears and flow data of the client when the specific scene is finished according to the network interface information; and calculating the consumption flow according to the flow data of the client when the specific scene appears and the flow data of the client when the specific scene ends. Specifically, the consumption traffic of the preset interactive application is a difference between traffic data of the client at the end of the specific scene and traffic data of the client at the start of the specific scene.
And when the performance index to be acquired comprises the consumed electric quantity, different system platforms have different acquisition methods. For example, in the Android platform, the current electric quantity is acquired when a specific scene appears and ends by the following steps: register static broadcast events in Android manifest. Android, intent, action, BATTERT _ CHANGED, wherein Android Manifest is a configuration file of Android application, and authority statement and the like are all in the configuration file; inheriting a BroadcastReceiver class (namely a broadcast receiving class), rewriting an onReceive method, receiving a power change broadcast notification in the onReceive method, and obtaining the current power through the broadcast notification. And subtracting the current electric quantity respectively acquired when the specific scene is ended and appears to obtain the consumed electric quantity. For another example, in the IOS platform, current electric quantity data is obtained by reading the UIDevice interface when a specific scene appears and ends, and the difference between the two electric quantity data is the consumed electric quantity.
103. And reporting the collected performance index data.
And after the client acquires the performance index data, the performance index data is subjected to data encapsulation and reporting. The client may report the performance index data to the server, or report the performance index data to another server, which is not limited herein.
In this embodiment, by obtaining the acquisition policy sent by the server, acquiring data of the performance index included in the acquisition policy in a time period between occurrence and termination of a specific scene in the preset interactive application, and reporting the data acquisition, the acquired data can more accurately reflect an actual situation of the client when the preset interactive application is operated, so that the validity of the data is improved, and the preset interactive application is optimized according to the performance index data.
The performance index data collection method performed by the client in the system shown in fig. 1 is described above, and the policy sending method performed by the server in the system is described below.
Referring to fig. 3, fig. 3 is a flowchart illustrating a policy sending method according to an embodiment of the present invention. In this embodiment, the policy sending method includes:
301. acquiring a collection strategy, wherein the collection strategy is used for indicating the performance index to be collected of a client in a specific scene of a preset interactive application.
In this embodiment, there are various methods for acquiring the acquisition policy. For example, the user-defined setting of the acquisition policy may be received and stored in a database, and when the acquisition policy needs to be sent to the client, the acquisition policy is obtained in the database and sent to the client. For another example, the database of another server stores the acquisition policy, and when the acquisition policy needs to be sent to the client, the acquisition policy is acquired from the database.
Optionally, in this embodiment, the server further receives a request parameter sent by the client, where the request parameter includes information of a user account used for logging in the preset interactive application in the client; and the server inquires an acquisition strategy corresponding to the information of the user account in a database according to the information of the user account. And if the acquisition strategy corresponding to the information of the user account is inquired, determining to acquire the acquisition strategy, and if the acquisition strategy corresponding to the information of the user account is not inquired, not sending the acquisition strategy to the client.
There are various methods for the server to query the database for the acquisition policy corresponding to the information of the user account according to the information of the user account, and a preferred method thereof is exemplified below.
The information of the user account includes a first parameter and a second parameter. When the acquisition strategy corresponding to the information of the user account is queried in the database according to the information of the user account, an acquisition total strategy is firstly acquired, wherein the acquisition total strategy can be the same as the acquisition strategy acquisition method described above, and is not repeated here. The collection set strategy comprises at least one collection strategy and at least one parameter, and a corresponding relation exists between the at least one collection strategy and the at least one parameter, wherein each collection strategy corresponds to at least one parameter, and each parameter corresponds to at least one collection strategy. Determining the priority of the first parameter and the priority of the second parameter, wherein the priority of the first parameter is higher than the priority of the second parameter, inquiring whether the collection strategy comprises the first parameter, and if so, acquiring the collection strategy corresponding to the first parameter; and if not, inquiring whether the second parameter is included in the total acquisition strategy, and if so, acquiring the acquisition strategy corresponding to the second parameter. Therefore, whether the acquisition strategies of the user corresponding to the parameters exist or not is sequentially judged according to the priority of each parameter in the information of the user account, and the acquisition strategies with higher matching degree with the user requirements can be found out from the total acquisition strategies.
302. And sending the acquisition strategy to the client.
In this embodiment, the collection policy is used for collecting, by the client, data of the performance index of the client within a target time period according to the collection policy when detecting that a specific scene in the preset interactive application occurs, where the target time period is a time period from occurrence to completion of the specific scene.
And after the acquisition strategy is acquired, packaging the acquisition strategy and issuing the acquisition strategy to the client. Preferably, in this embodiment, when the server encapsulates the acquisition policy, the server further encrypts the acquisition policy to ensure secure transmission of the acquisition policy. There are various methods for encryption, such as encryption using AES algorithm or DES algorithm, but not limited thereto.
303. And receiving the collected performance index data sent by the client.
And the client acquires the performance index data according to the received acquisition strategy and transmits the acquired performance index to the server. The server collects the data sent by each client so as to optimize the preset interactive application according to the data reported by each client.
In this embodiment, the server sends the acquisition policy to the client, so that the client can acquire data of the performance index included in the acquisition policy in a time period between occurrence and termination of a specific scene in the preset interactive application and report the data acquisition, and thus, the acquired data can more accurately reflect the actual situation of the client when the preset interactive application is operated, the validity of the data is improved, and the preset interactive application is optimized according to the performance index data.
In order to understand the present invention, the performance index data acquisition method and the policy transmission method of the present invention are exemplified in the following with reference to a practical application scenario.
Fig. 4 is a schematic workflow diagram of an embodiment of the system of the present invention, as shown in fig. 4. The system comprises a client, a first server and a second server. The second server receives a collection total strategy customized by a user and stores the collection total strategy into a redis database, wherein the collection total strategy comprises at least one collection strategy and at least one parameter, and the at least one collection strategy and the at least one parameter have a corresponding relation.
The client comprises a game engine for presetting games. When a user logs in and runs the preset game, the game engine initializes the SDK and acquires information of a user account, wherein the information of the user account comprises a user ID, an ID of a current large area, a system platform when the user logs in a preset interactive application, the type of the user account and an item identifier. The game engine sends the information of the user account to a request module in the client. The request module generates an HTTP request and a POST request and sends the HTTP request and the POST request to the first server after receiving the information of the user account, wherein the information of the user account is encrypted by adopting an AES algorithm and then serves as at least part of request parameters to be packaged in the POST request. If the transmission of the HTTP request and the POST request fails, for example, the transmission fails due to no network and the like, the failure result is reported.
And when the first server receives the HTTP request and the POST request, acquiring the total collection strategy from a redis database of the second server. The first server also extracts the information of the user account from the POST request and inquires the acquisition strategy to be issued according to the information. Specifically, the first server firstly queries whether the collection total policy contains the user ID, and if so, packages and encrypts the collection policy corresponding to the user ID, and then issues the collection policy to the client.
And if not, inquiring whether the acquisition total strategy contains the ID of the current large area, if so, packaging and encrypting the acquisition strategy corresponding to the ID of the large area, and then issuing the acquisition strategy to the client.
If not, inquiring whether the collection total strategy contains the user account type, if so, packaging and encrypting the collection strategy corresponding to the user account type, and then issuing the collection strategy to the client.
And if not, inquiring whether the total acquisition strategy comprises a system platform when the user logs in the preset interactive application, if so, packaging and encrypting the acquisition strategy corresponding to the system platform, and then issuing the acquisition strategy to the client.
If not, inquiring whether the total collection strategy contains the item identification, if so, packaging and encrypting the collection strategy corresponding to the item identification, and then issuing the collection strategy to the client. If not, returning error information, and not issuing an acquisition strategy to the client. The client does not need to perform data acquisition.
After receiving the acquisition strategy, an issuing module in the client extracts performance indexes to be acquired, wherein the performance indexes comprise an FPS, a CPU occupancy rate of a preset interactive application, a CPU occupancy rate of the client, memory usage, consumption flow, consumption electric quantity and network time delay.
Then, the issuing module respectively informs the network time delay module, the CPU occupancy rate acquisition module, the memory usage amount acquisition module, the consumption flow acquisition module and the consumption electric quantity acquisition module to acquire data. After the data are collected by the modules, the data are sent to a data encapsulation module in the client.
The issuing module also informs the game engine to collect the FPS.
In the SDK of the game engine, the logic code of a specific scene is:
NSLog(@”Hello,Game Start”);
NSLog(@”Hello,Now Detect”);
NSLog(@”Hello,Game Playing”);
NSLog(@”Hello,End Detect”);
NSLog(@”Hello,GameEnd”);
the front of NSLog (@ Hello, Game Start) is provided with a Start interface function GSDKSStart (), and the back of NSLog (@ "Hello, GameEnd") is provided with an end interface function GSDKEnd (). Start interface function GSDKStart () is called when the particular scene occurs, and start interface function GSDKStart () is called when the particular scene ends.
When the game engine detects that a starting interface function GSDKStart () is called, acquiring the FPS of the client every 20ms, and stopping acquiring the FPS until detecting that an ending interface function GSDKEnd () is called. The game engine also calculates average FPS, maximum FPS, minimum FPS and FPS jitter times according to the collected FPSs, wherein the FPS jitter times comprise FPS serious jitter times and/or FPS slight jitter times. And the game engine sends each calculated FPS to a data encapsulation module in the client.
And the data encapsulation module encapsulates the received data and sends the encapsulated data to the second server. And the data processing module in the second server processes the data and sends the data to the display module so that the display module can display the processed data.
The performance index data acquisition method and the policy transmission method of the present invention are described above, and the performance index data acquisition device and the policy transmission device of the present invention are described below.
As shown in fig. 5, fig. 5 is a schematic structural diagram of an embodiment of the performance index data acquisition apparatus of the present invention. In this embodiment, the performance index data acquisition apparatus 500 includes:
an obtaining module 501, configured to obtain an acquisition policy sent by a server, where the acquisition policy includes a performance index to be acquired when a specific scene of a preset interactive application appears for indicating a client;
an acquisition module 502, configured to, when a specific scene in the preset interactive application is detected to occur, acquire, according to the acquisition policy, data of the performance index of the client within a target time period, where the target time period is a time period from occurrence to completion of the specific scene;
a reporting module 503, configured to report the collected performance index data.
In this embodiment, by acquiring the acquisition policy sent by the server, acquiring data of the performance index included in the acquisition policy in a time period between occurrence and termination of a specific scene in the preset interactive application, and reporting the data, the acquired data can more accurately reflect an actual situation of the client when the preset interactive application is operated, so that the validity of the data is improved, and the preset interactive application is optimized according to the data.
Optionally, the obtaining module 501 is specifically configured to:
generating request parameters, wherein the request parameters are used for requesting an acquisition strategy;
encrypting the request parameters and sending the encrypted request parameters to a server;
receiving an encrypted data packet from the server;
and decrypting the encrypted data packet to obtain an acquisition strategy.
Optionally, the request parameter includes information of a user account used for logging in the preset interactive application in the client, and the information of the user account is used for the server to determine whether to send the acquisition policy to the client.
Optionally, the performance index to be collected includes at least one of a number of frames per second FPS transmitted, a CPU occupancy rate of a central processing unit of the preset interactive application, a CPU occupancy rate of the client, a memory usage amount, a consumption flow rate, a consumption electric quantity, and a network delay of the preset interactive application.
Optionally, when the performance index to be acquired includes the FPS, the acquisition module 502 is specifically configured to acquire the FPS of the client according to a preset frequency in the target time period; and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS shaking times according to the acquired FPS, wherein the FPS shaking times are times when the difference between two adjacent acquired FPS is larger than a threshold value in the target time period.
Optionally, when the performance index to be acquired includes the network delay, the acquisition module 502 is specifically configured to:
sending a test data packet to a server by adopting a user datagram UDP protocol at a first moment;
receiving a response data packet from the server;
and calculating the network time delay according to the time of receiving the response data packet and the first time.
Optionally, when the performance index to be collected includes the CPU occupancy of the central processing unit of the preset interactive application and the CPU occupancy of the client, the collection module 502 is specifically configured to:
acquiring a first time length, wherein the first time length is the time length occupied by the preset interactive application on the CPU in the target time period;
acquiring a second duration, wherein the second duration is the duration occupied by the client to the CPU in the target time period;
and calculating the CPU occupancy rate of the preset interactive application and the CPU occupancy rate of the client, wherein the CPU occupancy rate of the preset interactive application is the ratio of the first time length to the time length of the target time period, and the CPU occupancy rate of the client is the ratio of the second time length to the time length of the target time period.
Optionally, when the performance index to be collected includes the memory usage amount of the preset interactive application, the collection module 502 is specifically configured to:
acquiring a process Identification (ID) of the preset interactive application;
acquiring process information according to the process ID;
calling a task _ info function;
and acquiring the memory usage amount corresponding to the preset interactive process according to the task _ info function and the process information.
Optionally, when the performance index to be collected includes the consumption flow, the collection module 502 is specifically configured to:
reading the network interface information of the client;
acquiring flow data of the client when the specific scene appears and flow data of the client when the specific scene is finished according to the network interface information;
and calculating the consumption flow according to the flow data of the client when the specific scene appears and the flow data of the client when the specific scene ends.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a policy sending device according to an embodiment of the present invention. In this embodiment, the policy sending apparatus 600 includes:
an obtaining module 601, configured to obtain an acquisition policy, where the acquisition policy is used to indicate a performance index to be acquired by a client in a specific scene of a preset interactive application;
a sending module 602, configured to send the collection policy to the client, where the collection policy is used for the client to collect, according to the collection policy, data of the performance index of the client in a target time period when the client detects that a specific scene in the preset interactive application appears, where the target time period is a time period from appearance of the specific scene to completion of the specific scene;
a receiving module 603, configured to receive the collected performance index data sent by the client.
In this embodiment, the server sends the acquisition policy to the client, so that the client can acquire data of the performance index included in the acquisition policy in a time period between occurrence and termination of a specific scene in the preset interactive application and report the data acquisition, and thus, the acquired data can more accurately reflect the actual situation of the client when the preset interactive application is operated, the validity of the data is improved, and the preset interactive application is optimized according to the performance index data.
Optionally, the obtaining module 601 is specifically configured to:
receiving request parameters sent by a client, wherein the request parameters comprise information of a user account used for logging in the preset interactive application in the client;
and inquiring an acquisition strategy corresponding to the information of the user account in a database according to the information of the user account.
Optionally, the information of the user account includes a first parameter and a second parameter;
when querying, in a database, an acquisition policy corresponding to the information of the user account according to the information of the user account, the obtaining module 601 is specifically configured to:
acquiring a total acquisition strategy, wherein the total acquisition strategy comprises at least one acquisition strategy and at least one parameter, and the at least one acquisition strategy and the at least one parameter have a corresponding relation;
determining a priority of the first parameter and the second parameter, wherein the priority of the first parameter is higher than the priority of the second parameter;
inquiring whether the collection strategy comprises the first parameter or not, and if so, acquiring a collection strategy corresponding to the first parameter; and if not, inquiring whether the second parameter is included in the total acquisition strategy, and if so, acquiring the acquisition strategy corresponding to the second parameter.
Optionally, the apparatus further includes an encrypting module 604, configured to encrypt the acquisition policy before sending the acquisition policy to the client.
As shown in fig. 7, for convenience of description, only the parts related to the embodiment of the present invention are shown, and details of the specific technology are not disclosed, please refer to the method part of the embodiment of the present invention. The terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, etc., taking the terminal as the mobile phone as an example:
fig. 7 is a block diagram illustrating a partial structure of a mobile phone related to a terminal provided in an embodiment of the present invention. Referring to fig. 7, the handset includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (WiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 7 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile phone in detail with reference to fig. 7:
RF circuit 1010 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, for processing downlink information of a base station after receiving the downlink information to processor 1080; in addition, the data for designing uplink is transmitted to the base station. In general, RF circuit 1010 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 1010 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), and the like.
The memory 1020 can be used for storing software programs and modules, and the processor 1080 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1030 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also referred to as a touch screen, may collect touch operations by a user (e.g., operations by a user on or near the touch panel 1031 using any suitable object or accessory such as a finger, a stylus, etc.) and drive corresponding connection devices according to a preset program. Alternatively, the touch panel 1031 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 1030 may include other input devices 1032 in addition to the touch panel 1031. In particular, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, a joystick, or the like.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The Display unit 1040 may include a Display panel 1041, and optionally, the Display panel 1041 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1031 can cover the display panel 1041, and when the touch panel 1031 detects a touch operation on or near the touch panel 1031, the touch operation is transmitted to the processor 1080 to determine the type of the touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of the touch event. Although in fig. 7, the touch panel 1031 and the display panel 1041 are two independent components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1050, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Audio circuitry 1060, speaker 1061, microphone 1062 may provide an audio interface between the user and the handset. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, and the electrical signal is converted into a sound signal by the speaker 1061 and output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, which is then processed by the audio data output processor 1080 and then sent to, for example, another cellular phone via the RF circuit 1010, or output to the memory 1020 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help the user to send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1070, which provides wireless broadband internet access for the user. Although fig. 7 shows the WiFi module 1070, it is understood that it does not belong to the essential constitution of the handset, and can be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 1080 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and executes various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby integrally monitoring the mobile phone. Optionally, processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor, which handles primarily the operating system, user interfaces, applications, etc., and a modem processor, which handles primarily the wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1080.
The handset also includes a power source 1090 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1080 via a power management system to manage charging, discharging, and power consumption via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which are not described herein.
In an embodiment of the present invention, the terminal further includes a processor 1080 for controlling the execution of the method flow shown in fig. 1.
Fig. 8 is a schematic diagram of a server 1100 according to an embodiment of the present invention, where the server 1100 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1122 (e.g., one or more processors) and a memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing applications 1142 or data 1144. Memory 1132 and storage media 1130 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 1130 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 1122 may be provided in communication with the storage medium 1130 to execute a series of instruction operations in the storage medium 1130 on the server 1100.
The server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input-output interfaces 1158, and/or one or more operating systems 1141, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
The steps performed by the server in the above embodiments may be based on the server structure shown in fig. 8.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (27)

1. A performance index data acquisition method is characterized by comprising the following steps:
acquiring an acquisition strategy sent by a server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears and a data acquisition method of the performance index to be acquired, which is included in the acquisition strategy;
when a provision start interface function is detected to be called and a specific scene in the preset interactive application is determined to appear, acquiring data of performance indexes included in the acquisition strategy of the client in a target time period according to the acquisition strategy, and determining that the specific scene in the preset interactive application is ended until a provision end interface function is detected to be called, wherein the target time period is a time period from appearance to end of the specific scene;
reporting the collected performance index data;
when the performance index to be collected includes the FPS, collecting the data of the performance index of the client in a target time period according to the collection policy includes:
acquiring the FPS of the client according to a preset frequency in the target time period;
and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS shaking times according to the acquired FPS, wherein the FPS shaking times are times when the difference between two adjacent acquired FPS is larger than a threshold value in the target time period.
2. The method according to claim 1, wherein the obtaining of the collection policy sent by the server comprises:
generating request parameters, wherein the request parameters are used for requesting an acquisition strategy;
encrypting the request parameters and sending the encrypted request parameters to a server;
receiving an encrypted data packet from the server;
and decrypting the encrypted data packet to obtain an acquisition strategy.
3. The method according to claim 2, wherein the request parameters include information of a user account in the client for logging in the preset interactive application, and the information of the user account is used by the server to determine whether to send the collection policy to the client.
4. The performance index data collection method of any one of claims 1 to 3, wherein the performance index to be collected further comprises at least one of a CPU occupancy of the preset interactive application and a CPU occupancy of the client, a memory usage, a consumption flow, a consumption electric quantity, and a network delay of the preset interactive application.
5. The method according to claim 4, wherein when the performance indicator to be collected includes the network latency, the collecting data of the performance indicator of the client within a target time period according to the collection policy includes:
sending a test data packet to a server by adopting a user datagram UDP protocol at a first moment;
receiving a response data packet from the server;
and calculating the network time delay according to the time of receiving the response data packet and the first time.
6. The method for collecting performance index data according to claim 4, wherein when the performance index to be collected includes a CPU occupancy rate of the preset interactive application and a CPU occupancy rate of the client, the collecting the data of the performance index of the client in a target time period according to the collection policy includes:
acquiring a first time length, wherein the first time length is the time length occupied by the preset interactive application on the CPU in the target time period;
acquiring a second duration, wherein the second duration is the duration occupied by the client to the CPU in the target time period;
and calculating the CPU occupancy rate of the preset interactive application and the CPU occupancy rate of the client, wherein the CPU occupancy rate of the preset interactive application is the ratio of the first time length to the time length of the target time period, and the CPU occupancy rate of the client is the ratio of the second time length to the time length of the target time period.
7. The method according to claim 4, wherein when the performance index to be collected includes the memory usage amount of the preset interactive application, the collecting the data of the performance index of the client in a target time period according to the collection policy includes:
acquiring a process Identification (ID) of the preset interactive application;
acquiring process information according to the process ID;
calling a task _ info function;
and acquiring the memory usage amount corresponding to the preset interactive process according to the task _ info function and the process information.
8. The method according to claim 4, wherein when the performance index to be collected includes the consumption traffic, the collecting data of the performance index of the client in a target time period according to the collection policy includes:
reading the network interface information of the client;
acquiring flow data of the client when the specific scene appears and flow data of the client when the specific scene is finished according to the network interface information;
and calculating the consumption flow according to the flow data of the client when the specific scene appears and the flow data of the client when the specific scene ends.
9. A method for sending a policy, comprising:
acquiring an acquisition strategy, wherein the acquisition strategy is used for indicating a performance index to be acquired by a client in a specific scene of a preset interactive application and a data acquisition method of the performance index to be acquired, which is included in the acquisition strategy;
sending the acquisition strategy to the client, wherein the acquisition strategy is used for acquiring data of performance indexes included in the acquisition strategy of the client within a target time period according to the acquisition strategy when the client determines that a specific scene in the preset interactive application appears when detecting that a provision start interface function is called, and determining that the specific scene in the preset interactive application is ended until detecting that a provision end interface function is called, wherein the target time period is a time period from appearance to end of the specific scene;
receiving collected performance index data sent by the client;
when the performance index to be collected includes the FPS, collecting the data of the performance index of the client in a target time period according to the collection policy includes:
acquiring the FPS of the client according to a preset frequency in the target time period;
and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS shaking times according to the acquired FPS, wherein the FPS shaking times are times when the difference between two adjacent acquired FPS is larger than a threshold value in the target time period.
10. The method according to claim 9, wherein the acquiring the collection policy comprises:
receiving request parameters sent by a client, wherein the request parameters comprise information of a user account used for logging in the preset interactive application in the client;
and inquiring an acquisition strategy corresponding to the information of the user account in a database according to the information of the user account.
11. The policy sending method according to claim 10, wherein the information of the user account includes a first parameter and a second parameter;
the querying of the acquisition strategy corresponding to the information of the user account in the database according to the information of the user account comprises the following steps:
acquiring a total acquisition strategy, wherein the total acquisition strategy comprises at least one acquisition strategy and at least one parameter, and the at least one acquisition strategy and the at least one parameter have a corresponding relation;
determining a priority of the first parameter and the second parameter, wherein the priority of the first parameter is higher than the priority of the second parameter;
inquiring whether the collection strategy comprises the first parameter or not, and if so, acquiring a collection strategy corresponding to the first parameter; and if not, inquiring whether the second parameter is included in the total acquisition strategy, and if so, acquiring the acquisition strategy corresponding to the second parameter.
12. The method according to claim 9, wherein the sending the collection policy to the client further comprises:
and encrypting the acquisition strategy.
13. A performance index data collection system, comprising:
the acquisition module is used for acquiring an acquisition strategy sent by the server, wherein the acquisition strategy comprises a performance index to be acquired when a specific scene of preset interactive application appears and a data acquisition method of the performance index to be acquired, which is included in the acquisition strategy;
the acquisition module is used for acquiring data of performance indexes included in the acquisition strategy of the client within a target time period according to the acquisition strategy when a specific scene in the preset interactive application is determined to appear when a provision start interface function is detected to be called, and determining that the specific scene in the preset interactive application is ended until a provision end interface function is detected to be called, wherein the target time period is a time period from appearance to end of the specific scene;
the reporting module is used for reporting the collected performance index data;
when the performance index to be acquired comprises the FPS, the acquisition module is specifically used for acquiring the FPS of the client according to a preset frequency in the target time period; and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS shaking times according to the acquired FPS, wherein the FPS shaking times are times when the difference between two adjacent acquired FPS is larger than a threshold value in the target time period.
14. The performance index data collection device of claim 13, wherein the acquisition module is specifically configured to:
generating request parameters, wherein the request parameters are used for requesting an acquisition strategy;
encrypting the request parameters and sending the encrypted request parameters to a server;
receiving an encrypted data packet from the server;
and decrypting the encrypted data packet to obtain an acquisition strategy.
15. The apparatus according to claim 14, wherein the request parameter includes information of a user account used for logging in the preset interactive application in a client, and the information of the user account is used for the server to determine whether to send the collection policy to the client.
16. The apparatus according to any one of claims 13 to 15, wherein the performance index to be collected further includes at least one of a CPU occupancy of the preset interactive application and a CPU occupancy of the client, a memory usage amount, a consumption flow, a consumption electric quantity, and a network delay of the preset interactive application.
17. The apparatus according to claim 16, wherein when the performance metric to be collected includes the network latency, the collection module is specifically configured to:
sending a test data packet to a server by adopting a user datagram UDP protocol at a first moment;
receiving a response data packet from the server;
and calculating the network time delay according to the time of receiving the response data packet and the first time.
18. The apparatus of claim 16, wherein when the performance metrics to be collected include the CPU occupancy of the central processing unit of the preset interactive application and the CPU occupancy of the client, the collection module is specifically configured to:
acquiring a first time length, wherein the first time length is the time length occupied by the preset interactive application on the CPU in the target time period;
acquiring a second duration, wherein the second duration is the duration occupied by the client to the CPU in the target time period;
and calculating the CPU occupancy rate of the preset interactive application and the CPU occupancy rate of the client, wherein the CPU occupancy rate of the preset interactive application is the ratio of the first time length to the time length of the target time period, and the CPU occupancy rate of the client is the ratio of the second time length to the time length of the target time period.
19. The apparatus according to claim 16, wherein when the performance index to be collected includes the memory usage amount of the preset interactive application, the collection module is specifically configured to:
acquiring a process Identification (ID) of the preset interactive application;
acquiring process information according to the process ID;
calling a task _ info function;
and acquiring the memory usage amount corresponding to the preset interactive process according to the task _ info function and the process information.
20. The performance index data collection device of claim 16, wherein when the performance index to be collected includes the consumption flow, the collection module is specifically configured to:
reading the network interface information of the client;
acquiring flow data of the client when the specific scene appears and flow data of the client when the specific scene is finished according to the network interface information;
and calculating the consumption flow according to the flow data of the client when the specific scene appears and the flow data of the client when the specific scene ends.
21. A policy transmitting apparatus, comprising:
the acquisition module is used for acquiring an acquisition strategy, wherein the acquisition strategy is used for indicating the performance index to be acquired in a specific scene of a preset interactive application by a client and a data acquisition method of the performance index to be acquired, which is included in the acquisition strategy;
a sending module, configured to send the collection policy to the client, where the collection policy is used for, when the client detects that a provision start interface function is called and determines that a specific scene in the preset interactive application occurs, collecting, according to the collection policy, data of a performance index included in the collection policy of the client within a target time period, and determining that the specific scene in the preset interactive application ends until a provision end interface function is called, where the target time period is a time period from occurrence to end of the specific scene, and when the performance index to be collected includes an FPS, collecting, according to the collection policy, the data of the performance index of the client within the target time period, where the collection policy includes: acquiring FPS of the client according to preset frequency in the target time period, and calculating at least one of average FPS, maximum FPS, minimum FPS and FPS jitter times according to the acquired FPS, wherein the FPS jitter times are times when a difference value between two adjacent acquired FPS is larger than a threshold value in the target time period;
and the receiving module is used for receiving the collected performance index data sent by the client.
22. The policy sending apparatus according to claim 21, wherein the obtaining module is specifically configured to:
receiving request parameters sent by a client, wherein the request parameters comprise information of a user account used for logging in the preset interactive application in the client;
and inquiring an acquisition strategy corresponding to the information of the user account in a database according to the information of the user account.
23. The policy transmitting device according to claim 22, wherein the information of the user account includes a first parameter and a second parameter;
when the acquisition module queries an acquisition policy corresponding to the information of the user account in a database according to the information of the user account, the acquisition module is specifically configured to:
acquiring a total acquisition strategy, wherein the total acquisition strategy comprises at least one acquisition strategy and at least one parameter, and the at least one acquisition strategy and the at least one parameter have a corresponding relation;
determining a priority of the first parameter and the second parameter, wherein the priority of the first parameter is higher than the priority of the second parameter;
inquiring whether the collection strategy comprises the first parameter or not, and if so, acquiring a collection strategy corresponding to the first parameter; and if not, inquiring whether the second parameter is included in the total acquisition strategy, and if so, acquiring the acquisition strategy corresponding to the second parameter.
24. The apparatus according to claim 21, further comprising an encryption module configured to encrypt the collection policy before sending the collection policy to the client.
25. A computer-readable storage medium, in which a computer program is stored, which, when loaded and executed by a processor, implements a performance indicator data collection method according to any one of claims 1 to 8 or a policy sending method according to any one of claims 9 to 12.
26. A terminal, comprising:
a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store the program, the program at least to:
implementing a performance indicator data acquisition method according to any of the claims 1-8 above.
27. A server, comprising:
a processor and a memory;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store the program, the program at least to:
implementing the policy sending method according to any of the claims 9-12 above.
CN201610875487.7A 2016-09-30 2016-09-30 Performance index data acquisition method and device and strategy sending method and device Active CN107888550B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610875487.7A CN107888550B (en) 2016-09-30 2016-09-30 Performance index data acquisition method and device and strategy sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610875487.7A CN107888550B (en) 2016-09-30 2016-09-30 Performance index data acquisition method and device and strategy sending method and device

Publications (2)

Publication Number Publication Date
CN107888550A CN107888550A (en) 2018-04-06
CN107888550B true CN107888550B (en) 2021-06-01

Family

ID=61769017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610875487.7A Active CN107888550B (en) 2016-09-30 2016-09-30 Performance index data acquisition method and device and strategy sending method and device

Country Status (1)

Country Link
CN (1) CN107888550B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113541786A (en) * 2018-12-06 2021-10-22 华为技术有限公司 Data acquisition method and related equipment
CN110457229B (en) * 2019-08-23 2022-01-28 腾讯科技(深圳)有限公司 Game performance monitoring method and device, electronic equipment and storage medium
CN113010203A (en) * 2019-12-20 2021-06-22 Oppo广东移动通信有限公司 Application optimization method based on open platform and related device
CN112346775B (en) * 2020-09-21 2024-02-02 杭州数智政通科技有限公司 Index data general processing method, electronic device and storage medium
CN112256542B (en) * 2020-10-19 2022-02-08 中山大学 eBPF-based micro-service system performance detection method, device and system
CN113055402B (en) * 2021-03-30 2022-04-12 深圳红途科技有限公司 Data transmission control method and device, computer equipment and storage medium
CN118171119A (en) * 2024-05-14 2024-06-11 每日互动股份有限公司 Method, device, medium and equipment for acquiring swing user identification

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166619A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Performance measuring method and terminal of application program
CN105653451A (en) * 2015-12-29 2016-06-08 北京金山安全软件有限公司 Software performance testing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717670B (en) * 2013-12-13 2019-09-13 中国移动通信集团公司 A kind of measure of the quality of service method, apparatus and system
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
CN105260306B (en) * 2015-10-20 2018-05-08 网易(杭州)网络有限公司 The method for testing performance and device of fine arts resource in a kind of games

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166619A (en) * 2013-05-20 2014-11-26 腾讯科技(深圳)有限公司 Performance measuring method and terminal of application program
CN105653451A (en) * 2015-12-29 2016-06-08 北京金山安全软件有限公司 Software performance testing method and device

Also Published As

Publication number Publication date
CN107888550A (en) 2018-04-06

Similar Documents

Publication Publication Date Title
CN107888550B (en) Performance index data acquisition method and device and strategy sending method and device
CN106293445B (en) Method and device for acquiring application program use data and terminal equipment
CN107146616B (en) Equipment control method and related product
CN104383681B (en) Method for controlling game program, device and mobile terminal
CN109379247A (en) The method and device that the network delay of a kind of pair of application program is detected
CN109905380B (en) Node control method and related device in distributed system
CN106598584B (en) Method, device and system for processing resource file
WO2015027714A1 (en) Video playing method and apparatus, terminal device and server
CN107291586B (en) Application program analysis method and device
US10657347B2 (en) Method for capturing fingerprint and associated products
CN104426844B (en) A kind of safety certifying method, server and security certification system
CN106412311B (en) A kind of data transmission method and terminal device
CN108900386B (en) Method and device for generating alarm information and electronic equipment
CN106657165B (en) Network attack defense method, server and terminal
CN108200180B (en) Method and device for limiting request frequency and computer equipment
CN106534324B (en) A kind of data sharing method and Cloud Server
CN106911848B (en) Method for outputting prompt message and terminal equipment
CN106709282B (en) resource file decryption method and device
US9680921B2 (en) Method, apparatus, and system for controlling voice data transmission
EP3179693A1 (en) Method and device for establishing a data connection
CN106331105A (en) Method and device for guaranteeing network acceleration, and network QoS guarantee method and device
CN106020945B (en) Shortcut item adding method and device
CN116541865A (en) Password input method, device, equipment and storage medium based on data security
CN105577627B (en) Communication method, device, network equipment, terminal equipment and communication system
CN104104508B (en) Method of calibration, device and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant