Functional testing method and apparatus, electronic device, and storage medium

By constructing and computing the data matrix assimilating the time-sequence heterogeneous data in the game, the problem of inaccurate backtesting results of the game function is solved, and more accurate backtesting results are achieved.

CN114116824BActive Publication Date: 2025-07-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111443377.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-07-22
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The prior art cannot effectively process a large number of time-sequence heterogeneous data in the game, resulting in inaccurate functional backtest results.

Method used

By constructing a data matrix and performing matrix operations, the time-sequence heterogeneous data of different data sources are assimilated with frequency and logical structure, so that it can directly participate in the test formula operation.

Benefits of technology

The accuracy of game function backtest results is improved, ensuring that the backtest data fully contains all relevant timing heterogeneous data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116824B_ABST
    Figure CN114116824B_ABST
Patent Text Reader

Abstract

The present application provides a function testing method, an apparatus therefor, an electronic device, and a storage medium. The method includes: in response to a calculation instruction of a test formula used in a target function test, obtaining N groups of target timing data from N types of data sources, where the N types of data sources are the data sources corresponding to the timing data required in the test formula, and N is an integer greater than zero; constructing each group of target timing data into a data matrix having a preset data sampling frequency and a preset sampling start time according to the preset data sampling frequency, obtaining N data matrices; processing the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources so as to assimilate the logical structures of the data in the N data matrices; performing an operation on the data in the N assimilated data matrices according to the test formula to obtain an operation result; and when the operation result is within a preset numerical range, determining that the target function test passes. The method of the present application makes the backtest result of the game function more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to data processing technologies, and in particular, to a functional testing method and apparatus, an electronic device, and a storage medium therefor. Background Art

[0002] Time series data refers to data indexed in chronological order. For example, the coordinate sequences (x1, y1, t1), (x2, y2, t2), (x3, y3, t3),..., (xn, yn, tn) corresponding to the running trajectory of a game character are a set of time series data, where (x, y) represents the map coordinates of the character, and t is the time when the character reaches the coordinate. Heterogeneous means that the sampling frequencies or logical structures of time series data are different. Among them, the logical structure is a concept in the mathematical sense. For example, when describing the movement trajectory of a game character, some time series data use rectangular coordinate systems, and some time series data use polar coordinate systems. This situation can be referred to as different logical structures of time series data. The reason for heterogeneity is the use of different time series data sources.

[0003] In the design of games, it is often necessary to perform backtesting on a certain function designed in the game, which requires the use of a large amount of heterogeneous time series data. For example, to backtest the numerical results of a combat algorithm, it is necessary to use in-game venue data, player data, weather data, etc. The sampling frequencies of these data are not necessarily the same, so they cannot be directly verified and calculated.

[0004] Generally, the existing technology can only screen out time series data belonging to the same data source from a large amount of heterogeneous time series data, and use this time series data belonging to the same data source for functional backtesting, and cannot process a large amount of heterogeneous time series data. This will cause the problem that the functional backtesting results of the game are not accurate enough.

[0005] Therefore, how to effectively process a large amount of heterogeneous time series data to make the backtesting results of game functions more accurate is still an urgent problem to be solved. Summary of the Invention

[0006] The present application provides a functional testing method and apparatus, an electronic device, and a storage medium therefor, so as to make the backtesting results of game functions more accurate.

[0007] On the one hand, the present application provides a functional testing method, including:

[0008] Responding to a calculation instruction of a test formula used in a target functional test, obtaining N groups of target time series data from N types of data sources, where the N types of data sources are the data sources corresponding to the time series data required in the test formula, and N is an integer greater than zero;

[0009] Construct each set of target time-series data into a data matrix with the preset data sampling frequency and preset sampling start time according to the preset data sampling frequency, obtaining N data matrices;

[0010] Process the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, so as to assimilate the logical structures of the data in the N data matrices;

[0011] Perform operations on the data in the N assimilated data matrices according to the test formula to obtain an operation result;

[0012] When the operation result is within the preset numerical range, determine that the target function test passes.

[0013] In one embodiment, the step of constructing each set of target time-series data into a data matrix with the preset data sampling frequency and preset sampling start time according to the preset data sampling frequency, obtaining N data matrices includes:

[0014] For each type of data source among the N types of data sources, calculate the data matrix of the data source in the following manner:

[0015] Construct the initial timestamp matrix of the data source according to the timestamps of each target time-series data sampled by the data source. The matrix elements of the initial timestamp matrix are sampling times, with a size of n*m, where n represents the number of terminal devices from which the target time-series data sampled by the data source comes, and m represents the number of sampling times of the target time-series data sampled by the terminal device with the most sampling time points in the data source;

