CN113368493A - Virtual scene flow processing method and device, electronic equipment and storage medium - Google Patents

Virtual scene flow processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113368493A
CN113368493A CN202110631899.7A CN202110631899A CN113368493A CN 113368493 A CN113368493 A CN 113368493A CN 202110631899 A CN202110631899 A CN 202110631899A CN 113368493 A CN113368493 A CN 113368493A
Authority
CN
China
Prior art keywords
map
battle
virtual
fighting
observation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110631899.7A
Other languages
Chinese (zh)
Other versions
CN113368493B (en
Inventor
谢亚晋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shanghai Co Ltd
Original Assignee
Tencent Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shanghai Co Ltd filed Critical Tencent Technology Shanghai Co Ltd
Priority to CN202110631899.7A priority Critical patent/CN113368493B/en
Publication of CN113368493A publication Critical patent/CN113368493A/en
Application granted granted Critical
Publication of CN113368493B publication Critical patent/CN113368493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • A63F2300/535Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing for monitoring, e.g. of user parameters, terminal parameters, application parameters, network parameters
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/80Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
    • A63F2300/807Role playing or strategy games

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a flow processing method and device for a virtual scene, electronic equipment and a computer readable storage medium; the method comprises the following steps: monitoring flow data in a combat map of a virtual scene through at least one observation object associated with the combat map; the process for operating the virtual scene comprises a battle process and a fighting process different from the battle process, wherein a battle map is operated in the battle process; synchronizing the monitored flow data to at least one monitored object in the fighting process; and synchronizing the flow data to the fighting client associated with at least one monitoring object through at least one monitoring object in the fighting process so as to present a virtual scene corresponding to the flow data in the fighting client. Through this application, improve the stability of battle process and sight and fight process.

Description

Virtual scene flow processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to computer data processing technologies, and in particular, to a method and an apparatus for processing a flow in a virtual scene, an electronic device, and a computer-readable storage medium.
Background
The display technology based on the graphic processing hardware expands the perception environment and the channel for acquiring information, particularly the display technology of the virtual scene, can realize diversified interaction between virtual objects controlled by users or artificial intelligence according to the actual application requirements, has various typical application scenes, and can simulate the real fighting process between the virtual objects in the virtual scenes of military exercise simulation, games and the like.
In the network game, a spectator-battle mode is generally provided for spectator players to view the opponents in progress, and in the spectator mode, spectator players can acquire the competitive pictures of the battle players in the opponents, the grades of specific opponent characters, equipment information, and the like.
In the related art, the spectator and fighter players are transmitted into a fighting map, and the spectator and fighter players are located on the same map, so that the fighting state change of the fighter players is synchronized to the spectator and fighter players, and the spectator and fighter players can synchronously watch the opponents in the fighting. However, when many spectators appear in a short time, this method causes a sudden increase in the flow rate and affects the stability of the battle progress.
Disclosure of Invention
The embodiment of the application provides a flow processing method and device for a virtual scene, electronic equipment and a computer readable storage medium, which are used for realizing the separation of a fighting process and improving the stability of the fighting process and the fighting process.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a flow processing method for a virtual scene, which comprises the following steps:
monitoring traffic data in a combat map of a virtual scene through at least one observation object associated with the combat map;
wherein, the process of operating the virtual scene comprises a battle process and a battle watching process different from the battle process, and the battle process operates the battle map;
synchronizing the monitored flow data to at least one monitored object in the fighting process;
and synchronizing the flow data to a spectator client associated with at least one monitoring object through the at least one monitoring object in the spectator process so as to present a virtual scene corresponding to the flow data in the spectator client.
In the above technical solution, the synchronizing the monitored traffic data to at least one monitored object in the spectator fighting process includes:
merging the flow data respectively monitored by the at least one observation object to obtain merged flow data;
synchronizing the merged traffic data to a listening object associated with the at least one observation object.
In the above technical solution, before monitoring the traffic data in the battle map through at least one observation object associated with the battle map of the virtual scene, the method further includes:
acquiring a related object of the at least one observation object;
associating the at least one viewing object with a map grid in the combat map, respectively, when the associated object characterizes the map grid in the combat map;
when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map.
In the above technical solution, the obtaining of the associated object of the at least one observation object includes:
when the frequency of the virtual character movement in the battle map is larger than a frequency threshold value, taking the virtual character in the battle map as an associated object of the at least one observation object;
when the frequency of the virtual character movement in the battle map is smaller than or equal to the frequency threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
In the above technical solution, the obtaining of the associated object of the at least one observation object includes:
calling a rate prediction model based on the fighting conditions of the virtual characters in the fighting map to obtain the number growth rate of the virtual characters in the fighting map;
when the growth rate of the number of the virtual characters is smaller than or equal to a rate threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object;
when the number of virtual characters increases by a rate greater than the rate threshold, a map grid in the battle map is taken as an associated object of the at least one observed object.
An embodiment of the present application provides a flow processing apparatus for a virtual scene, including:
the monitoring module is used for monitoring the flow data in a combat map through at least one observation object associated with the combat map of the virtual scene; wherein, the process of operating the virtual scene comprises a battle process and a battle watching process different from the battle process, and the battle process operates the battle map;
the first synchronization module is used for synchronizing the monitored flow data to at least one monitored object in the fighting process;
and the second synchronization module is used for synchronizing the flow data to a spectator client associated with at least one monitoring object through the at least one monitoring object in the spectator process so as to present a virtual scene corresponding to the flow data in the spectator client.
In the above technical solution, the first synchronization module is further configured to perform merging processing on the basis of the traffic data respectively monitored by the at least one observation object, so as to obtain merged traffic data;
synchronizing the merged traffic data to a listening object associated with the at least one observation object.
In the above technical solution, the apparatus further includes:
the association module is used for acquiring an associated object of the at least one observation object;
associating the at least one viewing object with a map grid in the combat map, respectively, when the associated object characterizes the map grid in the combat map;
when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map.
In the above technical solution, when the at least one observation object is respectively associated with the map grid in the battle map, the monitoring module is further configured to obtain event data of the map grid in the battle map through the observation object associated with the map grid in the battle map;
and when the event data of the map grid is updated, acquiring the flow data corresponding to the latest event data of the map grid.
In the above technical solution, when the at least one observation object is respectively associated with the map grid in the battle map, the first synchronization module is further configured to obtain a timestamp of flow data respectively monitored by the at least one observation object and a corresponding map grid coordinate;
and merging the traffic data with the same timestamp and adjacent map grid coordinates to obtain merged traffic data.
In the above technical solution, when the at least one observation object is respectively associated with the virtual character in the battle map, the monitoring module is further configured to obtain event data of the virtual character in the battle map through the observation object associated with the virtual character in the battle map;
and when the event data of the virtual role is updated, acquiring the flow data corresponding to the latest event data of the virtual role.
In the above technical solution, when the at least one observation object is respectively associated with the virtual character in the battle map, the first synchronization module is further configured to obtain a timestamp of flow data respectively monitored by the at least one observation object and a coordinate of the corresponding virtual character in the battle map;
and merging the traffic data which have the same timestamp and are adjacent to the corresponding virtual character in the coordinate of the battle map to obtain the merged traffic data.
In the above technical solution, the first synchronization module is further configured to obtain the number of virtual characters in the battle map that are in an activated state;
when the number of the virtual characters in the activated state is smaller than or equal to a number threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object;
when the number of the virtual characters in the activated state is larger than the number threshold value, taking a map grid in the battle map as an associated object of the at least one observation object.
In the above technical solution, the first synchronization module is further configured to, when the virtual characters are uniformly distributed in a battle map, use the virtual characters in the battle map as associated objects of the at least one observation object;
when the virtual characters are unevenly distributed in the battle map, the map grid in the battle map is used as an associated object of the at least one observation object.
In the above technical solution, the first synchronization module is further configured to, when the frequency of the virtual character movement in the battle map is greater than a frequency threshold, take the virtual character in the battle map as an associated object of the at least one observation object;
when the frequency of the virtual character movement in the battle map is smaller than or equal to the frequency threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
In the above technical solution, the first synchronization module is further configured to call a rate prediction model based on a fighting situation of a virtual character in the fighting map to obtain a number growth rate of the virtual character in the fighting map;
when the growth rate of the number of the virtual characters is smaller than or equal to a rate threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object;
when the number of virtual characters increases by a rate greater than the rate threshold, a map grid in the battle map is taken as an associated object of the at least one observed object.
In the above technical solution, the first synchronization module is further configured to store the merged traffic data into a data merge queue;
and the monitoring object associated with the at least one observation object acquires the merged traffic data from the data merging queue.
In the above technical solution, the apparatus further includes:
the control module is used for acquiring the occupation ratio of the sightseeing process in a total process, wherein the total process comprises the sightseeing process and the fighting process;
and carrying out process regulation and control based on the fighting strategy corresponding to the occupation ratio.
In the above technical solution, the control module is further configured to stop the spectator fighting process and the fighting process based on an overload protection strategy when the spectator fighting strategy corresponding to the occupancy ratio is the overload protection strategy;
when the observation strategy corresponding to the occupancy ratio is a stopping observation strategy, stopping the observation process based on the stopping observation strategy;
when the fighting strategy corresponding to the occupancy ratio is a fighting strategy for stopping adding, stopping adding a new fighting client based on the fighting strategy for stopping adding;
and when the fighting strategy corresponding to the occupancy ratio is a reduced view strategy, reducing the flow data based on the reduced view strategy.
An embodiment of the present application provides an electronic device for traffic processing, where the electronic device includes:
a memory for storing executable instructions;
and the processor is used for realizing the flow processing method of the virtual scene provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions for causing a processor to execute the method for processing a flow of a virtual scene provided in the embodiment of the present application.
The embodiment of the application has the following beneficial effects:
the flow data of the battle map is monitored through the observation object associated with the battle map, and the monitored flow data is transferred through the monitoring object, so that the battle progress is separated from the fighting progress, the stability of the battle progress and the fighting progress is improved, and the performance of the fighting progress for bearing the fighting client is improved.
Drawings
FIG. 1 is a schematic view of a spectator, provided in the related art, for conveying spectator players to a battle map;
FIG. 2 is a schematic view of a spectator, provided in the related art, for conveying spectator players to a separate spectator map;
fig. 3 is an application mode diagram of a traffic processing method for a virtual scene according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device for traffic processing provided in an embodiment of the present application;
5A-5B are schematic flow charts of a method for processing movement of a virtual object according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a map grid association provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of association with a virtual role provided by an embodiment of the present application;
8-10 are schematic diagrams of flow merging provided by embodiments of the present application;
FIG. 11 is a schematic diagram of a framework provided by an embodiment of the present application;
FIG. 12 is a schematic illustration of traffic redundancy provided by embodiments of the present application;
FIG. 13 is a schematic illustration of spectator traffic synchronization in different grids, as provided by an embodiment of the present application;
FIG. 14 is a diagram illustrating message merging and sharing provided by an embodiment of the present application;
fig. 15 is a schematic diagram of a fighting strategy provided in an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, references to the terms "first", "second", and the like are only used for distinguishing similar objects and do not denote a particular order or importance, but rather the terms "first", "second", and the like may be used interchangeably with the order of priority or the order in which they are expressed, where permissible, to enable embodiments of the present application described herein to be practiced otherwise than as specifically illustrated and described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Online Game (Online Game): the game is also called an online game, and refers to an electronic game in which a plurality of game players play interactive entertainment through a computer and the Internet.
2) Massively Multiplayer Online Role-Playing games (MMORPG), Multiplayer Online Role-Playing Game: an online game classified by the number of players. In a MMORPG, players can play one or more virtual characters and control the activity and behavior of the virtual character in the virtual world of the game.
3) Virtual scene: by utilizing the scene which is output by the equipment and is different from the real world, the visual perception of the virtual scene can be formed by naked eyes or the assistance of the equipment, such as a two-dimensional image output by a display screen, and a three-dimensional image output by a stereoscopic display technology such as a stereoscopic projection technology, a virtual reality technology and an augmented reality technology; in addition, various real-world-simulated perceptions such as auditory perception, tactile perception, olfactory perception, motion perception and the like can be formed through various possible hardware.
4) In response to: for indicating the condition or state on which the performed operation depends, when the condition or state on which the performed operation depends is satisfied, the performed operation or operations may be in real time or may have a set delay; there is no restriction on the order of execution of the operations performed unless otherwise specified.
5) A client: and an application program for providing various services, such as a Game Client (Game Client) and the like, a military exercise simulation Client, which is run in the terminal. The Game client is a program which corresponds to the Game Server and provides local service for Game players, and needs to be matched with the Game Server to operate, and the Game Server is a service software program which provides data calculation, verification, storage and forwarding functions for the Game client.
6) Virtual roles: various avatars in the virtual scene that can interact, or movable objects in the virtual scene. The movable object may be a virtual character, a virtual animal, an animation character, or the like. The avatar may be an avatar in the virtual scene that is virtual to represent the user. The virtual scene can comprise a plurality of virtual characters, and each virtual character has a shape and a volume in the virtual scene and occupies a part of the space in the virtual scene.
For example, the virtual Character may be a user Character controlled by an operation on the client, an Artificial Intelligence (AI) set in a virtual scene match by training, or a Non-user Character (NPC) set in a virtual scene interaction. For example, the virtual character may be a virtual character that has a competing interaction in a virtual scene. For example, the number of virtual characters participating in interaction in the virtual scene may be preset, or may be dynamically determined according to the number of clients participating in interaction.
Taking a shooting game as an example, the user may control the virtual character to freely fall, glide or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bow to move on the land, or control the virtual character to swim, float or dive in the sea, or the like, and of course, the user may also control the virtual character to move in the virtual scene by riding a virtual vehicle, for example, the virtual vehicle may be a virtual car, a virtual aircraft, a virtual yacht, or the like, which is only exemplified by the above-mentioned scenes, but the present invention is not limited thereto. The user can also control the virtual character to carry out antagonistic interaction with other virtual characters through the virtual prop, for example, the virtual prop can be a throwing type virtual prop such as a grenade, a beaming grenade and a viscous grenade, and can also be a shooting type virtual prop such as a machine gun, a pistol and a rifle, and the type of the virtual prop is not specifically limited in the application.
7) And (4) process: a program with certain independent functions (a run activity on a certain data set). It is the basic unit that the operating system executes dynamically, and in the operating system, the process is the basic allocation unit as well as the basic execution unit. The progress comprises a fighting progress and a fighting progress, the fighting progress and the watching progress are operated in a map, the fighting progress represents codes for processing various visual angle switching of fighting players and the like, and the fighting progress represents codes for processing a large number of fighting states of fighting players, such as fighting, blood volume deduction and the like.
8) And (3) observation mode: a behavior pattern is capable of automatically notifying other associated objects when the state of an object changes, so as to automatically refresh the state of the object. The observation mode provides a means for associated objects to synchronize communications, keeping state synchronization between an object and other objects that depend on it.
The observation mode comprises an observation object and a monitoring object, wherein the observation object is an instance object established in a battle progress and is used for managing various memory resources required by a battle logic and monitoring a state event (flow data) of a battle map in the battle progress; the monitoring object is an instance object established in the fighting process and used for managing various memory resources required by the fighting logic, receiving the state event sent by the observation object and forwarding the state event to the fighting client.
9) Block chains: the method comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, new blocks cannot be removed once being added into a Block chain, and recorded data submitted by nodes in the Block chain system are recorded in the blocks.
In the network game, a spectator-battle mode is usually provided for spectator players to watch the opponents in progress, in the spectator mode, spectator players can obtain the competitive pictures of battle players in the opponents, the grades of specific opponent characters, equipment information and the like, spectator players can watch the battles, battles and competitions from the side, and spectator players do not participate in the battles. In the related art, the following two schemes are available for realizing the fighting mode:
first, as shown in fig. 1, a spectator player 101 (corresponding to an example object) is transmitted into a battle map example 102, the spectator player and a battle player 103 (corresponding to an example object) are in a map, the state change of the battle player is synchronized to the spectator player, and the spectator player can directly receive the state traffic data due to the state traffic data (including a mobile packet and a skill packet) of the battle player in the battle map, and then present a game picture based on the state traffic data. This solution supports perhaps two hundred spectators per battle map, but it appears that many spectator players are grouped together. When a large number of spectators gather, from the perspective of the server, the broadcast volume of the mobile packages and the skill packages increases quadratically along with the increase of the number of spectators, so that stress is applied to a Central Processing Unit (CPU) and a network, and certain optimization strategies (such as lossy service) need to be applied in a matched manner to reduce the stress; from the perspective of the client, rendering is complicated due to too many people, and the picture quality needs to be reduced for smoothness (during rendering, the fighter can shield the flow data of the fighting player, so that rendering is performed based on the flow data of the fighter only). The competition of the fighting players is influenced by the spectator player, and the fighting players are somewhat lost.
In the second scheme, as shown in fig. 2, map latitude separation is adopted to separate a spectator-fighting player 201 from a fighting player 202, a spectator-fighting map is specially provided for the spectator-fighting player, the fighting player is in the fighting map, then the state change of the fighting player is synchronized to the spectator-fighting player, and in order to reduce the spectator-fighting delay, the spectator-fighting map and the fighting map are created in the same process (one process comprises one fighting map and a plurality of spectator-fighting maps). The scheme reduces the number of people in the same map, reduces synchronous flow, and avoids the influence of spectator players on the fighting logic in the fighting map, wherein, because the number of spectator players is far greater than the number of fighting people, a large number of spectator players need to be contained in the spectator map (one spectator map can contain a plurality of spectator players). However, the number of maps that can be accommodated by the same process is limited, and for battle fighting in a playoff, the number of people in battle fighting is large, and the process cannot create enough maps to enable players to fight, which seriously affects experience.
In conclusion, the first scheme is simple to implement, but the spectator players can influence the fighting logic in the fighting map and are easy to generate errors, and the number of people on the same fighting map is increased, so that the visual field synchronous flow of the spectator players is increased; and the second scheme can reduce the flow consumption, can not influence the fighting logic in the fighting map, but limits the number of spectators to the number of maps which can be created by the progress, and influences the upper limit of the number of spectators to the fighters.
In order to solve the above problem, embodiments of the present application provide a method and an apparatus for processing a flow in a virtual scene, an electronic device, and a computer-readable storage medium, which can implement separation of a battle progress and a fighting progress, and improve stability of the battle progress and the fighting progress. An exemplary application of the electronic device provided in the embodiments of the present application is described below, and the electronic device provided in the embodiments of the present application may be implemented as various types of user terminals such as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device, and a vehicle-mounted terminal), and may also be implemented as a server. In the following, an exemplary application will be explained when the device is implemented as a server.
In order to facilitate easier understanding of the traffic processing method for a virtual scene provided in the embodiments of the present application, an exemplary implementation scenario of the traffic processing method for a virtual scene provided in the embodiments of the present application is first described, and the virtual scene may be output completely based on terminal output or based on cooperation between a terminal and a server.
In some embodiments, the virtual scene may be a picture presented in a military exercise simulation, and a user may simulate a tactic, a strategy or a tactics through virtual objects belonging to different teams in the virtual scene, so that the virtual scene has a great guiding effect on the command of military operations.
In some embodiments, the virtual scene may be an environment for game characters to interact with, for example, game characters to play against in the virtual scene, and the two-way interaction may be performed in the virtual scene by controlling the actions of the virtual objects, so that the user can relieve the life pressure during the game.
In an implementation scenario, referring to fig. 3, fig. 3 is a schematic diagram of an application mode of a traffic processing method for a virtual scenario provided in an embodiment of the present application, and the application mode is applied to a terminal (illustratively, a combat terminal 400-1 and a spectator terminal 400-2) and a server 200, and is adapted to complete virtual scenario calculation depending on the calculation capability of the server 200 and output the virtual scenario at the terminal.
Taking the visual perception of forming the virtual scene 100 as an example, the server 200 performs calculation of display data related to the virtual scene and sends the calculated display data to the terminal, the terminal depends on the graphic calculation hardware to complete loading, analysis and rendering of the calculated display data, and depends on the graphic output hardware to output the virtual scene to form the visual perception, for example, a two-dimensional video frame can be presented on a display screen of a smart phone, or a video frame realizing a three-dimensional display effect is projected on a lens of augmented reality/virtual reality glasses; for perception in the form of a virtual scene, it is understood that an auditory perception may be formed by means of a corresponding hardware output of the terminal, e.g. using a microphone output, a tactile perception using a vibrator output, etc.
By way of example, the combat terminal 400-1 runs a combat client 410-1 (e.g., a web-based game application, a game application for a vehicle-mounted terminal), by connecting the game server (i.e., the server 200) to play game interaction with other users, the combat terminal 400-1 outputs the virtual scene 100 of the combat client 410-1, including target virtual object 110 and virtual object 120, target virtual object 110 may be a game character controlled by a combat player, i.e., the target virtual object 110 is controlled by the real player, will operate in the virtual scene in response to the real player's operation of buttons (including rocker buttons, attack buttons, defense buttons, etc.), for example, when a real user moves the joystick to the left, the target virtual object will move to the left in the virtual scene, and may also remain stationary, jump, and use various functions (such as skills and props); the virtual object 120 may be an obstacle in the virtual scene, for example, the target virtual object 110 may be moved by moving the rocker button 130 around the virtual object 120 to avoid passing through the obstacle, affecting the reliability of the human-machine interaction in the virtual scene.
Wherein the spectator terminal 400-2 runs a spectator client 410-2 (e.g., a network-based game application, a game application of a vehicle-mounted terminal), by listening to the objects to select the perspective of the combat client 410-1, and synchronizing the virtual scene of the combat client 410-1 by connecting to the game server (i.e., server 200), that is, the server 200 monitors traffic data in the battle map (e.g., status changes such as the target virtual object 110 moving around the virtual object 120) through the observation object associated with the battle map of the virtual scene 100, synchronizes the monitored traffic data to the monitoring object in the progress of the battle, by listening to the objects to synchronize traffic data to the spectator client 410-2, the spectator client 410-2 presents the corresponding virtual scene 100 based on the traffic data, e.g., the target virtual object 110 moves around the virtual object 120.
In some embodiments, the electronic device may implement the traffic processing method of the virtual scene provided in the embodiments of the present application by running a computer program, for example, the computer program may be a native program or a software module in an operating system; may be a local (Native) Application program (APP), i.e. a program that needs to be installed in an operating system to run, such as a game APP; or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also a game applet that can be embedded in any APP. In general, the computer programs described above may be any form of application, module or plug-in.
The embodiments of the present application may be implemented by means of Cloud Technology (Cloud Technology), which refers to a hosting Technology for unifying series resources such as hardware, software, and network in a wide area network or a local area network to implement data calculation, storage, processing, and sharing.
The cloud technology is a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied based on a cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources.
As an example, the server 200 may be an independent physical server, may be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server 200 may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited thereto.
In some embodiments, multiple servers may be grouped into a blockchain, and the server 200 is a node on the blockchain, and there may be an information connection between each node in the blockchain, and information transmission between the nodes may be performed through the information connection. Data (for example, traffic processing logic, monitored traffic data, and the like) related to the traffic processing method for the virtual scenario provided in the embodiment of the present application may be stored in the block chain.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device for traffic processing provided in an embodiment of the present application, and is described by taking the electronic device as a server as an example, where the electronic device shown in fig. 4 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in electronic device 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in fig. 4.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450, for example, comprises one or more storage devices physically located remote from processor 410.
The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 453 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the traffic processing device of the virtual scene provided in this embodiment of the present application may be implemented in software, and fig. 4 illustrates the traffic processing device 455 of the virtual scene stored in the memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: a listening module 4551, a first synchronization module 4552, a second synchronization module 4553, an association module 4554, and a regulation module 4555, which are logical and thus may be arbitrarily combined or further divided according to the functions implemented, and the functions of the respective modules will be described below.
As described above, the traffic processing method for a virtual scene provided in the embodiments of the present application may be implemented by various types of electronic devices, for example, a server. Referring to fig. 5A, fig. 5A is a schematic flowchart of a method for processing movement of a virtual object according to an embodiment of the present application, and is described with reference to the steps shown in fig. 5A.
In the following steps, the virtual character can freely fall, glide or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bow to move ahead on the ground, and can perform antagonistic interaction with other virtual characters. The virtual character may be a user character controlled by a battle player through an operation on the client, for example, a virtual character performing a countermeasure interaction in a virtual scene, or a non-user character provided in the virtual scene interaction.
The battle map is an example created in a battle process and used for presenting a virtual scene, for example, objects such as scenes, buildings, virtual characters and the like exist in the battle map.
The process of operating the virtual scene comprises a battle process and a fighting process different from the battle process, the battle process and the fighting process are independent, a battle map is operated in the battle process, and a monitoring object is created in the fighting process. The spectator progress represents codes for handling various view angle switching of spectator players, and the fighting progress represents codes for handling a large amount of fighting states such as fighting of fighting players and blood volume deduction. The monitoring object is an instance object established in the fighting process and used for managing various memory resources required by the fighting logic, receiving the state event sent by the observation object and forwarding the state event to the fighting client.
In step 101, traffic data in a combat map of a virtual scene is monitored through at least one viewing object associated with the combat map.
The flow data, namely the flow packet, represents a state event occurring in the battle map, the flow packet includes a mobile packet, a skill packet and a view packet, for example, the mobile packet includes a motion event of a virtual character in the virtual scene, namely, the virtual character freely falls from the sky, glides or opens a parachute to fall, runs on the ground, jumps, crawls, bends to move ahead and the like, the skill packet includes a skill released by the virtual character, a state of the skill and the like, and the view packet includes a virtual scene in the view field in which a real player controls the virtual character, for example, a landscape, an obstacle, an opponent and the like which can be seen by the virtual character.
In some embodiments, through at least one observation object associated with a battle map of a virtual scene, before monitoring traffic data in the battle map, an associated object of the at least one observation object is obtained; when the associated object represents a map grid in the battle map, associating the at least one observation object with the map grid in the battle map respectively; when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map.
For example, before the observation object monitors the traffic data, the associated object of the observation object is determined, the associated object may be a virtual character in a battle map or a map grid in the battle map (i.e. the battle map is divided into a plurality of map grids), when the associated object is the map grid in the battle map, at least one observation object is respectively associated with the map grids in the battle map, and then the traffic data generated by the map grids of the battle map is monitored through at least one observation object associated with the map grids of the battle map; when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map, and then the flow data generated by the virtual characters in the battle map is monitored through the at least one observation object associated with the virtual characters in the battle map.
In some embodiments, monitoring traffic data in a combat map of a virtual scene through at least one viewing object associated with the combat map while the at least one viewing object is respectively associated with a map grid in the combat map comprises: acquiring event data of a map grid in a battle map through an observation object associated with the map grid in the battle map; and when the event data of the map grid is updated, acquiring the flow data corresponding to the latest event data of the map grid.
For example, before the observation object is associated with the map grid in the battle map, the battle map is divided into a plurality of map grids, wherein the division granularity is negatively related to the progress of the battle, and when the progress of the battle is more idle, the division granularity of the battle map is thinner, so that the progress is fully utilized, the effect of the battle is improved, and more battle details can be seen. Each map grid in the battle map can be respectively associated with an observation object, or a part of map grids in the battle map can be associated with the observation object, when a certain part of map grids do not generate flow data within a period of time, the part of map grids are in an idle state, and the association between the part of map grids and the observation object can be cancelled.
As shown in fig. 6, the observation object 1 is associated with the map grid 601 in the battle map, the observation object 2 is associated with the map grid 602 in the battle map, and the observation object 3 is associated with the map grid 603 in the battle map, so that the observation object acquires event data of the map grid in the battle map in real time (an event occurring in real time, for example, an event such as a virtual character picking up a virtual item in the map grid), and when the event data of the map grid 601 is updated, the observation object 1 acquires traffic data corresponding to the latest event data of the map grid 601.
In some embodiments, monitoring traffic data in a combat map of a virtual scene through at least one viewing object associated with the combat map while the at least one viewing object is respectively associated with a virtual character in the combat map comprises: acquiring event data of virtual characters in a battle map through observation objects related to the virtual characters in the battle map; and when the event data of the virtual role is updated, acquiring the flow data corresponding to the latest event data of the virtual role.
For example, before the virtual character is associated with the map grid in the battle map, each virtual character in the battle map is associated with the observation object, or a part of virtual characters in the battle map is associated with the observation object, when a certain part of virtual characters does not generate flow data within a period of time, the part of virtual characters are in an idle state or a killing state, that is, the association between the part of virtual characters and the observation object can be cancelled.
As shown in fig. 7, the observation object 1 is associated with the virtual character 701 in the battle map, the observation object 2 is associated with the virtual character 702 in the battle map, and the observation object 3 is associated with the virtual character 703 in the battle map, and the observation object acquires event data of the virtual character in the battle map in real time (an event occurring in real time, for example, an event such as a virtual item being picked up by the virtual character or a flight from the ground to a jump station), and when the event data of the virtual character 701 is updated, the observation object 1 acquires traffic data corresponding to the latest event data of the virtual character 701.
In some embodiments, obtaining the associated object of the at least one observed object comprises: acquiring the number of virtual characters in an activated state in a battle map; when the number of the virtual characters in the activated state is less than or equal to a number threshold value, taking the virtual characters in the battle map as associated objects of at least one observation object; and when the number of the virtual characters in the activated state is larger than the number threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
For example, before the observation object monitors the traffic data, the associated object of the observation object may be determined based on the number of the virtual characters in the activated state in the battle map, and when the number of the virtual characters in the activated state is less than or equal to the number threshold, it is indicated that the number of the virtual characters in the activated state in the battle map is relatively small, the number of the pictures of the virtual characters that the spectator needs to watch is relatively small, and the virtual characters in the battle map may not affect the battle progress because the virtual characters affect the battle progress, and thus the virtual characters in the battle map may be used as the associated object of the observation object; when the number of the virtual characters in the activated state is larger than the number threshold, it is indicated that the number of the virtual characters in the activated state in the battle map is large, the number of the pictures of the virtual characters required to be watched by the spectator player is large, and the battle progress may be affected, so that the map grid in the battle map can be used as the related object of the observation object.
In some embodiments, obtaining the associated object of the at least one observed object comprises: when the virtual characters are uniformly distributed in the battle map, the virtual characters in the battle map are used as associated objects of at least one observation object; when the virtual characters are unevenly distributed in the battle map, the map grids in the battle map are used as the associated objects of at least one observation object.
For example, before the observation object monitors the traffic data, the associated object of the observation object may be determined based on the distribution of the virtual character in the battle map, and when the virtual character is uniformly distributed in the battle map, it is indicated that the virtual character exists at each position of the battle map, and in order to accurately track the view angle of the virtual character, the virtual character in the battle map may be used as the associated object of the observation object; when the virtual characters are unevenly distributed in the battle map, the virtual characters are concentrated at certain positions of the battle map, and in order to solve the problem of traffic redundancy caused by excessive fighter population, a map grid in the battle map can be used as a related object of an observation object.
In some embodiments, obtaining the associated object of the at least one observed object comprises: when the frequency of the virtual character movement in the battle map is larger than a frequency threshold value, taking the virtual character in the battle map as a related object of at least one observation object; and when the frequency of the virtual character movement in the battle map is less than or equal to the frequency threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
For example, before the observation object monitors the traffic data, the associated object of the observation object may be determined based on the frequency of the virtual character movement in the battle map, and when the frequency of the virtual character movement in the battle map is greater than a frequency threshold, it is indicated that the movement track of the virtual character is relatively wide, the virtual character may exist at each position of the battle map, and in order to accurately and efficiently track the view angle of the virtual character, the virtual character in the battle map may be used as the associated object of the observation object; when the frequency of the virtual character movement in the battle map is smaller than or equal to the frequency threshold value, the movement tracks of the virtual character are concentrated, and in order to solve the problem of traffic redundancy caused by excessive fighter number, the map grid in the battle map can be used as a related object of an observation object.
In some embodiments, obtaining the associated object of the at least one observed object comprises: calling a rate prediction model based on the fighting conditions of the virtual characters in the fighting map to obtain the number growth rate of the virtual characters in the fighting map; when the growth rate of the number of the virtual characters is smaller than or equal to the rate threshold value, taking the virtual characters in the battle map as associated objects of at least one observation object; and when the growth rate of the number of the virtual characters is larger than the rate threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
For example, a rate prediction model is used for carrying out growth rate prediction processing on combat situations (such as blood volume, skill state and virtual item holding level of each virtual character) of the virtual characters in a combat map to obtain the growth rate of the number of the virtual characters in the combat map, and when the growth rate of the number of the virtual characters is smaller than or equal to a rate threshold value, the virtual characters in the combat map are fewer in a future period of time, so that the virtual characters in the combat map can be used as related objects of an observation object; when the growth rate of the number of the virtual characters is larger than the rate threshold value, the fact that the number of the virtual characters in the battle map is large in a period of time in the future is shown, the situation that the virtual characters cannot be fed back in time in a period of time is avoided, and the map grid in the battle map can be used as a related object of the observation object in advance, so that the observation object is related to the map grid. The rate prediction model can be a trained neural network model, and the neural network model can be trained based on combat situation samples and the number growth rate of the markers.
In step 102, the monitored traffic data is synchronized to at least one monitored object in the spectator process.
For example, after the observation object monitors the traffic data, the observation object synchronizes the monitored traffic data to at least one monitoring object in the fighting progress, thereby preventing the fighting logic from being influenced by the fighting logic due to the crossing part between the fighting progress and the fighting progress.
Referring to fig. 5B, fig. 5B is a schematic flowchart of a flow processing method for a virtual scene according to an embodiment of the present application, and fig. 5B shows that step 102 of fig. 5A may be implemented through steps 1021 to step 1022: in step 1021, merging the traffic data respectively monitored by at least one observation object to obtain merged traffic data; in step 1022, the merged traffic data is synchronized to a listening object associated with the at least one observation object.
For example, there may be repeated portions between traffic data respectively heard by at least one observer, which cause traffic redundancy, thereby affecting the progress of the process. In order to solve the problem of traffic redundancy, the traffic data respectively monitored by at least one observation object is merged to delete the repeated traffic data, the merged traffic data is synchronized to the monitoring object associated with the at least one observation object, and the transmission process of the traffic data is accelerated based on the reduced traffic data.
In some embodiments, when at least one observation object is respectively associated with a map grid in a battle map, performing a merging process based on traffic data respectively monitored by the at least one observation object to obtain merged traffic data, including: acquiring timestamps of flow data respectively monitored by at least one observation object and corresponding map grid coordinates; and merging the traffic data with the same timestamp and adjacent map grid coordinates to obtain merged traffic data.
For example, when an observation object is associated with a map grid in a battle map, because traffic data (including a view field packet) generated by adjacent map grids are partially overlapped, a timestamp of the monitored traffic data and corresponding map grid coordinates are acquired, the traffic data with the same timestamp and adjacent map grid coordinates are merged to delete repeated traffic data, and the merged traffic data is synchronized to the monitoring object associated with at least one observation object, so that merging and sharing of the traffic packets are realized, and traffic synchronization overhead is greatly reduced.
As shown in fig. 8, if observation object 1 is associated with map grid 601 in the battle map, observation object 2 is associated with map grid 602 in the battle map, and observation object 3 is associated with map grid 603 in the battle map, then there is a partial overlap in traffic data generated by map grid 601, map grid 602, and map grid 603 monitored at the same time, the traffic data of monitored map grid 601, map grid 602, and map grid 603 are merged to delete duplicate traffic data, and the merged traffic data is synchronized to the monitoring object associated with at least one observation object, so as to implement merging and sharing of traffic packets, thereby greatly reducing the overhead of traffic synchronization.
In some embodiments, when at least one observation object is respectively associated with a virtual character in a battle map, performing a merging process based on traffic data respectively monitored by the at least one observation object to obtain merged traffic data, including: acquiring time stamps of flow data respectively monitored by at least one observation object and coordinates of corresponding virtual characters in a battle map; and merging the traffic data which have the same timestamp and are adjacent to the corresponding virtual character in the coordinate in the battle map to obtain merged traffic data.
For example, when the observation object is associated with a virtual character in a battle map, because the traffic data (including the view field packets) generated by the adjacent virtual character are partially overlapped, a timestamp of the monitored traffic data and the coordinates of the corresponding virtual character in the battle map are acquired, the traffic data with the same timestamp and the corresponding virtual character adjacent to the coordinates in the battle map are merged to delete the repeated traffic data, and the merged traffic data are synchronized to the monitoring object associated with at least one observation object, so that merging and sharing of the traffic packets are realized, and the overhead of traffic synchronization is greatly reduced.
As shown in fig. 9, when the observation object 1 is associated with the virtual character 701 in the battle map, the observation object 2 is associated with the virtual character 702 in the battle map, and the observation object 3 is associated with the virtual character 703 in the battle map, if the coordinates of the virtual character 701, the virtual character 702, and the virtual character 703 monitored at the same time are adjacent to each other in the battle map, it is monitored that there is a partial overlap in the traffic data generated by the virtual character 701, the virtual character 702, and the virtual character 703, the traffic data of the monitored virtual character 701, the virtual character 702, and the virtual character 703 are merged to delete the duplicate traffic data, and the merged traffic data is synchronized to the monitoring object associated with at least one observation object, so as to merge and share the traffic packets, thereby greatly reducing the overhead of traffic synchronization.
In some embodiments, synchronizing the merged traffic data to a listening object associated with the at least one observation object comprises: storing the merged flow data into a data merging queue; and the monitoring object associated with at least one observation object acquires the merged traffic data from the data merging queue.
As shown in fig. 10, after merging the traffic data respectively monitored by at least one observation object to obtain merged traffic data, the merged traffic data is stored in a data merging queue, and the monitoring object associated with the at least one observation object obtains the merged traffic data from the data merging queue by using the first-in first-out characteristic of the queue, so as to obtain real-time traffic data in time based on the characteristics of the queue.
In step 103, the traffic data is synchronized to the spectator client associated with the at least one monitor object through the at least one monitor object in the spectator process, so as to present a virtual scene corresponding to the traffic data in the spectator client.
For example, after the observation object monitors the traffic data, the observation object synchronizes the monitored traffic data to the monitoring object in the fighting process, and synchronizes the traffic data to the fighting client associated with the monitoring object through the monitoring object, thereby preventing the fighting process and the fighting process from having a cross part, preventing the fighting logic from influencing the fighting logic, improving the stability of the fighting process and the fighting process, and improving the performance of the fighting process for bearing the fighting client based on the traffic data transferred by at least one associated monitoring object.
In some embodiments, an occupation ratio of a spectator fighting process in a total process is obtained, wherein the total process comprises a spectator fighting process and a battle fighting process; and carrying out process regulation and control based on the fighting strategy corresponding to the occupation ratio.
For example, the occupation ratio of the spectator and fighting process in the total process is the occupation ratio of the spectator and fighting process in a central processing unit (including spectator and fighting processes and the like), when the occupation ratio of the spectator and fighting process in the total process is higher, the spectator and fighting process occupies more central processing units, and the central processing unit mainly processes the spectator and fighting process, so that different strategies are selected corresponding to different central processing unit processing pressures to ensure the stability of the server.
In some embodiments, when the fighting strategy corresponding to the occupancy ratio is the overload protection strategy, stopping the fighting process and the fighting process based on the overload protection strategy; when the observation strategy corresponding to the occupancy ratio is a stopping observation strategy, stopping the observation process based on the stopping observation strategy; when the observation strategy corresponding to the occupancy ratio is the observation strategy for stopping adding, stopping adding a new observation client based on the observation strategy for stopping adding; and when the fighting strategy corresponding to the occupation ratio is a reduced view strategy, reducing the flow data based on the reduced view strategy.
As shown in fig. 15, when the occupancy ratio reaches 100%, an overload protection strategy is adopted to stop the fighting process and the watching process, and the process processed by the central processing unit is adjusted; when the occupation ratio reaches 90%, adopting a strategy of stopping the observation and fighting to stop the observation and fighting process; when the occupation ratio reaches 80%, adopting a strategy of stopping adding the spectator warfare to stop adding a new spectator warfare client; when the occupancy ratio reaches 70%, a visual field reduction strategy is adopted to reduce the size of the flow data.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
In the network game, a spectator-battle mode is usually provided for spectator players to watch the opponents in progress, in the spectator mode, spectator players can obtain the competitive pictures of battle players in the opponents, the grades of specific opponent characters, equipment information and the like, spectator players can watch the battles, battles and competitions from the side, and spectator players do not participate in the battles.
In the realization mode of the related technology, the spectator and fighter players can influence the fighting logic in the fighting map and are easy to generate errors, and the number of people on the same fighting map is increased, so that the visual field synchronous flow of the spectator and fighter players is increased; the number of spectators is limited by the number of maps that can be created by the process, affecting the upper limit of the number of spectators.
In order to solve the above problems, an embodiment of the present application provides a method for processing traffic in a virtual scene, which solves the problem of influence of a spectator-fighting logic on a fighting logic (i.e., influence of a spectator-fighting process on a fighting process) through an observation object agent scheme, solves the problem that spectators are limited by the bearing problem of the process and a map, introduces a message merging scheme, and alleviates the traffic synchronization problem caused by a large number of spectators.
The following describes a traffic processing method for a virtual scene according to an embodiment of the present application:
as shown in fig. 11, the observation object can be associated with various entities in the battle map (such as virtual characters in the battle), monitor events (traffic data) generated on the entities, and forward to the registered monitoring object (instance object created in the battle process for managing various memory resources required by the battle logic). The monitoring object (Agent) receives the event from the observation object and sends the event to the client (namely, the spectator), and the client can switch the spectator view angle by switching the related monitoring object. One observation object can register a plurality of monitoring objects which are in a one-to-many relationship, the monitoring objects are established on other fighting progress (GameSvr), the number of the GameSvr can be adjusted according to the number of spectators to bear enough monitoring objects, the CPU and the network performance of the fighting progress (BattleSvr) are prevented from being influenced, the fighting logic and the fighting logic are separated, the fighting player is ensured not to be influenced by the number of spectators, and the fighting experience is ensured.
If each fighting player is associated with 1 observation object, the number of the fighting people is increased, the number of the observation objects is also increased, and finally the network traffic of the observation objects synchronized to the monitoring objects is increased greatly, as shown in fig. 12, 2 fighting players in 3 fighting players are very close to each other, so that when the fighting players visit the virtual characters controlled by the two fighting players close to each other, the visual fields seen by the fighting players are basically the same, namely, the visual field packets (Pkg) (the traffic packets include the visual field packets, the mobile packets, the skill packets and the like), and if each fighting player still hangs 1 observation object, the redundant traffic of the visual field synchronization is caused.
In order to solve the problem of redundancy of view synchronization traffic, the embodiment of the present application optimizes network performance by merging redundant traffic. The flow merging scheme is specifically described as follows:
firstly, the combat map is divided into 3 × 3 square grids, that is, the combat map is divided into 9 grids, the combat map is not limited to the 3 × 3 square grids, and each observation object is not mounted on a combat player but mounted on a grid where the combat player is located, wherein the scheme that the observation object is mounted on a game character is suitable for a scene with a small number of combat people, and the scheme that the observation object is mounted on the grid is used for solving the problem of traffic redundancy caused by an excessive number of combat people.
Therefore, if a large number of fighting players are concentrated in one grid, only 1 observation object needs to be mounted on one grid concentrated by the large number of fighting players, and the spectator players can enjoy the fighting pictures of the large number of fighting players. As shown in fig. 13, the battle players are actor _ list, and if the battle players are concentrated in two grids, and each observation object is mounted on the grid where the battle player is located, only two synchronous view field packets are provided at the same time, namely, Pkg1 and Pkg2, and the two view field packets are synchronized according to the grids where the battle players are located, so as to solve the problem of traffic redundancy caused by too many battle players.
For example, a battle player at the junction of two grids, although mounted by two different observers, has similar view packages, so that the traffic can be optimized. As shown in fig. 14, the grids on which 3 observation objects are mounted are close to each other, and 3 observation objects (observers) are involved, in the message cache, the traffic packets of the 3 observation objects are extracted, similar traffic packets are merged and duplicate traffic packets are deleted, and then the merged and deleted traffic packets are stored in the data merge queue, so that merging and sharing of the traffic packets are realized, and the overhead of traffic synchronization is greatly reduced.
As shown in fig. 14, the observation object mounted on each grid caches the traffic packets in the grid in its own cache queue, and the spectator process extracts the traffic packets from the cache queue one by one, compares the grid identification gridd (each grid has a unique identification for representing a unique identity) of each traffic packet, and the timestamp generated by the traffic packet. Merging the flow packets with the same timestamp and adjacent grid identifications, deleting repeated data, only reserving 1 flow packet, and then putting the flow packets into a data merging queue, wherein the data merging queue is sequenced by the timestamp.
In order to prevent the number of spectators from increasing infinitely, especially during a playoff period, the number of spectators increases steeply compared with the ordinary time, occupancy rates of spectator and battle processes (GameSvr) in a CPU (including spectator and battle processes and the like) are counted, as shown in FIG. 15, different occupancy rates trigger different spectator and battle strategies, and overload protection is triggered when the occupancy rate of the CPU reaches 100%; when the CPU occupancy rate reaches 90%, triggering a fighting stopping strategy and directly stopping a fighting system; the CPU occupancy rate reaches 80%, and new spectator and battle players are prohibited from entering the spectator and battle system; when the CPU occupancy reaches 70%, the view range is reduced, thereby reducing the size of the view packet. Different strategies are selected by different pressures to ensure stability of the server.
In summary, the traffic processing method for the virtual scene provided in the embodiment of the present application has the following beneficial effects:
1) the fighting logic and the fighting logic are separated through the observation object agent scheme, so that the problem of influence of the fighting logic on the fighting logic is solved, the fighting players are not influenced by the number of spectators and the fighting experience is ensured;
2) the problem that the number of spectators is limited by the progress and the bearing of a map is solved, and the upper limit of the number of spectators is improved;
3) the message merging scheme is introduced to realize merging and sharing of the flow packets, so that the flow synchronization overhead is greatly reduced, and the problem of flow synchronization caused by a large number of spectators is solved.
The method for processing the traffic of the virtual scene provided by the embodiment of the present application is described with reference to the exemplary application and implementation of the electronic device provided by the embodiment of the present application, and a scheme for implementing the traffic processing of the virtual scene by matching each module in the traffic processing device 455 of the virtual scene provided by the embodiment of the present application is continuously described below.
A monitoring module 4551, configured to monitor traffic data in a battle map of a virtual scene through at least one observation object associated with the battle map; wherein, the process of operating the virtual scene comprises a battle process and a battle watching process different from the battle process, and the battle process operates the battle map; a first synchronization module 4552, configured to synchronize the monitored traffic data to at least one monitored object in the spectator process; a second synchronization module 4553, configured to synchronize the traffic data to a spectator client associated with at least one monitoring object in the spectator process through the at least one monitoring object, so as to present a virtual scene corresponding to the traffic data in the spectator client.
In some embodiments, the first synchronization module 4552 is further configured to perform merging processing on traffic data respectively monitored by the at least one observation object, so as to obtain merged traffic data; synchronizing the merged traffic data to a listening object associated with the at least one observation object.
In some embodiments, the apparatus further comprises: an association module 4554 configured to obtain an associated object of the at least one observation object; associating the at least one viewing object with a map grid in the combat map, respectively, when the associated object characterizes the map grid in the combat map; when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map.
In some embodiments, when the at least one observation object is respectively associated with a map grid in the battle map, the monitoring module 4551 is further configured to obtain event data of the map grid in the battle map through the observation object associated with the map grid in the battle map; and when the event data of the map grid is updated, acquiring the flow data corresponding to the latest event data of the map grid.
In some embodiments, when the at least one observation object is respectively associated with a map grid in the battle map, the first synchronization module 4552 is further configured to obtain a timestamp of traffic data respectively monitored by the at least one observation object and corresponding map grid coordinates; and merging the traffic data with the same timestamp and adjacent map grid coordinates to obtain merged traffic data.
In some embodiments, when the at least one observation object is respectively associated with virtual characters in the battle map, the monitoring module 4551 is further configured to obtain event data of the virtual characters in the battle map through the observation objects associated with the virtual characters in the battle map; and when the event data of the virtual role is updated, acquiring the flow data corresponding to the latest event data of the virtual role.
In some embodiments, when the at least one observation object is respectively associated with a virtual character in the battle map, the first synchronization module 4552 is further configured to obtain a timestamp of traffic data respectively monitored by the at least one observation object and coordinates of the corresponding virtual character in the battle map; and merging the traffic data which have the same timestamp and are adjacent to the corresponding virtual character in the coordinate of the battle map to obtain the merged traffic data.
In some embodiments, the first synchronization module 4552 is further configured to obtain the number of virtual characters in the battle map that are in an active state; when the number of the virtual characters in the activated state is smaller than or equal to a number threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object; when the number of the virtual characters in the activated state is larger than the number threshold value, taking a map grid in the battle map as an associated object of the at least one observation object.
In some embodiments, the first synchronization module 4552 is further configured to use the virtual character in the battle map as an associated object of the at least one observation object when the virtual character is uniformly distributed in the battle map; when the virtual characters are unevenly distributed in the battle map, the map grid in the battle map is used as an associated object of the at least one observation object.
In some embodiments, the first synchronization module 4552 is further configured to treat the virtual character in the battle map as an associated object of the at least one observed object when the frequency of the virtual character movement in the battle map is greater than a frequency threshold; when the frequency of the virtual character movement in the battle map is smaller than or equal to the frequency threshold value, taking the map grid in the battle map as an associated object of the at least one observation object.
In some embodiments, the first synchronization module 4552 is further configured to invoke a rate prediction model based on the combat situation of the virtual characters in the combat map, to obtain a rate of increase in the number of virtual characters in the combat map; when the growth rate of the number of the virtual characters is smaller than or equal to a rate threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object; when the number of virtual characters increases by a rate greater than the rate threshold, a map grid in the battle map is taken as an associated object of the at least one observed object.
In some embodiments, the first synchronization module 4552 is further configured to store the merged traffic data in a data merge queue; and the monitoring object associated with the at least one observation object acquires the merged traffic data from the data merging queue.
In some embodiments, the apparatus further comprises: a control module 4555, configured to obtain an occupancy ratio of the spectator process in a total process, where the total process includes the spectator process and the battle process; and carrying out process regulation and control based on the fighting strategy corresponding to the occupation ratio.
In some embodiments, the regulatory module 4555 is further configured to stop the spectator fighting process and the fighting process based on the overload protection policy when the spectator fighting policy corresponding to the occupancy ratio is the overload protection policy; when the observation strategy corresponding to the occupancy ratio is a stopping observation strategy, stopping the observation process based on the stopping observation strategy; when the fighting strategy corresponding to the occupancy ratio is a fighting strategy for stopping adding, stopping adding a new fighting client based on the fighting strategy for stopping adding; and when the fighting strategy corresponding to the occupancy ratio is a reduced view strategy, reducing the flow data based on the reduced view strategy.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the method for processing the flow of the virtual scene in the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, where the executable instructions are stored, and when executed by a processor, will cause the processor to execute a traffic processing method of a virtual scene provided in an embodiment of the present application, for example, a traffic processing method of a virtual scene as shown in fig. 5A to 5B.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A traffic processing method for a virtual scene is characterized by comprising the following steps:
monitoring traffic data in a combat map of a virtual scene through at least one observation object associated with the combat map;
wherein, the process of operating the virtual scene comprises a battle process and a battle watching process different from the battle process, and the battle process operates the battle map;
synchronizing the monitored flow data to at least one monitored object in the fighting process;
and synchronizing the flow data to a spectator client associated with at least one monitoring object through the at least one monitoring object in the spectator process so as to present a virtual scene corresponding to the flow data in the spectator client.
2. The method of claim 1, wherein synchronizing the monitored traffic data to at least one listening object in the spectator process comprises:
merging the flow data respectively monitored by the at least one observation object to obtain merged flow data;
synchronizing the merged traffic data to a listening object associated with the at least one observation object.
3. The method of claim 2,
before the monitoring traffic data in a combat map of a virtual scene by at least one viewing object associated with the combat map, the method further comprises:
acquiring a related object of the at least one observation object;
associating the at least one viewing object with a map grid in the combat map, respectively, when the associated object characterizes the map grid in the combat map;
when the associated objects represent virtual characters in the battle map, the at least one observation object is respectively associated with the virtual characters in the battle map.
4. The method of claim 3, wherein the monitoring traffic data in the combat map for at least one viewing object associated with the combat map of the virtual scene while the at least one viewing object is respectively associated with the map grid in the combat map comprises:
obtaining event data of a map grid in the battle map through an observation object associated with the map grid in the battle map;
and when the event data of the map grid is updated, acquiring the flow data corresponding to the latest event data of the map grid.
5. The method of claim 3, wherein when the at least one observation object is respectively associated with the map grids in the battle map, the merging the traffic data based on the traffic data respectively monitored by the at least one observation object to obtain the merged traffic data comprises:
acquiring timestamps of flow data respectively monitored by the at least one observation object and corresponding map grid coordinates;
and merging the traffic data with the same timestamp and adjacent map grid coordinates to obtain merged traffic data.
6. The method of claim 3, wherein the monitoring traffic data in the combat map through at least one viewing object associated with the combat map of a virtual scene while the at least one viewing object is respectively associated with virtual characters in the combat map comprises:
acquiring event data of virtual characters in the battle map through observation objects associated with the virtual characters in the battle map;
and when the event data of the virtual role is updated, acquiring the flow data corresponding to the latest event data of the virtual role.
7. The method of claim 3, wherein when the at least one observation object is respectively associated with the virtual characters in the battle map, the merging the traffic data based on the traffic data respectively monitored by the at least one observation object to obtain the merged traffic data comprises:
acquiring timestamps of flow data respectively monitored by the at least one observation object and coordinates of corresponding virtual characters in a battle map;
and merging the traffic data which have the same timestamp and are adjacent to the corresponding virtual character in the coordinate of the battle map to obtain the merged traffic data.
8. The method of claim 3, wherein the obtaining the associated one of the at least one observed object comprises:
acquiring the number of virtual characters in an activated state in the battle map;
when the number of the virtual characters in the activated state is smaller than or equal to a number threshold value, taking the virtual characters in the battle map as associated objects of the at least one observation object;
when the number of the virtual characters in the activated state is larger than the number threshold value, taking a map grid in the battle map as an associated object of the at least one observation object.
9. The method of claim 3, wherein the obtaining the associated one of the at least one observed object comprises:
when the virtual characters are uniformly distributed in a battle map, taking the virtual characters in the battle map as associated objects of the at least one observation object;
when the virtual characters are unevenly distributed in the battle map, the map grid in the battle map is used as an associated object of the at least one observation object.
10. The method of claim 2, wherein the synchronizing the merged traffic data to a listening object associated with the at least one observation object comprises:
storing the merged flow data into a data merging queue;
and the monitoring object associated with the at least one observation object acquires the merged traffic data from the data merging queue.
11. The method of claim 1, further comprising:
acquiring an occupation ratio of the sightseeing process in a total process, wherein the total process comprises the sightseeing process and the fighting process;
and carrying out process regulation and control based on the fighting strategy corresponding to the occupation ratio.
12. The method according to claim 11, wherein the process control based on the fighting strategy corresponding to the occupancy ratio comprises:
when the observation strategy corresponding to the occupancy ratio is an overload protection strategy, stopping the observation process and the fighting process based on the overload protection strategy;
when the observation strategy corresponding to the occupancy ratio is a stopping observation strategy, stopping the observation process based on the stopping observation strategy;
when the fighting strategy corresponding to the occupancy ratio is a fighting strategy for stopping adding, stopping adding a new fighting client based on the fighting strategy for stopping adding;
and when the fighting strategy corresponding to the occupancy ratio is a reduced view strategy, reducing the flow data based on the reduced view strategy.
13. An apparatus for processing traffic of a virtual scene, the apparatus comprising:
the monitoring module is used for monitoring the flow data in a combat map through at least one observation object associated with the combat map of the virtual scene; wherein, the process of operating the virtual scene comprises a battle process and a battle watching process different from the battle process, and the battle process operates the battle map;
the first synchronization module is used for synchronizing the monitored flow data to at least one monitored object in the fighting process;
and the second synchronization module is used for synchronizing the flow data to a spectator client associated with at least one monitoring object through the at least one monitoring object in the spectator process so as to present a virtual scene corresponding to the flow data in the spectator client.
14. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor, configured to execute the executable instructions stored in the memory, and to implement the method for processing traffic of the virtual scene according to any one of claims 1 to 12.
15. A computer-readable storage medium storing executable instructions for implementing the method for traffic processing of a virtual scene according to any one of claims 1 to 12 when executed by a processor.
CN202110631899.7A 2021-06-07 2021-06-07 Flow processing method and device for virtual scene, electronic equipment and storage medium Active CN113368493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110631899.7A CN113368493B (en) 2021-06-07 2021-06-07 Flow processing method and device for virtual scene, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110631899.7A CN113368493B (en) 2021-06-07 2021-06-07 Flow processing method and device for virtual scene, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113368493A true CN113368493A (en) 2021-09-10
CN113368493B CN113368493B (en) 2023-09-22

