Data Processing Method, Apparatus, Electronic Device and Storage Medium
By acquiring images and determining map parameters in the virtual scene, generating the starting and end coordinates of the virtual scene travel route, and presenting the travel route and auxiliary lines in the virtual scene, the problems of low efficiency in the prior art travel route generation and dependence on log data are solved, and more efficient travel route generation and lower storage pressure are achieved.
Patent Information
- Application Number
- CN202110373145.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-07
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-04-07
AI Technical Summary
The prior art is inefficient when generating travel routes in virtual scenarios and relies on log data, occupying a large storage space, and increasing hardware costs.
By acquiring the virtual scene image, determining the map position coordinates and type parameters, generating the starting and end coordinates of the virtual scene travel route based on this information, and presenting the travel route and auxiliary lines in the virtual scene.
It improves the efficiency of virtual scene travel route generation, reduces calculation costs, does not rely on game log data, adapts to different types of games, and reduces the data storage pressure of game terminals.
Smart Images

Figure CN113694528B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to information processing technologies, and in particular to data processing methods, devices, electronic devices, and storage media. Background Art
[0002] Virtual scenarios generally have characteristics such as complex virtual behavior rules, ever-changing dynamic scenarios, uncertain behavior achievement, incomplete information, and short decision-making time. Facing such a huge decision-making space and real-time decision-making requirements, how to formulate, select, and execute the virtual scenario travel route is the most important problem faced during the execution of virtual scenarios. When providing different virtual scenario travel routes to users in a virtual scenario, the risk factors corresponding to different virtual scenario travel routes are different. In related technologies, when providing a travel route in a virtual scenario to a user, the generation of the travel route depends on log data, the generation speed is slow, and the log data in the virtual scenario occupies a large amount of terminal storage space, increasing the storage hardware cost of the device. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a data processing method, device, electronic device, and storage medium, which can effectively improve the efficiency of generating virtual scenario travel routes.
[0004] The technical solution of the embodiments of the present invention is implemented as follows:
[0005] Embodiments of the present invention provide a data processing method, including:
[0006] Obtain a virtual scenario image in the virtual scenario where the target object is located;
[0007] When it is determined that the map identifier in the virtual scenario image is in an open state, determine the map position coordinates and map type parameters that match the virtual scenario image;
[0008] Based on the map position coordinates and map type parameters, determine the scale information that matches the virtual scenario image;
[0009] Determine the starting position coordinates and ending position coordinates of the virtual scenario travel route that matches the virtual scenario;
[0010] According to the scale information that matches the virtual scenario image, the starting position coordinates and ending position coordinates of the virtual scenario travel route, determine the virtual scenario travel route coordinates and auxiliary line coordinates of the virtual scenario travel route;
[0011] Based on the virtual scenario travel route coordinates and auxiliary line coordinates, present the virtual scenario travel route and the corresponding auxiliary line in the virtual scenario.
[0012] An embodiment of the present invention further provides a data processing device, including:
[0013] An information transmission module, configured to obtain a virtual scene image in a virtual scene where a target object is located;
[0014] An information processing module, configured to determine a map position coordinate and a map type parameter matching the virtual scene image when it is determined that a map identifier in the virtual scene image is in an open state;
[0015] The information processing module is configured to determine scale information matching the virtual scene image based on the map position coordinate and the map type parameter;
[0016] The information processing module is configured to determine a starting position coordinate and an ending position coordinate of a virtual scene travel route matching the virtual scene;
[0017] The information processing module is configured to determine a virtual scene travel route coordinate and an auxiliary line coordinate of the virtual scene travel route according to the scale information matching the virtual scene image, the starting position coordinate and the ending position coordinate of the virtual scene travel route;
[0018] The information processing module is configured to present a virtual scene travel route and a corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinate and the auxiliary line coordinate of the virtual scene travel route.
[0019] An embodiment of the present invention further provides an electronic device, and the electronic device includes:
[0020] A memory, configured to store executable instructions;
[0021] A processor, configured to implement the foregoing data processing method when running the executable instructions stored in the memory.
[0022] An embodiment of the present invention further provides a computer-readable storage medium, storing executable instructions, and the executable instructions implement the foregoing data processing method when executed by a processor.
[0023] The embodiment of the present invention has the following beneficial effects:
[0024] The present invention obtains a virtual scene image in a virtual scene where a target object is located; when it is determined that a map identifier in the virtual scene image is in an open state, it determines map position coordinates and map type parameters that match the virtual scene image; based on the map position coordinates and map type parameters, it determines scale information that matches the virtual scene image; it determines starting position coordinates and ending position coordinates of a virtual scene travel route that matches the virtual scene; according to the scale information that matches the virtual scene image, the starting position coordinates and ending position coordinates of the virtual scene travel route, it determines virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route; based on the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route, it presents the virtual scene travel route and corresponding auxiliary lines in the virtual scene. Thus, not only can the efficiency of generating the virtual scene travel route be effectively improved, enabling faster processing of complex-dimensional virtual scene travel routes, and presenting the virtual scene travel route and corresponding auxiliary lines in the virtual scene in a timely and accurate manner, but also it has robustness and generalization for different virtual scenes, reduces the calculation cost of the virtual scene travel route, and does not rely on game log data, can adapt to different types of games, and reduces the data storage pressure on the game terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of the usage scenario of the data processing method provided by an embodiment of the present invention;
[0026] Figure 2 It is a schematic diagram of the composition structure of the data processing device provided by an embodiment of the present invention;
[0027] Figure 3 It is an optional flowchart of the data processing method provided by an embodiment of the present invention;
[0028] Figure 4 It is an optional schematic diagram of the processing effect of the virtual scene travel route in an embodiment of the present invention;
[0029] Figure 5A It is a schematic diagram of the display effect of the game map in an embodiment of the present invention;
[0030] Figure 5B It is a schematic diagram of the display effect of the game map in an embodiment of the present invention;
[0031] Figure 5C It is an optional flowchart of the data processing method in an embodiment of the present invention;
[0032] Figure 6 It is a schematic diagram of the display effect of the game map identifier in an embodiment of the present invention;
[0033] Figure 7 An optional process schematic diagram of the data processing model training method provided by an embodiment of the present invention;
[0034] Figure 8 A schematic diagram of the data processing model in the embodiment of the present invention being a residual-inverted structure;
[0035] Figure 9 An optional process schematic diagram of the data processing model training method provided by an embodiment of the present invention;
[0036] Figure 10 A schematic diagram of the data processing model provided by an embodiment of the present invention applied to a first-person shooter (FPS) game;
[0037] Figure 11 An optional process schematic diagram of the application process of the data processing model provided by an embodiment of the present invention;
[0038] Figure 12 A schematic diagram of the cascaded extraction of the travel route in the virtual scene in the embodiment of the present invention;
[0039] Figure 13 A schematic diagram of detecting the center of a circle by the Hough gradient method for the cascaded extraction of the travel route in the virtual scene in the embodiment of the present invention;
[0040] Figure 14 A schematic diagram of calculating the travel route in the virtual scene in the embodiment of the present invention. Detailed implementation manners
[0041] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.
[0042] In the following descriptions, reference is made to "some embodiments", which describe subsets of all possible embodiments. However, it can be understood that "some embodiments" can be the same subsets or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0043] Before further elaborating on the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.
[0044] 1) Responsive to, which is used to represent the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more executed operations can be real-time or can have a set delay; without special instructions, there is no limitation on the execution order of the multiple executed operations.
[0045] 2) Based on the conditions or states on which the executed operations depend, when the dependent conditions or states are met, one or more of the executed operations can be real-time or can have a set delay; without special instructions, there is no restriction on the execution order of multiple executed operations.
[0046] 3) Model training: Perform multi-classification learning on an image dataset. This model can be constructed using deep learning frameworks such as TensorFlow or torch, and a multi-classification model is formed by combining multiple layers of neural network layers such as CNN. The input of the model is a three-channel or original-channel matrix formed by reading an image using tools such as openCV, and the output of the model is a multi-classification probability. The web page category is finally output through algorithms such as softmax. During training, the model gradually approaches the correct trend through objective functions such as cross-entropy until the stop condition is reached to complete the training.
[0047] 4) Neural Network (NN): Artificial Neural Network (ANN), also known as neural network or neural-like network for short, is a mathematical model or computational model that mimics the structure and function of a biological neural network (the central nervous system of an animal, especially the brain) in the fields of machine learning and cognitive science, and is used to estimate or approximate a function.
[0048] 5) Virtual scene: It is a virtual scene displayed (or provided) when an application runs on a terminal. This virtual scene can be a simulation environment of the real world, a semi-simulated and semi-fictional three-dimensional environment, or a purely fictional three-dimensional environment.
[0049] The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene and a three-dimensional virtual scene. The following embodiments are illustrated by taking the virtual scene as a three-dimensional virtual scene, but are not limited to this. Optionally, the virtual scene is also used for a virtual scene battle between at least two virtual objects. Optionally, the virtual scene is also used for a battle between at least two virtual objects using virtual props. Optionally, the virtual scene can also be not limited to a gunfight game, a parkour game, a racing game, a multiplayer online tactical competitive game (Multiplayer Online Battle Arena, MOBA), a racing game (Racing Game, RCG) and a sports game (SPG). The trained data processing model provided by the present application can be deployed in the game server corresponding to the aforementioned various game scenes, used to generate a real-time virtual scene route and present it in the game interface, perform corresponding actions in the corresponding game, simulate the operation of the virtual user, and complete different types of games in the virtual scene with the users who actually participate in the game.
[0050] 6) Virtual objects, images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. The movable objects can be virtual characters, virtual animals, cartoon characters, etc., such as people, animals, plants, oil drums, walls, stones, etc. displayed in a virtual scene. The virtual object can be a virtual image in the virtual scene that represents the user. A virtual scene can include multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.
[0051] 7) Action: In the process of controlling virtual objects through operations on the client, when the virtual scene route and the corresponding auxiliary lines are presented in the virtual scene using the data processing method provided in the present application, any point in the virtual scene route can be selected with the help of the auxiliary lines to perform corresponding actions. For example, when the virtual scene route is a route in a game map, any position can be selected in the game's air route to perform parachuting or airdropping, or any position can be selected in the game's water route to perform diving or diving.
[0052] Before introducing the data processing method provided by the present application, the processing process of obtaining the virtual scene route in the related art is first described. Taking the generation of the virtual scene route of the FPS game as an example, in order to realize the presentation of the virtual scene route through the game map in the virtual scene, the following three methods can be included:
[0053] (1) Extract the virtual scene travel route based on the template matching algorithm: In this process, template matching includes searching for the position of the template image in a larger image. Then, on the image to be detected, calculate the similarity between the template image and the target image in the overlapping window from left to right and from top to bottom. The greater the similarity, the greater the probability that the two are the same. Extract the virtual scene travel route based on the similarity.
[0054] However, the limitation of obtaining the virtual scene travel route by template matching is that the extracted virtual scene travel route can only move horizontally or vertically, and is easily affected by noise. When the virtual scene travel route rotates or undergoes non-horizontal and non-vertical morphological changes, the target cannot be effectively detected. Moreover, when the image range is large, the execution efficiency is very slow, affecting the display effect of the game.
[0055] (2) Extract the virtual scene travel route based on the feature matching algorithm, but this method is not sensitive to noise. It is unable to extract better feature points and is prone to false matching. When the virtual scene image range is large, there is also the defect of slow execution efficiency.
[0056] (3) Extract the virtual scene travel route based on the CNN algorithm. This solution requires a large amount of sample data to be labeled. However, the virtual scene travel route presented in the virtual scene is a linear target with randomly appearing angles. The cost of manual data labeling is high. Moreover, since the virtual scene travel route itself contains fewer semantic features, it is difficult to accurately regress the detection box, and the coordinate accuracy of the virtual scene travel route cannot be guaranteed, resulting in the game player not being able to obtain the most suitable virtual scene travel route.
[0057] Based on this, the embodiments of the present invention provide a data processing method to realize presenting the virtual scene travel route and the corresponding auxiliary line in the virtual scene.
[0058] Figure 1 For the schematic diagram of the implementation scenario of the data processing method provided by the embodiments of the present invention, see Figure 1 , to support an exemplary application, the terminal includes terminal 10-1 and terminal 10-2. The terminal is connected to the data processing device 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and uses wireless or wired links to achieve data transmission.
[0059] The terminal (such as terminal 10-2) is located on the user side and is used to send a virtual scene travel route generation request to request a virtual scene travel route adapted to the virtual scene where the target object is located. The target object can be various types of game users. The terminal (including terminal 10-1 and terminal 10-2) can obtain the virtual scene data from the corresponding virtual scene server 200 through the network 300 and present the virtual scene in the display area of the terminal. The data processing device set in the terminal can execute the following solutions: obtain the virtual scene image in the virtual scene where the target object is located; when it is determined that the map identifier in the virtual scene image is in the open state, determine the map position coordinates and map type parameters that match the virtual scene image; based on the map position coordinates and map type parameters, determine the scale information that matches the virtual scene image; determine the starting position coordinates and ending position coordinates of the virtual scene travel route that matches the virtual scene; according to the scale information that matches the virtual scene image, the starting position coordinates and ending position coordinates of the virtual scene travel route, determine the virtual scene travel route coordinates and auxiliary line coordinates corresponding to the virtual scene travel route; based on the virtual scene travel route coordinates and auxiliary line coordinates, present the virtual scene travel route and the corresponding auxiliary line in the virtual scene.
[0060] In some embodiments, the terminal 10-1 may install and run an application program that supports virtual scenarios. The application program may be different virtual scenarios such as virtual reality application programs, three-dimensional map programs, simulation programs, first-person shooting games (FPS), multiplayer online battle arena games (MOBA), etc. Taking a shooting game as an example, the user can control the virtual object to perform actions at different positions in the virtual scene travel route, or perform actions at different time points when moving along the virtual scene travel route. For example, at different positions in the virtual scene travel route, the user can achieve free fall in the sky, glide, or open a parachute to fall, etc. Also, at different positions in the virtual scene travel route on land, the user can achieve running, jumping, crawling, bending forward, etc. The user can also control the virtual object to achieve swimming, floating, or diving in the ocean at different positions in the virtual scene travel route. Of course, the user can also control the virtual object to move in the virtual scene by taking a virtual vehicle and display the real-time position at different positions in the virtual scene travel route. For example, the virtual vehicle can be a virtual car, virtual aircraft, or virtual yacht moving along the virtual scene travel route. Here, only the above scenarios are used for illustration, and the embodiments of the present invention do not make specific limitations in this regard. The user can also control the virtual object to interact with other virtual objects through virtual props in ways such as fighting, and the present invention does not make specific limitations on the types of virtual props.
[0061] The data processing device for implementing the data processing method of the embodiments of the present invention will be described below. The data processing device can be implemented in various forms, such as a terminal with data processing device processing functions, or a server provided with data processing device processing functions. For example, the server 200 in the previous Figure 1 section. Figure 2 FIG. is a schematic structural diagram of the data processing device provided by the embodiments of the present invention. It can be understood that Figure 2 only shows the exemplary structure of the data processing device rather than all structures, and partial structures or all structures shown can be implemented according to needs. Figure 2
[0062] The data processing device provided by the embodiments of the present invention includes: at least one processor 201, a memory 202, a user interface 203, and at least one network interface 204. Each component in the data processing device is coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 All kinds of buses are labeled as bus system 205.
[0063] Among them, the user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, a button, a keypad, a touchpad or a touch screen, etc.
[0064] It can be understood that the memory 202 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The memory 202 in the embodiments of the present invention is capable of storing data to support the operation of the terminal (such as 10-1). Examples of such data include: any computer programs for operating on the terminal (such as 10-1), such as an operating system and application programs. Among them, the operating system contains various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application programs can include various application programs.
[0065] In some embodiments, the data processing device provided by the embodiments of the present invention can be implemented in a combination of software and hardware. As an example, the data processing device provided by the embodiments of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided by the embodiments of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0066] As an example of the data processing device provided by the embodiments of the present invention implemented in a combination of software and hardware, the data processing device provided by the embodiments of the present invention can be directly embodied as a combination of software modules executed by the processor 201. The software modules can be located in a storage medium, and the storage medium is located in the memory 202. The processor 201 reads the executable instructions included in the software modules in the memory 202 and combines the necessary hardware (for example, including the processor 201 and other components connected to the bus 205) to complete the data processing method provided by the embodiments of the present invention.
[0067] As an example, the processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0068] As an example of the data processing device provided by the embodiments of the present invention implemented in hardware, the device provided by the embodiments of the present invention can be directly implemented by using the processor 201 in the form of a hardware decoding processor. For example, it can be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components to execute the data processing method provided by the embodiments of the present invention.
[0069] The memory 202 in the embodiments of the present invention is used to store various types of data to support the operation of the data processing device. Examples of these data include: any executable instructions for operating on the data processing device, such as executable instructions, and the program for implementing the data processing method of the embodiments of the present invention can be included in the executable instructions.
[0070] In some other embodiments, the data processing device provided by the embodiments of the present invention can be implemented in software. Figure 2 The data processing device stored in the memory 202 is shown, which can be software in the form of a program and plug-ins, etc., and includes a series of modules. As an example of the program stored in the memory 202, it can include a data processing device, and the following software modules are included in the data processing device:
[0071] The information transmission module 2081 is used to obtain the virtual scene image in the virtual scene where the target object is located.
[0072] The information processing module 2082 is used to determine the map position coordinates and map type parameters that match the virtual scene image when it is determined that the map identifier in the virtual scene image is in an open state.
[0073] The information processing module 2082 is used to determine the scale information that matches the virtual scene image based on the map position coordinates and map type parameters.
[0074] An information processing module 2082, configured to determine the starting position coordinates and the ending position coordinates of a virtual scene travel route that matches the virtual scene.
[0075] The information processing module 2082 is configured to determine the virtual scene travel route coordinates and the auxiliary line coordinates of the virtual scene travel route according to the scale information that matches the virtual scene image, the starting position coordinates and the ending position coordinates of the virtual scene travel route.
[0076] The information processing module 2082 is configured to present the virtual scene travel route and the corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinates and the auxiliary line coordinates of the virtual scene travel route.
[0077] In some embodiments, the data processing device 200 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The terminal (such as terminal 10-1) may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present invention.
[0078] According to Figure 2 the data processing device shown, in one aspect of the present application, the present application further provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the different embodiments and combinations of the embodiments provided in the various alternative implementation manners of the above point data processing method.
[0079] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; it may also be various devices including one or any combination of the above memories.
[0080] Continuing to describe the data processing method provided by the embodiments of the present invention in combination with Figure 2 the data processing device shown, see Figure 3 , Figure 3An optional flowchart of the data processing method provided by the embodiments of the present invention. The data processing method provided by this application can be executed by a game accelerator running on the Figure 1 shown terminal 10-1 or 10-2, so as to ensure the accuracy of the virtual scene travel route while improving the efficiency of generating the virtual scene travel route, and more quickly process the virtual scene travel route in complex dimensions. Figure 3 The steps shown can be executed by various electronic devices running a data processing device. For example, it can be a terminal with a data processing device, such as a motion sensing game console, or the data processing method provided by this application can be executed through the game accelerator software in a mobile phone.
[0081] Next, in combination with Figure 3 the steps shown, taking the data processing device implementing the data processing method provided by the embodiments of the present invention as an example for specific description.
[0082] Step 301: The data processing device acquires a virtual scene image in the virtual scene where the target object is located, and the virtual scene image includes a map identifier.
[0083] During the display of the virtual scene image, the map identifier can be set at the edge position of the virtual scene image (including but not limited to the upper left corner position or the upper right corner position of the virtual scene image). Specifically, due to the differences in virtual scenes, the game screens presented in the game client are also diverse. However, for any type of game, the map identifier in the virtual scene image indicates that the current presented virtual scene image includes the corresponding game map. Taking the fps game as an example, when presenting the game screen, the map identifier is shown at the edge of the image to present the corresponding game map (such as Figure 5A and Figure 5B the shown game map).
[0084] Step 302: When the data processing device determines that the map identifier in the virtual scene image is in an open state, it determines the map position coordinates and map type parameters that match the virtual scene image.
[0085] In some embodiments of the present invention, when it is determined that the map identifier in the virtual scene image is in an open state, the map position coordinates and map type parameters that match the virtual scene image can be determined by the following method:
[0086] Detect the virtual scene image through a scale matching mechanism to determine the status of the map identifier in the virtual scene image; when it is determined that the map identifier in the virtual scene image is in the open state, extract the map data in the virtual scene image through a data processing model; through the data processing model, extract the map position coordinates and map type parameters that match the virtual scene image from the extracted map data in the virtual scene image. Figure 4 This is an optional processing effect schematic diagram of the virtual scene travel route in the embodiment of the present invention. As Figure 4 shown, when the virtual scene is a game environment, after the game user enters the game, if the game user triggers the map identifier in the game interface (when Figure 4 the presented virtual scene is a game environment, the map identifier at the edge of the game screen can be triggered by clicking or voice command), it means that the game user needs to use the game map, then start to extract the map position coordinates and map type parameters that match the virtual scene image. If the game user does not trigger the map identifier in the game interface, it means that the game user does not need to use the game map, and there is no need to present the corresponding virtual scene travel route, thus meeting the different usage requirements of game users.
[0087] Before extracting the map position coordinates and map type parameters that match the virtual scene image, it is first necessary to determine the status of the map identifier in the virtual scene image. Only when the map identifier in the virtual scene image is in the open state can the corresponding virtual scene travel route and the corresponding auxiliary line be generated. When the virtual scene is a game environment, refer to Figure 1The terminals 10-1 and 10-2 shown, where the areas of the terminal display regions of the terminals 10-1 and 10-2 are different. Therefore, when executing the same game process, the sizes of the virtual scene images in the presented virtual scene are also different. When obtaining the virtual scene travel route for execution, through the data processing method provided by this application, it is possible to adapt to game video screens of different sizes. Specifically, taking a FPS game as an example of the game scene, the user can perform operations on this terminal in advance. After the terminal detects the user's operation, it can download the game configuration file of the electronic game. The game configuration file can include the application program of the electronic game, interface display data, virtual scene data, etc., so that when the user logs in to the electronic game on this terminal, the game configuration file can be called to render and display the electronic game interface. The user can perform touch operations on the terminal. After the terminal detects the touch operation, it can determine the game data corresponding to the touch operation and render and display the game data. The game data can include information such as virtual scene data and the behavior data of virtual objects in the virtual scene. During the game process, the FPS game can provide different game travel position displays to the game user along with different operations of the user. For example, it can display the real-time position of virtual objects in the game route. The game user can control the virtual object to move in the virtual scene by taking a virtual vehicle and display the real-time position at different positions in the virtual scene travel route. Here, only the above scenario is used as an example for illustration, and the embodiments of the present invention do not make specific limitations in this regard. The user can also control the virtual object to fight with other virtual objects through virtual props in the virtual scene travel route. During this process, the game user can be reminded to avoid the high-risk area at the lower part of the virtual scene travel route by displaying the position of the virtual scene travel route, generate the farthest distance auxiliary line before parachuting to help the game user more reasonably select the parachuting position, or provide different landing positions for the user to choose in the virtual scene travel route in water. As Figure 4 shown, during the presentation process of the virtual scene travel route, after detecting the coordinates of the virtual scene travel route, the following uses can be made: (1) An auxiliary line corresponding to the virtual scene travel route can be generated according to the common parachuting distance, such as Figure 4 the auxiliary lines 303 and 304 corresponding to the virtual scene travel route shown (for example, in the island map, the normal farthest flight distance can reach 1600m, and two auxiliary lines can be presented in the game map), and it is prompted in the form of a floating window (such as Figure 4 the floating window 305 shown) to help ordinary game users more reasonably select the parachuting point before parachuting; (2) The position of the virtual scene travel route can be displayed in the game interface to prompt the game user to avoid the lower area 302 of the virtual scene travel route when searching for resources. The game props resources thrown in this area 302 have been searched and the danger coefficient is relatively high. The auxiliary effect of the virtual scene travel route is as Figure 4 shown, through Figure 4The simplified game user parachuting point 301 selection and reminder virtual scene travel route position shown in [the figure] where the map type parameter includes at least one of the following: island, desert, rainforest, snowfield, and valley, which can enrich the game experience of game users in different virtual scenes.
[0088] In order to determine the state of the map identifier in the virtual scene image, in some embodiments of the present invention, the data processing method provided by this application can be implemented by encapsulating it in game accelerator software. Since the game accelerator can perform data processing on different types of games respectively, in order to present the virtual scene travel route and the corresponding auxiliary line in different virtual scenes, a scale matching mechanism can be configured in the data processing model. The opening state of the map identifier is detected through the detection algorithm corresponding to the scale matching mechanism, and the data in the virtual scene is used to identify the state of the map identifier in the virtual scene image, avoiding mis-triggering of the virtual scene travel route, reducing the computing power of the game terminal, enabling game users to obtain a smoother game experience, and at the same time enhancing the multi-scale detection ability for different virtual scenes to adapt to the processing requirements of virtual screens of different sizes.
[0089] Exemplarily, refer to Figure 5A , Figure 5A which is a schematic diagram of the game map display effect in the embodiments of the present invention. Figure 5A The virtual scene shown is a racing game environment. When it is necessary to present the virtual scene travel route and the corresponding auxiliary line in the virtual scene of the game video screen shown in Figure 5A , when the racing game program runs, it is necessary to determine that when the map identifier 301 "X" that appears in the upper left corner of the game screen is triggered, it indicates that the current game map is in the open state. Since Figure 5A the game video screen shown is presented through the display area of the game terminal, the virtual scene travel route and the corresponding auxiliary line in the game map to be presented and the map identifier in the presented virtual scene image also need to be adjusted according to the corresponding ratio. In order to determine whether the game map is in the open state in the virtual scene shown in Figure 5A , specifically, the scaling coefficient of the virtual scene image saved in the historical data in the virtual scene can be requested and obtained in the game terminal; when the scaling coefficient in the historical data is obtained, the map identifier in the virtual scene image is intercepted based on the scaling coefficient to form an image to be matched; the correlation coefficient between the virtual scene template image and the image to be matched is determined; when the correlation coefficient between the virtual scene template image and the image to be matched reaches the correlation coefficient threshold of the current virtual scene, it is determined that the state of the map identifier in the virtual scene image is the open state.
[0090] Exemplarily, refer to Figure 5B , Figure 5BSchematic diagram of the display effect of the game map in the embodiments of the present invention Figure 5A The virtual scene shown is an FPS game environment. When it is necessary to present the virtual scene travel route and the corresponding auxiliary line in the virtual scene of the game video screen shown Figure 5B When the map identifier 302 "X" appears in the upper right corner of the game screen, it indicates that the current game map is in the open state. Different from the embodiment environment shown Figure 5A The difference from the embodiment environment shown Figure 5B The game video screen shown is presented for the first time in the game terminal. The game terminal does not store the zoom factor of the virtual scene image in the historical data. At the same time Figure 5B The game video screen to be presented on the terminal display interface is different from the embodiment environment shown Figure 5A (For example, the virtual scene image sizes of the same game process respectively run by the terminals 10-2 and 10-1 shown Figure 1 are different). Therefore, it is necessary to calculate the normalized correlation coefficients corresponding to each set of zoom factors in the multi-scale zoom factor table in turn (by normalizing the calculated correlation coefficients to form normalized correlation coefficients), and judge the state of the map identifier in the virtual scene image through the relationship between the normalized correlation coefficient and the correlation coefficient threshold. Specifically, since Figure 5B The game video screen shown is presented through the display area of the game terminal. The virtual scene travel route and the corresponding auxiliary line in the game map to be presented and the map identifier in the presented virtual scene image also need to be adjusted according to the corresponding ratio. To determine whether the game map is in the open state in the virtual scene shown Figure 5B When the zoom factor of the virtual scene image is not obtained, a multi-scale zoom factor table matching the virtual scene is generated; based on each set of zoom factors in the multi-scale zoom factor table, the map identifier in the virtual scene image is intercepted to form an image to be matched; the correlation coefficient between the virtual scene template image and the image to be matched is determined; and the correlation coefficient is normalized to form a normalized correlation coefficient; calculate the normalized correlation coefficients corresponding to each set of zoom factors in the multi-scale zoom factor list in turn until the maximum value of the normalized correlation coefficient between the virtual scene template image and the image to be matched reaches the correlation coefficient threshold of the current virtual scene, and determine that the state of the map identifier in the virtual scene image is the open state
[0091] The judgment of whether the game map state is in the open state is described. Refer to Figure 5C , Figure 5C Figure XX is an optional flowchart of the data processing method in the embodiments of the present invention, which specifically includes the following steps
[0092] Step 501: Obtain the virtual scene image.
[0093] Step 502: Determine whether the game terminal has saved the zoom factor. If so, execute Step 503; otherwise, execute Step 504.
[0094] Among them, in the stage of obtaining the virtual scene image, corresponding virtual scene travel routes will be generated in the virtual scenes of role-playing games and FPS games. For example, the virtual scene travel route of the game character in the water area in a role-playing game, or the virtual scene travel route of the game character in the airspace in an FPS game. However, the game complexities of the two types of games are different. For the determination of the virtual scene travel routes in different virtual scenes, different methods can be used to determine the status of the map identifier, so as to provide a better user experience for game users. When obtaining the virtual scene image, for role-playing games, when the game accelerator process identifies the status of the map identifier through the scale matching mechanism, it can use only the sampling method with a sampling time interval of 3 s to intercept the virtual scene image in the virtual scene, so as to maintain the coherence of the user's game process and reduce the computational amount of the terminal. For FPS games, since there are a variety of game props in the virtual scene travel route, for example, the flight virtual props in the flight route include hot air balloons, airplanes, parachutes, etc., and the load-bearing virtual props include boxes or boxes, etc. The flight virtual props can carry the load-bearing virtual props and fall when flying in the virtual scene. When the game accelerator process identifies the status of the map identifier through the scale matching mechanism, it can use the sampling method with a sampling time interval of 1 s to intercept the virtual scene image in the virtual scene, so as to reduce the occupancy of the game engine, reduce the load of the game terminal, and ensure the coherence of the game process. At the same time, for FPS games with a high terminal load, game users can also configure the time interval for the scale matching mechanism to detect the virtual scene image by themselves to meet the user's usage habits.
[0095] In some embodiments of the present invention, when detecting the virtual scene image through the scale matching mechanism, a multi-scale matching coefficient list can be pre-generated. Among them, each group of elements in the multi-scale matching coefficient list includes the zoom factors in the width and height directions, and the generation method can be customized in combination with specific tasks in different virtual scenes. Specifically, in some embodiments of the present invention, the status of the map identifier in the virtual scene image can be determined through the following method. The unit of the step length and interval in the following processing method is cm to adapt to the display area of the game terminal:
[0096] 1) In both the x-axis and y-axis directions, with a step size of 0.1 and the condition that x ≥ y, completely traverse the interval [1, 1.5] to generate a scaling factor queue; 2) In both the x-axis and y-axis directions, with a step size of 0.05 and the condition that x ≤ y, completely traverse the interval [0.7, 1] to generate a scaling factor queue; 3) Merge the two generated queues as the candidate scaling factor list, as follows:
[0097] [(fx s1 , fy s1 ), (fx s2 , fy s2 ), (fx s3 , fy s3 ),...]
[0098] Step 503: Generate a multi-scale scaling factor list.
[0099] In some embodiments of the present invention, to reduce the algorithm calculation amount, after the first successful match, the multi-scale loop matching can no longer be used. Thus, the same game session uses a fixed scaling factor for matching calculations. Check whether the multi-scale scaling factor and the open flag position have been saved. If they have been saved, step 503 can be executed; otherwise, step 504 is executed.
[0100] Refer to Figure 6 , Figure 6 which is a schematic diagram of the interception process of the game map identifier in the embodiments of the present invention. In some embodiments of the present invention, after a successful match, the scaling factor and the map open flag position are saved, specifically including the following steps: 1) Input a virtual scene image, intercept the upper-right corner candidate area containing the open flag, with a size of h*w (where h is the height and w is the length, preferably 200 (pixels) * 200 (pixels) for mobile game virtual environments, and can be specifically adjusted according to the game type or virtual scene), as the image to be matched; 2) Traverse the scaling factor list, and when taking each set of scaling factors to calculate the corresponding correlation coefficient, the following process can be executed:
[0101] 1) Based on the scaling factor (f x , f y ), scale the template image, and calculate the normalized correlation coefficient for the template image and the image to be matched. Among them, R(x, y) is the normalized correlation coefficient, and the calculation formula refers to formula (1):
[0102]
[0103] 2) Among them, T’(x’, y’) represents the relative value of the template to its mean value, and I 2 (x + x’, y + y’) represents the relative value of the image to be matched to its mean value, and the calculation formula refers to formula 2:
[0104] T′(x′, y′) = T(x′, y′) - 1 / (w·h)·∑ x″,y″ T (x″, y″)
[0105] I′(x + x′, y + y′) = I(x + x′, y + y′) - 1 / (w·h)·∑ x″,y″ I(x + x″, y + y″); (2)
[0106] 3) The maximum normalized correlation coefficient R max is greater than the threshold T (preferably 0.75 in the FPS game), indicating a successful match. Save the scaling factor (f xs , f ys ) and the matching position (x1, y1, x2, y2), and output the map as an open state.
[0107] After step 502 is executed, when the game terminal has saved the scaling factor and position parameters, it can continue to be processed in the following manner: 1) Input the virtual scene image and use the saved coordinate frame (x1, y1, x2, y2) to intercept the upper right corner map opening identifier; 2) Scale the template with the scaling factor (f xs , f ys ), calculate the normalized correlation coefficient for the template image and the image to be matched; 3) If the maximum normalized correlation coefficient R max is greater than the threshold T, it indicates a successful match, which is specifically achieved through the following steps:
[0108] Step 504: Crop the identifier in the game map.
[0109] Step 505: Scale the template image.
[0110] Step 506: Calculate the correlation coefficient Rmax between the image and the template.
[0111] Step 507: Determine whether Rmax is greater than the threshold T.
[0112] When it is determined that Rmax is greater than the threshold T, execute step 514.
[0113] Step 508: Crop the upper right corner h*w area of the image.
[0114] Step 509: Take a set of scaling factors and scale the template image.
[0115] Step 510: Calculate the maximum correlation coefficient Rmax between the image and the template.
[0116] Step 511: Determine whether Rmax is greater than the threshold T. If so, execute step 512; otherwise, execute step 513.
[0117] Step 512: Save the zoom factor and the position of the open flag.
[0118] Step 513: Determine whether the traversal of the zoom factor list is completed; if not completed, return to execute Step 509.
[0119] Step 514: Determine whether the game map is in the open state.
[0120] When it is determined that the map identifier in the virtual scene image is in the open state, continue to execute Step 303.
[0121] Step 303: The data processing device determines the scale information matching the virtual scene image based on the map position coordinates and the map type parameters.
[0122] Among them, the scale information is used to represent the position mapping relationship between the actual map and the thumbnail map. By using the scale information and performing mapping processing on the real-time position of the game character in the game scene, the corresponding real-time position in the virtual scene travel route presented in the game map can be obtained.
[0123] In some embodiments of the present invention, determining the scale information matching the virtual scene image based on the map position coordinates and the map type parameters can be achieved in the following manner:
[0124] Through the data processing model, determine the map position coordinates and the map type parameters matching the virtual scene image, where the map type parameters include at least one of the following: island, desert, rainforest, snowfield, and valley; by the ratio of the size of the game map to the size of the virtual scene image, the scale information matching the virtual scene image can be determined. Due to different game types, in order to more accurately determine the scale matching the virtual scene image, the data processing model can perform feature convolution and feature fusion processing on the map position coordinates and the map type parameters, and output the confidence, regression box coordinates, and map category information corresponding to the map position coordinates and the map type parameters; and further perform non-maximum suppression processing on the confidence, regression box coordinates, and map category information corresponding to the map position coordinates and the map type parameters.
[0125] Specifically, perform non-maximum suppression processing on the map position coordinates and map type parameters that match the virtual scene image to determine the scale information that matches the virtual scene image. Among them, non-maximum suppression is often used in computer vision tasks to suppress detection results that are not maxima. Here, it mainly refers to non-maximum suppression in object detection tasks to remove redundant overlapping detection boxes. Sort the detection results in descending order by probability category, which specifically includes the following steps: (a) Assume that the boxes predicted as the island category in the map detection task are arranged in descending order as A, B, C, D, E; (b) Select the box A with the highest probability, mark it as the accepted box, and judge the IoU value (the result obtained by dividing the overlapping part of the two regions by the set part of the two regions) between the remaining boxes B, C, D, E and A; (c) Generally, the IoU threshold is set to 0.2-0.5. If it is greater than this threshold, it means it is a redundant box and needs to be discarded. Assume that B exceeds the threshold and is discarded, and C, D, E do not exceed the threshold; (d) Continue to select the box C with the largest probability from the remaining detection boxes, mark it as the accepted box, calculate the IoU value between boxes D and E and C, and discard those with IoU greater than the threshold; (e) Iterate and repeat the above process until all detection boxes of all categories are processed. Perform non-maximum suppression processing on the map position coordinates and map type parameters that match the virtual scene image, so that the scale of the mobile map screen can be calculated in real time, and the problem of how to measure the distance in the mobile game screen can be solved.
[0126] In some embodiments, after determining the scale information that matches the virtual scene image, the operation of the virtual object in the virtual scene can be controlled based on the determined scale information; for example, it is possible to choose to control the game character to parachute at a suitable position, as Figure 4 shown, the game user can control the virtual object to adjust the virtual scene travel route of the plane being ridden, and can select the target landing location along the virtual scene travel route, or parachute and throw game props at positions No. 1, No. 2, and No. 3 on the virtual scene travel route; it is also possible to adjust the corresponding heading according to the scale. Combining Figure 4 shown, the straight line with an arrow represents the virtual scene travel route of the plane ridden by the virtual object, the arrow represents the end point of the plane flight, and the circle represents the starting point of the plane flight. When the virtual object is riding on the plane, the user can display the map corresponding to the virtual scene through a trigger operation. Optionally, the trigger operation includes at least one of single-click operation, double-click operation, swipe operation, drag operation, and long-press operation.
[0127] In order to overcome the defects of inaccurate generation and low efficiency of the virtual scene travel route generated by the traditional virtual scene travel route generation method, the technical solution provided by the present invention uses artificial intelligence technology. Artificial intelligence AI (Artificial Intelligence) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, a theory, method, technology and application system that perceives the environment, acquires knowledge and uses knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning and decision-making.
[0128] Machine learning (ML) is an interdisciplinary subject involving multiple fields such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning. With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in multiple fields. For example, in this application, when processing data in a virtual scene through artificial intelligence, the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route can be determined through different neural networks and processing processes in the data processing model. Then, based on the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route, the virtual scene travel route and the corresponding auxiliary line are presented in the virtual scene, enabling game users to obtain an accurate virtual scene travel route and a better user experience. Combined with Figure 2As shown, the data processing device 200 is configured to, after receiving a generated route request, implement the data processing method provided in this application through the deployed data processing model. As an example, the data processing device 200 is used to implement the data processing method provided in the present invention. The trained data processing model can be stored in the storage medium of the data processing device 200 to generate virtual scene travel routes of various types in different virtual scenarios (such as shooting games, parkour games, racing games, Multiplayer Online Battle Arena (MOBA), Racing Game (RCG), and sport games (SPG)). Specifically, before using the data processing model, the data processing model needs to be trained. The specific process includes: determining the historical parameters of the target object according to the type of the virtual scene where the target object is located; determining a training sample set matching the data processing model based on the historical parameters of the target object; extracting different training samples from the first training sample set to form a second training sample set based on the noise threshold matching the data processing model; and training the data processing model according to the second training sample set.
[0129] Of course, the data processing device provided in the present invention can be trained based on the data processing model in the virtual scene travel route generation environment of the same type of virtual scene, and can also be adjusted according to the different levels of the target object. Finally, a virtual scene travel route adapted to the virtual scene determined by the data processing model is presented on the user interface (UI). The obtained virtual scene travel route through the data processing model and adapted to the virtual scene can also be called by other application programs (such as game simulators or motion sensing game devices). Of course, the data processing models matching different types of games can also be migrated to the online battle FPS games, offline controlled FPS games, and cloud games in the instant messaging process.
[0130] In some embodiments, when processing the map position coordinates and map type parameters, it can be implemented through the deployed data processing model. Before deploying the data processing model, the data processing model needs to be trained to determine the parameters of different neural networks in the data processing model to achieve the effect of accurately processing the map position coordinates and map type parameters. Among them, Figure 7 This is an optional flowchart of the data processing model training method provided in the embodiments of the present invention. It can be understood that Figure 7The steps shown can be executed by various electronic devices running the data processing model training device. For example, it can be a game terminal with a data processing model training device, or a server cluster of a game operator. After that, the trained data processing model is encapsulated in the corresponding game accelerator software to provide services for game users to process the virtual scene travel route.
[0131] Step 701: The data processing model training device determines the historical parameters of the target object according to the type of the virtual scene where the target object is located.
[0132] Step 702: The data processing model training device determines a first training sample set that matches the data processing model based on the historical parameters of the target object.
[0133] Among them, the first training sample set includes at least one set of training samples, and after obtaining the training samples, information annotation needs to be performed on the obtained training samples.
[0134] Step 703: The data processing model training device extracts different training samples from the first training sample set to form a second training sample set based on the noise threshold that matches the data processing model.
[0135] In some embodiments of the present invention, when the virtual scene where the target object is located is a role-playing game, a dynamic noise threshold that matches the usage environment of the data processing model is determined; the first training sample set is denoised according to the dynamic noise threshold to form a second training sample set that matches the dynamic noise threshold; when the virtual scene where the target object is located is a battle game, a fixed noise threshold corresponding to the data processing model is determined, and the first training sample set is denoised according to the fixed noise threshold to form a second training sample set that matches the fixed noise threshold. Among them, due to the different virtual scenes of the data processing model, the dynamic noise threshold that matches the usage environment of the data processing model is also different. For example, an FPS game for online battles of a role-playing game can be executed through an instant messaging client process, or a role-playing game can be executed through an offline-controlled FPS game process. The game complexity of the online battle FPS game is usually greater than that of the offline-controlled FPS game. Therefore, the dynamic noise threshold that matches the usage environment of the data processing model needs to be less than the dynamic noise threshold in the usage environment of the role-playing game executed by the game user through the offline-controlled FPS game process, and training samples exceeding the noise threshold are deleted according to the noise threshold. Different dynamic noise thresholds can be used to adapt to different types of games, effectively screening training samples, so that users can obtain a better virtual scene travel route generated by the deployed trained data processing model.
[0136] In some embodiments of the present invention, when the virtual scene where the target object is located is a first-person shooting game, a fixed noise threshold corresponding to the data processing model is determined, and the first training sample set is denoised according to the fixed noise threshold to form a second training sample set that matches the fixed noise threshold. For a battle game deployed on a fixed game terminal (such as a somatosensory game console or an AR game glasses and other game devices), the fixed noise threshold can effectively improve the acquisition speed and accuracy of training samples, reduce the waiting time of game users. When the version of the game process is updated, a new fixed noise threshold can be obtained, and the training samples with noise lower than the fixed noise threshold in the carried training samples are deleted to improve the learning efficiency of the game terminal.
[0137] Step 704: The data processing model training device trains the data processing model according to the extracted second training sample set, and determines the model parameters of the feature extractor network and the sample classifier network in the data processing model.
[0138] Step 705: After the data processing model training device determines the network parameters of different neural networks in the data processing model, it deploys the trained data processing model in the corresponding game terminal.
[0139] Step 706: Determine whether the map has been opened; and when it is in the opened state, execute Step 707.
[0140] Step 707: Detect the map position and category.
[0141] Step 708: Perform NMS processing, calculate the map scale, and output the map coordinates and scale.
[0142] Step 709: Determine whether the loss function loss reaches the threshold and tends to be stable. If so, execute Step 710; otherwise, execute Step 711.
[0143] Step 710: Stop the iteration and output the model parameters of the data processing model.
[0144] Step 711: Perform gradient descent processing to update the weight parameters of the data processing model.
[0145] Among them, in order to meet the needs of different types of games in game terminals (such as different mobile games in mobile phones or different mobile games in dedicated game terminals), the trained data processing model can be encapsulated in the game accelerator process to achieve auxiliary processing for different types of games, so that the same user can obtain the virtual scene travel route and the corresponding auxiliary line presented in the virtual scene through the data processing model in different game processes, avoiding the defect of occupying a large amount of data storage space of the game terminal caused by using game historical data to obtain the virtual scene travel route.
[0146] In some embodiments of the present invention, since the game accelerator can process the virtual scene travel routes in different types of games, in order to adapt to various types of games, the deep neural network used by the data processing model can also select faster region-based convolutional neural network Faster-RCNN, single-shot multibox detector SSD, neural networks of the YOLO series, etc. When the data processing model encapsulated in the mobile game accelerator process uses a neural network of the YOLO series (for example, using the deep neural network object detection algorithm YOLOv4-tiny as the main structure network of the data processing model), the recognition of map identifiers at different positions in the virtual scene image can also be adjusted according to different game processes. For example, select the pre-trained YOLOv4-tiny network to recognize the map identifiers during the airdrop process or the map identifiers of the water area virtual scene travel route distributed at different positions to achieve adaptation to the map identifiers at different positions in different game processes, improve the generation rate of the virtual scene travel route, and reduce the waiting time of game users.
[0147] In some embodiments, in order to facilitate the deployment of the data processing model in the mobile terminal to improve the operation efficiency of the mobile end and reduce the parameter calculation amount, the feature extractor network used by the data processing model can be an inverted residual structure network, where, refer to Figure 8 , Figure 8This is a schematic diagram of the inverted residual structure network in the embodiments of the present invention. First, the feature dimension can be enhanced through 1×1 pointwise convolution, then depthwise convolutions (DW) are used to extract features, and then a 1×1 convolution is used to restore to the original feature dimension. Finally, feature fusion of virtual scene images is achieved through cross-layer connection. The input resolution of the data processing model can be 608×608 (which can also be adjusted according to different game types). To improve the regression accuracy of the data processing model for map logo recognition, the regression loss function uses the GIoU loss. Among them, GIoU loss, that is, Generalized Intersection over Union, represents the generalized intersection over union, which is a loss function in deep learning and is used to measure the gap between the predicted bounding box and the true annotation bounding box in the object detection task. It belongs to an improved version of the Intersection over Union (IoU) loss. Assume the ground truth box is B g , and the predicted box is B p , then calculate the minimum bounding rectangle B g of B p and B c , then the GIoU loss at this time = 1 - GIoU. In the FPS game, the GIoU threshold can be set to 0.9, that is, only when the GIoU value of the predicted map is not less than 0.9 is it considered that the data processing model outputs the correct result. During game training, the model weight parameters are continuously updated through the gradient descent method. When the loss value GIoU loss is less than 0.1 and tends to be stable, the training can be stopped, and the weights at this time are saved to obtain the model parameters of the corresponding data processing model to achieve the recognition of map logos in the game screen of the FPS game.
[0148] In some embodiments of the present invention, a deep neural network can also be used. For example, the deep neural network used by the data processing model can include, for example, the VGG network, the ResNet series network, and the Inception series network to adapt to FPS games with more complex game strategies (such as FPS games with faster frame-by-frame change speeds and more complex virtual scene images). Taking the data processing model using ResNet as an example, after obtaining a new training book, the data processing model can be trained according to the second training sample set to determine the model parameters of the feature extractor network in the data processing model and the model parameters of the sample classifier network in the data processing model.
[0149] Next, the training of the data processing model based on the second training sample set will be described. See Figure 9 , Figure 9An optional process schematic diagram of the data processing model training method provided by an embodiment of the present invention, including the following steps:
[0150] Step 901: Determine the initial parameters of the feature extractor network and the initial parameters of the sample classifier network in the data processing model.
[0151] Step 902: Process the second training sample set through the feature extractor network to obtain the updated parameters of the feature extractor network and the updated parameters of the sample classifier network.
[0152] Step 903: Update the initial parameters of the feature extractor network with the updated parameters of the feature extractor network, and update the initial parameters of the sample classifier network with the updated parameters of the sample classifier network.
[0153] Step 904: Determine the multi-task loss function matching the data processing model.
[0154] Step 905: Based on the multi-task loss function, adjust the model parameters of the feature extractor network and the model parameters of the sample classifier network until the multi-task loss function corresponding to the data processing model reaches the corresponding convergence condition.
[0155] When the multi-task loss function corresponding to the data processing model reaches the corresponding convergence condition, the model parameters of the feature extractor network and the model parameters of the sample classifier network in the data processing model can be determined.
[0156] During the update process, by using the mean squared error loss function, the gradient backpropagation of the neural network can be used to update the network parameters of the feature extractor network and the sample classifier network in the game model to achieve iterative update.
[0157] After determining the scale information matching the virtual scene image, the virtual scene travel route and corresponding auxiliary lines can continue to be presented to the game user, specifically including:
[0158] Step 304: The data processing device determines the starting position coordinates and ending position coordinates of the virtual scene travel route matching the virtual scene.
[0159] Step 305: The data processing device determines the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route according to the scale information matching the virtual scene image, the starting position coordinates and ending position coordinates of the virtual scene travel route.
[0160] Step 306: The data processing device presents the virtual scene travel route and the corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinates and the auxiliary line coordinates of the virtual scene travel route.
[0161] In some embodiments of the present invention, according to the scale information matching the virtual scene image, the starting position coordinates and the ending position coordinates of the virtual scene travel route, determining the virtual scene travel route coordinates and the auxiliary line coordinates of the virtual scene travel route can be achieved in the following manner:
[0162] Determine the distance between the virtual scene travel route auxiliary lines according to the virtual scene. When the virtual scene travel route is in a horizontal or vertical state, determine the auxiliary line coordinates corresponding to the two auxiliary lines by translating the starting position coordinates and the ending position coordinates of the virtual scene travel route; generate two auxiliary lines matching the distance between the virtual scene travel route auxiliary lines based on the auxiliary line coordinates corresponding to the two auxiliary lines respectively; or determine the distance between the virtual scene travel route auxiliary lines according to the virtual scene. When the virtual scene travel route is in an inclined state, determine the auxiliary line coordinates corresponding to the two auxiliary lines respectively and the rotation angle by rotating the starting position coordinates and the ending position coordinates of the virtual scene travel route; generate two auxiliary lines matching the distance between the virtual scene travel route auxiliary lines based on the auxiliary line coordinates corresponding to the two auxiliary lines respectively and the rotation angle. Thus, a more accurate virtual scene travel route can be obtained according to the scale information matching the virtual scene image, the starting position coordinates and the ending position coordinates of the virtual scene travel route, and the use of game users can be prevented from being affected by incorrect virtual scene travel routes.
[0163] In some embodiments of the present invention, when presenting the virtual scene travel route and the auxiliary line to the game, in response to the virtual scene image parameters, obtain the brightness difference between the game map in the virtual scene and the virtual scene image; based on the brightness difference, adjust the brightness of the virtual scene travel route presented in the game map to be different from that of the game map, so as to make the virtual scene travel route in the game map present a different brightness from the game map. Among them, the average saturation of the game map of the virtual scene image and the average saturation of the virtual scene image can be calculated respectively, and the brightness difference diff between the average saturation of the game map and the average saturation of the virtual scene image can be calculated s Convert the game map of the virtual scene image into an HSV image, and then complete diff for each pixel point of the S layer in the HSV image s*For the operation of 0.8, the saturation of the game map and virtual scene images is harmonized to avoid affecting the viewing experience of game users due to excessive saturation differences between the game map and virtual scene images. Regarding the brightness difference, adjusting the brightness of the virtual scene travel route presented in the game map to be different from the game map can achieve a distinct presentation state of the virtual scene travel route and the game map, enabling game users to intuitively obtain prompts for the virtual scene travel route during the game process and obtaining a better usage experience.
[0164] When the trained data processing model is deployed in the corresponding mobile game accelerator process to provide auxiliary virtual scene travel routes for different mobile games of the user terminal, it can facilitate game users to promptly and accurately select the parachute takeoff position in the virtual scene travel route. Taking the FPS game as an example, the data processing method of the present application will be described below. Figure 10 It is a schematic diagram of the application of the data processing model provided by the embodiment of the present invention to the FPS game. In Figure 10 different legends are used to show different position information such as "G Port", "P City", "School", "R City", "Nuclear Power Plant", "M City", etc. in the game map. Through the data processing method provided by the present invention, by choosing to parachute at different positions in the virtual scene travel route, different positions in the game map can be reached to obtain game props at the corresponding positions. Also, according to the auxiliary line of the virtual scene travel route, the corresponding position in the virtual scene travel route can be selected for throwing game props. At the same time, the virtual scene travel route can be presented in different display states. In some embodiments of the present invention, the presentation form of the virtual scene travel route can also be determined according to the type of the virtual scene or the user level corresponding to the virtual scene; adopting the presentation form of the virtual scene travel route, the virtual scene travel route and the corresponding auxiliary line are presented in the virtual scene. For example, the virtual scene travel route can be presented as a wide straight line 1001 with overlapping red and white and dynamically changing, with a white circle 1002 as the starting point and a white triangle 1003 as the ending point. It should be noted that, to conform to the usage habits of users, the color, line thickness, and the morphological form of the prompt graphics at the starting and ending points of the virtual scene travel route can all be configured by game users themselves.
[0165] Next, taking the virtual scene as a game as an example, the data processing method provided by the embodiment of the present invention will be further described. Continuing to refer to Figure 11 , Figure 11 It is an optional flowchart of the process of the data processing method provided by the embodiment of the present invention. Figure 11 The steps shown can be executed by various game terminals or game accelerator processes deployed with the data processing model, and specifically include the following steps:
[0166] Step 1101: Obtain the game image, adjust the pixels of the game image, and adjust the size to 608×608.
[0167] Step 1102: Detect the map position coordinates and map type parameters that match the game image through the data processing model in the mobile game accelerator process.
[0168] Step 1103: Output the confidence, regression box coordinates, and category of all detection results through the data processing model.
[0169] Step 1104: Trigger non-maximum suppression processing to determine the map position coordinates and map type parameters that match the game image, as well as the scale information that matches the game image.
[0170] Among them, the processing result process of non-maximum suppression can remove redundant detection boxes, sort the detection results in descending order by probability by category, traverse all detection boxes, set the IoU threshold corresponding to the FPS game to 0.3, obtain the map position coordinates and map type parameters of the corresponding FPS game, and can also calculate the current map scale according to the map category and size. For example, in the FPS game, the size of the game map image is l m ×l m , corresponding to the actual size of the game scene is l g ×l g , then the map scale is
[0171] Step 1105: Cascade extract the virtual scene travel route coordinates within the map range according to the game map position coordinates.
[0172] Among them, refer to Figure 12 , Figure 12 is the schematic diagram of the cascade extraction of the virtual scene travel route in the embodiment of the present invention, which may specifically include the following steps:
[0173] Step 1201: Input the virtual scene image and crop out the map area image.
[0174] Step 1202: Input the game map image and extract the straight line where the virtual scene travel route is located. Specifically, it includes the following steps:
[0175] 12021: Convert the map image from the RGB color space to the HSV color space.
[0176] 12022: Set the HSV threshold to separate the red color of the virtual scene travel route. For example Figure 3The area of the virtual scene travel route shown, hue threshold: 0 - 7 and 173 - 180, saturation threshold: 150 - 230, lightness threshold: 100 - 200. Pixel values in the area that meet the conditions are set to 1, otherwise to 0, to obtain a binary image;
[0177] 12023: Use the Canny operator to perform edge detection on the binary image.
[0178] Among them, the high and low threshold settings are 50 and 150 respectively; The Sobel operator S can be used x , S y to calculate the grayscale gradient matrices in the horizontal and vertical directions of the image respectively, and then calculate the gradient intensity matrix;
[0179]
[0180] Among them, pixels with a gradient intensity value greater than 150 are considered strong edge points, pixels less than 50 are considered non-edge points, and points with an intensity value between 50 - 150 that are connected to strong edge points are classified as edge points, otherwise they are non-edge points.
[0181] 12024: Perform Hough line detection on the edge binary image.
[0182] The polar coordinate data of the straight line at the edge of the virtual scene travel route can be obtained. Among them, H(θ,ρ) = 0 can be initialized to count the frequency of the occurrence of the straight line (θ,ρ). For each non-zero pixel point (x,y), find all the polar coordinates of the straight lines passing through this point (θ,ρ), and execute H(θ,ρ) = H(θ,ρ) + 1; After traversing all non-zero pixel points, count the magnitudes of all H(θ,ρ). Parameters that satisfy H(θ,ρ) ≥ 70 are considered to have a real straight line, and a series of straight line polar coordinate data is obtained: [(ρ1,θ1),(ρ2,θ2),(ρ3,θ3)....]
[0183] (θ represents the angle between the straight line and the positive x-axis direction, ρ represents the distance between the straight line and the origin);
[0184] 12025: Select two straight lines with the closest slopes; Specifically, the detection results can be sorted according to the slopes, and two straight lines A(ρ a ,θ a ) and B(ρ a ,θ a ) with the closest slopes are selected. If |ρ a - ρ b | ≤ 4, then calculate the polar coordinates of the middle line of the two straight lines (ρ m ,θ m ) as the straight line where the virtual scene travel route is located, otherwise this detection ends; Among them, the straight line is calculated as follows:
[0185]
[0186] 12026: Convert the straight-line polar coordinates in the detected virtual scene travel route.
[0187] Convert the straight-line polar coordinates (ρ m , θ m ) in the detected virtual scene travel route into rectangular coordinates. To avoid the problem of infinite slope for vertical lines, when the line is close to a vertical line (such as ), calculate the rectangular coordinates of the intersection point of the straight line in the virtual scene travel route and the map boundary through the following formula:
[0188]
[0189] For the remaining cases, the calculation formula is as follows:
[0190]
[0191] Thus, the coordinates of the intersection point of the line in the virtual scene travel route and the map boundary can be obtained as point A(x a , y a ), point B(x b , y b ).
[0192] Step 1203: Extract the starting point of the virtual scene travel route near the straight line where the virtual scene travel route is located, and obtain the coordinates of the starting point of the virtual scene travel route. Specifically, it includes the following steps:
[0193] Step 12031: Convert the map image from the RGB color space to the HSV color space.
[0194] Step 12032: Set the HSV threshold to separate the white area of the starting point of the virtual scene travel route. Hue threshold: 0 - 255, saturation threshold: 0 - 12, value threshold: 243 - 255. Set the pixel value of the area that meets the conditions to 1, otherwise set it to 0 to obtain a binary image.
[0195] Step 12033: Perform Gaussian blur processing on the Figure 2 value map. In an fps game, the mask size can be set to 7 * 7 and the standard deviation to 1.5 to generate a Gaussian kernel with a normal distribution. Slide from left to right and from top to bottom to perform weighted averaging on the pixels within the window in turn and assign the value to the central element of the window to smooth the noise points.
[0196] Step 12034: Perform morphological dilation on the binary image. This can eliminate holes. The structuring element is a rectangle with a size of 3*3. The structuring element slides from left to right and from top to bottom and performs an AND operation with the image pixels within the window in turn. When at least one value of the operation result is 1, the pixel at this position is assigned 1, otherwise 0.
[0197] Step 12035: Perform morphological erosion to eliminate edge burrs. Among them, the structuring element is a rectangle with a size of 3*3. The structuring element slides from left to right and from top to bottom and compares with the image pixels within the window in turn. When the pixel values corresponding to the positions where the value in the structuring element is 1 within the window are all 1, the image at this position is assigned 1, otherwise 0.
[0198] Step 12036: Perform Hough circle detection on the binary image.
[0199] Step 12037: Calculate the distance OD from the center of the circle to the flight path; among them, for all non-zero pixel points, initialize the circle space C(a,b)=0 to count the occurrence frequency of each coordinate. Traverse all non-zero pixel points in the binary image, draw a line along the gradient direction, as Figure 8 shown. For the points (a,b) passed by the line segment, execute C(a,b)=C(a,b)+1. Finally, the points where C(a,b)≥25 are regarded as the centers of the circles.
[0200] After Step 12037 is executed, continue to execute the following steps:
[0201] Step 12038: Contour detection, polygon fitting, and filtering non-triangles.
[0202] For all non-zero pixel points, initialize N(r)=0 to count the occurrence frequency of each radius value. Traverse all non-zero points to calculate their distances from the center of the circle. For the points that satisfy 8≤r≤25, execute N(r)=N(r)+1. Finally, the r value corresponding to the maximum N(r) is regarded as the radius of the circle.
[0203] Calculate the distance from the center of the circle to the midline of the virtual scene travel route, that is, the perpendicular distance from the center of the circle O to the line AB, which is calculated by the vector method, where is the vector, |AO| and |AB| are the moduli of the vectors, and the formula is as follows:
[0204]
[0205] When the distance from the center of the circle to the virtual scene travel route is less than 1 / 2*r, the coordinates of this center of the circle can be used as the starting coordinates of the virtual scene travel route, otherwise discard.
[0206] Step 1204: Extract the end point of the virtual scene travel route near the straight line where the virtual scene travel route is located and obtain the coordinates of the end point of the virtual scene travel route.
[0207] In the execution of steps 1202 to 1204, step 12041 can be executed first: perform Gaussian blur processing on the virtual scene image, convert the RGB image to the HSV space, and binarize the separated white area; after extracting the end point of the virtual scene travel route near the straight line where the virtual scene travel route is located and obtaining the coordinates of the end point of the virtual scene travel route, continue to execute step 1106.
[0208] Step 1106: Determine the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route according to the scale information matching the game image, the starting position coordinates and the end position coordinates of the virtual scene travel route.
[0209] Step 1107: Present the virtual scene travel route and the corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinates and auxiliary line coordinates of the virtual scene travel route.
[0210] Next, taking the extraction of Figure 3 the virtual scene travel route shown as an example, the data processing method provided by this application will be further described. Among them, in the process of extracting the position coordinates of the virtual scene travel route, the straight line where the virtual scene travel route is located can be determined first, and then the starting point and end point coordinates can be accurately extracted near the virtual scene travel route. This process does not require annotating the virtual scene travel route data, and can be quickly transplanted to similar games through threshold adjustment, so that the data processing method provided by this application is applicable to different virtual scenes. Specifically, when extracting the starting position coordinates, first convert the game map from the RGB mode to the HSV mode; based on the game map in the HSV mode, extract the image of the area where the starting point of the virtual scene travel route is located; perform Gaussian blur processing, morphological dilation processing, and morphological erosion processing on the image of the area where the starting point of the virtual scene travel route is located in sequence; perform Hough circle detection processing on the first preprocessed image, and determine the center of the circle after the Hough circle detection processing as the coordinates of the starting position of the virtual scene travel route.
[0211] Figure 13 It is a schematic diagram of detecting the center of the circle by the Hough gradient method for cascaded extraction of the virtual scene travel route in the embodiment of the present invention; the process of detecting the center of the circle by the Hough gradient method for cascaded extraction can include the following steps:
[0212] 1) Perform Gaussian blur processing on the map image to smooth the noise that appears, where the mask size in the FPS game is 7*7 and the standard deviation is 1.5.
[0213] 2) Convert the Gaussian-blurred map image from the RGB color space to the HSV color space.
[0214] 3) Set the HSV threshold to isolate the white area at the end of the virtual scene travel route. The hue threshold is 0 - 255, the saturation threshold is 0 - 12, and the value threshold is 243 - 255. Set the pixel value of the area that meets the conditions to 1, and otherwise to 0 to obtain a binary image.
[0215] 4) Perform morphological dilation on the obtained binary image to eliminate holes. Among them, the element structure is a rectangle with a size of 3 (pixels) * 3 (pixels).
[0216] 5) Perform morphological erosion on the dilated result to eliminate edge burrs and obtain the second preprocessed image. The structuring element is a rectangle with a size of 3 (pixels) * 3 (pixels).
[0217] 6) Perform contour detection on the second preprocessed image. Preferably, use the findContours function in OpenCV to process, retain the hierarchical structure of the contours, only retain the pixel values of the two endpoints for straight contours, and obtain the coordinate set of the contour points.
[0218] 7) Approximate each closed contour with a polygon, only retain closed triangles, and the maximum distance difference between the contour line and the approximated polygon cannot exceed 0.05 times the perimeter of the contour to obtain the vertex coordinates of the triangle.
[0219] 8) Calculate the lengths of the long side and the short side of the triangle l max ,l min , and a practical triangle should meet the following conditions: l max≤4 / 3 l min .
[0220] 9) Calculate the centroid coordinates of the triangle, which can be calculated through the moments of the image space. Given the spatial moment m pq The calculation method is:
[0221]
[0222] Among them, I(x, y) is the gray value at the image (x, y). The binary image only contains 0 and 1. (p + q) represents the order. The x and y coordinates of the centroid can be calculated respectively through the first-order moments in the x and y directions as:
[0223]
[0224] 10) Calculate the straight-line distance d between the centroid of the triangle and the virtual scene travel route. tri , if it meets d tri≤ l min / 2, then accept the centroid of the triangle as the end point coordinates of the virtual scene travel route, otherwise discard it.
[0225] Step 1205: Output the coordinates of the virtual scene travel route and the corresponding auxiliary line coordinates.
[0226] Set the distance between the auxiliary lines of the virtual scene travel route to D auv , and generate a pair of auxiliary lines that are parallel to, of equal length to, and at a distance of D from the virtual scene travel route. Perform different calculation processes according to the state of the virtual scene travel route, where auv Figure Figure 14 is a schematic diagram of the virtual scene travel route calculation in an embodiment of the present invention, specifically including the following two cases:
[0227] (a) When the virtual scene travel route is horizontal or vertical ( Figure 14 the dotted line shown as a in
[0228] ), through translation processing, calculate the endpoint coordinates of the auxiliary lines on both sides. Figure 14 (b) When the virtual scene travel route is inclined ( Figure 14 the dotted line shown as b in ver ), as shown in ver , first rotate the virtual scene travel route by θ i1 degrees to the vertical direction, calculate the coordinates of the parallel auxiliary lines on the left and right, and then rotate the auxiliary lines by -θ i1 degrees to obtain the true auxiliary line endpoint coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4). To ensure that the auxiliary lines do not exceed the map range, if the auxiliary line endpoint coordinates exceed the map range, then calculate the intersection coordinates of the nearest map boundary to this endpoint and this auxiliary line. For example, if (x1, y1) exceeds the map range, then use (x i1 , y i1 ) to replace it. Finally, the auxiliary line coordinates are (x
[0229] , y Figure 3 ), (x2, y2), (x3, y3), (x4, y4).
[0230] Beneficial technical effects:
[0231] The present invention obtains a virtual scene image in a virtual scene where a target object is located; when it is determined that a map identifier in the virtual scene image is in an open state, it determines a map position coordinate and a map type parameter that match the virtual scene image; based on the map position coordinate and the map type parameter, it determines a scale information that matches the virtual scene image; determines a starting position coordinate and an ending position coordinate of a virtual scene travel route that matches the virtual scene; according to the scale information that matches the virtual scene image, the starting position coordinate and the ending position coordinate of the virtual scene travel route, it determines a virtual scene travel route coordinate and an auxiliary line coordinate of the virtual scene travel route; based on the virtual scene travel route coordinate and the auxiliary line coordinate of the virtual scene travel route, it presents the virtual scene travel route and the corresponding auxiliary line in the virtual scene. Thereby, it can not only effectively improve the efficiency of generating the virtual scene travel route, achieve faster processing of the virtual scene travel route in complex dimensions, present the virtual scene travel route and the corresponding auxiliary line in the virtual scene in a timely and accurate manner, but also be robust and generalizable for different virtual scenes, reduce the calculation cost of the virtual scene travel route, and does not rely on game log data, can adapt to different types of games, and reduce the data storage pressure on the game terminal.
[0232] The above is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data processing method, characterized in that, The method includes: Obtaining a virtual scene image in the virtual scene where the target object is located; When it is determined that the map identifier in the virtual scene image is in an open state, determining the map position coordinates and map type parameters that match the virtual scene image; Based on the map position coordinates and map type parameters, determining the scale information that matches the virtual scene image; Extracting a virtual scene travel route that matches the virtual scene from the virtual scene image; Determining the starting position coordinates and ending position coordinates of the virtual scene travel route that matches the virtual scene; According to the scale information that matches the virtual scene image, the starting position coordinates and ending position coordinates of the virtual scene travel route, determining the virtual scene travel route coordinates and auxiliary line coordinates corresponding to the virtual scene travel route; Based on the virtual scene travel route coordinates and auxiliary line coordinates, presenting the virtual scene travel route and the corresponding auxiliary line in the virtual scene.
2. The method according to claim 1, characterized in that, The step of when it is determined that the map identifier in the virtual scene image is in an open state, determining the map position coordinates and map type parameters that match the virtual scene image includes: Detecting the virtual scene image through a scale matching mechanism to obtain the state of the map identifier in the virtual scene image; When it is determined that the map identifier in the virtual scene image is in an open state, extracting the map data in the virtual scene image through a data processing model; Through the data processing model, extracting the map position coordinates and map type parameters that match the virtual scene image from the extracted map data in the virtual scene image.
3. The method according to claim 2, characterized in that, The step of detecting the virtual scene image through a scale matching mechanism to obtain the state of the map identifier in the virtual scene image includes: Obtaining the scaling coefficient of the virtual scene image from the historical data of the virtual scene; Based on the scaling coefficient, performing image cropping processing on the map identifier in the virtual scene image to obtain a to-be-matched image, where the to-be-matched image includes the map identifier in the virtual scene image; Obtaining the virtual scene template image corresponding to the virtual scene and determining the correlation coefficient between the virtual scene template image and the to-be-matched image; When the correlation coefficient reaches the correlation coefficient threshold, determining that the state of the map identifier in the virtual scene image is an open state.
4. The method according to claim 2, characterized in that, The step of detecting the virtual scene image through a scale matching mechanism to obtain the state of the map identifier in the virtual scene image includes: When the scaling coefficient of the virtual scene image is not obtained from the historical data of the virtual scene, generating a multi-scale scaling coefficient table that matches the virtual scene; Based on each set of scaling coefficients in the multi-scale scaling coefficient table, performing cropping processing on the map identifier in the virtual scene image to obtain a to-be-matched image; Obtaining the virtual scene template image corresponding to the virtual scene and determining the correlation coefficient between the virtual scene template image and the to-be-matched image, and performing normalization processing on the correlation coefficient to obtain a normalized correlation coefficient; Calculate the normalized correlation coefficients corresponding to each group of scaling coefficients in the multi-scale scaling coefficient table in sequence. When the maximum value of the calculated normalized correlation coefficient reaches the correlation coefficient threshold, determine that the state of the map identifier in the virtual scene image is the open state.
5. The method according to claim 1, characterized in that, Determining the scale information matching the virtual scene image based on the map position coordinates and map type parameters includes: Performing feature extraction processing on the virtual scene image through a data processing model to determine the map position coordinates and map type parameters matching the virtual scene image; Performing feature convolution processing on the map position coordinates and map type parameters through a data processing model, and performing feature fusion processing on the results of the feature convolution processing to obtain the confidence level, regression box coordinates, and map category information corresponding to the map position coordinates and map type parameters; Performing non-maximum suppression processing on the confidence level, regression box coordinates, and map category information corresponding to the map position coordinates and map type parameters; Based on the results of the non-maximum suppression processing of the confidence level, regression box coordinates, and map category information corresponding to the map position coordinates and map type parameters, determine the size of the game map in the virtual scene and the size of the virtual scene image; Determine the scale information matching the virtual scene image according to the ratio of the size of the game map to the size of the virtual scene image.
6. The method according to claim 5, characterized in that, The method further includes: Determine the historical parameters of the target object according to the type of the virtual scene; Based on the historical parameters of the target object, determine the first training sample set matching the data processing model, where the first training sample set includes at least one group of training samples; Based on the noise threshold matching the data processing model, extract different training samples from the first training sample set to form the second training sample set; Train the data processing model according to the extracted second training sample set.
7. The method according to claim 6, wherein The data processing model includes an extractor network and a sample classifier network; Training the data processing model according to the extracted second training sample set includes: Determine the initial parameters of the feature extractor network and the initial parameters of the sample classifier network; Process the second training sample set through the feature extractor network to obtain the updated parameters of the feature extractor network and the updated parameters of the sample classifier network; Update the initial parameters of the feature extractor network through the updated parameters of the feature extractor network, and update the initial parameters of the sample classifier network through the updated parameters of the sample classifier network; Determine the multi-task loss function matching the data processing model; Based on the multi-task loss function, adjust the model parameters of the feature extractor network and the model parameters of the sample classifier network until the multi-task loss function corresponding to the data processing model reaches the corresponding convergence condition.
8. The method according to claim 1, wherein Determining the virtual scene travel route coordinates and auxiliary line coordinates corresponding to the virtual scene travel route according to the scale information matching the virtual scene image, the starting position coordinates and the ending position coordinates of the virtual scene travel route, includes: When the number of auxiliary lines corresponding to the virtual scene travel route is two, determining the distance between the two auxiliary lines corresponding to the virtual scene travel route according to the virtual scene, and determining the virtual scene travel route coordinates corresponding to the virtual scene travel route based on the distance between the two auxiliary lines corresponding to the virtual scene travel route; When the virtual scene travel route is in a horizontal or vertical state, determining the auxiliary line coordinates corresponding to the two auxiliary lines corresponding to the virtual scene travel route through the translation of the starting position coordinates and the ending position coordinates of the virtual scene travel route; When the virtual scene travel route is in an inclined state, determining the auxiliary line coordinates corresponding to the two auxiliary lines respectively through the rotation of the starting position coordinates and the ending position coordinates of the virtual scene travel route.
9. The method according to claim 8, wherein Presenting the virtual scene travel route and the corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinates and the auxiliary line coordinates, includes: Generating two auxiliary lines matching the virtual scene travel route based on the auxiliary line coordinates corresponding to the two auxiliary lines respectively, and presenting the virtual scene travel route and the corresponding auxiliary line in the game map in the virtual scene, or Generating two auxiliary lines matching the virtual scene travel route based on the auxiliary line coordinates corresponding to the two auxiliary lines respectively and the rotation angle, and presenting the virtual scene travel route and the corresponding auxiliary line in the game map in the virtual scene based on the rotation angle; Wherein, the rotation angle is determined when the virtual scene travel route is in an inclined state, and is determined based on the rotation of the starting position coordinates and the ending position coordinates of the virtual scene travel route.
10. The method according to claim 1, wherein The method further includes: Converting the game map in the virtual scene from the RGB (Red, Green, Blue) mode to the HSV (Hue, Saturation, Value) mode; Extracting the image of the area where the starting point of the virtual scene travel route is located based on the game map in the HSV mode; Successively performing Gaussian blur processing, morphological dilation processing, and morphological erosion processing on the image of the area where the starting point of the virtual scene travel route is located to obtain a first preprocessed image; Performing Hough circle detection processing on the first preprocessed image, and determining the coordinates of the center of the circle obtained through the Hough circle detection processing as the coordinates of the starting position of the virtual scene travel route.
11. The method according to claim 10, wherein The method further includes: Performing Gaussian blur processing on the image of the area where the ending point of the virtual scene travel route is located; Converting the result of the Gaussian blur processing from the RGB mode to the HSV mode to obtain the virtual scene travel route ending point in the HSV mode; Successively performing morphological dilation processing and morphological erosion processing on the image of the area where the virtual scene travel route ending point in the HSV mode is located to obtain a second preprocessed image; Perform contour detection processing on the second preprocessed image, and determine the coordinates of the centroid of the triangle obtained through the contour detection processing as the coordinates of the end position of the virtual scene travel route.
12. The method according to claim 1, wherein The virtual scene travel route coordinates and the auxiliary line coordinates present the virtual scene travel route and the corresponding auxiliary line in the virtual scene, including: Determine the presentation form of the virtual scene travel route according to the type of the virtual scene or the user level corresponding to the virtual scene; Adopt the presentation form of the virtual scene travel route to present the virtual scene travel route and the corresponding auxiliary line in the virtual scene.
13. A data processing device, wherein The device includes: An information transmission module, configured to obtain a virtual scene image in the virtual scene where the target object is located; An information processing module, configured to determine the map position coordinates and the map type parameters matching the virtual scene image when it is determined that the map identifier in the virtual scene image is in an open state; The information processing module is configured to determine the scale information matching the virtual scene image based on the map position coordinates and the map type parameters; extract the virtual scene travel route matching the virtual scene from the virtual scene image; The information processing module is configured to determine the starting position coordinates and the end position coordinates of the virtual scene travel route matching the virtual scene; The information processing module is configured to determine the virtual scene travel route coordinates and the auxiliary line coordinates corresponding to the virtual scene travel route according to the scale information matching the virtual scene image, the starting position coordinates and the end position coordinates of the virtual scene travel route; The information processing module is configured to present the virtual scene travel route and the corresponding auxiliary line in the virtual scene based on the virtual scene travel route coordinates and the auxiliary line coordinates.
14. An electronic device, characterized in that, The electronic device includes: A memory, configured to store executable instructions; A processor, configured to implement the data processing method according to any one of claims 1 to 12 when running the executable instructions stored in the memory.
15. A computer-readable storage medium storing executable instructions, characterized in that, The executable instructions, when executed by the processor, implement the data processing method according to any one of claims 1-12.
16. A computer program product comprising computer-executable instructions, characterized in that, The computer executable instructions, when executed by the processor, implement the data processing method according to any one of claims 1-12.
Citation Information
Patent Citations
Route indication method and equipment based on map in game and storage medium
CN109876442A
Route guiding method and device, storage medium and computer equipment
CN112546627A