[0016] Expand the initial timestamp matrix of the data source into a target timestamp matrix with a size of n*(p*m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero;

[0017] Construct the initial data matrix of the data source according to the target time-series data sampled by the data source. The matrix elements of the initial data matrix are the data values of the target time-series data;

[0018] Perform matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

[0019] In one embodiment, the step of performing matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source includes:

[0020] Construct a zero matrix with the same size as the target timestamp matrix of the data source, where different rows of the zero matrix represent different terminal devices and columns represent sampling times;

[0021] Determine the column interval and row in the zero matrix to which the first data belongs according to the sampling time and terminal device corresponding to the first data in the initial data matrix of the data source;

[0022] Fill the first data in all sub - matrices formed by the column interval and row in the zero matrix to which the first data belongs, until each time - series data in the initial data matrix of the data source is filled into the zero matrix, obtaining the data matrix of the data source, until the data matrices of each type of data source are obtained.

[0023] In one embodiment, before obtaining N groups of target time - series data from N types of data sources according to the calculation instruction of the test formula used in response to the target function test, it further includes:

[0024] Obtain time - series data collected by multiple terminal devices;

[0025] Filter the time - series data collected by the multiple terminal devices according to a preset field, and store the filtered and compressed time - series data in different databases according to different data sources.

[0026] In one embodiment, the storing the filtered and compressed time - series data in different databases according to different data sources includes:

[0027] Compress the filtered time - series data in the form of data columns, and store the compressed time - series data in different databases according to different data sources.

[0028] On the other hand, the present application provides a function test device, including:

[0029] An acquisition module, configured to obtain N groups of target time - series data from N types of data sources in response to the calculation instruction of the test formula used in the target function test, where the N types of data sources are the data sources corresponding to the time - series data required in the test formula, and N is an integer greater than zero;

[0030] A matrix construction module, configured to construct each group of target time - series data into a data matrix with the preset data sampling frequency and preset sampling start time according to the preset data sampling frequency, obtaining N data matrices;

[0031] A logical structure assimilation module, configured to process the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, so as to assimilate the logical structures of the data in the N data matrices;

[0032] An operation module, configured to perform operations on the data in the N assimilated data matrices according to the test formula to obtain an operation result;

[0033] A judgment module, configured to determine that the target function test passes when the operation result is within a preset numerical range.

[0034] In one embodiment, the matrix construction module is specifically configured to:

[0035] For each type of data source among the N types of data sources, calculate the data matrix of the data source in the following manner:

[0036] Construct an initial timestamp matrix of the data source according to the timestamps of each target time-series data sampled by the data source. The matrix elements of the initial timestamp matrix are sampling times, with a size of n*m, where n represents the number of terminal devices from which the target time-series data sampled by the data source is sourced, and m represents the number of sampling times of the target time-series data sampled by the terminal device with the most sampling time points in the data source;

[0037] Expand the initial timestamp matrix of the data source into a target timestamp matrix with a size of n*(p*m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero;

[0038] Construct an initial data matrix of the data source according to the target time-series data sampled by the data source. The matrix elements of the initial data matrix are the data values of the target time-series data;

[0039] Perform matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

[0040] On the other hand, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0041] The memory stores computer-executable instructions;

[0042] The processor executes the computer-executable instructions stored in the memory to implement the function test method as described in the first aspect.

[0043] On the other hand, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the function test method as described in the first aspect.

[0044] On the other hand, the present application provides a computer program product, including a computer program which, when executed by a processor, implements the function testing method described in the first aspect.

[0045] The function testing method provided by the present application assimilates the sampling frequencies and starting times of the time series data collected from different data sources by constructing a matrix, and then operates on N such data matrices according to the set coordinate mapping relationship between the sampling coordinates of N types of data sources, so as to assimilate the logical structures of the data in different data matrices. Thus, through matrix construction and matrix operations, the time series data sampled from different types of data sources are assimilated, so that the time series data sampled from different types of data sources can be directly substituted into the test formula for calculation. Since the data used for the backtest of the game function is comprehensive enough (including all time series heterogeneous data related to the function to be backtested), not just the data from a certain data source, the backtest result obtained during the backtest of the game function will be more accurate, solving the problem that the backtest result of the game function in the prior art is not accurate enough. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0047] Figure 1 It is a schematic diagram of the application scenario of the function testing method provided by the present application.

[0048] Figure 2 It is a schematic flowchart of the function testing method provided by one of the embodiments of the present application.