Family

ID=77576090

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110631899.7A Active CN113368493B (en) 2021-06-07 2021-06-07 Flow processing method and device for virtual scene, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113368493B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013138893A (en) * 2013-03-14 2013-07-18 Square Enix Co Ltd Network game system, game device, and program
CN109692480A (en) * 2019-02-02 2019-04-30 网易(杭州)网络有限公司 It watches in a kind of online game method and apparatus
CN111589167A (en) * 2020-05-14 2020-08-28 腾讯科技(深圳)有限公司 Event fighting method, device, terminal, server and storage medium
CN111672105A (en) * 2020-05-28 2020-09-18 腾讯科技(深圳)有限公司 Visual field data packet sending method, device, equipment and medium based on virtual environment
CN112148495A (en) * 2020-10-09 2020-12-29 网易(杭州)网络有限公司 Game cluster management method and device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013138893A (en) * 2013-03-14 2013-07-18 Square Enix Co Ltd Network game system, game device, and program
CN109692480A (en) * 2019-02-02 2019-04-30 网易(杭州)网络有限公司 It watches in a kind of online game method and apparatus
CN111589167A (en) * 2020-05-14 2020-08-28 腾讯科技(深圳)有限公司 Event fighting method, device, terminal, server and storage medium
CN111672105A (en) * 2020-05-28 2020-09-18 腾讯科技(深圳)有限公司 Visual field data packet sending method, device, equipment and medium based on virtual environment
CN112148495A (en) * 2020-10-09 2020-12-29 网易(杭州)网络有限公司 Game cluster management method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113368493B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
WO2022151946A1 (en) Virtual character control method and apparatus, and electronic device, computer-readable storage medium and computer program product
CN105705211B (en) Game system, game control method, and game control program
CN112090069A (en) Information prompting method and device in virtual scene, electronic equipment and storage medium
WO2022068452A1 (en) Interactive processing method and apparatus for virtual props, electronic device, and readable storage medium
CN114344892B (en) Data processing method and related device
CN112416196B (en) Virtual object control method, device, equipment and computer readable storage medium
CN112402959A (en) Virtual object control method, device, equipment and computer readable storage medium
WO2022242021A1 (en) Message sending method and apparatus for multiplayer online battle program, and terminal and medium
CN113101667B (en) Virtual object control method, device, equipment and computer readable storage medium
KR20230147160A (en) Methods, devices, electronic devices, storage media and program products for controlling objects during hypothetical scenarios
CN112057860B (en) Method, device, equipment and storage medium for activating operation control in virtual scene
CN113633964A (en) Virtual skill control method, device, equipment and computer readable storage medium
CN113262488A (en) Control method, device and equipment for virtual object in virtual scene and storage medium
CN112402946A (en) Position acquisition method, device, equipment and storage medium in virtual scene
CN111672105A (en) Visual field data packet sending method, device, equipment and medium based on virtual environment
CN114344906A (en) Method, device, equipment and storage medium for controlling partner object in virtual scene
CN113144603A (en) Method, device, equipment and storage medium for switching call objects in virtual scene
CN112090067A (en) Virtual vehicle control method, device, equipment and computer readable storage medium
CN113368493B (en) Flow processing method and device for virtual scene, electronic equipment and storage medium
CN113144617B (en) Control method, device and equipment of virtual object and computer readable storage medium
CN114042309B (en) Virtual prop using method, device, terminal and storage medium
CN111298432B (en) Virtual object information acquisition method and device, server and readable storage medium
JP2023548922A (en) Virtual object control method, device, electronic device, and computer program
CN112156472A (en) Control method, device and equipment of virtual prop and computer readable storage medium
CN111589115A (en) Visual field control method and device for virtual object, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40052797

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant