Virtual road generation method and device, storage medium and electronic equipment
By acquiring and sampling virtual road signs to generate virtual roads, the problem of low virtual road generation efficiency is solved, and rapid and diversified virtual road generation is achieved.
Patent Information
- Application Number
- CN202410008110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the virtual road generation method is single, resulting in low generation efficiency and high similarity of virtual roads generated multiple times.
By obtaining the pre-set multiple virtual road segment identifications and the number of target road segments, the virtual road segment identification string is sampled to ensure that the parameters of each virtual road segment are different, and a virtual road with connection relationship is generated to avoid overlapping, and the generation process is optimized by random sampling and collision detection.
Improve the efficiency and accuracy of virtual road generation, ensure the diversity and uniqueness of generated virtual roads, reduce generation time, and improve the availability of the generation process.
Smart Images

Figure CN120252676A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular, to a method and device for generating a virtual road, a storage medium, and an electronic device. Background Art
[0002] Currently, when generating a virtual road in related technologies, the types, lengths, widths and other related road parameters of the virtual road are often manually input in the road parameter window of the client. Furthermore, the virtual road is generated according to the set road parameters. Since it takes too long to manually set the road parameters of the virtual road, and the method of generating the virtual road through the client is too single, and the similarity of the virtual roads generated multiple times is too high, the generation efficiency of the virtual road in related technologies is low.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of this application provide a method and device for generating a virtual road, a storage medium, and an electronic device, so as to at least solve the technical problem that the generation efficiency of the virtual road is low due to the single generation method of the virtual road.
[0005] According to one aspect of the embodiments of this application, a method for generating a virtual road is provided, including: obtaining a plurality of pre-set virtual section identifiers and a target section quantity, where one virtual section identifier among the plurality of virtual section identifiers corresponds to one virtual section among a plurality of virtual sections, and the section parameters set for each virtual section among the plurality of virtual sections are different from each other, and the target section quantity is used to represent the quantity of virtual sections used to form a first target virtual road; sampling a first virtual section identifier string from the plurality of virtual section identifiers according to the target section quantity, where the quantity of virtual section identifiers in the first virtual section identifier string is the same as the target section quantity, and the virtual sections associated with the first virtual section identifier string do not overlap with each other; generating the first target virtual road according to the first virtual section identifier string, where the first target virtual road includes a first virtual section and a second virtual section with a connection relationship, and the virtual section identifiers corresponding to the first virtual section and the second virtual section are adjacent to each other in the first virtual section identifier string.
[0006] According to another aspect of the embodiments of the present application, there is also provided a virtual road generation device, including: an acquisition module, configured to acquire a plurality of pre-set virtual section identifiers and a target section quantity, wherein one virtual section identifier among the plurality of virtual section identifiers corresponds to one virtual section among the plurality of virtual sections, and the section parameters set for each virtual section among the plurality of virtual sections are different from each other, and the target section quantity is used to represent the quantity of virtual sections used to form a first target virtual road; a sampling module, configured to sample a first virtual section identifier string from the plurality of virtual section identifiers according to the target section quantity, wherein the quantity of virtual section identifiers in the first virtual section identifier string is the same as the target section quantity, and the virtual sections associated with the first virtual section identifier string do not overlap with each other; a generation module, configured to generate the first target virtual road according to the first virtual section identifier string, wherein the first target virtual road includes a first virtual section and a second virtual section having a connection relationship, and the virtual section identifiers corresponding to the first virtual section and the second virtual section are adjacent to each other in the first virtual section identifier string.
[0007] Optionally, the device is configured to sample a first virtual section identifier string from the plurality of virtual section identifiers in the following manner: acquire an initial identifier string, wherein the initial identifier string is pre-set to not have any identifiers; cyclically sample the plurality of virtual section identifiers according to the target section quantity, and add the virtual section identifier obtained each time to the tail of the initial identifier string; in the case where the quantity of virtual section identifiers in the initial identifier string is the same as the target section quantity, determine the initial identifier string as the first virtual section identifier string, wherein the sorting order of the virtual section identifiers in the first virtual section identifier string is related to the execution order of the sampling operation.
[0008] Optionally, the device is configured to sample a first virtual road segment identification string from the multiple virtual road segment identifications according to the number of target road segments in the following manner: perform an nth sampling on the multiple virtual road segment identifications to obtain an nth virtual road segment identification, where n is a positive integer; determine a corresponding nth virtual road segment according to the nth virtual road segment identification, where the multiple virtual road segments include the nth virtual road segment; perform a collision detection on the nth virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment in the sampled virtual road segments, where the sampled virtual road segments represent the virtual road segments corresponding to the virtual road segment identifications obtained by performing the first sampling to the (n - 1)th sampling on the multiple virtual road segment identifications, and the collision virtual road segment represents the virtual road segment in the sampled virtual road segments that collides with the nth virtual road segment; in the case where no collision virtual road segment is detected, add the nth virtual road segment identification to the tail of the initial identification string; in the case where a collision virtual road segment is detected, delete the virtual road segment identifications corresponding to the collision virtual road segment to the nth virtual road segment in the collision detection virtual road from the initial identification string; in the case where the number of virtual road segment identifications in the initial identification string is the same as the number of target road segments, determine the initial identification string as the first virtual road segment identification string.
[0009] Optionally, the device is configured to sample a first virtual road segment identification string from the multiple virtual road segment identifications according to the number of target road segments in the following manner: perform an mth sampling on the multiple virtual road segment identifications to obtain an mth virtual road segment identification, where m is a positive integer; determine a corresponding mth virtual road segment according to the mth virtual road segment identification, where the multiple virtual road segments include the mth virtual road segment; perform a collision detection on the mth virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment in the sampled virtual road segments, where the sampled virtual road segments represent the virtual road segments corresponding to the virtual road segment identifications obtained by performing the first sampling to the (m - 1)th sampling on the multiple virtual road segment identifications, and the collision virtual road segment represents the virtual road segment in the sampled virtual road segments that collides with the mth virtual road segment; in the case where no collision virtual road segment is detected, add the mth virtual road segment identification to the tail of the initial identification string; in the case where a collision virtual road segment is detected, delete the virtual road segment identifications corresponding to the (m - x)th virtual road segment to the mth virtual road segment in the collision detection virtual road from the initial identification string, where x is a positive integer less than m; in the case where the number of virtual road segment identifications in the initial identification string is the same as the number of target road segments, determine the initial identification string as the first virtual road segment identification string.
[0010] Optionally, the device is further configured to: before obtaining a plurality of preset virtual road segment identifiers and a target road segment quantity, obtain first sample road segment parameters corresponding to a first sample virtual road segment; perform random sampling on the values of the first sample road segment parameters to obtain second sample road segment parameters, and generate a second sample virtual road segment according to the second sample road segment parameters; set a first virtual road segment identifier for the first sample road segment parameters, and set a second virtual road segment identifier for the second sample road segment parameters, and generate the plurality of virtual road segment identifiers.
[0011] Optionally, the device is configured to perform random sampling on the values of the first sample road segment parameters in the following manner to obtain second sample road segment parameters, and generate a second sample virtual road segment according to the second sample road segment parameters, including at least one of the following: obtain a first length value of the first sample road segment parameters, perform random sampling and update on the first length value to obtain a second length value, and generate the second sample road segment parameters according to the second length value, where the first length value is different from the second length value; obtain a first width value of the first sample road segment parameters, perform random sampling and update on the first width value to obtain a second width value, and generate the second sample road segment parameters according to the second width value, where the first width value is different from the second width value; obtain a first inclination angle value of the first sample road segment parameters, perform random sampling and update on the first inclination angle value to obtain a second inclination angle value, and generate the second sample road segment parameters according to the second inclination angle value, where the first inclination angle value is different from the second inclination angle value; obtain a first road segment height value of the first sample road segment parameters, perform random sampling and update on the first road segment height value to obtain a second road segment height value, and generate the second sample road segment parameters according to the second road segment height value, where the first road segment height value is different from the second road segment height value; obtain a first road segment type value of the first sample road segment parameters, perform random sampling and update on the first road segment type value to obtain a second road segment type value, and generate the second sample road segment parameters according to the second road segment type value, where the first road segment type value is different from the second road segment type value.
[0012] Optionally, the device is configured to generate the first target virtual road according to the first virtual road segment identification string in the following manner: detect each virtual road segment identification in the first virtual road segment identification string one by one to determine a target virtual road segment identification combination, where the target virtual road segment identification combination includes a straight virtual road segment identification and a curved virtual road segment identification, and the positions adjacent to the front and back of the curved virtual road segment identification in the first virtual road segment identification string are both the straight virtual road segment identifications; replace the target virtual road segment identification combination with a shortcut virtual road segment identification having a matching relationship with the target virtual road segment identification combination to obtain a second virtual road segment identification string, where the shortcut virtual road segment identification corresponds to a shortcut virtual road segment combination, and the shortcut virtual road segment combination includes a first straight virtual road segment and a second straight virtual road segment, a first curved virtual road segment and a second curved virtual road segment connecting the first straight virtual road segment and the second straight virtual road segment, and the road length of the second curved virtual road segment is different from the road length of the first curved virtual road segment; generate the first target virtual road according to the second virtual road segment identification string.
[0013] Optionally, the device is configured to generate the first target virtual road according to the first virtual road segment identification string in the following manner: randomly sample other virtual road segment identifications in the first virtual road segment identification string except the first virtual road segment identification to determine a first virtual road segment identification to be emptied; add a first type of emptied virtual road segment identification at the front position of each first virtual road segment identification to be emptied in the first virtual road segment identification string to obtain a third virtual road segment identification string, where the first type of emptied virtual road segment identification is used to indicate that there is a preset height difference between two virtual road segments connected to the virtual road segment corresponding to the first type of emptied virtual road segment identification; generate the first target virtual road according to the third virtual road segment identification string.
[0014] Optionally, the device is configured to generate the first target virtual road according to the first virtual road segment identification string in the following manner: perform probability sampling on each virtual road segment identification in the first virtual road segment identification string to determine a second virtual road segment identification to be emptied; replace each second virtual road segment identification to be emptied in the first virtual road segment identification string with a second type of emptied virtual road segment identification to obtain a fourth virtual road segment identification string, where the virtual road segment corresponding to the second type of emptied virtual road segment identification is a straight line segment with a preset slope value; generate the first target virtual road according to the fourth virtual road segment identification string.
[0015] Optionally, the device is further configured to: after generating the first target virtual road according to the first virtual road segment identification string, sample a fifth virtual road segment identification string from the multiple virtual road segment identifications according to the number of target road segments, where the number of virtual road segment identifications in the fifth virtual road segment identification string is the same as the number of target road segments, each virtual road segment associated with the fifth virtual road segment identification string does not overlap with each other, the fifth virtual road segment identification string is different from the first virtual road segment identification string, and the number of target road segments is further used to represent the number of virtual road segments used to form the second target virtual road; generate the second target virtual road according to the fifth virtual road segment identification string, where the second target virtual road includes a third virtual road segment and a fourth virtual road segment with a connection relationship, and the virtual road segment identifications corresponding to the third virtual road segment and the fourth virtual road segment are adjacent to each other in the fifth virtual road segment identification string, and the first target virtual road is different from the second target virtual road.
[0016] Optionally, the device is further configured to: receive a target request message sent from a target client on a target server, where the target request message includes the number of target road segments, and the target request message is a request message generated when the target client inputs the number of target road segments and a target server address, and the target server address is used to connect to the target server; sample a first virtual road segment identification string from the multiple virtual road segment identifications according to the number of target road segments on the target server, where the corresponding relationship between the multiple virtual road segment identifications and the multiple virtual road segments is stored on the target server; send the first virtual road segment identification string to the target client on the target server, so that the target client generates the first target virtual road according to the first virtual road segment identification string.
[0017] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above virtual road generation method when running.
[0018] According to another aspect of the embodiments of the present application, there is provided a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual road generation method as described above.
[0019] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the above-mentioned virtual road generation method through the computer program.
[0020] In the embodiments of the present application, a plurality of pre-set virtual section identifiers and a target section number are obtained. Among them, one virtual section identifier in the plurality of virtual section identifiers corresponds to one virtual section in the plurality of virtual sections, and the section parameters set for each virtual section in the plurality of virtual sections are different from each other. The target section number is used to represent the number of virtual sections used to form the first target virtual road; a first virtual section identifier string is sampled from the plurality of virtual section identifiers according to the target section number. Among them, the number of virtual section identifiers in the first virtual section identifier string is the same as the target section number, and the virtual sections associated with the first virtual section identifier string do not overlap with each other; a first target virtual road is generated according to the first virtual section identifier string. Among them, the first target virtual road includes a first virtual section and a second virtual section with a connection relationship, and the virtual section identifiers corresponding to the first virtual section and the second virtual section are adjacent to each other in the first virtual section identifier string. In the case of obtaining a plurality of pre-set virtual section identifiers and the target section number, sampling a virtual section identifier with the same number as the target section number from the plurality of virtual section identifiers to form a first virtual section identifier string, and finally using the first virtual section identifier string to generate a first target virtual road, achieving the purpose of saving the generation time of the virtual road, thereby realizing the technical effect of quickly generating the virtual road while ensuring the usability of the generated virtual road, and further solving the technical problem of low generation efficiency of the virtual road due to the single generation method of the virtual road.
[0021] On the other hand, by sampling from a plurality of virtual section identifiers to obtain a first virtual section identifier string, and ensuring that the adjacent sampled virtual section identifiers are different during the sampling process, the uniqueness and diversity of the first virtual section identifier string are ensured. Further, the accuracy of generating the first target virtual road according to the first virtual section identifier string is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0023] Figure 1 is a schematic diagram of an application environment of an optional virtual road generation method according to an embodiment of the present application;
[0024] Figure 2It is a schematic flowchart of an optional method for generating a virtual road according to an embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of an optional method for generating a virtual road according to an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0027] Figure 5 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0029] Figure 7 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0030] Figure 8 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0031] Figure 9 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0032] Figure 10 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0033] Figure 11 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0034] Figure 12 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0035] Figure 13 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application;
[0036] Figure 14 It is a schematic structural diagram of an optional virtual road generation device according to an embodiment of the present application;
[0037] Figure 15 It is a schematic structural diagram of an optional virtual road generation product according to an embodiment of the present application;
[0038] Figure 16 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. Detailed implementation manners
[0039] In order to enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0040] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of this application described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0041] The following describes this application in conjunction with embodiments:
[0042] According to one aspect of the embodiments of this application, a method for generating a virtual road is provided. Optionally, in this embodiment, the above method for generating a virtual road can be applied to a hardware environment composed of a server 101 and a terminal device 103 as shown in Figure 1 the following figure. As shown in Figure 1As shown, the server 101 is connected to the terminal device 103 via a network and can be used to provide services for the terminal device or the application installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 can be set up on the server or independently of the server to provide data storage services for the server 101. For example, a game data storage server. The above network can include, but is not limited to: a wired network, a wireless network. Among them, the wired network includes: a local area network, a metropolitan area network, and a wide area network. The wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The terminal device 103 can be a terminal configured with an application and can include, but is not limited to, at least one of the following: a mobile phone (such as an Android mobile phone, an iOS mobile phone, etc.), a laptop computer, a tablet computer, a handheld computer, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a mixed reality (MR) terminal, and other computer devices. The above server can be a single server, a server cluster composed of multiple servers, or a cloud server.
[0043] Combined with Figure 1 As shown, the above method for generating a virtual road can be executed by an electronic device, which can be a terminal device or a server. The above method for generating a virtual road can be implemented separately by the terminal device or the server, or jointly implemented by the terminal device and the server.
[0044] The above is only an example, and this embodiment does not make specific limitations.
[0045] Optionally, as an alternative implementation, as Figure 2 shown, the above method for generating a virtual road includes:
[0046] S202, obtaining a plurality of pre-set virtual road segment identifiers and the number of target road segments. Among them, one virtual road segment identifier among the plurality of virtual road segment identifiers corresponds to one virtual road segment among the plurality of virtual road segments. The road segment parameters set for each virtual road segment among the plurality of virtual road segments are different from each other. The number of target road segments is used to represent the number of virtual road segments used to form the first target virtual road;
[0047] Optionally, in the embodiments of the present application, the above-mentioned virtual section can be understood as a specific area on the virtual road. The position area of the virtual section in the virtual road can be known through the above-mentioned virtual section identifier. For example, the virtual section identifier is X, and X corresponds to the 3rd section on the virtual road, that is, the identifier of the 3rd section is X. The above-mentioned target section quantity can represent the number of sections included in the above-mentioned target virtual road. Among them, the virtual road can be understood as a road simulated and presented in a virtual reality or augmented reality environment through artificial intelligence technology. The virtual road can be used in fields such as games, autonomous driving, traffic planning, and testing of vehicle autonomous driving systems. For example, the virtual road in a racing game can be used to conduct real-time traffic simulation and driving experience in a virtual environment, so as to better understand traffic rules, road conditions, and vehicle behaviors. The virtual road can also be used to develop intelligent transportation systems and improve urban traffic planning.
[0048] Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning, and decision-making.
[0049] Artificial intelligence technology is an interdisciplinary subject, involving a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model, also known as the large model or the basic model, can be widely applied to downstream tasks in various major directions of artificial intelligence after fine-tuning. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0050] Autonomous driving technology refers to the vehicle's ability to drive itself without the operation of a driver. It usually includes technologies such as high-precision maps, environmental perception, computer vision, behavior decision-making, path planning, and motion control. Autonomous driving includes multiple development paths such as single-vehicle intelligence, vehicle-road cooperation, and networked cloud control. Autonomous driving technology has a wide range of application prospects. Currently, in addition to the fields of logistics, public transportation, taxis, and intelligent transportation, it will be further developed in the future.
[0051] Furthermore, Figure 3It is a schematic diagram of an optional method for generating a virtual road according to an embodiment of the present application. As Figure 3 shown, the above virtual road segments may include, but are not limited to, straight road segments 302, curved road segments 304, turning road segments 306, flying road segments, etc. The above road segment parameters include, but are not limited to, length, width, angle, slope, traffic volume, speed limit signs, traffic lights, road conditions, road markings, etc. The straight road segment 302 represents a straight line in the virtual road, and there is no curved or turning part of the road segment. The curved road segment 304 represents an arc-shaped curved road segment in the virtual road. The turning road segment 306 represents a part of the road segment where a turn occurs in the virtual road, forming a corner or a bend. Among them, the curved road segment 304 may include a transition curve, and the turning road segment 306 may include a transition turn. The transition curve usually refers to a circular arc-shaped road segment set on a straight road to connect two straight roads, enabling vehicles to smoothly transition to another straight road. The design of the transition curve can reduce the inertial force when the vehicle turns, improving the comfort and safety of driving. The transition turn refers to a curved road segment set at the intersection of two roads in different directions to connect the two roads and enable the vehicle to turn smoothly. The design of the transition turn can reduce the turning radius when the vehicle turns, enabling the vehicle to complete the turning action more smoothly. The flying road segment can be understood as a specific road segment where high-altitude flight or jumping can be performed.
[0052] It should be noted that the above first target virtual road has the same number of road segments as the number of target road segments. Each road segment in the first target virtual road corresponds to a virtual road segment identifier, and different road segments in the first target virtual road may have the same virtual road segment identifier, that is, the road segment parameters set in different regions of the first target virtual road may be the same.
[0053] Exemplarily, Figure 4 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application. As Figure 4 shown, enter the editor 402 on the terminal device. First, select the function of creating a virtual road. Enter the address 404 of the server and the number 406 of target road segments in the parameter setting window, and click the generate button 408. The editor 402 sends a request for generating a virtual road to the server. Figure 5 It is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application. The generated virtual road is as Figure 5 shown as 502 and is displayed on the terminal device.
[0054] S204, sample a first virtual road segment identifier string from multiple virtual road segment identifiers according to the number of target road segments. Among them, the number of virtual road segment identifiers in the first virtual road segment identifier string is the same as the number of target road segments, and the virtual road segments associated with the first virtual road segment identifier string do not overlap with each other;
[0055] Exemplarily, the above first virtual road segment identification string may include virtual road segment identifications sampled from a plurality of virtual road segment identifications. That is, a plurality of virtual road segments can be obtained through the first virtual road segment identification string. Specifically, the number of virtual road segment identifications included in the above first virtual road segment identification string is the same as the number of the target road segments. Moreover, among the plurality of road segments corresponding to the plurality of virtual road segment identifications in the first virtual road segment identification string, there is no overlapping or overlapping part in space, that is, there is no common intersection point between the road segments. When obtaining the currently sampled virtual road segment identification, it is necessary to compare it with the previously sampled virtual road segment identifications. Only when the virtual road segment associated with the currently sampled virtual road segment identification does not overlap with the virtual road segment associated with the previously obtained virtual road segment identification, the currently sampled virtual road segment identification is determined as a virtual road segment identification in the first virtual road segment identification string. That is, there are no overlapping virtual road segments among the virtual road segments associated with the finally generated first virtual road segment identification string.
[0056] For example, sampling is performed with replacement from a plurality of virtual road segment identifications to obtain a virtual road segment identification A as the first virtual road segment identification in the first virtual road segment identification string. The virtual road segment identification A represents a straight road segment a with an angle of 0°. Then, sampling is performed again with replacement from the plurality of virtual road segment identifications to obtain a second virtual road segment identification B and a third virtual road segment identification C. The second virtual road segment identification B represents a curved road segment b with an angle of 60°. At this time, the straight road segment a, the curved road segment b, and the straight road segment c are connected to form a virtual road, and the straight road segment a and the straight road segment c overlap. That is, it is necessary to adjust the first virtual road segment identification string. By sampling, a virtual road segment identification D is obtained, and the virtual road segment identification A is replaced with the virtual road segment identification D. The virtual road segment identification D represents a curved road segment d with an angle of 30°. Then, the sampling of the fourth virtual road segment identification continues.
[0057] In an exemplary embodiment, Figure 6 is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application, as Figure 6As shown, sample from multiple virtual road segment identifiers according to the number of target road segments to generate a first virtual road segment identifier string. This first virtual road segment identifier string may include virtual road segment identifier 602, virtual road segment identifier 604, virtual road segment identifier 606, virtual road segment identifier 608, virtual road segment identifier 610, virtual road segment identifier 612, etc. Taking virtual road segment identifier 602 as an example, virtual road segment identifier 602 is represented by the character a, corresponding to a virtual road segment of the ordinary straight road type with a length of 60, a width of 30, and an angle of 0°. For another example, virtual road segment identifier 604 is represented by the character b, corresponding to a virtual road segment of the standard 180° left bend type with a length of 35Π, a width of 30, and an angle of -180°. Π represents a mathematical constant, approximately 3.14159.
[0058] It should be noted that Figure 7 is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. Figure 7 afa shown in Figure 6 refers to the virtual road segments indicated by virtual road segment identifier a, virtual road segment identifier f, and virtual road segment identifier a shown in Figure 6 a refers to the virtual road segment identifier a shown in Figure 7 aba shown in Figure 6 refers to the virtual road segments indicated by virtual road segment identifier a, virtual road segment identifier b, and virtual road segment identifier a shown in Figure 8 is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. Figure 8 aba shown in Figure 6 refers to the virtual road segments indicated by virtual road segment identifier a, virtual road segment identifier c, and virtual road segment identifier a shown in Figure 9 is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. The above virtual road segment identifiers are not limited to being represented by English characters, and may also include but are not limited to forms such as Arabic numerals. Moreover, the above multiple virtual road segment identifiers may include but are not limited to the virtual road segment identifiers Figures 6 to 9 shown as [a, b, c, d, e, f, g, l, m, E, F, G, H, I, J, K, L, M, N], and the virtual road segment identifiers in the first virtual road segment identifier string can also be replaced.
[0059] For example, the first virtual road segment identifier string generated after sampling is [a, b, a, d, f, a, g, a]. According to Figures 6 to 9 the virtual road segment examples shown, r can be used to replace aba. Figure 10 is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. As Figure 10As shown, the virtual road segment identifier corresponding to the straight road segment 1002 is a, the virtual road segment identifier corresponding to the left 180° standard bend road segment 1004 is b, the virtual road segment identifier corresponding to the straight road segment 1006 is a, and r indicates that on the basis of the virtual road segment created according to aba, a near road segment is created between the virtual road segments corresponding to the two a straight road segment identifiers, that is, the left 180° bend near road combination segment 1008. Similarly, q can be used to replace aga, and aga represents the virtual road segment identifier a shown in Figure 6 The virtual road segment identifier a shown in Figure 7 The virtual road segment indicated by the virtual road segment identifier g and the virtual road segment identifier a shown in. On the basis of the virtual road segment created according to aga, a near road segment is created between the straight road segments corresponding to the two a virtual road segment identifiers, that is, the right 180° bend near road combination segment. The obtained first virtual road segment identifier string is [r, d, f, q]. Moreover, the vacated road segment can be realized by inserting virtual road segment identifiers into the first virtual road segment identifier string.
[0060] For another example, as Figure 8 Shown, inserting the virtual road segment identifier t between the virtual road segments r and d in [r, d, f, q] represents a type of vacated road segment, that is, when connecting to the previous road segment, it is offset 2 units downward in the vertical direction. Figure 11 Figure is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. As Figure 11 Shown, it includes a virtual road 1102 composed of [r, d]. After inserting the virtual road segment identifier t associated with a type of vacated road segment 1104 between r and d, the virtual road 1106 is obtained.
[0061] Furthermore, Figure 12 Figure is a schematic diagram of another optional virtual road generation method according to an embodiment of the present application. As Figure 12 Shown, it includes a virtual road 1206 composed of a virtual road segment 1202 and a virtual road segment 1204. After inserting the virtual road segment identifier u associated with a type of two vacated road segment 1208 between the virtual road segment 1202 and the virtual road segment 1204, the virtual road 1210 is obtained, where the virtual road segment identifier u represents a type of two vacated road segment, that is, when connecting to the previous road segment, after offsetting 30° upward in the vertical direction, a straight road segment is created, and after offsetting 30° downward in the vertical direction, it remains straight with the previous road segment. The road segment parameters of the virtual road segment can be set flexibly, that is, the vacated road segment can include but is not limited to a type of one vacated road segment, a type of two vacated road segment, etc. For example, creating a type of three vacated road segment means that when connecting to the previous road segment, it is offset 5 units downward in the vertical direction, and then a straight road segment identical to the previous road segment is created.
[0062] S206, generating a first target virtual road according to the first virtual road segment identifier string, wherein the first target virtual road includes a first virtual road segment and a second virtual road segment having a connection relationship, and the virtual road segment identifiers corresponding to the first virtual road segment and the second virtual road segment are in adjacent positions in the first virtual road segment identifier string.
[0063] Optionally, in an embodiment of the present application, the above-mentioned first virtual road segment and the second virtual road segment may include but are not limited to straight road segments, turning road segments, curved road segments, transition curves, transition curves, empty road segments, etc. The first virtual road segment and the second virtual road segment are connected to form a target virtual road. The first virtual road segment identification string includes the virtual road segment identifications corresponding to the first virtual road segment and the second virtual road segment, that is, the sections of the target virtual road can be composed of virtual road segments corresponding to the virtual road segment identifications in the first virtual road segment identification string.
[0064] Exemplarily, the virtual road segment is determined according to the position of the virtual road segment identifier in the first virtual road segment identifier string, and the virtual road segments are sequentially connected according to the position of the virtual road segment identifier to finally obtain the target virtual road. Figures 6 to 9 Taking the virtual road section shown as an example, the first virtual road section identification string is [r, t, d, u, f, q], which means that the target virtual road is composed of a combination of a 180° left shortcut section, a first-class empty section, a 90° left standard curve section, a second-class empty section, a 15° right turn section, and a 90° right shortcut combination section.
[0065] In an alternative embodiment, Figure 13 is a schematic diagram of another optional method for generating a virtual road according to an embodiment of the present application, such as Figure 13 As shown, the virtual road generation method proposed in the present application can be applied to a racing game application, and the virtual road of the game track can be designed and generated through the following steps, including but not limited to:
[0066] S1302, determining the target number of road sections of the virtual road of the game track and obtaining optional virtual road section identifiers of the virtual road of the game track;
[0067] S1304, sampling virtual road segment identifiers having the same number as the target road segment from the multiple virtual road segment identifiers, the virtual road segments associated with the sampled virtual road segment identifiers may include but are not limited to non-overlapping straight road segments, 180° curved road segments, 90° curved road segments, 90° turning road segments, transition curved road segments, transition turning road combination sections, etc., and the sampled virtual road segment identifiers are combined into a first virtual road segment identifier string;
[0068] S1306, replacing some virtual road segment identifiers in the first virtual road segment identifier string, selecting from qualified 180° curved road segments and 90° turning road segments, and replacing them with shortcut combined road segments;
[0069] S1308: insert at any position in the first virtual road segment identifier string Figure 8 A virtual road segment identifier associated with a type of vacated road segment shown;
[0070] S1310: insert at any position in the first virtual road segment identifier string Figure 8 The virtual road segment identifier associated with the second type of vacated road segment shown;
[0071] S1312, connecting the virtual road segments associated with the virtual road segment identifiers in sequence according to the positions of the virtual road segment identifiers in the first virtual road segment identifier string obtained in S1310, to obtain a virtual road for the game track.
[0072] In an optional embodiment, if Figure 13 As shown, the virtual road generation method proposed in this application can be applied to autonomous driving applications, and the autonomous driving virtual road can be designed and generated through the following steps, including but not limited to:
[0073] S1, determining the number of target road sections of the autonomous driving virtual road and obtaining optional virtual road section identifiers of the autonomous driving virtual road;
[0074] S2, sampling virtual road segment identifiers having the same number as the target road segment from multiple virtual road segment identifiers, the virtual road segments associated with the sampled virtual road segment identifiers may include but are not limited to non-overlapping straight road segments, 180° curved road segments, 90° curved road segments, 90° turning road segments, transition curved road segments, transition turning road combination sections, etc., and the sampled virtual road segment identifiers are combined into a first virtual road segment identifier string;
[0075] S3, replacing some virtual road segment identifiers in the first virtual road segment identifier string, selecting from qualified 180° curved road segments and 90° turning road segments, and replacing them with shortcut combined road segments;
[0076] S4: insert at any position in the first virtual road segment identifier string Figure 8 A virtual road segment identifier associated with a type of vacated road segment shown;
[0077] S5: insert at any position in the first virtual road segment identifier string Figure 8 The virtual road segment identifier associated with the second type of vacated road segment shown;
[0078] S6. Connect the virtual road segments associated with the virtual road segment identifiers in the first virtual road segment identifier string obtained according to S5 in sequence to obtain an autonomous driving virtual road.
[0079] Through the embodiments of the present application, a plurality of pre-set virtual road segment identifiers and the number of target road segments are obtained. Among them, one virtual road segment identifier in the plurality of virtual road segment identifiers corresponds to one virtual road segment in the plurality of virtual road segments, and the road segment parameters set for each virtual road segment in the plurality of virtual road segments are different from each other. The number of target road segments is used to represent the number of virtual road segments used to form the first target virtual road. Sample a first virtual road segment identifier string from the plurality of virtual road segment identifiers according to the number of target road segments. Among them, the number of virtual road segment identifiers in the first virtual road segment identifier string is the same as the number of target road segments, and the virtual road segments associated with the first virtual road segment identifier string do not overlap with each other. Generate a first target virtual road according to the first virtual road segment identifier string. Among them, the first target virtual road includes a first virtual road segment and a second virtual road segment with a connection relationship. The virtual road segment identifiers corresponding to the first virtual road segment and the second virtual road segment are adjacent to each other in the first virtual road segment identifier string. In the case of obtaining a plurality of pre-set virtual road segment identifiers and the number of target road segments, sample a virtual road segment identifier with the same number as the number of target road segments from the plurality of virtual road segment identifiers to form a first virtual road segment identifier string, and finally use the first virtual road segment identifier string to generate a first target virtual road, achieving the purpose of saving the generation time of the virtual road, thereby realizing the technical effect of quickly generating the virtual road while ensuring the usability of the generated virtual road, and further solving the technical problem of low generation efficiency of the virtual road due to the single generation method of the virtual road.
[0080] On the other hand, by sampling from a plurality of virtual road segment identifiers to obtain a first virtual road segment identifier string, and ensuring that the adjacent sampled virtual road segment identifiers are different during the sampling process, the uniqueness and diversity of the first virtual road segment identifier string are ensured. Further, the accuracy of generating the first target virtual road according to the first virtual road segment identifier string is improved.
[0081] As an optional solution, sampling the first virtual road segment identifier string from the plurality of virtual road segment identifiers according to the number of target road segments includes: obtaining an initial identifier string, where the initial identifier string is pre-set to have no identifiers; sampling the plurality of virtual road segment identifiers cyclically according to the number of target road segments, and adding the sampled virtual road segment identifier to the end of the initial identifier string each time; when the number of virtual road segment identifiers in the initial identifier string is the same as the number of target road segments, determining the initial identifier string as the first virtual road segment identifier string, where the sorting order of each virtual road segment identifier in the first virtual road segment identifier string is related to the execution order of the sampling operation.
[0082] Optionally, in the embodiments of the present application, the above initial identification string can be understood as a blank identification string, that is, there is no virtual road segment identification in the pre-set initial identification string. In the process of sampling the above multiple virtual road segment identifications, it may include but is not limited to sampling with replacement. For example, if the number of target road segments is N, where N is a positive integer, N samplings can be performed from multiple virtual road segment identifications, and the virtual road segment identification obtained each time is stored in the above initial identification string. Finally, the initial identification string will store N virtual road segment identifications.
[0083] Further, after storing all N virtual road segment identifications in the initial identification string, the sampling ends. At this time, this initial identification string is determined as the above first virtual road segment identification string. Among them, the position of the virtual road segment identification in the first virtual road segment identification string is associated with the sampling order of the virtual road segment identification. For example, the virtual road segment identification A obtained by the first sampling will be at the end position of the first virtual road segment identification string. After the virtual road segment identification B is obtained by the second sampling, the position of the virtual road segment identification A will change and move forward one position, being in the penultimate position in the first virtual road segment identification string. At this time, the virtual road segment identification B will be at the end position of the first virtual road segment identification string. Finally, after N samplings end, the virtual road segment identification A obtained by the first sampling is stored at the first position in the finally generated first virtual road segment identification string, and the virtual road segment identification B obtained by the second sampling is stored at the second position.
[0084] Through the embodiments of the present application, by performing cyclic sampling from multiple virtual road segment identifications according to the number of target road segments, storing the result obtained each time in the initial identification string, and determining the initial identification string after sampling ends as the first virtual road segment identification string, and moreover, the virtual road segment identifications in the first virtual road segment identification string are consistent with the sampling order, the technical effect of improving the sampling efficiency of the virtual road segment identification is achieved. Furthermore, the purpose of ensuring the accuracy of generating the first virtual road segment identification string is achieved.
[0085] As an alternative solution, sampling the first virtual road segment identification string from the multiple virtual road segment identifications according to the number of target road segments described above includes: performing the nth sampling on the multiple virtual road segment identifications to obtain the nth virtual road segment identification, where n is a positive integer; determining the corresponding nth virtual road segment according to the nth virtual road segment identification, where the multiple virtual road segments include the nth virtual road segment; performing a collision detection on the nth virtual road segment and the sampled virtual road segments to determine whether the sampled virtual road segments include a collision virtual road segment, where the sampled virtual road segments refer to the virtual road segments corresponding to the virtual road segment identifications obtained by performing the first sampling to the (n - 1)th sampling on the multiple virtual road segment identifications, and the collision virtual road segment refers to the virtual road segment in the sampled virtual road segments that collides with the nth virtual road segment; in the case where the collision virtual road segment is detected, deleting the virtual road segment identifications corresponding to the collision virtual road segment to the virtual road segment corresponding to the nth virtual road segment in the collision detection virtual road from the initial identification string; in the case where the number of virtual road segment identifications in the initial identification string is the same as the number of target road segments, determining the initial identification string as the first virtual road segment identification string.
[0086] Optionally, in the embodiments of the present application, the first virtual road segment identification string includes n sampled virtual road segment identifications, and each virtual road segment identification corresponds to a virtual road segment. That is, n virtual road segments can be obtained according to the first virtual road segment identification string, and these n virtual road segments can be included in the multiple virtual road segments. The sampled virtual road segments can be understood as the virtual road segments corresponding to the virtual road segment identifications sampled before the current sampling. When a virtual road segment A in the sampled virtual road segments collides with the virtual road segment corresponding to the virtual road segment identification obtained by the current sampling, that is, there is an intersection point between the two road segments. In other words, there is an overlapping road segment between virtual road segment A and the virtual road segment corresponding to the virtual road segment identification obtained by the current sampling. At this time, the virtual road segment A is determined as the collision virtual road segment.
[0087] It should be noted that after each virtual road segment identification is obtained by sampling, it is necessary to perform a collision detection on the virtual road segment corresponding to the virtual road segment identification and the sampled virtual road segments. Assuming that there is no collision virtual road segment in the sampled virtual road segments, store the virtual road segment identification obtained by the current sampling at the end position of the first virtual road segment identification string. Conversely, if there is a collision virtual road segment in the sampled virtual road segments, the virtual road segment identification corresponding to the collision virtual road segment can be determined from the first virtual road segment identification string, and delete all the virtual road segment identifications included between the virtual road segment identification corresponding to the collision virtual road segment in the first virtual road segment identification string and the virtual road segment identification obtained by the current sampling, and then perform sampling again.
[0088] For example, assume that n is 5. At the 4th sampling, the virtual road segment identifier I is obtained, and the virtual road segment identifier I corresponds to the virtual road segment i. Since there is a collision between the virtual road segment i and the virtual road segment j in the sampled virtual road segments, that is, the virtual road segment identifier corresponding to the virtual road segment j determined from the first virtual road segment identifier string is the virtual road segment identifier J obtained at the 2nd sampling. At this time, the first virtual road segment identifier string is [A, J, B, I]. I, B, and J will be deleted, and the first virtual road segment identifier string is updated to [A]. After the next sampling, the virtual road segment identifier Q is obtained. The virtual road segment q corresponding to the virtual road segment identifier Q is continuously subjected to collision detection with the virtual road segments corresponding to the virtual road segment identifiers in the first virtual road segment identifier string. At this time, since there is only one virtual road segment identifier A in the first virtual road segment identifier string, when there is no collision between the virtual road segment q and the virtual road segment a corresponding to the virtual road segment identifier A, the virtual road segment identifier Q is stored at the end position of the first virtual road segment identifier string, and the first virtual road segment identifier string is updated to [A, Q], until finally 5 virtual road segment identifiers are sampled, that is, the first virtual road segment identifier string is generated.
[0089] As an alternative solution, sampling the first virtual road segment identifier string from the multiple virtual road segment identifiers according to the number of target road segments includes: performing the mth sampling on the multiple virtual road segment identifiers to obtain the mth virtual road segment identifier, where m is a positive integer; determining the corresponding mth virtual road segment according to the mth virtual road segment identifier, where the multiple virtual road segments include the mth virtual road segment; performing collision detection on the mth virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment in the sampled virtual road segments, where the sampled virtual road segments represent the virtual road segments corresponding to the virtual road segment identifiers obtained by performing the 1st sampling to the (m - 1)th sampling on the multiple virtual road segment identifiers, and the collision virtual road segment represents the virtual road segment in the sampled virtual road segments that collides with the mth virtual road segment; in the case where no collision virtual road segment is detected, adding the mth virtual road segment identifier to the tail of the initial identifier string; in the case where a collision virtual road segment is detected, deleting the virtual road segment identifiers corresponding to the virtual road segments from the (m - x)th to the mth in the collision detection virtual road from the initial identifier string, where x is a positive integer less than m; in the case where the number of virtual road segment identifiers in the initial identifier string is the same as the number of target road segments, determining the initial identifier string as the first virtual road segment identifier string.
[0090] Optionally, in the embodiment of the present application, the first virtual road segment identifier string includes m sampled virtual road segment identifiers, and each virtual road segment identifier corresponds to a virtual road segment. That is, m virtual road segments can be obtained according to the first virtual road segment identifier string, and these m virtual road segments can be included in the multiple virtual road segments.
[0091] It should be noted that, assuming that there is a collision virtual section in the sampled virtual sections, the virtual section identifier corresponding to the collision virtual section can be determined from the first virtual section identifier string, and a virtual section identifier is randomly selected from the virtual section identifiers corresponding to the sampled virtual sections as the x-th virtual section identifier, and the virtual section identifiers between the x-th virtual section identifier and the virtual section identifier obtained in the current sampling are deleted to update the first virtual section identifier string, where the x-th virtual section identifier may include, but is not limited to, a virtual section identifier between the virtual section identifier corresponding to the collision virtual section in the first virtual section identifier string and the virtual section identifier obtained in the current sampling.
[0092] Exemplarily, assuming that n is 5, in the 4th sampling, the virtual section identifier I is obtained, and this virtual section identifier I corresponds to the virtual section i. Since there is a collision between the virtual section i and the virtual section a in the sampled virtual sections, that is, the virtual section identifier corresponding to the virtual section a determined from the first virtual section identifier string is the virtual section identifier A obtained in the 1st sampling. At this time, the first virtual section identifier string is [A, J, B, I]. The third virtual section identifier B can be used as the above-mentioned x-th virtual section identifier, and the virtual section identifiers B and I are deleted, and the first virtual section identifier string is updated to [A, J], until finally 5 virtual section identifiers are obtained by sampling, that is, the first virtual section identifier string is generated.
[0093] Through the embodiments of the present application, during each sampling of the virtual section identifier, a collision detection with the sampled virtual sections is performed. In the case of determining a collision section, all virtual section identifiers between the virtual section identifier corresponding to the collision section and the virtual section identifier obtained in the current sampling can be deleted, or a virtual section identifier can be randomly selected from the virtual section identifiers corresponding to the sampled virtual sections, and the virtual section identifiers between this virtual section identifier and the virtual section identifier obtained in the current sampling are deleted, and sampling continues to obtain the first virtual section identifier string, so as to achieve the technical effect of improving the accuracy of the first virtual section identifier string.
[0094] As an alternative solution, before obtaining the preset multiple virtual section identifiers and the target section quantity, the method further includes: obtaining the first sample section parameters corresponding to the first sample virtual section; randomly sampling the values of the first sample section parameters to obtain second sample section parameters, and generating a second sample virtual section according to the second sample section parameters; setting a first virtual section identifier for the first sample section parameters, and setting a second virtual section identifier for the second sample section parameters to generate the multiple virtual section identifiers.
[0095] Optionally, in the embodiments of the present application, the above-mentioned first sample virtual road section and the above-mentioned second sample virtual road section may include, but are not limited to, non-overlapping straight road sections, 180° bend road sections, 90° bend road sections, 90° turning road sections, transition bend road sections, transition turning combined road sections, etc. The above-mentioned first sample road section parameters and the second sample road section parameters may include, but are not limited to, the above-mentioned road section parameters including, but not limited to, length, width, angle, slope, etc.
[0096] Exemplarily, the first sample virtual road section includes a straight road section A and a bend road section B. The first sample road section parameters include that the length of the straight road section A is 30, the width is 20, and the angle is 0°. The length of the bend road section B is 30, the width is 20, and the angle is 30°. At this time, random sampling is performed on the length, width, and angle of the straight road section A and the bend road section B respectively to obtain straight road sections and bend road sections with different combinations of length, width, and angle, which are the above-mentioned second sample virtual road sections.
[0097] Exemplarily, as Figures 6 to 9 shown, the identification includes the above-mentioned first virtual road section identification and the second virtual road section identification, and each virtual road section identification corresponds to a road section parameter.
[0098] As an alternative solution, randomly sample the values of the above-mentioned first sample road section parameters to obtain second sample road section parameters, and generate a second sample virtual road section according to the above-mentioned second sample road section parameters, including at least one of the following: obtain the first length value of the above-mentioned first sample road section parameter, randomly sample and update the above-mentioned first length value to obtain a second length value, and generate the above-mentioned second sample road section parameter according to the above-mentioned second length value, where the above-mentioned first length value is different from the above-mentioned second length value; obtain the first width value of the above-mentioned first sample road section parameter, randomly sample and update the above-mentioned first width value to obtain a second width value, and generate the above-mentioned second sample road section parameter according to the above-mentioned second width value, where the above-mentioned first width value is different from the above-mentioned second width value; obtain the first inclination angle value of the above-mentioned first sample road section parameter, randomly sample and update the above-mentioned first inclination angle value to obtain a second inclination angle value, and generate the above-mentioned second sample road section parameter according to the above-mentioned second inclination angle value, where the above-mentioned first inclination angle value is different from the above-mentioned second inclination angle value; obtain the first road section height value of the above-mentioned first sample road section parameter, randomly sample and update the above-mentioned first road section height value to obtain a second road section height value, and generate the above-mentioned second sample road section parameter according to the above-mentioned second road section height value, where the above-mentioned first road section height value is different from the above-mentioned second road section height value; obtain the first road section type value of the above-mentioned first sample road section parameter, randomly sample and update the above-mentioned first road section type value to obtain a second road section type value, and generate the above-mentioned second sample road section parameter according to the above-mentioned second road section type value, where the above-mentioned first road section type value is different from the above-mentioned second road section type value.
[0099] Exemplarily, the above-mentioned first sample road section parameters include the above-mentioned first length value. Randomly sample the above-mentioned first length value to obtain a second length value to generate the second sample road section parameter. At this time, the road section length in the second sample road section parameter is different from the road section length in the first sample road section parameter. Similarly, the above-mentioned first sample road section parameters include the above-mentioned first width value. Randomly sample the above-mentioned first width value to obtain a second width value to generate the second sample road section parameter. At this time, the road section width in the second sample road section parameter is different from the road section width in the first sample road section parameter. The first sample road section parameters include a first inclination angle. Randomly sample the first inclination angle value to obtain a second inclination angle value, and use the second inclination angle value as the road inclination angle value in the second sample road section parameter. The inclination angle in the second sample road section parameter is different from the inclination angle in the first sample road section parameter.
[0100] Further, the first sample road section parameters further include the first road section height and the first road section type value. Random sampling is performed on the first road section height value to obtain a second road section height value, and the second road section height value is used as the road section height value in the second sample road section parameters. The road section height in the second sample road section parameters is different from the road section height in the first sample road section parameters. Similarly, random sampling is performed on the first road section type value to obtain a second road section type value, and the second road section type value is used as the road section type value in the second sample road section parameters. The road section type in the second sample road section parameters is different from the road section type in the first sample road section parameters. The road section type may include, but is not limited to, straight road sections, curved road sections, turning road sections, transitional curved road sections, transitional turning combined road sections, etc.
[0101] As an alternative solution, generating the first target virtual road according to the first virtual road section identification string includes: detecting each virtual road section identification in the first virtual road section identification string to determine a target virtual road section identification combination, where the target virtual road section identification combination includes a straight virtual road section identification and a curved virtual road section identification, and the straight virtual road section identifications are located at the front and rear adjacent positions of the curved virtual road section identification in the first virtual road section identification string; replacing the target virtual road section identification combination with a short-cut virtual road section identification having a matching relationship with the target virtual road section identification combination to obtain a second virtual road section identification string, where the short-cut virtual road section identification corresponds to a short-cut virtual road section combination, and the short-cut virtual road section combination includes a first straight virtual road section and a second straight virtual road section, a first curved virtual road section and a second curved virtual road section connecting the first straight virtual road section and the second straight virtual road section, and the road section length of the second curved virtual road section is different from the road section length of the first curved virtual road section; generating the first target virtual road according to the second virtual road section identification string.
[0102] Exemplarily, assume that the first virtual road section identification string may include virtual road section identifications of multiple road section types, and the target virtual road section identification combination may include a straight virtual road section identification and a curved virtual road section identification, that is, the first target virtual road corresponding to the first virtual road section identification string may include, but is not limited to, straight road sections and curved road sections.
[0103] For example, as Figure 7As shown, assume that the first virtual road segment identification string is [a, b, a, c]. The storage order of the virtual road segment identifications in the above target virtual road segment identification combination is the virtual road segment identification a corresponding to the straight road segment, the virtual road segment identification b corresponding to the curved road segment, and the virtual road segment identification a corresponding to the straight road segment. That is, the target virtual road segment identification combination is aba. At this time, the target virtual road segment identification combination can be replaced with the above-mentioned shortcut virtual road segment identification. The shortcut virtual road segment identification is r. At this time, the virtual road segment represented by the shortcut virtual road segment identification r and the virtual road segment represented by the target virtual road segment identification combination aba can have the same road conditions. At this time, replace aba in the first virtual road segment identification string [a, b, a, c] with r, and the first virtual road segment identification string is updated to the above-mentioned second virtual road segment identification string [r, c].
[0104] Further, the shortcut virtual road segment identification corresponds to the above-mentioned shortcut virtual road segment combination. The shortcut virtual road segment combination includes a first straight virtual road segment and a second straight virtual road segment. The first curved virtual road segment and the second curved virtual road segment can be used to connect the first straight virtual road segment and the second straight virtual road segment. That is, there are two optional road segments between the first straight virtual road segment and the second straight virtual road segment, which are the first straight virtual road segment and the second straight virtual road segment respectively. One of the straight virtual road segments in the first straight virtual road segment and the second straight virtual road segment can be the same as the curved virtual road segment corresponding to the curved virtual road segment identification in the above-mentioned shortcut virtual road segment combination. And, the road length of the second curved virtual road segment is different from the road length of the first curved virtual road segment. Finally, the first target virtual road is generated using the second virtual road segment identification string obtained after replacing the target virtual road segment identification combination with the shortcut virtual road segment identification.
[0105] As an optional solution, generating the first target virtual road according to the above first virtual road segment identification string includes: randomly sampling other virtual road segment identifications in the first virtual road segment identification string except the first virtual road segment identification to determine the first virtual road segment identification to be vacated; adding a first type of vacated virtual road segment identification at the front position of each of the first virtual road segment identifications to be vacated in the first virtual road segment identification string to obtain a third virtual road segment identification string, where the first type of vacated virtual road segment identification is used to indicate that there is a preset height difference between the two virtual road segments connected to the virtual road segment corresponding to the first type of vacated virtual road segment identification. Generate the first target virtual road according to the above third virtual road segment identification string.
[0106] Optionally, in the embodiments of the present application, the above first virtual road section identifier to be vacated corresponds to a vacated road section. The virtual road section identifiers in the above first virtual road section identifier string can be randomly sampled to obtain a virtual road section identifier as the above first virtual road section identifier to be vacated. Moreover, multiple first virtual road section identifiers to be vacated can be sampled from the first virtual road section identifier string.
[0107] Exemplarily, as Figure 11 shown, assume that the first virtual road section identifier string is [a, b, d, a]. Among them, take the position of the third virtual road section identifier d as the position of the first virtual road section identifier to be vacated, that is, insert the first vacated virtual road section identifier t at the position of the third virtual road section identifier in the first virtual road section identifier string. At this time, the first virtual road section identifier string is updated to [a, b, t, d, a]. That is, the third virtual road section identifier string is the updated first virtual road section identifier string [a, b, t, d, a], and the third virtual road section identifier string will be used to generate the first target virtual road.
[0108] As an optional solution, the above generating the first target virtual road according to the above first virtual road section identifier string includes: performing probability sampling on each virtual road section identifier in the above first virtual road section identifier string to determine the second virtual road section identifier to be vacated; replacing each of the above second virtual road section identifiers to be vacated in the above first virtual road section identifier string with a second type of vacated virtual road section identifier to obtain a fourth virtual road section identifier string, where the virtual road section corresponding to the above second type of vacated virtual road section identifier is a straight road section with a preset slope value; generating the above first target virtual road according to the above fourth virtual road section identifier string.
[0109] Optionally, in the embodiments of the present application, the above second virtual road section identifier to be vacated corresponds to a vacated road section. The virtual road section identifiers in the above first virtual road section identifier string can be randomly sampled to obtain a virtual road section identifier as the above second virtual road section identifier to be vacated. Moreover, multiple second virtual road section identifiers to be vacated can be sampled from the first virtual road section identifier string.
[0110] Exemplarily, as Figure 12As shown, assume that the first virtual road segment identification string is [a, b, d, a]. Among them, probability sampling will be performed on the virtual road segment identifications in the first virtual road segment identification string one by one. For example, assume that when the probability sampling value of each virtual road segment identification is greater than or equal to 0.5, the position of this virtual road segment identification is determined as the position of the second virtual road segment identification to be vacated. For example, the probability sampling result of the third virtual road segment identification d is 0.6. At this time, the position of the third virtual road segment identification d is used as the position of the second virtual road segment identification to be vacated. That is, the second vacated virtual road segment identification u is inserted at the position of the third virtual road segment identification in the first virtual road segment identification string. At this time, the first virtual road segment identification string is updated to [a, b, t, d, a]. That is, the fourth virtual road segment identification string is the updated first virtual road segment identification string [a, b, u, d, a]. The fourth virtual road segment identification string will be used to generate the first target virtual road. It should be noted that the above fourth virtual road segment identification string may also include the above first virtual road segment identification to be vacated.
[0111] Through the embodiments of the present application, the target virtual road segment identification combination in the first virtual road segment identification string is replaced by the near-road virtual road segment identification, and then the second virtual road segment identification string is obtained. Moreover, the first virtual road segment identification to be vacated and the second virtual road segment identification to be vacated can be inserted into the first virtual road segment identification string respectively to obtain the third virtual road segment identification string and the fourth virtual road segment identification string, which achieves the purpose of increasing the types of virtual road segment identifications included in the virtual road segment identification string, and further achieves the purpose of ensuring the diversity of road segments of the first target virtual road.
[0112] As an optional solution, after generating the first target virtual road according to the first virtual road segment identification string, the method further includes: sampling a fifth virtual road segment identification string from the multiple virtual road segment identifications according to the target road segment quantity, where the number of virtual road segment identifications in the fifth virtual road segment identification string is the same as the target road segment quantity, the virtual road segments associated with the fifth virtual road segment identification string do not overlap with each other, the fifth virtual road segment identification string is different from the first virtual road segment identification string, and the target road segment quantity is also used to represent the number of virtual road segments used to form the second target virtual road; generating the second target virtual road according to the fifth virtual road segment identification string, where the second target virtual road includes a third virtual road segment and a fourth virtual road segment with a connection relationship, and the virtual road segment identifications corresponding to the third virtual road segment and the fourth virtual road segment are adjacent positions in the fifth virtual road segment identification string, and the first target virtual road is different from the second target virtual road.
[0113] Exemplarily, the above-mentioned fifth virtual road segment identification string may include, but is not limited to, virtual road segment identifications of multiple road segment types. The number of virtual road segment identifications in the fifth virtual road segment identification string is the same as the number of target road segments. For example, at the first sampling, a first virtual road segment identification string is sampled from multiple virtual road segment identifications. At the second sampling, a fifth virtual road segment identification string is sampled from the same multiple virtual road segment identifications as the first sampling. The first virtual road segment identification string and the fifth virtual road segment identification string may be different. Among them, the storage positions of the same virtual road segment identifications in the first virtual road segment identification string and the fifth virtual road segment identification string may be different.
[0114] Further, after obtaining the fifth virtual road segment identification string, the virtual road segments corresponding to each virtual road segment identification in the fifth virtual road segment identification string may be connected to generate the above-mentioned second target virtual road. The above-mentioned third virtual road segment and the above-mentioned fourth virtual road segment are adjacent in the second target virtual road. In the fifth virtual road segment identification string, the virtual road segment identification corresponding to the third virtual road segment and the virtual road segment identification corresponding to the fourth virtual road segment are also adjacent.
[0115] Through the embodiments of the present application, multiple virtual road segment identification strings obtained by randomly sampling multiple virtual road segment identifications multiple times may all be different virtual road segment identification strings. That is, the virtual road segment identification strings obtained by each sampling may include different virtual road segment identifications, or different virtual road segment identifications may be stored at the same positions in the virtual road segment identification strings obtained by each sampling, achieving the purpose of ensuring the reliability of the virtual road segment identification strings, and further improving the generation efficiency of the virtual road segment identification strings.
[0116] As an optional solution, the above method further includes: receiving, on the target server, a target request message sent from the target client, where the target request message includes the above-mentioned number of target road segments, and the target request message is a request message generated when the target client inputs the number of target road segments and the target server address, and the target server address is used to connect to the target server; sampling, on the target server, a first virtual road segment identification string from the above-mentioned multiple virtual road segment identifications according to the number of target road segments, where the corresponding relationship between the above-mentioned multiple virtual road segment identifications and the above-mentioned multiple virtual road segments is stored on the target server; sending, on the target server, the first virtual road segment identification string to the target client, so that the target client generates the above-mentioned first target virtual road according to the first virtual road segment identification string.
[0117] Exemplarily, the above-mentioned target server may include, but is not limited to, cloud servers, distributed servers, etc., the above-mentioned target client may include, but is not limited to, independent applications, website web pages, etc., and the above-mentioned target request message may include, but is not limited to, a request for a first virtual road segment identification string.
[0118] In an exemplary embodiment, as Figure 4 shown, enter the target client on the terminal device. First, select to create a new virtual road. Enter the address of the target server and the number of target road segments in the parameter setting window, and click the generate button. The target client sends a target request message to the target server, that is, a generation request for the virtual road. After receiving the target request message, the target server samples a first virtual road segment identification string from multiple virtual road segment identifications, and sends the first virtual road segment identification string to the target client. The target client can generate a first target virtual road according to the first virtual road segment identification string, or after the target server directly generates a first target virtual road according to the first virtual road segment identification string, send the first target virtual road to the target client for display.
[0119] Optionally, in an exemplary embodiment, the virtual road generation method proposed in this application can be applied to the application scenario of lane simulation design in racing games, and a variety of large quantities of racing game tracks can be generated in a short time. The generated tracks can not only be used to create new game tracks, but also generate a large amount of training data required by artificial intelligence algorithms. It may include, but is not limited to, using a game track editor to assist in designing the operation interface for generating tracks, where, as Figure 4As shown, the track in the editor can be regarded as being formed by connecting several section units in sequence end to end. When the level designer starts to design a new track, new sections need to be created, and the section type (such as 9 types including straight, curve, bend, ring, etc.) is selected, and at the same time the expected section parameters are input. For example, if the straight type is selected, multiple section parameters such as section length, width, road surface height, inclination angle, etc. need to be input. If the curve type is selected, parameters such as arc length or angle need to be input. Each section already has two gates by default, one called the Entry Gate and the other called the Exit Gate. Walls will not be generated on the edges of the section where there are gates, and walls are automatically generated by the program on other edges without gates. The walls will prevent the racing car from passing through. After two sections are created, the level designer can use the function of creating a new connection provided by the editor to select to establish a connection between the exit gate of section A and the entry gate of section B. After the connection is established, the position of section A displayed in the operation interface remains unchanged, while the position and attitude of section B will be automatically adjusted so that the entry of section B aligns with the exit of section A and adheres to A, that is, the relative position between section B and section A remains unchanged. After creating and editing sections A, B, C, D,... and establishing connections to make them connected end to end to form the main track, and also completing the design and editing of all shortcut tracks, the export track function of the editor can be used to export the track file saved in fbx format. This fbx file can perform the following steps, including but not limited to fine-tuning and refining the section shape using 3dmax software, performing art texture mapping using maya software, etc. The method for generating virtual roads proposed in this application can add an "intelligent one-key generation" function to this editor to generate game tracks with one key.
[0120] Specifically, in the editor, in the first step, click the + sign next to "Intelligent One - Key Generation" to bring up the parameter setting window, and enter the server address and the expected number of road segments of the track (usually 100) in the window; in the second step, press the Generate button, and the editor will send a generation request to the server. The track batch generation algorithm of the present application can include but is not limited to being deployed on the server. After receiving the request, the server generates a string of identifiers (the above - mentioned first virtual road identifier string) that can be used to represent the track and sends it back to the editor; in the third step, click the "Intelligent One - Key Generation" button, and the editor will create, connect, and visualize the identifiers in the identifier string in sequence according to the corresponding road segments or road - segment combinations on the editor interface to complete the entire track creation process. When generating the above - mentioned first virtual road identifier string, a part of the virtual road identifiers can be selected to be fixed, and only part of the virtual road identifiers are generated. Since the generation model of the first virtual road identifier string includes a probability sampling process, the virtual road identifier strings generated under the same input will not be fixed and will have a certain degree of randomness. Therefore, the virtual road identifier strings generated multiple times can be different from the previously generated virtual road identifier strings. The road segments generated according to the first virtual road identifier string can be directly used for making new tracks or can be used as a dataset for batch generation for other machine - learning - based track generation algorithms.
[0121] Exemplarily, a correspondence table of identifier - road - segment combinations is first constructed. A track is composed of multiple road segments connected end - to - end. One identifier (the above - mentioned virtual road - segment identifier) can be used to represent a type of road segment or road - segment combination. Each time a virtual road identifier string is generated, a string of identifiers with a length of about a (a can be 100) is generated on the server and sent to the editor. The editor constructs and visually presents the track in the editor according to the correspondence table of identifier - road - segment combinations. As Figure 13 shown, it is an overall flowchart for generating an identifier string representing a track. First, randomly sample one by one from straight roads, 180° curves, 90° curves, turning roads, transition curves, and transition turning roads, and continuously arrange the sampled virtual road - segment identifiers. There will be a determination of track overlap to ensure that the generated tracks do not overlap. Then, in the generated initial identifier string (the above - mentioned initial virtual road - segment identifier string), the generation of short - cut roads is achieved through the replacement of certain identifiers. Finally, the generation of airborne road segments is achieved through the replacement and insertion of some identifiers.
[0122] Furthermore, as Figures 6 to 9 shown in the correspondence table of identifier - road - segment combinations, the virtual road segment is the basic unit of the track. A track is composed of multiple road segments connected end - to - end. For each road segment, first, its road - segment type needs to be determined as a straight road, a curve, or a turning road, and then other road - segment parameters are determined, such as road length, road width, turning angle, etc. As Figure 3Three different types of road sections are shown schematically. In the editor, road section parameters such as length, width, and turning angle can be set as continuous float variables, so that various combinations of road sections can be obtained. In this method, variables can be discretized, that is, some road section or road section combination templates are fixed, so that the selection of road sections will be carried out among a limited number of options. Therefore, as Figures 6 to 9 shown, a label is used to correspond to a fixed road section or road section combination design, so that a race track can be generated by sampling among a limited number of road section options by selecting the label. In the label-road section combination comparison table, the name can be understood as the road section name described in natural language, and the road section parameters refer to the road section type determined for this road section when creating this road section using code in the editor, as well as the quantitative calculation logic of the three parameters of length, width, and turning angle, etc. After obtaining the label-road section combination comparison table, the basic race track is composed of road sections such as straight roads, curved roads, and turning roads. If a race track with 100 road sections is to be generated, 100 random samplings can be performed among the labels abcdefglmEFGHIJKLMN to obtain the race track. In this application, a generation method is proposed that takes into account both the randomness of the batch generation result of the race track and ensures that the race tracks do not overlap. Among them, first, an empty label string result is initialized. In the while loop, when the length of result has not reached 100, the content in the loop is continuously executed. In each iteration of the while loop, first, a label x is randomly sampled from abcdefglmEFGHIJKLMN and appended to the end of the current result. The race track is pre-simulated according to the label-road section combination comparison table. Starting from the beginning, the road sections represented by the other labels in result except x are traversed in turn, and a collision detection is performed with the road section represented by x. If no collision occurs, the next iteration of the while loop is carried out; if it is detected that the i-th road section collides with the x road section, all the labels in result after the i-th label are cut and deleted, and then the while loop continues. Usually, a race track composed of basic road sections with a length of 100 can be generated within 10 seconds.
[0123] It should be noted that shortcuts and empty sections can also be added to the track. After obtaining a track composed of basic sections without overlapping each other, the identification string can be checked one by one from the beginning. If an aba segment is detected, it is replaced by r, if an aca segment is detected, it is replaced by s, if an afa segment is detected, it is replaced by p, and if an aga segment is encountered, it is replaced by q. This achieves the technical effect of adding a shortcut segment combination to the track while ensuring that the main roads of the track do not overlap with each other. In addition, 10 identifications are randomly selected from all the identifications in the first virtual section identification string except the first identification, and the identification t is inserted in front of these identifications. When creating a track in the editor, the section represented by the identification will have a vertical downward offset of 2 units when connected to the previous section. This forms a type of vacant road section combination situation. For all the identifiers a in the current identifier string, each identifier has a 50% probability of being replaced by u. In the editor, u represents the second type of vacant road section. In actual use, the track designer can send a generation instruction to the server in the editor. The server generates a first virtual road section identification string according to the virtual road generation method proposed in this application. The first virtual road section identification string is sent to the editor, and the editor processes the first virtual road section identification string according to the identifier road section combination comparison table, and finally generates and visualizes the track in the interface.
[0124] Through the embodiments of the present application, the method for generating a virtual road proposed in the present application can be applied to an existing editor to intelligently and automatically generate an entire track, which includes elements such as straight tracks, standard curves, turns, transition curves, shortcuts, and aerial leaps. This allows a large number of tracks to be generated in a short period of time, and allows the tracks to have the style and quality of previously launched tracks. This reduces the manpower cost and labor intensity associated with planning and designing new tracks for racing game levels, improves the development efficiency of new tracks, and eliminates the need to worry about overfitting due to insufficient historical sample data in the process of generating new tracks, greatly improving the usability of generated tracks.
[0125] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0126] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0127] According to another aspect of the embodiments of the present application, there is also provided a virtual road generation device for implementing the above-mentioned virtual road generation method. As Figure 14 shown, the device includes:
[0128] An acquisition module 1402, configured to acquire a plurality of pre-set virtual section identifiers and the number of target sections, wherein one of the plurality of virtual section identifiers corresponds to one of the plurality of virtual sections, and the section parameters set for each virtual section in the plurality of virtual sections are different from each other, and the number of target sections is used to represent the number of virtual sections used to form the first target virtual road;
[0129] A sampling module 1404, configured to sample a first virtual section identifier string from the plurality of virtual section identifiers according to the number of target sections, wherein the number of virtual section identifiers in the first virtual section identifier string is the same as the number of target sections, and the virtual sections associated with the first virtual section identifier string do not overlap with each other;
[0130] A generation module 1406, configured to generate a first target virtual road according to the first virtual section identifier string, wherein the first target virtual road includes a first virtual section and a second virtual section with a connection relationship, and the virtual section identifiers corresponding to the first virtual section and the second virtual section are adjacent to each other in the first virtual section identifier string.
[0131] As an optional solution, the above device is used to sample a first virtual section identifier string from the above-mentioned plurality of virtual section identifiers in the following manner: acquire an initial identifier string, wherein the initial identifier string is pre-set to have no identifiers; sample the above-mentioned plurality of virtual section identifiers in a loop according to the number of target sections, and add the virtual section identifier obtained each time to the end of the initial identifier string; when the number of virtual section identifiers in the initial identifier string is the same as the number of target sections, determine the initial identifier string as the first virtual section identifier string, wherein the sorting order of the virtual section identifiers in the first virtual section identifier string is related to the execution order of the sampling operation.
[0132] As an alternative, the above-mentioned device is used to sample the first virtual road segment identification string from the above-mentioned multiple virtual road segment identifications according to the above-mentioned target road segment quantity in the following manner: perform the nth sampling on the above-mentioned multiple virtual road segment identifications to obtain the nth virtual road segment identification, where n is a positive integer; determine the corresponding nth virtual road segment according to the above-mentioned nth virtual road segment identification, where the above-mentioned multiple virtual road segments include the above-mentioned nth virtual road segment; perform a collision detection on the above-mentioned nth virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment in the above-mentioned sampled virtual road segments, where the above-mentioned sampled virtual road segments refer to the virtual road segments corresponding to the virtual road segment identifications obtained by performing the 1st sampling to the (n - 1)th sampling on the above-mentioned multiple virtual road segment identifications, and the above-mentioned collision virtual road segment refers to the virtual road segment in the above-mentioned sampled virtual road segments that collides with the above-mentioned nth virtual road segment; in the case where the above-mentioned collision virtual road segment is not detected, add the above-mentioned nth virtual road segment identification to the tail of the above-mentioned initial identification string; in the case where the above-mentioned collision virtual road segment is detected, delete the virtual road segment identifications corresponding to the collision virtual road segment to the above-mentioned nth virtual road segment in the above-mentioned collision detection virtual road from the above-mentioned initial identification string; in the case where the number of virtual road segment identifications in the above-mentioned initial identification string is the same as the above-mentioned target road segment quantity, determine the above-mentioned initial identification string as the above-mentioned first virtual road segment identification string.
[0133] As an alternative, the above-mentioned device is used to sample the first virtual road segment identification string from the above-mentioned multiple virtual road segment identifications according to the above-mentioned target road segment quantity in the following manner: perform the mth sampling on the above-mentioned multiple virtual road segment identifications to obtain the mth virtual road segment identification, where m is a positive integer; determine the corresponding mth virtual road segment according to the above-mentioned mth virtual road segment identification, where the above-mentioned multiple virtual road segments include the above-mentioned mth virtual road segment; perform a collision detection on the above-mentioned mth virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment in the above-mentioned sampled virtual road segments, where the above-mentioned sampled virtual road segments refer to the virtual road segments corresponding to the virtual road segment identifications obtained by performing the 1st sampling to the (m - 1)th sampling on the above-mentioned multiple virtual road segment identifications, and the above-mentioned collision virtual road segment refers to the virtual road segment in the above-mentioned sampled virtual road segments that collides with the above-mentioned mth virtual road segment; in the case where the above-mentioned collision virtual road segment is not detected, add the above-mentioned mth virtual road segment identification to the tail of the above-mentioned initial identification string; in the case where the above-mentioned collision virtual road segment is detected, delete the virtual road segment identifications corresponding to the (m - x)th virtual road segment to the above-mentioned mth virtual road segment in the above-mentioned collision detection virtual road from the above-mentioned initial identification string, where x is a positive integer less than m; in the case where the number of virtual road segment identifications in the above-mentioned initial identification string is the same as the above-mentioned target road segment quantity, determine the above-mentioned initial identification string as the above-mentioned first virtual road segment identification string.
[0134] As an alternative, the above device is further configured to: before obtaining the plurality of pre-set virtual road segment identifiers and the number of target road segments, obtain first sample road segment parameters corresponding to a first sample virtual road segment; randomly sample the values of the first sample road segment parameters to obtain second sample road segment parameters, and generate a second sample virtual road segment according to the second sample road segment parameters; set a first virtual road segment identifier for the first sample road segment parameters, and set a second virtual road segment identifier for the second sample road segment parameters to generate the plurality of virtual road segment identifiers.
[0135] As an alternative, the above device is configured to randomly sample the values of the first sample road segment parameters in the following manner to obtain second sample road segment parameters, and generate a second sample virtual road segment according to the second sample road segment parameters, including at least one of the following: obtaining a first length value of the first sample road segment parameters, randomly sampling and updating the first length value to obtain a second length value, and generating the second sample road segment parameters according to the second length value, where the first length value is different from the second length value; obtaining a first width value of the first sample road segment parameters, randomly sampling and updating the first width value to obtain a second width value, and generating the second sample road segment parameters according to the second width value, where the first width value is different from the second width value; obtaining a first inclination angle value of the first sample road segment parameters, randomly sampling and updating the first inclination angle value to obtain a second inclination angle value, and generating the second sample road segment parameters according to the second inclination angle value, where the first inclination angle value is different from the second inclination angle value; obtaining a first road segment height value of the first sample road segment parameters, randomly sampling and updating the first road segment height value to obtain a second road segment height value, and generating the second sample road segment parameters according to the second road segment height value, where the first road segment height value is different from the second road segment height value; obtaining a first road segment type value of the first sample road segment parameters, randomly sampling and updating the first road segment type value to obtain a second road segment type value, and generating the second sample road segment parameters according to the second road segment type value, where the first road segment type value is different from the second road segment type value.
[0136] As an alternative, the above device is used to generate the first target virtual road according to the above first virtual road segment identification string in the following manner: detect each virtual road segment identification in the above first virtual road segment identification string one by one to determine a target virtual road segment identification combination, where the above target virtual road segment identification combination includes a straight virtual road segment identification and a curved virtual road segment identification, and the positions adjacent to the front and back of the above curved virtual road segment identification in the above first virtual road segment identification string are both the above straight virtual road segment identifications; replace the above target virtual road segment identification combination with a shortcut virtual road segment identification having a matching relationship with the above target virtual road segment identification combination to obtain a second virtual road segment identification string, where the above shortcut virtual road segment identification corresponds to a shortcut virtual road segment combination, and the above shortcut virtual road segment combination includes a first straight virtual road segment and a second straight virtual road segment, a first curved virtual road segment and a second curved virtual road segment connecting the above first straight virtual road segment and the above second straight virtual road segment, and the road length of the above second curved virtual road segment is different from the road length of the above first curved virtual road segment; generate the above first target virtual road according to the above second virtual road segment identification string.
[0137] As an alternative, the above device is used to generate the first target virtual road according to the above first virtual road segment identification string in the following manner: randomly sample the virtual road segment identifications in the above first virtual road segment identification string except the first virtual road segment identification to determine a first virtual road segment identification to be emptied; add a first type of emptied virtual road segment identification at the front position of each of the above first virtual road segment identifications to be emptied in the above first virtual road segment identification string to obtain a third virtual road segment identification string, where the above first type of emptied virtual road segment identification is used to indicate that there is a preset height difference between the two virtual road segments connected to the virtual road segment corresponding to the above first type of emptied virtual road segment identification; generate the above first target virtual road according to the above third virtual road segment identification string.
[0138] As an alternative, the above device is used to generate the first target virtual road according to the above first virtual road segment identification string in the following manner: perform probability sampling on each virtual road segment identification in the above first virtual road segment identification string to determine a second virtual road segment identification to be emptied; replace each of the above second virtual road segment identifications to be emptied in the above first virtual road segment identification string with a second type of emptied virtual road segment identification to obtain a fourth virtual road segment identification string, where the virtual road segment corresponding to the above second type of emptied virtual road segment identification is a straight road segment with a preset slope value; generate the above first target virtual road according to the above fourth virtual road segment identification string.
[0139] As an alternative, the above-mentioned device is further configured to: after generating the first target virtual road according to the above-mentioned first virtual road segment identification string, sample a fifth virtual road segment identification string from the above-mentioned multiple virtual road segment identifications according to the above-mentioned target road segment quantity, where the number of virtual road segment identifications in the above-mentioned fifth virtual road segment identification string is the same as the above-mentioned target road segment quantity, each of the virtual road segments associated with the above-mentioned fifth virtual road segment identification string does not overlap with each other, the above-mentioned fifth virtual road segment identification string is different from the above-mentioned first virtual road segment identification string, and the above-mentioned target road segment quantity is further used to represent the number of virtual road segments used to form the second target virtual road; generate the second target virtual road according to the above-mentioned fifth virtual road segment identification string, where the above-mentioned second target virtual road includes a third virtual road segment and a fourth virtual road segment with a connection relationship, and the virtual road segment identifications corresponding to the above-mentioned third virtual road segment and the above-mentioned fourth virtual road segment are adjacent to each other in the above-mentioned fifth virtual road segment identification string, and the above-mentioned first target virtual road is different from the above-mentioned second target virtual road.
[0140] As an alternative, the above-mentioned device is further configured to: receive a target request message sent by a target client on a target server, where the above-mentioned target request message includes the above-mentioned target road segment quantity, and the above-mentioned target request message is a request message generated when the above-mentioned target client inputs the above-mentioned target road segment quantity and a target server address, and the above-mentioned target server address is used to connect to the above-mentioned target server; sample a first virtual road segment identification string from the above-mentioned multiple virtual road segment identifications according to the above-mentioned target road segment quantity on the above-mentioned target server, where the corresponding relationship between the above-mentioned multiple virtual road segment identifications and the above-mentioned multiple virtual road segments is stored on the above-mentioned target server; send the above-mentioned first virtual road segment identification string to the above-mentioned target client on the above-mentioned target server, so that the above-mentioned target client generates the above-mentioned first target virtual road according to the above-mentioned first virtual road segment identification string.
[0141] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0142] Regarding the device in the above-mentioned embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0143] According to one aspect of the present application, there is provided a computer program product, which includes a computer program.
[0144] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.
[0145] Figure 15 Schematically shown is a block diagram of a computer system of an electronic device for implementing the embodiments of the present application.
[0146] It should be noted that Figure 15 The computer system 1500 of the electronic device shown is only an example and should not impose any limitation on the functions and the scope of use of the embodiments of the present application.
[0147] As Figure 15 shown, the computer system 1500 includes a central processing unit 1501 (Central Processing Unit, CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1502 (Read-Only Memory, ROM) or a program loaded from a storage section 1508 into a random access memory 1503 (Random Access Memory, RAM). In the random access memory 1503, various programs and data required for system operations are also stored. The central processing unit 1501, the read-only memory 1502, and the random access memory 1503 are connected to each other via a bus 1504. An input / output interface 1505 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1504.
[0148] The following components are connected to the input / output interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including, for example, a cathode ray tube (Cathode Ray Tube, CRT), a liquid crystal display (Liquid Crystal Display, LCD), etc. and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a local area network card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the input / output interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed so that a computer program read therefrom can be installed into the storage section 1508 as needed.
[0149] In particular, according to the embodiments of the present application, the processes described in each method flowchart can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1509, and / or installed from the removable medium 1511. When the computer program is executed by the central processing unit 1501, various functions defined in the system of the present application are executed.
[0150] In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1509, and / or installed from the removable medium 1511. When the computer program is executed by the central processing unit 1501, various functions provided by the embodiments of the present application are executed.
[0151] According to another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned virtual road generation method is further provided. The electronic device may be Figure 1 the terminal device or server shown. This embodiment takes the electronic device as the terminal device as an example for illustration. As Figure 16 shown, the electronic device includes a memory 1602 and a processor 1604. A computer program is stored in the memory 1602, and the processor 1604 is configured to execute the steps in any of the above method embodiments through the computer program.
[0152] Optionally, in this embodiment, the above-mentioned electronic device may be at least one network device among multiple network devices in a computer network.
[0153] Optionally, in this embodiment, the above-mentioned processor may be configured to execute the methods in the embodiments of the present application through the computer program.
[0154] Optionally, those of ordinary skill in the art can understand that Figure 16 the structure shown is only schematic, Figure 16 and it does not limit the structure of the above-mentioned electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown in Figure 16 , or have a different configuration from that shown in Figure 16 .
[0155] Among them, the memory 1602 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for generating virtual roads in the embodiments of the present application. The processor 1604 executes various functional applications and data processing by running the software programs and modules stored in the memory 1602, that is, implements the above-mentioned method for generating virtual roads. The memory 1602 may include a high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 1602 may further include a memory remotely disposed relative to the processor 1604, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof. Among them, the memory 1602 can specifically but not limitedly be used to store information such as the first virtual road segment identification string. As an example, as Figure 16 shown, the above-mentioned memory 1602 may include but is not limited to the acquisition module 1402, sampling module 1404, and generation module 1406 in the above-mentioned device for generating virtual roads. In addition, it may also include but is not limited to other module units in the above-mentioned device for generating virtual roads, which will not be elaborated in this example.
[0156] Optionally, the above-mentioned transmission device 1606 is used to receive or send data via a network. Specific examples of the above network may include wired networks and wireless networks. In one instance, the transmission device 1606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, thereby enabling communication with the Internet or local area network. In one instance, the transmission device 1606 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0157] In addition, the above-mentioned electronic device further includes: a display 1608, which is used to display the above-mentioned first virtual road and the above-mentioned second virtual road; and a connection bus 1610, which is used to connect each module component in the above-mentioned electronic device.
[0158] In other embodiments, the above-mentioned terminal device or server can be a node in a distributed system. Among them, the distributed system can be a blockchain system, and the blockchain system can be a distributed system formed by connecting multiple nodes through network communication. Among them, the nodes can form a peer-to-peer network, and any form of computing device, such as servers, terminals and other electronic devices, can become a node in the blockchain system by joining the peer-to-peer network.
[0159] According to one aspect of the present application, there is provided a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the virtual road generation method provided in various alternative implementations of the above-mentioned virtual road generation aspect.
[0160] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be configured to store instructions for executing the methods in the various embodiments of the present application.
[0161] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a program instructing the relevant hardware of the terminal device. The program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disc, etc.
[0162] The serial numbers of the above embodiments of the present application are only for description and do not represent the superiority or inferiority of the embodiments.
[0163] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above-mentioned computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0164] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0165] In the several embodiments provided by the present application, it should be understood that the disclosed application program can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0166] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0168] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for generating a virtual road, characterized in that, Including: Obtaining a plurality of pre-set virtual road segment identifiers and a target road segment quantity, wherein one virtual road segment identifier among the plurality of virtual road segment identifiers corresponds to one virtual road segment among the plurality of virtual road segments, road segment parameters set for each virtual road segment among the plurality of virtual road segments are different from each other, and the target road segment quantity is used to represent the quantity of virtual road segments used to form a first target virtual road; Sampling a first virtual road segment identifier string from the plurality of virtual road segment identifiers according to the target road segment quantity, wherein the quantity of virtual road segment identifiers in the first virtual road segment identifier string is the same as the target road segment quantity, and virtual road segments associated with respective virtual road segment identifiers in the first virtual road segment identifier string do not overlap with each other; Generating the first target virtual road according to the first virtual road segment identifier string, wherein the first target virtual road includes a first virtual road segment and a second virtual road segment having a connection relationship, and virtual road segment identifiers corresponding to the first virtual road segment and the second virtual road segment are adjacent to each other in the first virtual road segment identifier string.
2. The method according to claim 1, wherein The sampling the first virtual road segment identifier string from the plurality of virtual road segment identifiers according to the target road segment quantity includes: Obtaining an initial identifier string, wherein the initial identifier string is pre-set to have no identifier; Sampling the plurality of virtual road segment identifiers cyclically according to the target road segment quantity, and adding the virtual road segment identifier obtained by each sampling to the tail of the initial identifier string; When the quantity of virtual road segment identifiers in the initial identifier string is the same as the target road segment quantity, determining the initial identifier string as the first virtual road segment identifier string, wherein the sorting order of respective virtual road segment identifiers in the first virtual road segment identifier string is related to the execution order of the sampling operation.
3. The method according to claim 2, wherein The sampling the first virtual road segment identifier string from the plurality of virtual road segment identifiers according to the target road segment quantity includes: Performing an nth sampling on the plurality of virtual road segment identifiers to obtain an nth virtual road segment identifier, wherein n is a positive integer; Determining a corresponding nth virtual road segment according to the nth virtual road segment identifier, wherein the plurality of virtual road segments includes the nth virtual road segment; Performing a collision detection on the nth virtual road segment and sampled virtual road segments to determine whether there is a collision virtual road segment among the sampled virtual road segments, wherein the sampled virtual road segments represent virtual road segments corresponding to virtual road segment identifiers obtained by performing a first sampling to an (n - 1)th sampling on the plurality of virtual road segment identifiers, and the collision virtual road segment represents a virtual road segment among the sampled virtual road segments that collides with the nth virtual road segment; When no collision virtual road segment is detected, adding the nth virtual road segment identifier to the tail of the initial identifier string; When the collision virtual road segment is detected, deleting virtual road segment identifiers corresponding to the collision virtual road segment to the nth virtual road segment in the collision detection virtual road from the initial identifier string; When the number of virtual road segment identifiers in the initial identifier string is the same as the number of target road segments, determine the initial identifier string as the first virtual road segment identifier string.
4. The method according to claim 2, wherein The sampling of the first virtual road segment identifier string from the multiple virtual road segment identifiers according to the number of target road segments includes: Performing the m-th sampling on the multiple virtual road segment identifiers to obtain the m-th virtual road segment identifier, where m is a positive integer; Determining the corresponding m-th virtual road segment according to the m-th virtual road segment identifier, where the multiple virtual road segments include the m-th virtual road segment; Performing collision detection on the m-th virtual road segment and the sampled virtual road segments to determine whether there is a collision virtual road segment among the sampled virtual road segments, where the sampled virtual road segments represent the virtual road segments corresponding to the virtual road segment identifiers obtained by performing the first sampling to the (m - 1)-th sampling on the multiple virtual road segment identifiers, and the collision virtual road segment represents the virtual road segment that collides with the m-th virtual road segment among the sampled virtual road segments; When no collision virtual road segment is detected, adding the m-th virtual road segment identifier to the end of the initial identifier string; When a collision virtual road segment is detected, deleting the virtual road segment identifiers corresponding to the (m - x)-th virtual road segment to the m-th virtual road segment in the collision detection virtual road, where x is a positive integer less than m; When the number of virtual road segment identifiers in the initial identifier string is the same as the number of target road segments, determine the initial identifier string as the first virtual road segment identifier string.
5. The method according to claim 1, characterized in that, Before obtaining the multiple pre-set virtual road segment identifiers and the number of target road segments, the method further includes: Obtaining the first sample road segment parameters corresponding to the first sample virtual road segment; Performing random sampling on the value of the first sample road segment parameters to obtain second sample road segment parameters, and generating a second sample virtual road segment according to the second sample road segment parameters; Setting a first virtual road segment identifier for the first sample road segment parameters and setting a second virtual road segment identifier for the second sample road segment parameters to generate the multiple virtual road segment identifiers.
6. The method according to claim 5, characterized in that, The performing random sampling on the value of the first sample road segment parameters to obtain second sample road segment parameters and generating a second sample virtual road segment according to the second sample road segment parameters includes at least one of the following: Obtaining the first length value of the first sample road segment parameters, performing random sampling and updating on the first length value to obtain a second length value, and generating the second sample road segment parameters according to the second length value, where the first length value is different from the second length value; Obtaining the first width value of the first sample road segment parameters, performing random sampling and updating on the first width value to obtain a second width value, and generating the second sample road segment parameters according to the second width value, where the first width value is different from the second width value; Obtain the first inclination angle value of the first sample road section parameters, randomly sample and update the first inclination angle value to obtain a second inclination angle value, and generate the second sample road section parameters according to the second inclination angle value, where the first inclination angle value is different from the second inclination angle value; Obtain the first road height value of the first sample road section parameters, randomly sample and update the first road height value to obtain a second road height value, and generate the second sample road section parameters according to the second road height value, where the first road height value is different from the second road height value; Obtain the first road type value of the first sample road section parameters, randomly sample and update the first road type value to obtain a second road type value, and generate the second sample road section parameters according to the second road type value, where the first road type value is different from the second road type value.
7. The method according to claim 1, wherein The generating the first target virtual road according to the first virtual road section identification string includes: Detect each virtual road section identification in the first virtual road section identification string one by one to determine a target virtual road section identification combination, where the target virtual road section identification combination includes a straight virtual road section identification and a curved virtual road section identification, and the straight virtual road section identifications are located at the positions adjacent to the front and back of the curved virtual road section identification in the first virtual road section identification string; Replace the target virtual road section identification combination with a shortcut virtual road section identification having a matching relationship with the target virtual road section identification combination to obtain a second virtual road section identification string, where the shortcut virtual road section identification corresponds to a shortcut virtual road section combination, and the shortcut virtual road section combination includes a first straight virtual road section and a second straight virtual road section, a first curved virtual road section and a second curved virtual road section connecting the first straight virtual road section and the second straight virtual road section, and the road length of the second curved virtual road section is different from the road length of the first curved virtual road section; Generate the first target virtual road according to the second virtual road section identification string.
8. The method according to claim 1, wherein The generating the first target virtual road according to the first virtual road section identification string includes: Randomly sample other virtual road section identifications in the first virtual road section identification string except the first virtual road section identification to determine a first virtual road section identification to be emptied; Add a first type of emptied virtual road section identification at the position in front of each first virtual road section identification to be emptied in the first virtual road section identification string to obtain a third virtual road section identification string, where the first type of emptied virtual road section identification is used to indicate that there is a preset height difference between two virtual road sections connected to the virtual road section corresponding to the first type of emptied virtual road section identification; Generate the first target virtual road according to the third virtual road section identification string.
9. The method according to claim 1, wherein The generating the first target virtual road according to the first virtual road section identification string includes: Perform probability sampling on each virtual road section identification in the first virtual road section identification string to determine a second virtual road section identification to be emptied; Replace each of the second virtual road sections to be vacated in the first virtual road section identification string with a second type of vacated virtual road section identification, obtaining a fourth virtual road section identification string, where the virtual road section corresponding to the second type of vacated virtual road section identification is a straight road section with a preset slope value; Generate the first target virtual road according to the fourth virtual road section identification string.
10. The method according to any one of claims 1 to 9, characterized in that, After generating the first target virtual road according to the first virtual road section identification string, the method further includes: Sample a fifth virtual road section identification string from the multiple virtual road section identifications according to the target road section quantity, where the number of virtual road section identifications in the fifth virtual road section identification string is the same as the target road section quantity, the virtual road sections associated with the fifth virtual road section identification string do not overlap with each other, the fifth virtual road section identification string is different from the first virtual road section identification string, and the target road section quantity is further used to represent the number of virtual road sections used to form the second target virtual road; Generate the second target virtual road according to the fifth virtual road section identification string, where the second target virtual road includes a third virtual road section and a fourth virtual road section with a connection relationship, and the virtual road section identifications corresponding to the third virtual road section and the fourth virtual road section are adjacent positions in the fifth virtual road section identification string, and the first target virtual road is different from the second target virtual road.
11. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Receive a target request message sent from a target client on a target server, where the target request message includes the target road section quantity, and the target request message is a request message generated when the target client inputs the target road section quantity and the target server address, and the target server address is used to connect to the target server; Sample a first virtual road section identification string from the multiple virtual road section identifications according to the target road section quantity on the target server, where the corresponding relationship between the multiple virtual road section identifications and the multiple virtual road sections is stored on the target server; Send the first virtual road section identification string to the target client on the target server, so that the target client generates the first target virtual road according to the first virtual road section identification string.
12. A virtual road generation device, characterized in that, Includes: An acquisition module, configured to acquire a plurality of pre-set virtual road section identifications and a target road section quantity, where one virtual road section identification in the plurality of virtual road section identifications corresponds to one virtual road section in the plurality of virtual road sections, the road section parameters set for each virtual road section in the plurality of virtual road sections are different from each other, and the target road section quantity is used to represent the number of virtual road sections used to form the first target virtual road; A sampling module, configured to sample a first virtual road section identification string from the multiple virtual road section identifications according to the target road section quantity, where the number of virtual road section identifications in the first virtual road section identification string is the same as the target road section quantity, and the virtual road sections associated with the first virtual road section identification string do not overlap with each other; A generation module, configured to generate the first target virtual road according to the first virtual road segment identification string, where the first target virtual road includes a first virtual road segment and a second virtual road segment having a connection relationship, and the virtual road segment identifications corresponding to the first virtual road segment and the second virtual road segment are adjacent to each other in the first virtual road segment identification string.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, where the computer program, when being run by an electronic device, executes the method described in any one of claims 1 to 11.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 11.
15. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method described in any one of claims 1 to 11 through the computer program.