[0049] Figure 3 It is a schematic flowchart of the function testing method provided by one of the embodiments of the present application.

[0050] Figure 4 It is a schematic diagram of the function testing device provided by one of the embodiments of the present application.

[0051] Figure 5 It is a schematic diagram of the electronic device provided by one of the embodiments of the present application.

[0052] Through the above-mentioned accompanying drawings, the clear embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and text descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0054] First, the terms involved in the present application are explained:

[0055] Time-series data: It refers to time-series data indexed in chronological order. Time-series data is a data column of the same unified index recorded in chronological order. For example, the coordinate sequence (x1, y1, t1), (x2, y2, t2), (x3, y3, t3),..., (xn, yn, tn) corresponding to the running trajectory of a game character is a set of time-series data, where (x, y) represents the map coordinates of the character, and t is the time when the character reaches this coordinate.

[0056] Time-series heterogeneous data: The sampling frequency or logical structure of time-series data is different. Here, the logical structure is a concept in a mathematical sense. For example, when describing the movement trajectory of a game character, some time-series data uses a rectangular coordinate system, and some time-series data uses a polar coordinate system, which means that the time-series data is different in logical structure. The reason for heterogeneity is the use of different time-series data sources. There can be multiple time-series data sources used in a system. For example, for an aircraft, its geographical coordinates (x, y, t) are time-series data sampled from the Global Positioning System (GPS); the vertical coordinate (z, t) is the sampled time-series data from a barometric sensor; the attitude coordinates (θ, φ, ψ, t) are the sampled time-series data from an attitude sensor.

[0057] In the design of games, it is often necessary to perform backtesting on a certain target function designed in the game, which requires the use of a large amount of time-series heterogeneous data. For example, if you want to calculate whether the actual damage (damage amount - damage reduction amount) suffered by a player character per second in a certain game scenario meets the game design requirements, you need to use the damage amount and damage reduction amount of the player character. However, the damage amount and damage reduction amount are time-series heterogeneous data. That is, when the player character is damaged, the data recording frequency is once per second, and the recorded damage amounts are shown in Table 1. When the player character is damaged, the recording frequency of the damage reduction data is once every 3 seconds, and the recorded damage reduction amounts are shown in Table 2. The prior art cannot directly perform verification operations on these time-series heterogeneous data, so it is impossible to implement the backtesting of the target function in the game.

[0058] Table 1:

[0059] The 1st second The 2nd second The 3rd second The 4th second The 5th second The 6th second The 7th second The 8th second The 9th second Player 1 200 200 200 200 200 200 200 200 200

[0060] Table 2:

[0061] The 1st second The 4th second The 7th second Player 1 100 90 100

[0062] Generally, the prior art can only screen out the time-series data belonging to the same data source from a large amount of time-series heterogeneous data, and then use the time-series data belonging to the same data source to perform functional backtesting. Since a large amount of time-series heterogeneous data cannot be introduced to perform functional backtesting, the problem that the functional backtesting result of the game is not accurate enough will occur.

[0063] Based on this, the present application provides a functional testing method and device. The functional testing method can perform frequency assimilation and logical structure assimilation on time-series heterogeneous data obtained from different data sources through matrix operations, so that these time-series heterogeneous data can be directly verified after assimilation. Since the data used for the backtesting of the game function is comprehensive enough (including all time-series heterogeneous data related to the function to be backtested), not only including the data of a certain data source, the backtesting result obtained during the backtesting of the game function will be more accurate, solving the problem that the functional backtesting result of the game in the prior art is not accurate enough.

[0064] The functional testing method provided by the present application is applied to an electronic device, such as a computer device, a server used in a laboratory, etc. Figure 1 It is a schematic diagram of the application of the functional testing method provided by the present application. Figure 1 In, a formula (such as the actual damage amount = damage amount - damage reduction amount described above) required for backtesting the target function in the game is displayed on the electronic device. When it is necessary to perform backtesting on the target function, the formula can be triggered to start calculation. At this time, after the electronic device performs sampling frequency assimilation and logical structure assimilation on all the time-series heterogeneous data required in the formula, the time-series data with the same logical structure is substituted into the formula, and the formula is calculated to obtain the calculation result, thereby realizing the backtesting verification of the target function.

[0065] Please refer to Figure 2 , one of the embodiments of the present application provides a functional testing method, including:

[0066] S210, in response to a calculation instruction of a test formula used in target function testing, obtain N groups of target time-series data from N types of data sources, where the N types of data sources are the data sources corresponding to the time-series data required in the test formula, and N is an integer greater than zero.

