Game trajectory data preprocessing methods and related equipment
By converting game trajectory data into a grid sequence and merging high-frequency adjacent grids, and using the Word2vec algorithm to extract embedding vectors, the problem of low efficiency in game trajectory data processing and inability to capture contextual semantics in existing technologies is solved, achieving more efficient data processing and more accurate deep learning model results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-06-21
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, game trajectory data processing suffers from bottlenecks and low efficiency, as well as the inability to perform unified normalization or standardization. Furthermore, existing technologies cannot effectively capture the potential contextual semantic information between grids.
By converting game trajectory data into a first grid sequence, merging high-frequency adjacent grids, a second grid sequence is calculated, and the Word2vec algorithm is used to extract the embedding vector sequence as the training set input to the deep learning model.
It achieves effective compression of long trajectory data, can perceive the prior influence of environmental factors on trajectory distribution, improves processing efficiency and performance, captures contextual semantic information between grids, and improves the accuracy of deep learning models.
Smart Images

Figure CN115221367B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and related equipment for preprocessing game trajectory data. Background Technology
[0002] In recent years, with the continued prosperity of the global gaming market, data-driven online games have become the mainstream. Online game developers can leverage artificial intelligence (AI) technology to enhance their game products, effectively improving development and operation capabilities, optimizing user experience, and thus increasing market revenue. Game trajectories are easily collected data within games, characterized by high versatility and low sensitivity. They comprehensively record user actions during gameplay, making them invaluable for analyzing and mining user behavior patterns. Therefore, they have received widespread attention in the field of game AI.
[0003] Currently, commonly used game trajectory data mainly includes three types: mouse trajectory, touch trajectory, and movement trajectory, covering various gaming devices such as PCs, tablets, and mobile phones. However, game trajectory data has three problems in actual use. (1) Because it is necessary to track and record the player's entire activity cycle in a specific gameplay or scene as completely as possible, the collected original trajectory is usually very long, usually reaching thousands or even tens of thousands of coordinate points in a single trajectory. Therefore, directly using long trajectory data for modeling has bottlenecks in both performance and efficiency. (2) Due to different settings of game clients, the collected original trajectory usually has different coordinate scales, making it impossible to perform unified normalization or standardization. The common solution is to use a grid mapping method for preprocessing, that is, to divide the trajectory coordinate plane into several grids of the same size and map the coordinates in the trajectory to the corresponding grids to discretize the original trajectory. This preprocessing method cannot perceive the prior influence of environmental factors on the trajectory distribution. For example, the trajectory may be affected by the UI of the game client (control position, interface layout, etc.) or game scene elements (buildings, mountains, or points of interest, etc.). (3) The mesh embedding vector is usually initialized as a random vector as input to the neural network model, thus failing to capture the potential contextual semantic information between meshes. Summary of the Invention
[0004] In view of this, the purpose of this application is to propose a method for preprocessing game trajectory data and related equipment.
[0005] To achieve the above objectives, this application provides a game trajectory data preprocessing method, characterized by comprising:
[0006] Convert the game trajectory data into a first grid sequence;
[0007] By merging high-frequency adjacent grids in the first grid sequence, a second grid sequence is calculated.
[0008] The embedding vectors of the second grid sequence are extracted, and the embedding vector sequence is calculated; the embedding vector sequence is used as the training set input to the deep learning model.
[0009] In one possible implementation, converting the game trajectory data into a first grid sequence includes:
[0010] Divide the coordinate plane of the game trajectory data into at least two grids;
[0011] The grids corresponding to the game trajectory data are used to form the first grid sequence.
[0012] In one possible implementation, all of the grids are the same size.
[0013] In one possible implementation, the game trajectory data includes at least two trajectory coordinates;
[0014] Each trajectory coordinate corresponds to only one grid.
[0015] In one possible implementation, the trajectory length of the second grid sequence mapping is less than the trajectory length of the first grid sequence mapping.
[0016] In one possible implementation, the step of merging high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence includes:
[0017] Count the frequency of adjacent grids in the first grid sequence;
[0018] Merge adjacent grids whose frequency reaches a specified threshold into a new grid;
[0019] In response to the first grid sequence reaching a preset expected value, the first grid sequence is transformed into the second grid sequence.
[0020] In one possible implementation, the magnitude of the preset expected value is determined based on the size of the coordinate value range of each coordinate axis of the game trajectory data.
[0021] In one possible implementation, the size of the preset expected value is 1 / 4 to 1 / 2 of the game trajectory data.
[0022] In one possible implementation, extracting the embedding vector of the second grid sequence and calculating the embedding vector sequence includes:
[0023] The embedding vector of the second grid sequence is extracted using the Word2vec algorithm, and the embedding vector sequence is calculated.
[0024] Based on the same inventive concept, one or more embodiments of this specification also provide a game trajectory data preprocessing apparatus, including:
[0025] The conversion module is configured to convert game trajectory data into a first grid sequence;
[0026] The merging module is configured to merge high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence;
[0027] The extraction module is configured to extract the embedding vector of the second grid sequence and calculate the embedding vector sequence; the embedding vector sequence is used as the training set input to the deep learning model.
[0028] Based on the same inventive concept, one or more embodiments of this specification also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the game trajectory data preprocessing method as described in any of the above.
[0029] Based on the same inventive concept, one or more embodiments of this specification also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute any of the game trajectory data preprocessing methods described above.
[0030] As can be seen from the above, the game trajectory data preprocessing method and related equipment provided in this application convert game trajectory data into a first grid sequence; merge high-frequency adjacent grids in the first grid sequence to calculate a second grid sequence; extract the embedding vectors of the second grid sequence to calculate an embedding vector sequence; and the embedding vector sequence is used as input to a deep learning model. For long trajectory data, converting it into a grid sequence and then merging high-frequency adjacent grids can effectively compress the long trajectory data, making subsequent processing more efficient. Furthermore, it can effectively capture the prior influence of environmental factors on trajectory distribution and improve the performance of grid mapping. After merging high-frequency adjacent grids, the Word2vec algorithm is used to extract the embedding vectors from the merged grid sequence. This step can effectively capture the potential contextual semantic information between grids and improve the performance of grid embedding. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram illustrating an application scenario of the game trajectory data preprocessing method according to an embodiment of this application;
[0033] Figure 2 This is a flowchart of a game trajectory data preprocessing method according to an embodiment of this application;
[0034] Figure 3 This is a schematic diagram of the game trajectory coordinate grid division in an embodiment of this application;
[0035] Figure 4 This is a structural diagram of the game trajectory data preprocessing device according to an embodiment of this application;
[0036] Figure 5 This is a schematic diagram of the electronic device structure according to an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0038] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0039] As described in the background section, the method of directly extracting embedding vectors after converting long trajectory data into a grid sequence in related technologies has a significant impact on the overall performance and efficiency due to the large amount of data in long trajectories. Secondly, the technical solution in related technologies that only converts long trajectory data into grids of the same size cannot effectively perceive the prior influence of environmental factors on the distribution of considerations, and the trajectory will be affected by the UI of the game client or game scene elements. Finally, when extracting grid embedding vectors in related technologies, they are often initialized as random vectors, which cannot capture the potential contextual semantic information between grids.
[0040] To address the aforementioned issues, this application proposes a game trajectory data preprocessing method. The method converts game trajectory data into a first grid sequence; merges high-frequency adjacent grids in the first grid sequence to calculate a second grid sequence; and extracts the embedding vectors from the second grid sequence to calculate an embedding vector sequence. This achieves compression of long trajectory data, and can perceive the prior influence of environmental factors on trajectory distribution and capture potential contextual semantic information between different grids, effectively improving processing speed and performance, and enriching and enhancing the grid embedding vectors.
[0041] refer to Figure 1 This is a schematic diagram illustrating an application scenario of the game trajectory data preprocessing method provided in the embodiments of this application. The application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, server 102, and data storage system 103 can all be connected via wired or wireless communication networks. The terminal device 101 includes, but is not limited to, desktop computers, mobile phones, mobile computers, tablet computers, media players, smart wearable devices, personal digital assistants (PDAs), game consoles, or other electronic devices capable of performing the aforementioned functions. The server 102 and data storage system 103 can both be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0042] Server 102 provides game trajectory data preprocessing services to users of terminal device 101. Terminal device 101 has a client installed that communicates with server 102. Users can input game trajectory data through the client and click the conversion calculation button. The client then sends the game trajectory data to server 102. Server 102 converts the game trajectory data into a first grid sequence, merges high-frequency adjacent grids in the first grid sequence, calculates a second grid sequence, extracts the embedding vectors of the second grid sequence, calculates an embedding vector sequence, inputs the embedding vector sequence into a deep learning model, obtains the final result, and sends the final result to the client. The client then displays the final result to the user to help the user perform corresponding game trajectory data analysis.
[0043] The data storage system 103 stores a large amount of training sample data, which may come from sources including but not limited to existing databases, data crawled from the Internet, or data uploaded by users when using the client. The server 102 can also continuously optimize the game trajectory data preprocessing technology based on newly added training sample data.
[0044] The following is combined Figure 1 The above application scenarios are used to describe the exemplary game trajectory data preprocessing method provided according to the embodiments of this application. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of this application, and the implementation of this application is not limited in any way in this respect. On the contrary, the implementation of this application can be applied to any applicable scenario.
[0045] The technical solutions of the embodiments of this application will be described in detail below through specific examples.
[0046] refer to Figure 2 The game trajectory data preprocessing method of this application embodiment includes the following steps:
[0047] Step S201: Convert the game trajectory data into a first grid sequence;
[0048] Step S202: Merge high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence;
[0049] Step S203: Extract the embedding vector of the second grid sequence and calculate the embedding vector sequence; the embedding vector sequence is used as input to the deep learning model.
[0050] refer to Figure 3 This is a schematic diagram of the game trajectory coordinate grid division in an embodiment of this application.
[0051] Regarding step S201, this application can divide the coordinate plane of the game trajectory data into M*N grids, with at least two grids. Furthermore, the divided grids ensure that any coordinate (x, y) in the game trajectory data coordinate plane can be uniquely mapped to one of the grids, and the grids mapped to the entire game trajectory data coordinates constitute the first grid sequence. For example... Figure 3 As shown, the coordinate plane of the game trajectory data with an abscissa of 2560 and an ordinate of 1440 is divided into 9 grids. The game trajectory data coordinates 1-9 each correspond to a separate grid, which can be represented by the following formula:
[0052] g = (x%M) × N + y%N
[0053] Where g represents a grid in the grid sequence, x and y represent coordinates, M represents the number of grids in the horizontal direction, N represents the number of grids in the vertical direction, and % represents the modulo operation.
[0054] Figure 3 The number in the lower right corner of the circle represents the order of the coordinates of the trajectory points. Figure 3 The numbers in the center of the circles on the right represent the grid number where the coordinate point of the trajectory is located.
[0055] In one possible implementation, the more grids the game trajectory data coordinate plane is divided into, the more refined the subsequent processing of the game trajectory data will be. However, the processing time will also be longer. Experiments have shown that dividing the game trajectory data coordinate plane into 200*100 grids (200 x 100 x 100) generally achieves a good balance between performance and efficiency during processing. Those skilled in the art should understand that the number of grids used to divide the game trajectory data coordinate plane can be adaptively varied and is not limited to the aforementioned 200*100 grids.
[0056] In one possible implementation, the game trajectory data includes at least two coordinates, and each trajectory coordinate corresponds to only one grid. For example: Before mapping (original trajectory): {[553,499],[548,491],[773,479],[822,481],[822,481],[843,492],[843,491],[318,419],[6,408],[23,397],[27,397],[27,397],[27,3 97],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,397],[27,3 97],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37,397],[37, 397],[37,397],[37,397],[37,397],[37,397],[37,397],[59,385],[737,191],[554,88],[566,-130],[496,94],[477,92],[487,10],[442,511],[620,97]}
[0057] After mapping: {[13098,12996,18395,19495,19495,19997,19996,7485,83,482,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,582,7 82,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,782,1280,17450,13034,13300,11734,11234,11421,10499,14635]}
[0058] As the examples above show, each trajectory coordinate does indeed correspond to only one grid cell. It's important to note that while each trajectory coordinate corresponds to only one grid cell, a single grid cell may contain more than one trajectory coordinate. That is, a single grid cell may contain multiple trajectory coordinates. (See reference...) Figure 3 The grids 1 and 5 in the data are related to the density of the grid division and the density distribution of the game trajectory data.
[0059] In one possible implementation, since map games need to adapt to different game clients, the collected original game trajectory data usually has different coordinate scales. In actual processing, there will be a problem that it is impossible to perform uniform normalization or standardization. The embodiments of this application obtain each grid of the same size after being divided by the above method, which effectively solves the above problem.
[0060] Regarding step S202, the applicant discovered that in order to better analyze and mine user behavior patterns in games, it is necessary to track and record the entire activity cycle of players in specific gameplay or scenarios as completely as possible. This results in excessively long user trajectories, often reaching thousands or even tens of thousands of lines. Therefore, directly using long trajectory data for subsequent data processing would significantly impact the performance and efficiency of the processing. Thus, this application's embodiment utilizes a Byte Pair Encoding (BPE) model to automatically merge frequently occurring grid pairs, thereby effectively compressing long trajectories and improving efficiency and performance for subsequent data processing. Therefore, in one possible implementation, the trajectory length mapped by the second grid sequence is shorter than the trajectory length mapped by the first grid sequence.
[0061] In one possible implementation, the step of merging high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence is achieved using a byte-pair encoding model. This byte-pair encoding model needs to be trained before deployment, and the data used during training is also long-trajectory data from game users.
[0062] In one possible implementation, the step of merging high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence is specifically as follows:
[0063] First, the frequency of occurrence in adjacent grids within the first grid sequence is counted. The BPE algorithm is generally used in existing technologies for merging words and phrases; in this embodiment, each grid is considered a word. Then, the adjacent grids with the highest frequency are merged to form a new grid. For example, the three grids (13098, 12996, 18395) appear frequently and are compressed into a new grid 13098_12996_18395 (grid A).
[0064] Then, the frequency of adjacent grids is counted again. At this time, the previously merged grid is treated as a new grid for counting. After counting, the grids are merged again. This process is repeated until the size of the first grid sequence reaches the preset expected value, at which point the merging stops. At this point, the first grid sequence is transformed into the second grid sequence.
[0065] In one possible implementation, the aforementioned preset expected value is related to the size of the game trajectory data, and is generally preset to 1 / 4 to 1 / 2 of the size of the game trajectory data. Note that those skilled in the art should undoubtedly understand that the aforementioned 1 / 2 and 1 / 4 are merely exemplary figures, and the preset expected value can be adjusted according to one's own needs, and does not mean that this application can only be implemented using the above method.
[0066] Furthermore, existing technologies use a grid mapping method to preprocess long trajectory data, which involves dividing the trajectory coordinate plane into several grids of the same size and mapping the coordinates in the trajectory to the corresponding grids to discretize the original trajectory. The uniformly divided grid assumes that each area has an equal probability of being reached by the trajectory. However, in reality, the probability of different areas on the map being traversed by the trajectory is affected by environmental factors. Therefore, this preprocessing method cannot reflect or perceive the prior influence of environmental factors on the trajectory distribution.
[0067] Taking mountains as an example (here, mountains are set in a way that players cannot climb or cross in the game), insurmountable mountains affect the formation of user trajectories in the game. The user's trajectory will not appear in the grid corresponding to the mountain. Therefore, when applying the BPE algorithm, the probability of merging grids at that location will be greatly reduced. Conversely, the probability of merging grids at locations where trajectories appear more frequently, such as roads, will be greatly increased. In the final new grid sequence, each grid has a different size. These grid sizes can, to some extent, reflect the probability of the user appearing on that terrain, and further, the type of terrain. The same principle applies to the game client's UI. Whether it's a mouse click or a touch click, trajectory points will appear frequently in the UI of the game. Those skilled in the art should understand that environmental factors are not limited to the aforementioned mountains and UI, but also include, for example, the game client's UI (control position, interface layout, etc.) or game scene elements (buildings, mountains, or POIS points of interest, etc.). The embodiments of this application can effectively perceive the prior influence of environmental factors on trajectory distribution.
[0068] As can be seen from the above, this application uses the BPE algorithm to merge high-frequency grid pairs, which can effectively perceive the prior influence of environmental factors on trajectory distribution and improve the performance of grid mapping.
[0069] The applicant discovered in experiments that, using common methods in existing technologies, grid embedding vectors are typically initialized as random vectors as input to neural network models, thus failing to capture the potential contextual semantic relationships between grids. Therefore, this step in the embodiments of this application employs a word pair vector model (Word2vec) to extract embedding vectors from the grid sequence.
[0070] Word2vec is a group of models used to generate word vectors. These models are shallow, two-layer neural networks trained to reconstruct linguistic word text. The network represents words and needs to guess the input words in adjacent positions. Under the bag-of-words assumption in word2vec, the order of words is unimportant. After training, the word2vec model can be used to map each word to a vector, which can be used to represent the relationship between words. This vector is the hidden layer of the neural network. In the embodiments of this application, a grid is regarded as a word. Therefore, using this model in the embodiments of this application can achieve a similar effect to the model in the vocabulary.
[0071] In some embodiments, the predictive neural network can be the Continuous Bag-of-Words Model (CBOW) or the Skip-Gram model.
[0072] In some embodiments, the predictive neural network can be a Skip-Gram model. First, the context grid of each grid in the second grid sequence calculated in step S202 is obtained. Then, based on the second grid sequence obtained in step S202, a predictive neural network is built. This predictive neural network can predict the predictive context grid of each grid in the second grid sequence. Taking a certain grid as an example, the grid is input into the predictive neural network to obtain the predictive context grid of that grid. A loss function is calculated using the predictive context grid and the context grid, and the predictive neural network is trained using the loss function. The loss function will have a pre-set threshold. When the loss function reaches the threshold after a certain training, training stops. At this time, the hidden layer weight matrix in the predictive neural network is the final embedding vector to be calculated. The above training is performed on each grid in the second grid sequence to finally obtain the embedding vectors of all grids, forming an embedding vector sequence.
[0073] In some embodiments, the predictive neural network can be a CBOW model. First, the context grid of each grid in the second grid sequence calculated in step S202 is obtained. Then, based on the second grid sequence obtained in step S202, a predictive neural network is built. This predictive neural network can predict a grid based on its context grid. Taking a grid as an example, the context grid of that grid is input into the predictive neural network to obtain the predicted grid. A loss function is calculated based on the predicted grid and the original grid. The predictive neural network is trained using this loss function. A threshold can be preset for this loss function. When the loss function reaches the threshold, training stops. The weight matrix of the hidden layer of the predictive neural network at this point is used as the embedding vector of that grid. The above training is performed on each grid in the second grid sequence, ultimately obtaining the embedding vectors of all grids, forming an embedding vector sequence. In some embodiments, the output function of the predictive neural network is a softmax function.
[0074] Furthermore, combined with the prior merging of the mesh in step S202, the embodiments of this application are able to effectively capture the potential contextual semantic information between meshes when extracting the embedding vector, thereby effectively improving the performance of mesh embedding.
[0075] In one possible implementation, the embedding vector extracted in step S203 is used as a training set input to the deep learning model. Compared with the prior art, the embedding vector calculated by this embodiment can perceive the prior influence of environmental factors on trajectory distribution and effectively capture the potential contextual semantic information between grids. After being applied to the deep learning model as a training set, the trained deep learning model can also perceive the prior influence of environmental factors on trajectory distribution and capture the potential contextual semantic information between grids, further improving the accuracy and yielding more accurate results when processing trajectory data. Furthermore, this deep learning model, after training, can be applied to various fields of trajectory analysis, such as classifying game trajectory data or identifying trajectory categories. Undoubtedly, this deep learning model can be adaptively improved to meet specific needs. The improvement methods should be known to those skilled in the art, and therefore will not be elaborated upon here.
[0076] As can be seen from the above embodiments, the game trajectory data preprocessing method described in this application converts the game trajectory data into a first grid sequence; merges high-frequency adjacent grids in the first grid sequence to calculate a second grid sequence; and extracts the embedding vectors of the second grid sequence to calculate an embedding vector sequence. For long trajectory data, merging the evenly divided grids using the BPE algorithm can effectively compress the long trajectory data and can perceive the prior influence of environmental factors on the trajectory distribution; extracting vectors from the compressed grid sequence using the Word2vec algorithm can effectively capture the potential contextual semantic information between grids. Compared with the prior art, this application effectively improves the performance and efficiency of computation, and the final embedding vector is more accurate, further making the prediction results after being input into the deep learning model more accurate.
[0077] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0078] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0079] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a game trajectory data preprocessing device.
[0080] refer to Figure 4 The game trajectory data preprocessing device includes:
[0081] Conversion module 11 is configured to convert game trajectory data into a first grid sequence;
[0082] Merging module 12 is configured to merge high-frequency adjacent grids in the first grid sequence to calculate the second grid sequence;
[0083] Extraction module 13 is configured to extract the embedding vector of the second grid sequence and calculate the embedding vector sequence; the embedding vector sequence is used as input to the deep learning model.
[0084] In one possible implementation, the conversion module 11 is used to:
[0085] Divide the coordinate plane of the game trajectory data into at least two grids;
[0086] The grids corresponding to the game trajectory data are used to form the first grid sequence.
[0087] In one possible implementation, the game trajectory data includes at least two trajectory coordinates;
[0088] Each trajectory coordinate corresponds to only one grid.
[0089] In one possible implementation, the trajectory length of the second grid sequence mapping is less than the trajectory length of the first grid sequence mapping.
[0090] In one possible implementation, the merging module 12 is used to:
[0091] Count the frequency of adjacent grids in the first grid sequence;
[0092] Merge adjacent grids whose frequency reaches a specified threshold into a new grid;
[0093] In response to the first grid sequence reaching a preset expected value, the first grid sequence is transformed into the second grid sequence.
[0094] In one possible implementation, the magnitude of the preset expected value is determined based on the size of the coordinate value range of each coordinate axis of the game trajectory data.
[0095] In one possible implementation, the size of the preset expected value is 1 / 4 to 1 / 2 of the game trajectory data.
[0096] In one possible implementation, the extraction module 13 is used to:
[0097] The embedding vector of the second grid sequence is extracted using the Word2vec algorithm, and the embedding vector sequence is calculated.
[0098] In one possible implementation, the extraction module 13 is used to:
[0099] Based on the second grid sequence, a prediction neural network is established;
[0100] A prediction neural network is used to predict the context grid of each grid in the second grid sequence to obtain a prediction sequence;
[0101] Calculate the loss function based on the predicted sequence and the context grid sequence of the acquired second grid sequence;
[0102] The prediction neural network is trained using the loss function.
[0103] In response to the loss function reaching a preset threshold, the hidden layer weight matrix in the predictive neural network is used as the embedding vector sequence.
[0104] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0105] The apparatus described above is used to implement the corresponding game trajectory data preprocessing method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0106] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the game trajectory data preprocessing method described in any of the above embodiments.
[0107] Figure 5 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0108] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0109] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0110] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0111] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0112] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0113] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0114] The electronic devices described above are used to implement the corresponding game trajectory data preprocessing methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0115] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the game trajectory data preprocessing method as described in any of the above embodiments.
[0116] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0117] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the game trajectory data preprocessing method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0118] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0119] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0120] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for preprocessing game trajectory data, characterized in that, include: Convert the game trajectory data into a first grid sequence; Count the frequency of adjacent grids in the first grid sequence; Merge adjacent grids whose frequency reaches a specified threshold into a new grid; In response to the first grid sequence reaching a preset expected value, the first grid sequence is transformed into a second grid sequence; The embedding vectors of the second grid sequence are extracted, and the embedding vector sequence is calculated; the embedding vector sequence is used as the training set input to the deep learning model.
2. The method according to claim 1, characterized in that, The process of converting game trajectory data into a first grid sequence includes: Divide the coordinate plane of the game trajectory data into at least two grids; The grids corresponding to the game trajectory data are used to form the first grid sequence.
3. The method according to claim 2, characterized in that, The game trajectory data includes at least two trajectory coordinates; Each of the trajectory coordinates corresponds to one of the grids.
4. The method according to claim 1, characterized in that, The trajectory length of the second grid sequence mapping is less than the trajectory length of the first grid sequence mapping.
5. The method according to claim 1, characterized in that, The magnitude of the preset expected value is determined based on the size of the coordinate value range of each coordinate axis of the game trajectory data.
6. The method according to claim 5, characterized in that, The preset expected value is between 1 / 4 and 1 / 2 of the trajectory data.
7. The method according to claim 1, characterized in that, The step of extracting the embedding vector of the second grid sequence and calculating the embedding vector sequence includes: The embedding vector of the second grid sequence is extracted using the Word2vec algorithm, and the embedding vector sequence is calculated.
8. The method according to claim 7, characterized in that, The step of extracting the embedding vector of the second grid sequence using the Word2vec algorithm and calculating the embedding vector sequence includes: Based on the second grid sequence, a prediction neural network is established; A prediction neural network is used to predict the context grid of each grid in the second grid sequence to obtain a prediction sequence; Calculate the loss function based on the predicted sequence and the context grid sequence of the acquired second grid sequence; The prediction neural network is trained using the loss function. In response to the loss function reaching a preset threshold, the hidden layer weight matrix in the predictive neural network is used as the embedding vector sequence.
9. A game trajectory data preprocessing device, characterized in that, include: The conversion module is configured to convert game trajectory data into a first grid sequence; The merging module is configured to count the frequency of adjacent grids in the first grid sequence; Merge adjacent grids whose frequency reaches a specified threshold into a new grid; In response to the first grid sequence reaching a preset expected value, the first grid sequence is transformed into a second grid sequence; The extraction module is configured to extract the embedding vector of the second grid sequence and calculate the embedding vector sequence; the embedding vector sequence is used as the training set input to the deep learning model.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.