Method, device and equipment for determining loading time consumption of web game in application program
During the loading process of web game, predefined events and server loading information are used to determine the time point of the loading stage, and the loading time of each loading stage is calculated, which solves the problem of missing and unreliability of loading time-consuming data in the prior art. , realizes effective loading time-consuming data statistics and provides reference data for the optimization of web games.
Patent Information
- Application Number
- CN202411453008.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, by requesting the game server to obtain time-consuming data, data loss is prone to occur, data reliability and real-timeness cannot be guaranteed, and reference data cannot be provided for iterative optimization of application access to web games.
During the loading process of web game, the time points of different loading stages are determined through the set first predefined event and the loading information feedback from the server, and the loading time of each loading stage is calculated, so that the client does not rely on the third-party server. The time-consuming data provided for loading.
Effective loading time-consuming data statistics are realized, providing reference data for iteratively optimizing the loading speed and online stability of web games, and solving the problems of data loss and unreliability.
Smart Images

Figure CN119425094A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, and apparatus for determining the loading time of a web game in an application. Background Art
[0002] With the rapid development of computer technology, more and more applications are trying to connect to web games to meet users' demand for diversified and highly interactive entertainment content. For example, live broadcast applications are trying to connect to web games provided by third-party game servers. While viewers are enjoying the live broadcast content in the live broadcast room, they can also participate in web games, which can attract users to stay in the live broadcast application for a longer time, thereby improving user stickiness and activity.
[0003] In related technologies, in order to optimize the user experience, the client can request the game server to obtain the loading time data. However, the third-party game server usually fails to determine the loading time of online games, or refuses to provide loading time data. In addition, the standards of loading time data provided by different third-party game servers are not unified, and the data dimensions do not meet the development requirements. At the same time, it is impossible to provide loading time data in real time, and it is necessary to repeatedly make requests to the third-party game server. As a result, the loading time data is easily missing, and the reliability and real-time performance of the loading time data cannot be guaranteed. It is impossible to provide reference data for the iterative optimization of application programs accessing web games, which needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a method, device and equipment for determining the loading time of a web game in an application, which solves the problem in the related art that the loading time data is easily missing when requesting the game server to obtain the loading time data, and the reliability and real-time performance of the loading time data cannot be guaranteed, and reference data cannot be provided for iterative optimization of the application accessing the web game. The method achieves that the client does not rely on the loading time data provided by the third-party game server, but instead performs time statistics of different loading stages in the process of loading the web game based on the set first predefined event and the loading information fed back by the game server, so that effective loading time data can be obtained, which provides effective reference data for iterative optimization of the loading speed and online stability of the web game.
[0005] In a first aspect, an embodiment of the present application provides a method for determining the loading time of a web game in an application, the method comprising:
[0006] In the case of triggering the loading of a webpage game, determining a first time point corresponding to a loading phase in the loading process of the webpage game by setting a first predefined event;
[0007] During the web game loading process, receiving loading information sent by the server, the loading information is generated based on an event output document pre-configured by the server;
[0008] Determining, based on the loading information, a second time point in the loading phase corresponding to a second predefined event during the webpage loading process;
[0009] The loading time of each loading stage in the loading process of the web game is calculated based on the first time point, the second time point and the starting time point when the loading of the web game is triggered.
[0010] In a second aspect, an embodiment of the present application further provides a device for determining the time taken to load a web game in an application program, the device comprising:
[0011] A first time point determination module, configured to determine a first time point corresponding to a loading stage in the loading process of the webpage game by setting a first predefined event when the loading of the webpage game is triggered;
[0012] An information receiving module, configured to receive loading information sent by a server during the web game loading process, wherein the loading information is generated based on an event output document pre-configured by the server;
[0013] A second time point determination module, configured to determine a second time point in the loading phase corresponding to a second predefined event in the webpage loading process based on the loading information;
[0014] The loading time determination module is configured to calculate the loading time of each loading stage in the web game loading process based on the first time point, the second time point and the starting time point when the web game loading is triggered.
[0015] In a third aspect, an embodiment of the present application further provides a device for determining the time taken to load a web game in an application, the device comprising:
[0016] one or more processors;
[0017] a storage device configured to store one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the loading time of a web game in an application program described in an embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, which, when executed by a computer processor, is configured to execute the method for determining the loading time of a web game in an application described in an embodiment of the present application.
[0020] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of a device reads and executes the computer program from the computer-readable storage medium, so that the device executes the method for determining the loading time of a web game in an application described in an embodiment of the present application.
[0021] In an embodiment of the present application, when triggering the loading of a webpage game, a first predefined event is set to determine a first time point corresponding to a loading phase in the loading process of the webpage game; during the loading process of the webpage game, loading information sent by a server is received, and the loading information is generated based on an event output document preconfigured by the server; based on the loading information, a second time point of the loading phase corresponding to a second predefined event in the loading process of the webpage is determined; based on the first time point and the second time point and the starting time point when the loading of the webpage game is triggered, the loading time of each loading phase in the loading process of the webpage game is calculated. In the above scheme, the time consumption of different loading phases in the process of loading the webpage game is counted based on the first predefined event set and the loading information fed back by the game server, so that effective loading time consumption data can be obtained, which provides effective reference data for iterative optimization of the loading speed and online stability of webpage games. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flowchart of a method for determining the time taken to load a web game in an application provided in an embodiment of the present application;
[0023] Figure 2 A flowchart of a method for determining the time consumption for loading a web game, including a process for specifically determining the time point of a loading phase, provided in an embodiment of the present application;
[0024] Figure 3 A flowchart of a method for determining the loading time of a web game including a process of specifically calculating the loading time of each loading stage provided in an embodiment of the present application;
[0025] Figure 4 A flowchart of a method for determining the loading time of a web game including a process of calculating the average loading time of a loading phase provided in an embodiment of the present application;
[0026] Figure 5 A flowchart of a method for determining the time taken to load a web game, including a process for calculating a loading success rate in a loading phase, provided in an embodiment of the present application;
[0027] Figure 6A structural block diagram of a device for determining the time taken to load a web game in an application provided in an embodiment of the present application;
[0028] Figure 7 A schematic diagram of the structure of a device for determining the time consumption for loading a web game in an application provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0031] The method for determining the loading time of a web game in an application provided in an embodiment of the present application can determine the first time point and the second time point of the corresponding loading phase respectively during the web game loading process by setting a first predefined event and the loading information sent by the server, and calculate the loading time of each loading phase in the web game loading process according to the first time point, the second time point and the starting time point when the web game loading is triggered. This method can be applied to the client to determine the loading time of web games in different applications. Taking social entertainment applications as an example, related applications may include live video applications, voice chat applications, short video applications, etc. The several applications listed above are only exemplary and explanatory. In actual scenarios, the method for determining the loading time of web games in this application can also be used in applications in other scenarios, and the embodiment of the present application does not limit this.
[0032] The method for determining the loading time of a web game in an application provided in an embodiment of the present application, the executor of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers and other terminal devices, and the embodiment of the present application does not limit this.
[0033] Figure 1 A flowchart of a method for determining the time taken to load a web game in an application provided in an embodiment of the present application. The method for determining the time taken to load a web game is applied to a client, such as Figure 1 As shown, the following steps are included:
[0034] Step S101: when triggering the loading of a web game, determining a first time point corresponding to a loading phase in the loading process of the web game by setting a first predefined event.
[0035] Among them, the web game loading can be triggered when it is detected that the user enables the built-in buttons or links and other controls in the application through interactive operations, and the interactive operations can be touch screen clicks, mouse clicks, etc. After triggering the loading of the web game, the client will load the kernel of the browser based on the system network view, use the kernel to establish a connection with the game server, and load the page corresponding to the web game to the system network view for display. The trigger callback corresponding to the first predefined event can be realized by registering the system callback of the system network view, which is used to output the system callback information when the system network view is in the loading stage related to the first predefined event. The first predefined event can be used to define the relevant stage when the system network view initially loads the page frame. In one embodiment, the first predefined event can include a callback onPageStart event and a callback onPageFinish event. Among them, the callback onPageStart event corresponds to the loading stage when the system network view starts loading the page frame, and the callback onPageFinish event corresponds to the loading stage when the system network view completes loading the page frame. In one embodiment, the callback moment corresponding to the first predefined event can be determined as the first time point of the corresponding loading stage. In one embodiment, the first time point corresponding to the loading phase in the web game loading process is determined by setting a first predefined event, and the specific implementation process may be: when the system callback information corresponding to the set first predefined event is monitored, the current moment is recorded as the first time point of the loading phase corresponding to the first predefined event. For example, at time T1, the system callback information that the system network view starts to load the page frame is monitored, and time T1 can be determined as the time point corresponding to the loading phase when the system network view starts to load the page frame. For another example, at time T2, the system callback information that the system network view completes loading the page frame is monitored, and time T2 can be determined as the time point corresponding to the loading phase when the system network view starts to load the page frame. The aforementioned specific first predefined event is only an exemplary description, and developers can make adaptive settings based on the monitoring requirements and optimization goals of the actual application scenario, which is not limited in this application.
[0036] Step S102: During the web game loading process, receiving loading information sent by the server, the loading information is generated based on the event output document pre-configured by the server.
[0037] Among them, the developer can define a second predefined event and a unified call entry for the intermediate key nodes in the web game loading process, distinguish different event calls through specific field identifiers, and output the relevant event output document to the server for interface callback debugging. For example, using the JavaScript call entry as an example, different event calls can be distinguished by the JSON specific field identifier in JavaScript. During the web game loading process, the server can send loading information in accordance with the callback requirements of the event output document when the loading stage corresponding to the second predefined event is reached to notify the client to record the time point of the relevant loading stage. In one embodiment, callback request information for outputting loading information is provided in the event output document. The callback request information includes a call name, a callback identifier, and call parameters. The call parameters include event fields and field values corresponding to the event fields. The field values are used to characterize the second predefined event corresponding to the loading information. For example, the reference format of the request information is as follows:
[0038] {"callName":"webProcess",
[0039] "callBackId":"xxx",
[0040] "callParam":
[0041] {
[0042] "event":"0"
[0043] }
[0044] }
[0045] Among them, callName is the call name, callBackId is the callback identifier, callParam is the call parameter, and event is the event field.
[0046] Step S103: determining a second time point in the loading phase corresponding to a second predefined event during the webpage loading process based on the loading information.
[0047] Among them, the loading information can be the interface callback result output by the server when it is in the relevant loading stage of the second predefined event. By identifying the second predefined event contained in the loading information, the current loading stage of the network loading process can be determined, so that the current moment is determined as the time point corresponding to the current loading stage. In one embodiment, the second predefined event can be a relevant stage for defining the system network view loading resources, client login game, etc. In one embodiment, the second predefined event can include a screen first display event, a game resource loading completion event, a game login event, a request authorization login event, and an authorization login success event. Among them, the screen first display event corresponds to the loading stage of displaying web page content for the first time in the system network view, the game resource loading completion event corresponds to the loading stage of the system network view completing the loading of game resources, and the game resources can include fonts, cascading style sheets, pictures, and animations, etc. The game login event corresponds to the loading stage of logging into the game server, the request authorization login event corresponds to the loading stage when the game server starts to request the client to authorize login, and the authorization login success event corresponds to the loading stage of successfully authorizing login to the game server. The aforementioned specific second predefined event is only an exemplary description, and developers can make adaptive settings based on the monitoring requirements and optimization goals of the actual application scenario, and this application does not limit it here.
[0048] Step S104, based on the first time point, the second time point and the starting time point when the webpage game loading is triggered, the loading time of each loading stage in the webpage game loading process is calculated.
[0049] In one embodiment, the starting time point when the web game loading is triggered can be recorded as T0, and the first predefined event is set to include callback onPageStart event and callback onPageFinish event, corresponding to the time point when the system network view starts loading the page frame as T1, and the time point when the system network view completes loading the page frame as T2. Among them, T1-T0 represents the time consumed from the client starting the browser kernel to enter loading to the start of loading the page frame, and T2-T0 represents the time consumed from the client starting the browser kernel to enter loading to the completion of loading the page frame. In one embodiment, the second predefined event is set to include the screen first display event, the game resource loading completion event, the game login event, the request authorization login event, and the authorization login success event, respectively corresponding to the time point when the system network view displays the web page content for the first time as T3, the time point when the system network view completes the loading of game resources as T4, the time point when the game server is logged in as T5, the time point when the game server starts to request the client to authorize login as T6, and the time point when the game server is successfully authorized to log in as T7. Wherein, T3-T0 represents the time consumed from when the client starts the browser kernel to enter loading to when the webpage content is displayed for the first time in the system network view, T4-T0 represents the time consumed from when the client starts the browser kernel to enter loading to when the system network view completes the loading of game resources, T5-T0 represents the time consumed from when the client starts the browser kernel to enter loading to when the game server starts to request the client to authorize the login, and T7-T0 represents the time consumed from when the client starts the browser kernel to enter loading to when the game server starts to authorize the login. In one embodiment, the adjacent first time point and the second time point can also be subtracted to determine the loading time between the intermediate loading stages, for example, the time point when the system network view starts to load the page frame is T1, and the time point when the system network view completes the loading of the page frame is T2, then T2-T1 represents the time consumed from when the system network view starts to load the page frame to when the loading of the page frame is completed. The above-mentioned specific calculation of loading time for different loading stages is only an exemplary description. Developers can make adaptive adjustments based on the monitoring requirements and optimization goals of actual application scenarios, and this application does not limit this.
[0050] In one embodiment, when the system network view is exited, or the loading time of a specific loading stage has been calculated, the calculated loading time of each loading stage can be summarized, and the summary result can be reported to the statistical background for monitoring the loading status of the web game, and providing effective reference data for iterative optimization of the access of the web game. For example, the loading stage corresponding to the callback onPageStart event, the callback onPageFinish event, the first screen display event, and the game resource loading completion event is reached, but the system network view is exited, and the data can be reported: T1-T0, T2-T0, T3-T0, T4-T0, 0, 0, 0, where 0 indicates that the loading stage corresponding to the subsequent event has not been reached. For another example, the loading stage corresponding to the authorization login success event has been reached, which can be regarded as the completion of the web game loading, and the data can be reported: T1-T0, T2-T0, T3-T0, T4-T0, T5-T0, T6-T0, T7-T0, T8-T0.
[0051] In the above, when the loading of a webpage game is triggered, the first time point corresponding to the loading stage in the loading process of the webpage game is determined by setting a first predefined event; during the loading process of the webpage game, the loading information sent by the server is received, and the loading information is generated based on the event output document pre-configured by the server; based on the loading information, the second time point of the loading stage corresponding to the second predefined event in the webpage loading process is determined; based on the first time point and the second time point and the starting time point when the loading of the webpage game is triggered, the loading time of each loading stage in the loading process of the webpage game is calculated. In the above scheme, the time consumption of different loading stages in the process of loading the webpage game is counted based on the set first predefined event and the loading information fed back by the game server, and effective loading time consumption data can be obtained, which provides effective reference data for iterative optimization of the loading speed and online stability of the webpage game.
[0052] Figure 2 A flowchart of a method for determining the time taken to load a web game including a process for determining the time point of a loading phase is provided in an embodiment of the present application. Figure 2 As shown, the following steps are included:
[0053] Step S201: When triggering the loading of a web game, determine a first time point corresponding to a loading phase in the loading process of the web game by setting a first predefined event.
[0054] Step S202: During the web game loading process, receiving loading information sent by the server, the loading information is generated based on the event output document pre-configured by the server.
[0055] Step S203: Read the field value of the event field from the loading information.
[0056] The event output document may predefine that the output loading information includes an event field, and different field values corresponding to the event field may be used to represent different second predefined events.
[0057] Step S204: query the set event mapping table based on the field value to determine the second predefined event corresponding to the loading information.
[0058] Among them, the event mapping table can record the second predefined events corresponding to different field values. Based on the read field value, the second predefined event that triggers the server to perform callback notification can be determined, and then the current loading stage of the web game loading process can be known.
[0059] Step S205: Record the current time as a second time point in the loading phase corresponding to the second predefined event.
[0060] Step S206: Calculate the loading time of each loading stage in the web game loading process based on the first time point, the second time point and the starting time point when the web game loading is triggered.
[0061] As described above, based on the field value corresponding to the event field in the loading information, the second predefined event that triggers the server callback can be effectively determined, and then the second time point of the loading phase corresponding to the second predefined event can be determined, providing accurate time data for the loading time calculation of the loading phase.
[0062] Figure 3 A flowchart of a method for determining the loading time of a web game provided in an embodiment of the present application, including a process for specifically calculating the loading time of each loading stage. Figure 3 As shown, the following steps are included:
[0063] Step S301: When triggering the loading of a webpage game, determine a first time point corresponding to a loading phase in the loading process of the webpage game through a set first predefined event.
[0064] Step S302: During the web game loading process, receiving loading information sent by the server, the loading information is generated based on the event output document pre-configured by the server.
[0065] Step S303: determining a second time point in the loading phase corresponding to a second predefined event during the webpage loading process based on the loading information.
[0066] Step S304: Subtract the first time point from the starting time point when the web game loading is triggered, to obtain the first loading time consumption of each loading stage corresponding to the first predefined event.
[0067] Step S305: Subtract the second time point from the start time point to obtain the second loading time consumption of each loading stage corresponding to the second predefined event.
[0068] As described above, by subtracting the first time point and the second time point from the start time point to obtain the loading time of the corresponding loading stage, effective loading time data can be obtained to meet the relevant requirements of subsequent optimization development.
[0069] Figure 4 A flowchart of a method for determining the loading time of a web game including a process of calculating the average loading time of the loading phase provided by an embodiment of the present application. Figure 4 As shown, the following steps are included:
[0070] Step S401: When triggering the loading of a web game, determine a first time point corresponding to a loading phase in the loading process of the web game by setting a first predefined event.
[0071] Step S402: During the web game loading process, receiving loading information sent by the server, the loading information is generated based on the event output document pre-configured by the server.
[0072] Step S403: determining a second time point in the loading phase corresponding to a second predefined event during the webpage loading process based on the loading information.
[0073] Step S404, based on the first time point and the second time point and the starting time point when the webpage game loading is triggered, the loading time of each loading stage in the webpage game loading process is calculated.
[0074] Step S405: Count the cumulative number of multiple loading times in the corresponding loading phase, and add up the multiple loading times to obtain the total time.
[0075] Among them, since there may be multiple loading of web games during the running of the application, the average loading time of each loading stage can be calculated to facilitate the subsequent evaluation of the loading stability of the web game. The number of results represents the number of calculated loading times corresponding to the loading stage when the web game is loaded multiple times. The total time represents the cumulative time consumed in the loading stage when the web game is loaded multiple times.
[0076] Step S406: Divide the total time consumption by the accumulated number to obtain the average loading time consumption of the corresponding loading stage.
[0077] The average loading time represents the average time consumed in the loading phase during multiple loading of web games.
[0078] In one embodiment, the average loading time corresponding to different loading stages can be subtracted to obtain the total average loading time of the intermediate loading stages. For example, a loading stage is from the client starting the browser kernel to entering the loading to logging into the game server, and the corresponding average loading time T is calculated. a1 , the other loading stage is from the client starting the browser kernel to loading to successfully authorizing and logging into the game server. The corresponding calculation results in the average loading time T a2 , the average loading time T a2 The average loading time T a1 The total average time from logging into the game server to successfully authorizing the game server to log in can be obtained by subtracting. Of course, other combined calculations of different loading stages can also be performed, which is not limited in this application.
[0079] As mentioned above, by further statistically calculating the average loading time of each loading stage, it can be helpful to provide reference data for the subsequent evaluation of the loading stability of the web game in each loading stage, so as to optimize the relevant loading process.
[0080] Figure 5 A flowchart of a method for determining the time taken to load a web game including a process for calculating the loading success rate of the loading phase provided by an embodiment of the present application. Figure 5 As shown, the following steps are included:
[0081] Step S501: When triggering the loading of a webpage game, determine a first time point corresponding to a loading phase in the loading process of the webpage game through a set first predefined event.
[0082] Step S502: During the web game loading process, loading information sent by the server is received, and the loading information is generated based on an event output document pre-configured by the server.
[0083] Step S503: determining a second time point in the loading phase corresponding to a second predefined event during the webpage loading process based on the loading information.
[0084] Step S504, based on the first time point and the second time point and the starting time point when the webpage game loading is triggered, the loading time of each loading stage in the webpage game loading process is calculated.
[0085] Step S505: Count the number of times the webpage game is loaded, and the number of results of multiple loading times in the corresponding loading phases.
[0086] Among them, during the running of the application, if there are multiple loading of web games, the loading of web games may fail. Therefore, the loading success rate of each loading stage can be calculated to facilitate subsequent analysis and determination of the relevant reasons for the failure of loading web games. The number of results represents the number of calculated loading times corresponding to the loading stage when the web game is loaded multiple times.
[0087] Step S506: Divide the number of results by the number of loading times to obtain the loading success rate of the corresponding loading stage.
[0088] The loading success rate indicates the number of successful loadings during multiple loadings of the web game in the loading phase.
[0089] In one embodiment, the loading success rates corresponding to different loading stages can also be subtracted to obtain the loading success rate loss between different loading stages. For example, one loading stage is from the client starting the browser kernel to enter the loading to the completion of the game resource loading, and the corresponding calculation obtains the loading success rate S1, and the other loading stage is from the client starting the browser kernel to enter the loading to the logging in game server, and the corresponding calculation obtains the loading success rate S2. Subtracting the loading success rate S2 from the loading success rate S1 can obtain the loading success rate loss from the completion of the game resource loading to the logging in game server. For example, for example, the loading success rate S1 is 100%, and the loading success rate S2 is 30%, which can be regarded as 70% of the users cannot reach the loading stage of the logging in game server. Of course, other combined calculations of different loading stages can also be performed, which is not limited in this application.
[0090] As mentioned above, by further statistically calculating the loading success rate of each loading stage, the loading success status of each loading stage in the process of multiple loading of web games can be effectively determined, which is helpful for providing reference data for subsequent repairs of related loading anomalies in applications connected to web games.
[0091] Figure 6 This is a structural block diagram of a device for determining the time taken to load a web game in an application provided in an embodiment of the present application. The device is configured to execute the method for determining the time taken to load a web game in an application provided in the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device comprises:
[0092] The first time point determination module 101 is configured to determine the first time point corresponding to the loading stage in the loading process of the webpage game by setting a first predefined event when the loading of the webpage game is triggered;
[0093] The information receiving module 102 is configured to receive loading information sent by the server during the web game loading process, and the loading information is generated based on the event output document pre-configured by the server;
[0094] A second time point determination module 103, configured to determine a second time point in a loading phase corresponding to a second predefined event in a webpage loading process based on the loading information;
[0095] The loading time determination module 104 is configured to calculate the loading time of each loading stage in the web game loading process based on the first time point, the second time point and the starting time point when the web game loading is triggered.
[0096] In the above, when the loading of a webpage game is triggered, the first time point corresponding to the loading stage in the loading process of the webpage game is determined by setting a first predefined event; during the loading process of the webpage game, the loading information sent by the server is received, and the loading information is generated based on the event output document pre-configured by the server; based on the loading information, the second time point of the loading stage corresponding to the second predefined event in the webpage loading process is determined; based on the first time point and the second time point and the starting time point when the loading of the webpage game is triggered, the loading time of each loading stage in the loading process of the webpage game is calculated. In the above scheme, the time consumption of different loading stages in the process of loading the webpage game is counted based on the set first predefined event and the loading information fed back by the game server, and effective loading time consumption data can be obtained, which provides effective reference data for iterative optimization of the loading speed and online stability of the webpage game.
[0097] In a possible embodiment, the second time point determination module 103 is further configured to:
[0098] Read the field value of the event field from the loading information;
[0099] The set event mapping table is queried based on the field value to determine the second predefined event corresponding to the loading information;
[0100] The current moment is recorded as a second time point in the loading phase corresponding to a second predefined event.
[0101] In a possible embodiment, the loading time-consuming determination module 104 is further configured to:
[0102] Subtract the first time point from the starting time point when the web game loading is triggered, to obtain the first loading time consumption of each loading stage corresponding to the first predefined event;
[0103] The second time point is subtracted from the start time point to obtain the second loading time consumption of each loading stage corresponding to the second predefined event.
[0104] In a possible embodiment, it further includes an average time consumption calculation module configured as follows:
[0105] Count the number of results of multiple loading times in the corresponding loading phase, and add up the multiple loading times to get the total time;
[0106] Divide the total time consumed by the number of results to obtain the average loading time consumed in the corresponding loading stage.
[0107] In a possible embodiment, a success rate calculation module is further included, configured as follows:
[0108] Count the number of times the web game is loaded, and the number of results of multiple loading times in the corresponding loading phase;
[0109] Divide the number of results by the number of loads to get the loading success rate of the corresponding loading stage.
[0110] In a possible embodiment, the first time point determination module 101 is further configured to:
[0111] When the system callback information corresponding to the set first predefined event is monitored, the current time is recorded as the first time point of the loading phase corresponding to the first predefined event.
[0112] In a possible embodiment, callback request information for outputting loading information is provided in the event output document. The callback request information includes a call name, a callback identifier, and call parameters. The call parameters include an event field and a field value corresponding to the event field. The field value is used to represent a second predefined event corresponding to the loading information.
[0113] Figure 7 A schematic diagram of a device for determining the time taken to load a web game in an application provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 7 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 7The example of connecting via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for determining the time taken to load a web game in the application in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the method for determining the time taken to load a web game in the above-mentioned application. The input device 203 can be configured to receive input digital or character information, and to generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0114] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a method for determining the loading time of a web game in an application described in the above embodiment, which includes: in the case of triggering the loading of a web game, determining a first time point corresponding to a loading stage in the web game loading process by setting a first predefined event; during the web game loading process, receiving loading information sent by a server, the loading information is generated based on an event output document pre-configured by the server; determining a second time point of the loading stage corresponding to a second predefined event in the web page loading process based on the loading information; and calculating the loading time of each loading stage in the web game loading process based on the first time point, the second time point and the starting time point when the web game loading is triggered.
[0115] It is worth noting that in the embodiment of the device for determining the loading time of a web game in the above-mentioned application, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0116] In some possible implementations, various aspects of the method provided in this application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps in the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the method for determining the time taken to load a web game in the application program described in the embodiment of this application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A method for determining the time taken to load a web game in an application, applied to a client, characterized in that: include: In the case of triggering the loading of a webpage game, determining a first time point corresponding to a loading phase in the loading process of the webpage game by setting a first predefined event; During the web game loading process, receiving loading information sent by the server, the loading information is generated based on an event output document pre-configured by the server; Determining, based on the loading information, a second time point in the loading phase corresponding to a second predefined event during the webpage loading process; The loading time of each loading stage in the loading process of the web game is calculated based on the first time point, the second time point and the starting time point when the loading of the web game is triggered.
2. The method for determining the loading time of a web game in an application according to claim 1, characterized in that: The determining, based on the loading information, a second time point of the loading phase corresponding to a second predefined event in the webpage loading process includes: Reading a field value of an event field from the loading information; Querying a set event mapping table based on the field value to determine a second predefined event corresponding to the loading information; The current moment is recorded as a second time point corresponding to the loading phase of the second predefined event.
3. The method for determining the loading time of a web game in an application according to claim 1, characterized in that: The calculating the loading time of each loading stage in the loading process of the web game based on the first time point, the second time point and the starting time point when the loading of the web game is triggered includes: Subtract the first time point from the starting time point when the loading of the web game is triggered, to obtain the first loading time consumption of each loading stage corresponding to the first predefined event; The second time point is subtracted from the start time point to obtain a second loading time consumption corresponding to each loading stage of the second predefined event.
4. The method for determining the loading time of a web game in an application according to claim 1, characterized in that: Also includes: Counting the number of results of multiple loading time consumptions corresponding to the loading stage, and adding the multiple loading time consumptions to obtain a total time consumption; The total time consumption is divided by the number of results to obtain the average loading time consumption corresponding to the loading stage.
5. The method for determining the loading time of a web game in an application according to claim 1, characterized in that: Also includes: Counting the number of times the webpage game is loaded, and the number of results of multiple loading times corresponding to the loading phase; The number of results is divided by the number of loading times to obtain the loading success rate corresponding to the loading stage.
6. The method for determining the time taken to load a web game in an application according to claim 1, characterized in that: The determining of the first time point corresponding to the loading phase in the web game loading process by setting the first predefined event includes: When the system callback information corresponding to the set first predefined event is monitored, the current time is recorded as the first time point of the loading phase corresponding to the first predefined event.
7. The method for determining the loading time of a web game in an application according to claim 1, characterized in that: The event output document is provided with callback request information for outputting the loading information, the callback request information includes a call name, a callback identifier and call parameters, the call parameters include an event field and a field value corresponding to the event field, and the field value is used to represent a second predefined event corresponding to the loading information.
8. A device for determining the time taken to load a web game in an application, characterized in that: include: A first time point determination module, configured to determine a first time point corresponding to a loading stage in the loading process of the webpage game by setting a first predefined event when the loading of the webpage game is triggered; An information receiving module, configured to receive loading information sent by a server during the web game loading process, wherein the loading information is generated based on an event output document pre-configured by the server; A second time point determination module, configured to determine a second time point in the loading phase corresponding to a second predefined event in the webpage loading process based on the loading information; The loading time determination module is configured to calculate the loading time of each loading stage in the web game loading process based on the first time point, the second time point and the starting time point when the web game loading is triggered.
9. A device for determining the time taken to load a web game in an application, the device comprising: one or more processors; A storage device is configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the loading time of a web game in the application described in any one of claims 1-7.
10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the method for determining the loading time of a web game in an application program according to any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, a method for determining the loading time of a web game in an application program described in any one of claims 1-7 is implemented.