[0067] For example, to calculate whether the actual damage (damage amount - damage reduction amount) received by a player character per second in a certain game scenario meets the game design requirements as described above, the formula used is: actual damage amount = damage amount - damage reduction amount. Among them, the damage amount is collected and recorded by a type of data source on any one terminal device, and the damage reduction amount is collected and recorded by another type of data source on the same terminal device. Therefore, when the tester inputs the calculation instruction for the test formula, the electronic device obtains the damage amount time series data (a set of target time series data) and the damage reduction amount time series data (a set of target time series data) of the player character from two types of data sources on any one terminal device or any number of terminal devices respectively. The obtained damage amount time series data and damage reduction amount time series data of the player character are shown in Table 3 and Table 4 respectively (Table 3 and Table 4 show the damage amount time series data and damage reduction amount time series data obtained from two terminal devices).

[0068] Table 3;

[0069]

[0070] Table 4:

[0071] The 1st second The 4th second The 7th second Player 1 (Terminal Device 1) 100 90 100 Player 2 (Terminal Device 2) 100 110 130

[0072] The type of data source described in this step includes multiple data sources, and each data source in the multiple data sources included in the type of data source exists in one terminal device. That is to say, if the type of data source includes 3 data sources, the target time series data obtained from the type of data source comes from the 3 terminal devices corresponding to the 3 data sources.

[0073] The target time series data can be time series data with specified fields and specified timestamps. Correspondingly, the calculation instruction of the test formula can also carry information about the specified fields and the specified timestamps, so that when the electronic device responds to the calculation instruction of the test formula, it can obtain time series data with the specified fields and the specified timestamps. The specified fields can include multiple different fields, and the specified timestamps can include multiple different timestamps.

[0074] Optionally, before executing step S210, it is also possible to obtain the time series data collected by multiple terminal devices, then filter the time series data collected by the multiple terminal devices according to the preset fields, compress the filtered time series data, and store it in different databases according to the different data sources. Among them, each database is used to store the time series data collected by a type of data source. Among them, the preset fields are set by the tester according to actual needs.

[0075] Optionally, when storing the filtered time-series data compressed into different databases according to different data sources, the filtered time-series data can be compressed in the form of data columns and then stored in different databases according to different data sources.

[0076] Optionally, before compressing the filtered time-series data, the time-series data obtained by filtering the time-series data collected by the multiple terminal devices can be stored in the form of a data list, and then the missing data in the time-series data in the data list is queried and processed, and the missing data is filled (all positions of the missing data are filled with data) or defaulted (the missing data is ignored). When storing the time-series data in the form of a data list, the data in the data list can also be converted into a pandas data structure, dataframe, for storage. After storing the time-series data in the form of a data list, the heterogeneous time-series data in the stored time-series data in the data list is compressed and stored in the form of data columns.

[0077] In this embodiment, the BCOLZ compression library can be used as the compression and storage medium for time-series data. Specifically, the meta-information of Bcolz can be used as the index for storing time-series data, and the time-series data is arranged in the time order of the time-series data. The storage location of heterogeneous time-series data is recorded according to the starting offset of each time-series data. When using the BCOLZ compression library to compress and store time-series data, it can be determined whether to compress the time-series data according to the scale of the stored time-series data. When the scale of the stored time-series data reaches the limit scale, the currently stored time-series data is compressed. During the compression process, a ctable data structure of the BCOLZ compression library is created to store the compressed time-series data. After storing and compressing the time-series data, a data list containing the compressed data and compression information is generated, and the data list is stored.

[0078] After step S210 starts to execute, the data list is extracted, and the time-series data required for the operation of the test formula is extracted from the BCOLZ compression library according to the parameters of the time-series data required for the operation of the test formula (such as the data field name, start and end times, data source, etc.) of the time-series data. For example, if it is necessary to obtain the game status data of player A from July 1, 2021 to July 11, 2021, an extractor is established and the parameters of the time-series data are input, and then the corresponding data slice can be extracted from the data list, and the desired time-series data can be obtained from the corresponding data slice.

[0079] S220, constructing each group of target time-series data into a data matrix with the preset data sampling frequency and the preset sampling start time to obtain N data matrices.

[0080] The preset data sampling frequency can be set according to actual needs. For example, it can be the maximum data sampling frequency among the data sampling frequencies of the N types of data sources (the larger the data sampling frequency, the more data can be collected in the same time). For example, the N types of data sources are the data sources for collecting damage amounts and the data sources for collecting damage reduction amounts described above, and the preset data sampling frequency is the data sampling frequency of the data source for collecting damage amounts.

