Map scene rendering method and apparatus, server, terminal, computer-readable storage medium, and computer program product
View Patent ↗A map scene rendering method and apparatus including receiving a map rendering instruction transmitted by a terminal for a to-be-rendered map, the map rendering instruction comprising path start and end information in the to-be-rendered map, determining at least one target instance node corresponding to the path start and end information from a rendering instance node queue, the rendering instance node queue being obtained by associating M rendering instance nodes based on path information of the to-be-rendered map, rendering the resource tiles based on the at least one target instance node to obtain target video data, and transmitting the target video data to the terminal.
1 . A map scene rendering method, performed by an electronic device, comprising:
receiving a map rendering instruction transmitted by a terminal for a to-be-rendered map, the map rendering instruction comprising path start and end information in the to-be-rendered map;
extracting a start location and an end location corresponding to the to-be-rendered map from the path start and end information;
obtaining a target location interval between the start location and the end location, and
determining at least one target instance node among M rendering instance nodes from a rendering instance node queue based on the target location interval, the rendering instance node queue being obtained by associating the M rendering instance nodes based on path information of the to-be-rendered map, each rendering instance node of the M instance rendering nodes is configured to render at least one corresponding resource tile of N resource tiles, the N resource tiles being obtained by dividing a map scene resource based on scene structure information of the to-be-rendered map, the map scene resource being for rendering a map scene of the to-be-rendered map, M and N being positive integers and M being less than or equal to N;
rendering at least one target resource tile of the N resource tiles corresponding to the at least one target instance node to obtain target video data; and
transmitting the target video data to the terminal.
2 . The map scene rendering method according to claim 1 , wherein before the determining the at least one target instance node, the map scene rendering method further comprises:
obtaining the map scene resource;
dividing the map scene resource based on the scene structure information to obtain the N resource tiles, and allocating each of the N resource tiles to a corresponding rendering instance node of the M rendering instance nodes; and
associating, based on the path information, the M rendering instance nodes corresponding to the N resource tiles to obtain the rendering instance node queue.
3 . The map scene rendering method according to claim 2 , wherein the scene structure information comprises scenario distribution information, and
wherein the dividing the map scene resource comprises:
dividing the map scene resource in a scenario dimension based on the scenario distribution information to obtain scenario resource tiles corresponding to each scenario of the to-be-rendered map;
identifying adjacent scenarios among all scenarios of the to-be-rendered map based on the scenario distribution information, and dividing the map scene resource to obtain a cross-scenario resource tile of the adjacent scenarios; and
determining the N resource tiles based on the scenario resource tiles and the cross-scenario resource tile.
4 . The map scene rendering method according to claim 3 , wherein the dividing the map scene resource to obtain the cross-scenario resource tile of the adjacent scenarios comprises:
calculating connection distances of candidate scenario connection paths between the adjacent scenarios based on the scenario resource tiles corresponding to each scenario;
determining a candidate scenario connection path among the candidate scenario connection paths as a target connection path, the candidate scenario connection path corresponding to a shortest connection distance; and
determining a resource tile among the N resource tiles that corresponds to the target connection path as the cross-scenario resource tile of the adjacent scenarios.
5 . The map scene rendering method according to claim 3 , wherein the dividing the map scene resource in the scenario dimension comprises:
dividing the map scene resource into the scenarios based on the scenario distribution information, to obtain a scenario resource clip for each scenario;
performing point of interest identification on the scenario resource clip for each scenario to obtain point of interest distribution corresponding to each scenario; and
dividing the scenario resource clip for each scenario based on the point of interest distribution, to obtain the scenario resource tiles corresponding to each scenario.
6 . The map scene rendering method according to claim 2 , wherein the associating the M rendering instance nodes comprises:
identifying a connection path distribution of the N resource tiles based on the path information;
determining a node connection sequence between the M rendering instance nodes based on the connection path distribution; and
constructing the rendering instance node queue according to the node connection sequence.
7 . The map scene rendering method according to claim 6 , wherein the determining the node connection sequence between the M rendering instance nodes comprises:
constructing, based on the connection path distribution, a node relationship graph corresponding to the M rendering instance nodes, the node relationship graph being a directed acyclic graph constructed based on the M rendering instance nodes; and
identifying the node connection sequence between the M rendering instance nodes based on the node relationship graph.
8 . The map scene rendering method according to claim 1 , wherein the determining the at least one target instance node comprises:
selecting the at least one target instance node corresponding to the at least one target resource tile from the rendering instance node queue.
9 . The map scene rendering method according to claim 1 , wherein the rendering the at least one target resource tile comprises:
rendering the at least one target resource tile based on the at least one target instance node to obtain rendered video data;
obtaining at least one piece of rendered video data from the rendered video data;
obtaining a topological sorting parameter of the at least one piece of rendered video data; and
labeling the at least one piece of rendered video data based on the topological sorting parameter to obtain the target video data.
10 . A map scene rendering apparatus, comprising:
at least one memory configured to store program code; and
at least one processor configured to read the program code and operate as instructed by the program code, the program code comprising:
receiving code configured to cause at least one of the at least one processor to receive a map rendering instruction transmitted by a terminal for a to-be-rendered map, the map rendering instruction comprising path start and end information in the to-be-rendered map;
rendering code configured to cause at least one of the at least one processor to:
extract a start location and an end location corresponding to the to-be-rendered map from the path start and end information,
obtain a target location interval between the start location and the end location,
determine at least one target instance node among M rendering instance nodes from a rendering instance node queue based on the target location interval, the rendering instance node queue being obtained by associating the M rendering instance nodes based on path information of the to-be-rendered map, each rendering instance node of the M rendering nodes is configured to render a corresponding resource tile of N resource tiles, the N resource tiles being obtained by dividing a map scene resource based on scene structure information of the to-be-rendered map, the map scene resource being for rendering a map scene of the to-be-rendered map, M and N being positive integers and M being less than or equal to N, and
render at least one target resource tile of the N resource tiles corresponding to the at least one target instance node to obtain target video data; and
video transmitting code configured to transmit the target video data to the terminal.
11 . The map scene rendering apparatus according to claim 10 , wherein the program code further comprises obtaining code configured to cause at least one of the at least one processor to obtain the map scene resource;
wherein the dividing code is further configured to cause at least one of the at least one processor to divide the map scene resource based on the scene structure information to obtain the N resource tiles, and allocate each of the N resource tiles to a corresponding rendering instance node of the M rendering instance nodes; and
wherein the program code further comprises associating code configured to cause at least one of the at least one processor to associate, based on the path information, the M rendering instance nodes corresponding to the N resource tiles to obtain the rendering instance node queue.
12 . The map scene rendering apparatus according to claim 11 , wherein the scene structure information comprises scenario distribution information, and
wherein the dividing code is further configured to cause at least one of the at least one processor to:
divide the map scene resource in a scenario dimension based on the scenario distribution information to obtain scenario resource tiles corresponding to each scenario of the to-be-rendered map;
identify adjacent scenarios among all scenarios of the to-be-rendered map based on the scenario distribution information, and divide the map scene resource to obtain a cross-scenario resource tile of the adjacent scenarios; and
determine the N resource tiles based on the scenario resource tiles and the cross-scenario resource tile.
13 . The map scene rendering apparatus according to claim 12 , wherein the dividing code is further configured to cause at least one of the at least one processor to:
calculate connection distances of candidate scenario connection paths between the adjacent scenarios based on the scenario resource tiles corresponding to each scenario;
determine a candidate scenario connection path among the candidate scenario connection paths as a target connection path, the candidate scenario connection path corresponding to a shortest connection distance; and
determine a resource tile among the N resource tiles that corresponds to the target connection path as the cross-scenario resource tile of the adjacent scenarios.
14 . The map scene rendering apparatus according to claim 12 , wherein the dividing code is further configured to cause at least one of the at least one processor to:
divide the map scene resource into the scenarios based on the scenario distribution information, to obtain a scenario resource clip for each scenario;
perform point of interest identification on the scenario resource clip for each scenario to obtain point of interest distribution corresponding to each scenario; and
divide the scenario resource clip for each scenario based on the point of interest distribution, to obtain the scenario resource tiles corresponding to each scenario.
15 . The map scene rendering apparatus according to claim 11 , wherein the associating code is further configured to cause at least one of the at least one processor to:
identify a connection path distribution of the N resource tiles based on the path information;
determine a node connection sequence between the M rendering instance nodes based on the connection path distribution; and
construct the rendering instance node queue according to the node connection sequence.
16 . The map scene rendering apparatus according to claim 15 , wherein the associating code is further configured to cause at least one of the at least one processor to:
construct, based on the connection path distribution, a node relationship graph corresponding to the M rendering instance nodes, the node relationship graph being a directed acyclic graph constructed based on the M rendering instance nodes; and
identify the node connection sequence between the M rendering instance nodes based on the node relationship graph.
17 . The map scene rendering apparatus according to claim 10 , wherein the rendering code is further configured to cause at least one of the at least one processor to:
select the at least one target instance node corresponding to the at least one target resource tile from the rendering instance node queue.
18 . The map scene rendering apparatus according to claim 10 , wherein the rendering code is further configured to cause at least one of the at least one processor to:
render the at least one resource tile based on the at least one target instance node to obtain rendered video data;
obtain at least one piece of rendered video data from the rendered video data;
obtain a topological sorting parameter of the at least one piece of rendered video data; and
label the at least one piece of rendered video data based on the topological sorting parameter to obtain the target video data.
19 . A non-transitory computer-readable storage medium storing computer code which, when executed by at least one processor, causes the at least one processor to at least:
receive a map rendering instruction transmitted by a terminal for a to-be-rendered map, the map rendering instruction comprising path start and end information in the to-be-rendered map;
extract a start location and an end location corresponding to the to-be-rendered map from the path start and end information;
obtain a target location interval between the start location and the end location;
determine at least one target instance node among M rendering instance nodes from a rendering instance node queue based on the target location interval, the rendering instance node queue being obtained by associating the M rendering instance nodes based on path information of the to-be-rendered map, each rendering instance node of the M rendering nodes is configured to render a corresponding resource tile of N resource tiles, the N resource tiles being obtained by dividing a map scene resource based on scene structure information of the to-be-rendered map, the map scene resource being for rendering a map scene of the to-be-rendered map, M and N being positive integers and M being less than or equal to N;
render at least one target resource tile of the N resource tiles corresponding to the at least one target instance node to obtain target video data; and
transmit the target video data to the terminal.
20 . The non-transitory computer-readable storage medium according to claim 19 , wherein the computer code, when executed by the at least one processor, causes the at least one processor to at least:
obtain the map scene resource;
divide the map scene resource based on the scene structure information to obtain the N resource tiles, and allocate each of the N resource tiles to a corresponding rendering instance node of the M rendering instance nodes; and
associate, based on the path information, the M rendering instance nodes corresponding to the N resource tiles to obtain the rendering instance node queue.