[0081] Then, after constructing the time-series data of the two types of data sources shown in Tables 3 and 4 into a data matrix according to the preset data sampling frequency, the data matrix constructed from the time-series data of the data source shown in Table 3 The data matrix constructed from the time-series data of the data source shown in Table 4 can be When constructing the time-series data of the data source shown in Table 4, the time-series data with time stamps from the 1st second to the 3rd second are all filled with the time-series data of the 1st second, the data with time stamps from the 4th second to the 6th second are all filled with the time-series data of the 4th second, and the data with time stamps from the 7th second to the 9th second are all filled with the time-series data of the 7th second. The first column matrix elements of the data matrix Z1 and the data matrix Z2 are all the time-series data collected at the 1st second.

[0082] S230. According to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, process the N data matrices to assimilate the logical structures of the data in the N data matrices.

[0083] The sampling coordinates of the N types of data sources may be different. In order to be able to execute the test formula, not only the data sampling frequencies and sampling start times corresponding to the N groups of target time-series data need to be the same, but also the logical structures of the N groups of target time-series data need to be the same. Therefore, after constructing the N groups of target time-series data into N data matrices with the preset data sampling frequency and the preset sampling start time according to the preset data sampling frequency, the interface mapping module can also be called to perform operations on the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources.

[0084] Optionally, when performing operations on the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, a two-dimensional mapping table between the sampling coordinates of different data sources can be created. As shown in Table 5 (the mapping fields shown in Table 5 refer to any data in the data matrix, and the field description refers to the coordinate system obtained after mapping and processing different sampling coordinates), the sampling coordinates of data source A are rectangular coordinates, and the sampling coordinates of data source B are polar coordinates. Suppose we need to map the data sampled in rectangular coordinates and the data sampled in polar coordinates to the data sampled in rectangular coordinates. We need to perform operations on the data matrix corresponding to data source A and the data matrix corresponding to data source B according to the coordinate mapping relationship between rectangular coordinates and polar coordinates. Specifically, the coordinate mapping relationship is created by the tester according to the sampling coordinates of different types of data sources. For example, the coordinate mapping relationship between the sampling coordinates of data source A and data source B is c = X * Y. Then, for data source A, c = X * Y, and for data source B, c = ρcosθX * ρsinθY. Performing operations on the N data matrices according to c can assimilate the sampling coordinates of the data in the data matrix corresponding to data source B to rectangular coordinates, thereby realizing the logical structure assimilation of the data in the data matrix of data source A and the data matrix of data source B.

[0085] Table 5:

[0086] Mapping field Field description Data source of type A Data source of type B X x-axis (rectangular coordinate system) X ρcosθ Y y-axis (rectangular coordinate system) Y ρsinθ

[0087] S240, perform operations on the data in the N assimilated data matrices according to the test formula to obtain the operation result.

[0088] After assimilating the logical structure of the data in the data matrix, operations can be performed on the data according to the test formula. Taking data source A and data source B shown in Table 5 as an example, suppose data source A and data source B sample the motion data of player a and player b respectively. The test formula is used to calculate the straight-line distance between player a and player b at each sampling time point. The test formula is S = (X A -X B ) 2 , X A represents the position data of player a on the two-dimensional coordinate, X B represents the position data of player b on the two-dimensional coordinate, where X B is the data expressed in rectangular coordinates.

[0089] S250, when the operation result is within the preset numerical range, determine that the target function test passes.

[0090] The preset numerical range is set by the tester, which is the numerical range where the operation result of the test formula is located when the target function meets the expectations of the tester. For example, if the straight-line distance between player a and player b described in step S240 meets the expected motion function of the tester, S should be between 1 centimeter and 2 centimeters. If the straight-line distance S between player a and player b at a certain sampled time point calculated is greater than or equal to 1 centimeter and less than or equal to 2 centimeters, it is determined that the motion function of player a and player b at that certain sampled time point passes the test. However, if S is greater than 2 centimeters or less than 1 centimeter, it is determined that the motion function test of player a and player b at that certain sampled time point fails.

[0091] The function test method provided in this embodiment assimilates the timing data collected from different data sources by constructing a matrix first for the data sampling frequency and the starting time of data sampling, and then operates on the N data matrices according to the set coordinate mapping relationship between the sampling coordinates of N types of data sources to assimilate the logical structures of the data in different data matrices. Thus, through matrix construction and matrix operations, the timing data sampled from different types of data sources is assimilated, enabling the timing data sampled from different types of data sources to be directly substituted into the test formula for operation. Since the data used for the backtest of the game function is comprehensive enough (including all timing heterogeneous data related to the function to be backtested), not just including the data of a certain data source, the backtest result obtained during the backtest of the game function will be more accurate, solving the problem that the backtest result of the game function in the prior art is not accurate enough.

[0092] Please refer to Figure 3 , one of the embodiments of the present application provides a function test method, and further describes the function test method provided in one of the embodiments. The method includes:

[0093] S310, in response to the calculation instruction of the test formula used in the target function test, obtain N groups of target timing data from N types of data sources, where the N types of data sources are the data sources corresponding to the timing data required in the test formula, and N is an integer greater than zero.

[0094] For the relevant description of step S310, reference can be made to the relevant description of step S210, which will not be elaborated here.

[0095] S320, construct an initial timestamp matrix of the data source according to the timestamps of each target timing data sampled by the data source. The matrix elements of the initial timestamp matrix are sampling times, with a size of n*m. n represents the number of terminal devices from which the target timing data sampled by the data source is sourced, and m represents the number of sampling times of the target timing data sampled by the terminal device with the most sampling time points in the data source.

[0096] For example, the size of the initial timestamp matrix O1 constructed based on the damage amounts shown in Table 3 is 2 * 9. Among them, the matrix elements "1", "2", "3", "4",..., "9" in O1 are the sampling times carried by the target time-series data respectively. For example, "1" is the sampling time (the 1st second) carried by the damage amount of 200 for Player 1 and the damage amount of 200 for Player 2, "2" is the sampling time (the 2nd second) carried by the damage amount of 200 for Player 1 and the damage amount of 200 for Player 2, and so on.

[0097] For example, the size of the initial timestamp matrix O2 constructed based on the damage reduction amounts shown in Table 4 is 2 * 3. Among them, the matrix elements "1", "4", and "7" in O2 are the sampling times carried by the target time-series data respectively. Specifically, "1" is the sampling time (the 1st second) carried by the damage reduction amount of 100 for Player 1 and the damage reduction amount of 100 for Player 2 in Table 4, "4" is the sampling time (the 4th second) carried by the damage reduction amount of 90 for Player 1 and the damage reduction amount of 110 for Player 2 in Table 4, and "7" is the sampling time (the 7th second) carried by the damage reduction amount of 100 for Player 1 and the damage reduction amount of 130 for Player 2 in Table 4.

[0098] S330, expand the initial timestamp matrix of the data source into a target timestamp matrix with a size of n * (p * m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero.

[0099] For example, the preset data sampling frequency is the data sampling frequency of terminal device 1 shown in Table 3, and the data source is the data source shown in Table 4. When expanding the initial timestamp matrix O2 of the data source shown in Table 4 into a matrix with the same size as the initial timestamp matrix O1, the value of p is 3.

[0100] The target timestamp matrix obtained after expanding the initial timestamp matrix O2

[0101] The data sampling frequency of the data source remains unchanged. Therefore, when the preset data sampling frequency changes, the value of p will also change with the change of the preset data sampling frequency. The preset data sampling frequency can be set according to actual needs, so the value of p can also be understood as being set according to actual needs.

[0102] S340, construct the initial data matrix of the data source according to the target time-series data sampled by the data source, and the matrix elements of the initial data matrix are the data values of the target time-series data.

[0103] For example, the initial data matrix constructed from the target time-series data shown in Table 4 is

[0104] S350, perform matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

[0105] Optionally, a zero matrix with the same size as the target timestamp matrix of the data source can be constructed first. Among them, different rows of the zero matrix G represent different terminal devices, and columns represent sampling times. Then, according to the sampling time and terminal device corresponding to the first data in the initial data matrix of the data source, determine the column interval and row where the first data belongs in the zero matrix. Then fill the first data in all sub-matrices formed by the column interval and row where the first data belongs in the zero matrix until each time-series data in the initial data matrix of the data source is filled into the zero matrix to obtain the data matrix of the data source.

[0106] For example, in the initial data matrix A of the data source described above, the sampling time corresponding to the first data 100 is the 1st second, and the column interval it belongs to is from the 1st second to the 3rd second. Then fill the first data into the positions from the 1st second to the 3rd second in the zero matrix. And so on, the data matrix of the data source obtained after filling each time-series data in the initial data matrix A of the data source into the zero matrix G

[0107] After processing each type of data source in the N types of data sources as in steps S320 to S350, N data matrices can be obtained (each type of data source corresponds to one data matrix).

[0108] S360, according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, process the N data matrices to assimilate the logical structures of the data in the N data matrices.

[0109] S370, perform operations on the data in the N assimilated data matrices according to the test formula to obtain an operation result.

[0110] S380, when the operation result is within the preset numerical range, determine that the target function test passes.

[0111] For the relevant descriptions of steps S360 to S380, reference can be made to the relevant descriptions of steps S230 to S240, which will not be elaborated here.

[0112] The function testing method provided in this embodiment details the steps of constructing the N data matrices in one of the embodiments. By constructing the timestamp matrices O and T, the initial data matrix A, and the zero matrix G, the data matrix Z of the data source is finally obtained until the data matrices of each type of data source in the N types of data sources are obtained. Then, according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, the N data matrices are processed to assimilate the logical structures of the data in different data matrices. Then, according to the test formula, the data in the N data matrices are calculated to obtain the calculation result, and after judging the calculation result, the test result of the target function is obtained. Since a large amount of heterogeneous data is used in the backtest of the game function, the backtest result of the game function is more accurate, solving the problem that the backtest result of the game function in the prior art is not accurate enough.

[0113] Please refer to Figure 4 , one of the embodiments of the present application further provides a function testing device 10, and the function testing device 10 includes:

[0114] An acquisition module 11, configured to respond to a calculation instruction of a test formula used in a target function test, and acquire N groups of target timing data from N types of data sources, where the N types of data sources are the data sources corresponding to the timing data required in the test formula, and N is an integer greater than zero.

[0115] A matrix construction module 12, configured to construct each group of target timing data into a data matrix with the preset data sampling frequency and the preset sampling start time according to the preset data sampling frequency, and obtain N data matrices.

[0116] A logical structure assimilation module 13, configured to process the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, so as to assimilate the logical structures of the data in the N data matrices.

[0117] An operation module 14, configured to calculate the data in the N assimilated data matrices according to the test formula, and obtain a calculation result.

[0118] A judgment module 15, configured to determine that the target function test passes when the calculation result is within a preset numerical range.

[0119] The matrix construction module 12 is specifically configured to: for each type of data source among the N types of data sources, calculate the data matrix of the data source in the following manner: construct an initial timestamp matrix of the data source according to the timestamps of each target time-series data sampled by the data source, where the matrix elements of the initial timestamp matrix are sampling times, with a size of n*m, n representing the number of terminal devices from which the target time-series data sampled by the data source is derived, and m representing the number of sampling times of the target time-series data sampled by the terminal device with the most sampling time points in the data source; expand the initial timestamp matrix of the data source to a target timestamp matrix with a size of n*(p*m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero; construct an initial data matrix of the data source according to the target time-series data sampled by the data source, where the matrix elements of the initial data matrix are the data values of the target time-series data; perform matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

[0120] The matrix construction module 12 is specifically configured to: construct a zero matrix with the same size as the target timestamp matrix of the data source, where different rows of the zero matrix represent different terminal devices and columns represent sampling times; determine the column interval and row in the zero matrix to which the first data belongs according to the sampling time and terminal device corresponding to the first data in the initial data matrix of the data source; fill the first data in all sub-matrices formed by the column interval and row in the zero matrix to which the first data belongs until each time-series data in the initial data matrix of the data source is filled into the zero matrix to obtain the data matrix of the data source, until the data matrices of each type of data source are obtained.

[0121] The acquisition module 11 is further configured to acquire time-series data collected by multiple terminal devices.

[0122] The storage module 16 is configured to screen the time-series data collected by the multiple terminal devices according to preset fields, and store the screened and compressed time-series data in different databases according to different data sources.

[0123] The storage module 16 is specifically configured to compress the screened time-series data in the form of data columns, and store the compressed time-series data in different databases according to different data sources.

[0124] Please refer to Figure 5 , one of the embodiments of the present application further provides an electronic device 20, including: a processor 21, and a memory 22 communicatively connected to the processor 21, where the memory 22 stores computer execution instructions; the processor 21 executes the computer execution instructions stored in the memory 22 to implement the function test method described in any one of the above embodiments.

[0125] The present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the instructions are executed, the computer-executable instructions, when executed by a processor, are used to implement the function testing method provided in any one of the foregoing embodiments.

[0126] It should be noted that the above computer-readable storage medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc. It may also be various electronic devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0127] It should be noted that in this document, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the element.

[0128] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.

[0129] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.

[0130] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0131] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0132] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0133] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural or equivalent process transformation made by using the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A functional testing method, characterized in that, Including: In response to a calculation instruction of a test formula used in a target function test, obtaining N groups of target time series data from N types of data sources, where the N types of data sources are the data sources corresponding to the time series data required in the test formula, and N is an integer greater than zero; Constructing, according to a preset data sampling frequency, each group of target time series data into a data matrix having the preset data sampling frequency and a preset sampling start time, to obtain N data matrices; Processing the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, so as to assimilate the logical structures of the data in the N data matrices; Performing an operation on the data in the N assimilated data matrices according to the test formula to obtain an operation result; When the operation result is within a preset numerical range, determining that the target function test passes.

2. The method according to claim 1, wherein The constructing, according to a preset data sampling frequency, each group of target time series data into a data matrix having the preset data sampling frequency and a preset sampling start time, to obtain N data matrices includes: For each type of data source among the N types of data sources, calculating to obtain a data matrix of the data source by using the following method: Constructing an initial timestamp matrix of the data source according to the timestamps of each target time series data sampled by the data source, where the matrix elements of the initial timestamp matrix are sampling times, and the size is n*m, n represents the number of terminal devices from which the target time series data sampled by the data source comes, and m represents the number of sampling times of the target time series data sampled by the terminal device with the most sampling time points in the data source; Expanding the initial timestamp matrix of the data source into a target timestamp matrix with a size of n*(p*m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero; Constructing an initial data matrix of the data source according to the target time series data sampled by the data source, where the matrix elements of the initial data matrix are the data values of the target time series data; Performing a matrix operation on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

3. The method according to claim 2, wherein The performing a matrix operation on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source includes: Constructing a zero matrix having the same size as the target timestamp matrix of the data source, where different rows of the zero matrix represent different terminal devices, and columns represent sampling times; Determining the column interval and row to which the first data belongs in the zero matrix according to the sampling time and the terminal device corresponding to the first data in the initial data matrix of the data source; Filling the first data in all sub-matrices formed by the column interval and row to which the first data belongs in the zero matrix until each time series data in the initial data matrix of the data source is filled into the zero matrix, to obtain the data matrix of the data source.

4. The method according to any one of claims 1 to 3, characterized in that, Before the in response to a calculation instruction of a test formula used in a target function test, obtaining N groups of target time series data from N types of data sources, further including: Obtaining time series data collected by multiple terminal devices; Filter the time-series data collected by the multiple terminal devices according to preset fields, compress the filtered time-series data, and store it in different databases according to different data sources.

5. The method according to claim 4, wherein The storing the compressed filtered time-series data in different databases according to different data sources includes: Compress the filtered time-series data in the form of data columns, and store the compressed time-series data in different databases according to different data sources.

6. A functional test device, characterized in that, Includes: An acquisition module, configured to respond to a calculation instruction of a test formula used in a target function test, and obtain N groups of target time-series data from N types of data sources, where the N types of data sources are the data sources corresponding to the time-series data required in the test formula, and N is an integer greater than zero; A matrix construction module, configured to construct each group of target time-series data into a data matrix with the preset data sampling frequency and preset sampling start time according to the preset data sampling frequency, and obtain N data matrices; A logical structure assimilation module, configured to process the N data matrices according to the coordinate mapping relationship between the sampling coordinates of the N types of data sources, so as to assimilate the logical structures of the data in the N data matrices; An operation module, configured to perform operations on the data in the N assimilated data matrices according to the test formula to obtain an operation result; A judgment module, configured to determine that the target function test passes when the operation result is within a preset numerical range.

7. The device according to claim 6, characterized in that, The matrix construction module is specifically configured to: For each type of data source among the N types of data sources, calculate the data matrix of the data source in the following manner: Construct an initial timestamp matrix of the data source according to the timestamps of each target time-series data sampled by the data source, where the matrix elements of the initial timestamp matrix are sampling times, and the size is n*m, n represents the number of terminal devices from which the target time-series data sampled by the data source comes, and m represents the number of sampling times of the target time-series data sampled by the terminal device with the most sampling time points in the data source; Expand the initial timestamp matrix of the data source to a target timestamp matrix with a size of n*(p*m) according to the preset data sampling frequency, where p is the ratio between the preset data sampling frequency and the data sampling frequency of the data source, and p is an integer greater than zero; Construct an initial data matrix of the data source according to the target time-series data sampled by the data source, where the matrix elements of the initial data matrix are the data values of the target time-series data; Perform matrix operations on the initial data matrix of the data source and the target timestamp matrix of the data source to obtain the data matrix of the data source.

8. An electronic device, characterized in that, Includes: A processor, and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the function test method according to any one of claims 1 to 5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the function test method according to any one of claims 1 to 5.

10. A computer program product, characterized in that, Comprising a computer program which, when executed by a processor, implements the functional test method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Radar echo signal simulator suitable for onboard radar system

    CN104614713A

  • Test, verification, and program and method of debug architecture

    JP2017076412A