Data synchronization method and electronic device
By mapping location information to serial number data for synchronization, the problem of high bandwidth pressure in IoT and digital twin technologies is solved, and fast and accurate location information synchronization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BOE TECHNOLOGY GROUP CO LTD
- Filing Date
- 2021-10-28
- Publication Date
- 2026-06-19
Smart Images

Figure CN116368820B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of digital twin technology, and in particular to a data synchronization method and electronic device. Background Technology
[0002] With the rapid development of technologies such as the Internet of Things and big data, building smart parks based on digital twin technology has become a development trend for major industrial parks. In spatial scenarios, a massive number of intelligent devices need to synchronize their location information in real time. Under the condition of a large number of concurrent devices, the total amount of location information data is relatively large, which will lead to significant bandwidth pressure. Summary of the Invention
[0003] In a first aspect, embodiments of this disclosure provide a data synchronization method, wherein the method is applied to a client and includes:
[0004] Obtain the location information of the target object within the target space scene;
[0005] The location information is mapped to obtain corresponding number data, and the amount of number data is less than the amount of location information.
[0006] The number data is sent to the service center so that the service center can send the number data to other clients.
[0007] In some embodiments, the positioning information includes: location information and / or orientation information;
[0008] The numbering data includes: a location area number corresponding to the location information and / or a direction area number corresponding to the direction information, wherein the amount of data for the location area number is less than the amount of data for the location information, and the amount of data for the direction area number is less than the amount of data for the direction information.
[0009] In some embodiments, the target space scene is an n-dimensional space, where n ≥ 2 and n is an integer;
[0010] The location information is n-dimensional data, and the location region number is 1-dimensional data;
[0011] The orientation information is n-dimensional data, and the orientation region number is 1-dimensional data.
[0012] In some embodiments, the step of mapping the location information to obtain corresponding number data includes:
[0013] The number data corresponding to the positioning information is determined based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different positioning information and number data.
[0014] In some embodiments, the positioning information includes the location information, and the target space scene is divided into multiple subspaces;
[0015] The mapping data includes a location mapping table, which contains multiple rows of data that correspond one-to-one with the subspace. Each row of data in the location mapping table includes the region location number of the corresponding subspace and first region description data for describing the region range defined by the corresponding subspace.
[0016] In some embodiments, the multiple subspaces divided into the target space scene have the same shape and equal size;
[0017] Alternatively, the multiple subspaces divided into the target space scene may not have the same shape and / or the same size.
[0018] In some embodiments, the target space scene is a 3D space, and the subspace is a cubic subspace;
[0019] The first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace.
[0020] In some embodiments, the step of determining the number data corresponding to the positioning information based on the pre-acquired mapping data configured for the target spatial scene includes:
[0021] The subspace where the target object is located is determined based on the first region description data and the location information in the pre-selected location mapping table, and the region location number of the subspace where the target object is located is obtained.
[0022] In some embodiments, the step of determining the subspace where the target object is located based on the first region description data and the location information in the pre-selected location mapping table, and obtaining the region location number of the subspace where the target object is located, includes:
[0023] Based on the previously obtained region location number, the first region description data, and the location information, detect whether the target object is within the subspace corresponding to the previously obtained region location number;
[0024] If so, the region location number of the subspace where the target object is currently located is the region location number obtained previously;
[0025] If not, then the candidate subspace set is obtained based on the previously obtained area location number, and the candidate subspace set includes at least one candidate subspace.
[0026] Based on the first region description data and the location information, detect whether the target object is located in one of the candidate subspaces in the candidate subspace set;
[0027] If so, the region location number of the candidate subspace where the target object is located shall be used as the region location number corresponding to the location signal;
[0028] If not, the candidate subspace set is updated, and the step of detecting whether the target object is within one of the candidate subspaces in the candidate subspace set based on the first region description data and the location information continues.
[0029] In some embodiments, the target space scene is a 3D space, and the positioning information includes the orientation information, which is a 3D direction vector corresponding to the orientation.
[0030] The mapping data includes an orientation mapping table, which is generated based on a pre-set virtual reference sphere, the surface of which is divided into multiple curved regions;
[0031] The orientation mapping table contains multiple rows of data that correspond one-to-one with the surface regions. Each row of data in the orientation mapping table includes the region orientation number of the corresponding surface region and second region description data for describing the range of the region defined by the corresponding surface region.
[0032] In some embodiments, the multiple curved regions divided by the surface of the virtual reference sphere have the same shape and equal size;
[0033] Alternatively, the multiple curved regions divided by the surface of the virtual reference sphere may not have the same shape and / or the same size.
[0034] In some embodiments, the curved surface region is a three-sided curved surface or a four-sided curved surface;
[0035] The second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region.
[0036] In some embodiments, the step of determining the number data corresponding to the positioning information based on the pre-acquired mapping data configured for the target spatial scene includes:
[0037] Based on the second region description data in the pre-selected orientation mapping table and the orientation information, determine the curved surface region that the target object faces when it is at the center of the virtual reference sphere, and obtain the region orientation number of the curved surface region that the target object faces.
[0038] In some embodiments, the step of determining the curved surface region that the target object faces when it is at the center of the virtual reference sphere, based on the second region description data in the pre-selected orientation mapping table and the orientation information, and obtaining the region orientation number of the curved surface region that the target object faces, includes:
[0039] Based on the orientation information, obtain the coordinates of the intersection point between the orientation of the target object and the surface of the virtual reference sphere when the target object is at the center of the virtual reference sphere;
[0040] Based on the previously obtained region orientation number, the second region description data, and the intersection point coordinates, detect whether the intersection point coordinates are within the surface region corresponding to the previously obtained region orientation number;
[0041] If so, the region orientation number of the curved surface area currently facing the target object is obtained as the region orientation number obtained previously;
[0042] If not, then the candidate surface region set is obtained based on the region orientation number obtained previously, and the candidate surface region set includes at least one candidate surface region.
[0043] Based on the second region description data and the intersection coordinates, detect whether the intersection coordinates are within one of the candidate surface regions in the candidate surface region set;
[0044] If so, the region orientation number of the candidate surface region where the intersection coordinates are located shall be used as the region orientation number of the surface region to which the target object is facing;
[0045] If not, the candidate surface region set is updated, and the step of detecting whether the intersection coordinates are within one of the candidate surface regions in the candidate surface region set is continued based on the second region description data and the intersection coordinates.
[0046] In some embodiments, the method further includes, before determining the number data corresponding to the positioning information based on pre-acquired mapping data:
[0047] The mapping data is obtained from the service center.
[0048] Store the mapping data.
[0049] In some embodiments, the step of storing the mapping data includes:
[0050] The mapping data is written to disk and cached in memory.
[0051] In some embodiments, after storing the mapping data, the method further includes:
[0052] In response to an update to the mapping data used by the target space scene within the service center, the stored mapping data used by the target space scene is synchronously updated.
[0053] In some embodiments, the step of mapping the location information to convert it into corresponding number data and the step of sending the number data to the service center further includes:
[0054] Check whether the currently obtained number data is the same as the previously obtained number data;
[0055] If they are the same, then proceed with the step of obtaining the location information of the target object within the target space scene;
[0056] If they are different, then the step of sending the number data to the service center is performed.
[0057] In some embodiments, when it is detected that the currently obtained number data is the same as the previously obtained number data, the step of obtaining the positioning information of the target object in the target space scene is performed after a set time interval.
[0058] The data synchronization method further includes:
[0059] In response to the detection that the currently obtained number data is the same as the previously obtained number data in i consecutive detections, it is determined whether the set time interval has reached the preset maximum time interval; where i≥1 and i is an integer;
[0060] If it is determined that the set time interval has reached the preset maximum time interval, then the set time interval is maintained unchanged;
[0061] If it is determined that the set time interval has not reached the preset maximum time interval, then the set time interval is increased;
[0062] When it is detected that the currently obtained number data is the same as the previously obtained number data, the method further includes: setting the set time interval to a preset default time interval;
[0063] After completing the step of sending the numbered data to the service center and after the preset default time interval has elapsed, the step of obtaining the location information of the target object in the target space scene is executed.
[0064] In some embodiments, the target space scene includes: a virtual game scene or a virtual interactive scene.
[0065] Secondly, this disclosure also provides a data synchronization method, which is applied to a client, and the data synchronization method includes:
[0066] Receive the serial number data sent by the service center;
[0067] The numbered data is mapped to obtain the location information of the target object in the target space scene. The amount of the numbered data is less than the amount of the location information.
[0068] In some embodiments, the numbering data includes: location area number and / or orientation area number;
[0069] The positioning information includes: location information corresponding to the location area number and / or orientation information corresponding to the orientation area number, wherein the data volume of the location area number is less than the data volume of the location information, and the data volume of the orientation area number is less than the data volume of the orientation information.
[0070] In some embodiments, the target space scene is an n-dimensional space, where n ≥ 2 and n is an integer;
[0071] The location information is n-dimensional data, and the location region number is 1-dimensional data;
[0072] The orientation information is n-dimensional data, and the orientation region number is 1-dimensional data.
[0073] In some embodiments, the step of mapping the numbered data to obtain the location information of the target object in the target space scene includes:
[0074] The location information corresponding to the numbered data is determined based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different location information and numbered data.
[0075] In some embodiments, the positioning information includes the location information, and the target space scene is divided into multiple subspaces;
[0076] The mapping data includes a location mapping table, which contains multiple rows of data that correspond one-to-one with the subspace. Each row of data in the location mapping table includes the region location number of the corresponding subspace and first region description data for describing the region range defined by the corresponding subspace. The first region description data includes at least representative location information pre-configured for the subspace.
[0077] In some embodiments, the target space scene is a 3D space, and the subspace is a cubic subspace;
[0078] The first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace, wherein the coordinates of the center point of the subspace serve as representative location information configured for the subspace.
[0079] In some embodiments, the step of determining the positioning information corresponding to the numbered data based on the pre-acquired mapping data configured for the target spatial scene includes:
[0080] Based on the pre-selected location mapping table and the location region number of the target object, the representative location information of the subspace where the target object is located is determined, and the determined representative location information is used as the location information of the target object in the target space scene.
[0081] In some embodiments, the target space scene is a 3D space, and the positioning information includes the orientation information, which is a 3D direction vector corresponding to the orientation.
[0082] The mapping data includes an orientation mapping table, which is generated based on a pre-set virtual reference sphere, the surface of which is divided into multiple curved regions;
[0083] The orientation mapping table contains multiple rows of data that correspond one-to-one with the surface regions. Each row of data in the orientation mapping table includes the region orientation number of the corresponding surface region and second region description data for describing the area range defined by the corresponding surface region. The second region description data includes at least representative orientation information pre-configured for the surface region.
[0084] In some embodiments, the curved surface region is a three-sided curved surface or a four-sided curved surface;
[0085] The second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region;
[0086] The direction vector from the center of the virtual reference sphere to the center point of the corresponding curved surface region serves as the representative orientation information configured for the curved surface region.
[0087] In some embodiments, the step of determining the positioning information corresponding to the numbered data based on the pre-acquired mapping data configured for the target spatial scene includes:
[0088] Based on the pre-selected orientation mapping table and the orientation region number of the target object, the representative orientation information of the curved surface region that the target object faces when it is at the center of the virtual reference sphere is determined, and the determined representative orientation information is used as the orientation information of the target object in the target space scene.
[0089] Thirdly, this disclosure also provides a data synchronization method, which is applied to a service center. The data synchronization method includes:
[0090] Receive the numbered data sent by the first client;
[0091] The number data is sent to the second client so that the second client can perform mapping processing on the received number data to obtain the location information of the target object in the target space scene.
[0092] In some embodiments, the data synchronization method further includes:
[0093] Receive the target space scene mapping data sent by the third client, wherein the mapping data contains the mapping relationship between different positioning information and number data;
[0094] Store the mapping data.
[0095] In some embodiments, the step of storing the mapping data includes:
[0096] The mapping data is written to disk and cached in memory.
[0097] In some embodiments, the data synchronization method further includes:
[0098] In response to an update of the mapping data within the third client, the stored mapping data is synchronously updated.
[0099] In some embodiments, the data synchronization method further includes:
[0100] In response to a download request sent by a fourth client, the mapping data requested by the fourth client is sent to the fourth client.
[0101] Fourthly, embodiments of this disclosure also provide an electronic device, including:
[0102] One or more first processors;
[0103] A first storage device, on which one or more programs are stored;
[0104] When the one or more programs are executed by the one or more first processors, the one or more first processors implement the data synchronization method provided by the first aspect or the second aspect.
[0105] Fifthly, embodiments of this disclosure also provide an electronic device, including:
[0106] One or more second processors;
[0107] A second storage device, on which one or more programs are stored;
[0108] When the one or more programs are executed by the one or more second processors, the one or more second processors implement the data synchronization method provided by the third aspect. Attached Figure Description
[0109] Figure 1 This is a system block diagram of the technical solution provided in the embodiments of this disclosure;
[0110] Figure 2 A flowchart of a data synchronization method provided in an embodiment of this disclosure;
[0111] Figure 3 A flowchart of another data synchronization method provided in this disclosure embodiment;
[0112] Figure 4A This is a flowchart of an optional implementation scheme of step S1021 in the embodiments of this disclosure;
[0113] Figure 4B This is a flowchart of an optional implementation scheme of step S10211 in the embodiments of this disclosure;
[0114] Figure 4C This is a schematic diagram illustrating the division of three-dimensional space into eight quadrants in an embodiment of this disclosure;
[0115] Figure 4D This is a flowchart of an optional implementation scheme of step S10212 in the embodiments of this disclosure;
[0116] Figure 5 This is a schematic diagram illustrating the division of a target space scene into subspaces in an embodiment of this disclosure;
[0117] Figure 6 This is another schematic diagram illustrating the division of the target space scene into subspaces in an embodiment of this disclosure;
[0118] Figure 7 This is a schematic diagram illustrating how the surface of a virtual reference sphere is divided into multiple curved surface regions in an embodiment of this disclosure;
[0119] Figure 8A flowchart illustrating yet another data synchronization method provided in this disclosure embodiment;
[0120] Figure 9 A flowchart illustrating yet another data synchronization method provided in this disclosure embodiment;
[0121] Figure 10 A flowchart illustrating yet another data synchronization method provided in this disclosure embodiment;
[0122] Figure 11 This is a flowchart of an optional implementation scheme of step S2021 in the embodiments of this disclosure;
[0123] Figure 12 A flowchart illustrating yet another data synchronization method provided in this disclosure embodiment;
[0124] Figure 13 A flowchart of another data synchronization method provided in an embodiment of this disclosure. Detailed Implementation
[0125] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0126] In this embodiment of the disclosure, "spatial scene" refers to a virtual digital scene constructed using modeling techniques (such as 3ds Max and AutoCAD), which can be rendered and displayed in a 3D engine; the spatial scene has a mapping relationship with the real physical space. In this embodiment of the disclosure, "object" refers to a virtual object located within the virtual digital scene, which is a mapping of a real intelligent device within the spatial scene.
[0127] Real-world smart devices need to synchronize the location information of the objects they map to within a spatial scene. In related technologies, the location information to be synchronized includes the object's position information and orientation information. The position information is represented by a three-dimensional coordinate (called position coordinate), and the orientation information is also represented by a three-dimensional vector (called orientation vector). Each dimension of the position coordinate and orientation vector is a 32-bit floating-point data (float32 data). That is to say, synchronizing one piece of location information requires synchronizing approximately 6 float32 data. When a large number of devices are running concurrently, the total amount of location information that needs to be synchronized is quite large, which will lead to significant bandwidth pressure.
[0128] To effectively address the aforementioned technical problems in related technologies, this disclosure provides corresponding solutions. The technical solutions provided by this disclosure can effectively reduce the amount of data during data synchronization and alleviate bandwidth pressure.
[0129] Figure 1 This is a system block diagram of the technical solution provided in the embodiments of this disclosure. Figure 1 As shown, the technical solution disclosed herein involves two types of terminals: client 1 and service center terminal 2. Client 1 can be the aforementioned smart device or a program installed on the aforementioned smart device (which, when run, can execute corresponding method steps). There are generally multiple clients 1. Service center terminal 2 is a device capable of providing centralized services to client 1 devices or a program installed on a device (which, when run, can provide centralized services to client 1). There is generally one service center terminal 2. Clients 1 synchronize data with each other through service center terminal 2.
[0130] Figure 2 This is a flowchart illustrating a data synchronization method provided in an embodiment of this disclosure. Figure 2 As shown, the data synchronization method provided in this embodiment is applied to a client and used to send synchronization data. The data synchronization method includes:
[0131] Step S101: Obtain the location information of the target object in the target space scene.
[0132] The target object is the mapping of the client executing the data synchronization method provided in this embodiment within the target space scene.
[0133] Generally, the client is equipped with sensors or input devices. The sensors or input devices generate corresponding control information in response to the user's operation. Based on this control information, the target object in the target space scene can be controlled. At the same time, the client can also obtain the positioning information of the target object in the target space scene.
[0134] Step S102: Map the location information to obtain the corresponding number data. The amount of number data is less than the amount of location information.
[0135] In step S102, the client can perform mapping processing on the location information based on a preset first mapping algorithm to obtain the corresponding number data; the technical solution of this disclosure does not limit the specific mapping algorithm used in step S102.
[0136] Step S103: Send the number data to the service center so that the service center can send the number data to other clients.
[0137] In step S103, the client sends the number data obtained in step S102 to the service center. The service center then sends the obtained number data (e.g., via broadcast) to other clients. Other clients can use a preset second mapping algorithm to map the number data to obtain the corresponding location information. The technical solution of this disclosure does not limit the specific mapping algorithm used by other clients in the process of mapping the number data.
[0138] Compared with the technical solutions in related technologies that directly transmit location information, the technical solution of this disclosure first maps the location information into numbered data with a relatively small amount of data, and then sends the numbered data to the service center so that other clients can perform data synchronization based on the numbered data. This can effectively reduce the amount of synchronized data and save bandwidth.
[0139] In some embodiments, the target space scene may include a virtual game scene; specifically, multiple clients may map multiple corresponding virtual objects within the same virtual game scene, and the multiple clients need to synchronize the location information of the virtual objects within the virtual game scene to ensure accurate game synchronization.
[0140] In some embodiments, the target space scene may include a virtual interactive scene; specifically, multiple clients in different locations may map multiple corresponding virtual objects in the same virtual interactive scene, and the multiple virtual objects may interact with each other in the virtual interactive scene.
[0141] In the aforementioned virtual game or virtual interaction scenarios, it is necessary for clients to quickly and accurately synchronize the location information of virtual objects to ensure a good user experience. The technical solution provided in this disclosure can effectively reduce the amount of data during the synchronization process, thereby meeting the requirement for quickly and accurately synchronizing the location information of virtual objects. Of course, the technical solution of this disclosure can also be applied to other scenarios, which will not be described in detail here.
[0142] In some embodiments, the positioning information includes location information and orientation information. The numbering data includes a location area number corresponding to the location information and an orientation area number corresponding to the orientation information. The amount of data for the location area number is less than the amount of data for the location information, and the amount of data for the orientation area number is less than the amount of data for the orientation information.
[0143] Optionally, the target space scene is an n-dimensional space, where n ≥ 2 and n is an integer; the location information is n-dimensional data, and the location region number is 1-dimensional data; the orientation information is n-dimensional data, and the orientation region number is 1-dimensional data.
[0144] As a specific example, the target space scene is a 3D space. Position information is represented by a 3D position coordinate, and orientation information is represented by a 3D direction vector. Each dimension of the position coordinate and direction vector is a 32-bit floating-point data (float32 data); that is, the data volume corresponding to one location information is 6 float32 data. The location region number obtained after mapping the position information is represented by a 1-dimensional 32-bit integer data (int32 data), and the orientation region number obtained after mapping the orientation information is represented by a 1-dimensional 32-bit integer data (int32 data); that is, the data volume corresponding to one number data is 2 int32 data. In other words, compared with the technical solutions in related technologies that directly transmit positioning information, the technical solution of this disclosure embodiment, by transmitting the number data obtained after mapping the positioning information, can reduce the amount of synchronization data by approximately 66.7%.
[0145] It should be noted that, in the embodiments of this disclosure, the positioning information may only include location information, that is, only the location information is mapped, and the numbering data may only include the location area number; alternatively, the positioning information may only include orientation information, that is, only the orientation information is mapped, and the numbering data may only include the orientation area number; furthermore, the positioning information may include both location and orientation information, but only the location information is mapped, and the orientation information is not mapped, in which case the location area number and orientation information can be sent to the service center; of course, the positioning information may also include both location and orientation information, but only the orientation information is mapped, and the location information is not mapped, in which case the orientation area number and location information can be sent to the service center. All of the above situations can reduce the amount of synchronized data and save bandwidth to a certain extent, and should also fall within the protection scope of this disclosure.
[0146] Figure 3 A flowchart illustrating another data synchronization method provided in this disclosure embodiment. Figure 3 As shown, Figure 3 The data synchronization method shown is based on Figure 2 A specific embodiment of the data synchronization method shown is provided, wherein step S102 specifically includes step S1021.
[0147] Step S1021: Determine the number data corresponding to the positioning information based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different positioning information and number data.
[0148] Specifically, the numbering data records the mapping relationship between different location information and location area number and / or the mapping relationship between different orientation information and orientation area number.
[0149] See also Figure 3 As shown, in some embodiments, the following step is further included between step S102 and step S103:
[0150] Step S103a: Check whether the currently obtained number data is the same as the previously obtained number data.
[0151] In step S103a, if the number data obtained in step S102 is the same as the number data obtained previously, then step S101 is executed. If the number data obtained in step S102 is different from the number data obtained previously, then step S103 is executed.
[0152] In some embodiments, when it is detected that the currently obtained number data is the same as the previously obtained number data, the step of obtaining the positioning information of the target object in the target space scene is performed after a set time interval.
[0153] In some embodiments, the data synchronization method further includes: in response to detecting i consecutive times that the currently obtained number data is the same as the previously obtained number data, determining whether the set time interval has reached a preset maximum time interval; wherein, i≥1 and i is an integer; if it is determined that the set time interval has reached the preset maximum time interval, then the set time interval is kept unchanged; if it is determined that the set time interval has not reached the preset maximum time interval, then the set time interval is increased.
[0154] In some embodiments, when it is detected that the currently obtained number data is the same as the previously obtained number data, the method further includes: setting the set time interval to a preset default time interval; and after completing the step of sending the number data to the service center and after the preset default time interval has elapsed, performing the step of obtaining the location information of the target object in the target space scene.
[0155] In some embodiments, the positioning information includes location information, and the target space scene is divided into multiple subspaces; the mapping data includes a location mapping table (the location mapping table is used to describe the mapping relationship between different location information and location area numbers), the location mapping table records multiple rows of data that correspond one-to-one with the subspaces, and each row of data in the location mapping table includes the area location number of the corresponding subspace and the first area description data used to describe the area range defined by the corresponding subspace.
[0156] In some embodiments, the multiple subspaces divided into the target spatial scene have the same shape and equal size; or, the multiple subspaces divided into the target spatial scene have different shapes and / or different sizes. For details regarding the division of the target spatial scene into subspaces, please refer to the following description.
[0157] Figure 4A This is a flowchart of an optional implementation scheme of step S1021 in the embodiments of this disclosure. Figure 4B This is a flowchart of an optional implementation scheme of step S10211 in the embodiments of this disclosure. Figure 4C This is a schematic diagram illustrating the division of three-dimensional space into eight quadrants in an embodiment of this disclosure. Figure 4D This is a flowchart of an optional implementation scheme for step S10212 in an embodiment of this disclosure. For example... Figures 4A to 4D As shown, in some embodiments, step S1021 includes: step S10211.
[0158] Step S10211: Determine the subspace where the target object is located based on the first region description data and location information in the pre-selected location mapping table, and obtain the region location number of the subspace where the target object is located.
[0159] In some embodiments, the first region description data includes at least representative location information pre-configured for the subspace. By setting representative location information to uniformly merge location information within the same subspace, the client can perform both the mapping process of location information to obtain the corresponding location region number and the mapping process of location region number to obtain the corresponding location information based on the same location mapping table. Simultaneously, it can reduce the frequency of data synchronization and lower jitter. Specific examples will be described later.
[0160] In some embodiments, the target space scene is a 3D space, and the subspace is a cubic subspace; the first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace. In this case, the coordinates of the center point of the subspace can be used as representative location information configured for the subspace.
[0161] It should be noted that using the coordinates of the center point of the subspace and the coordinates of a corresponding vertex of the subspace to describe the area defined by the subspace is merely illustrative and does not limit the technical solution of this disclosure. In the embodiments of this disclosure, other methods may also be used to describe the area defined by the subspace.
[0162] Figure 5 This is a schematic diagram illustrating the division of a target space scene into subspaces in an embodiment of this disclosure. For example... Figure 5 As shown, the target space scene can be divided into subspaces using either manual front-end partitioning or algorithmic partitioning. Among these, Figure 5The diagram illustrates the scenario where the target space scene is divided into multiple cubic subspaces of the same shape and size (referred to as "uniform density partitioning" in this disclosure). Each cubic subspace has a unique location region number (e.g., an int32 number), and a row of data can be generated for each cubic subspace as: {location region number, first region description data}.
[0163] As an optional approach, each cubic subspace corresponds to a row of data consisting of: {subspace location region number, subspace center point coordinates, subspace bottom-left vertex coordinates}; the data from all cubic subspaces forms a location mapping table. Figure 5 Taking a small cube subspace with a side length of 1 as an example, the cube subspace with position region number "1" has a center point coordinate of (0.5, 0.5, 0.5) and a bottom left vertex coordinate of (0, 0, 0). The cube subspace with position region number "2" has a center point coordinate of (1.5, 0.5, 0.5) and a bottom left vertex coordinate of (1, 0, 0). And so on, generating the position mapping table as follows: [{1, (0.5, 0.5, 0.5), (0, 0, 0)}, {2, (1.5, 0.5, 0.5), (1, 0, 0)}, {3, (2.5, 0.5, 0.5), (2, 0, 0)}, ...].
[0164] The corresponding location information, such as (0.1, 0, 0), (0.2, 0.3, 0.6f), and (0, 0, 0.8), all fall within the cube subspace with location region number "1". This location information is uniformly merged into the representative location information controlled by the cube subspace, i.e., the center point coordinates (0.5, 0.5, 0.5). When location information needs to be synchronized, only location region number "1" needs to be synchronized. Furthermore, when the location information of the target object changes within the same cube subspace, it is considered a location jitter phenomenon. Since the corresponding numbers are all 1, the location information does not need to be synchronized, thus reducing the frequency of data synchronization and avoiding location information jitter to a certain extent.
[0165] Figure 6 This is another schematic diagram illustrating the division of the target space scene into subspaces in an embodiment of this disclosure. For example... Figure 6 As shown, with Figure 5 The cases shown differ from those where the cube subspaces of the target space scene are all identical in shape and size. Figure 6 The diagram illustrates a case where the shapes and / or sizes of multiple cubic subspaces divided into target spatial scenes are not entirely the same (referred to in this disclosure as "non-uniform density partitioning").
[0166] In this embodiment of the disclosure, by dividing the target space scene into subspaces using a non-uniform density partitioning method, the problem of sparse distribution in some areas of the space scene can be effectively solved. That is, a location mapping table can contain distributions of different densities, which solves the differentiated distribution requirements of different sparse areas in the entire scene space, and helps to reduce the frequency of data synchronization and reduce jitter.
[0167] In this embodiment, the specific subdivision scheme for dividing the target spatial scene into subspaces is not limited. In practical applications, different subdivision schemes can be used to divide the same spatial scene into subspaces, and different location mapping tables can be obtained based on different subdivision schemes. When multiple location mapping tables are set for the same spatial scene, one of the location mapping tables can be selected as the current location mapping table applied to the target spatial scene according to actual needs (for example, pre-selected by a client or pre-selected by the service center).
[0168] See Figure 4B As shown, in some embodiments, step S10211 specifically includes:
[0169] Step S102111: Based on the previously obtained region location number, first region description data, and location information, detect whether the target object is within the subspace corresponding to the previously obtained region location number;
[0170] If yes, proceed to step S102112; otherwise, proceed to step S102113.
[0171] Step S102112: Obtain the region location number of the subspace where the target object is currently located, which is the region location number obtained previously.
[0172] Step S102113: Obtain a set of candidate subspaces based on the previously obtained area location number. The set of candidate subspaces includes at least one candidate subspace.
[0173] Step S102114: Detect whether the target object is located in a candidate subspace of the candidate subspace set based on the first region description data and location information.
[0174] If yes, proceed to step S102115; otherwise, proceed to step S102116.
[0175] Step S102115: Use the region location number of the candidate subspace where the target object is located as the region location number corresponding to the location signal.
[0176] Step S102116: Update the candidate subspace set.
[0177] After step S102116 is completed, the above-mentioned step of detecting whether the target object is in a candidate subspace of the candidate subspace set based on the first region description data and location information continues to be executed (i.e. step S102114).
[0178] As an example, when determining whether a target object with location information (x, y, z) is within the subspace of region location number k, we first look up the row of data corresponding to region location number k using the location mapping table: {k, (Xc, Yc, Zc), (Xl, Yl, Zl)}, where (Xc, Yc, Zc) represents the coordinates of the center point of the subspace of region location number k, and (Xl, Yl, Zl) represents the coordinates of the lower left corner of the subspace of region location number k. The coordinates of the upper right corner, symmetrical to the lower left corner about the center point, can be calculated and denoted as (Xr, Yr, Zr). If x, y, and z simultaneously satisfy: Xl≤x≤Xr, Yl≤y≤Yr, and Zl≤z≤Zr, then the target object with location information (x, y, z) is within the subspace of region location number k; otherwise, the target object with location information (x, y, z) is not within the subspace of region location number k.
[0179] When determining the region location number corresponding to a location information of (x, y, z), the previous region location number can be obtained first, denoted as j. Then, based on the currently obtained location information, it is determined whether the target object is within the region with region location number j (the specific determination method can be found in the previous content). If it is, it means that the location has not changed, and the region location number of the subspace where the target object is currently located is the region location number obtained previously. If it is not, it is determined whether the current location falls within a candidate subspace in the candidate subspace set. It should be noted that, in this embodiment of the disclosure, the candidate subspaces in the candidate subspace set can be selected according to a certain algorithm. For example, first, the subspaces adjacent to the subspace with the region location number obtained previously are selected as candidate subspaces to obtain an initial candidate subspace set; then, the center point coordinates (Xc, Yc, Zc) of the subspace with the region location number obtained previously are compared with the current location information (x, y, z) to further narrow down the candidate space. For example, see Figure 4C As shown, using the center point of the subspace with the previously obtained region location number as the origin, the three-dimensional space is divided into eight quadrants. For a detailed distribution, please refer to [reference needed]. Figure 4CAs shown, if the current location information (x, y, z) satisfies x > Xc, y > Yc, and z > Zc, it indicates that the point corresponding to the current location information falls in the I quadrant, thus narrowing down the candidate space set. If it is determined that the current location of the target object does not fall within any candidate subspace in the candidate subspace set, the candidate subspace set is updated. Other subspaces adjacent to the candidate subpixels in the current candidate subspace set and far from the subspace with region location number j are selected as new candidate subspaces, generating a new candidate subspace set. In other words, the candidate subspace set is recursively expanded and updated outwards according to the adjacent space, the next adjacent space, the adjacent space of the next adjacent space, and so on, connected to the subspace with region location number j obtained previously, until the region location number corresponding to the location information (x, y, z) is determined.
[0180] It should be noted that the above-mentioned technical means of determining the area location number corresponding to the location information through steps S102111 to S102116 is only an optional solution in the embodiments of this disclosure, and it will not limit the technical solution of this disclosure.
[0181] In some embodiments, the target space scene is a 3D space, and the positioning information includes orientation information, which is a 3D direction vector corresponding to the orientation; the mapping data includes an orientation mapping table (the orientation mapping table is used to describe the mapping relationship between different orientation information and orientation region numbers), the orientation mapping table is generated based on a pre-set virtual reference sphere, and the surface of the virtual reference sphere is divided into multiple curved surface regions; the orientation mapping table records multiple rows of data that correspond one-to-one with the curved surface regions, and each row of data in the orientation mapping table includes the region orientation number of the corresponding curved surface region and second region description data used to describe the region range defined by the corresponding curved surface region.
[0182] See also Figure 4A As shown, in some embodiments, step S1021 includes step S10212.
[0183] Step S10212: Determine the surface region that the target object faces when it is at the center of the virtual reference sphere based on the second region description data and orientation information in the pre-selected orientation mapping table, and obtain the region orientation number of the surface region that the target object faces.
[0184] In some embodiments, the second region description data includes at least representative orientation information pre-configured for the curved surface region. By setting representative orientation information to uniformly merge orientation information located within the same curved surface region, the client can perform both the process of mapping orientation information to obtain the corresponding orientation region number and the process of mapping orientation region number to obtain the corresponding orientation information based on the same orientation mapping table. Simultaneously, it can reduce the frequency of data synchronization and lower jitter. Specific examples will be described later.
[0185] In some embodiments, the multiple curved regions divided by the surface of the virtual reference sphere have the same shape and equal size; or, the multiple curved regions divided by the surface of the virtual reference sphere have different shapes and / or different sizes.
[0186] Figure 7 This is a schematic diagram illustrating how the surface of a virtual reference sphere is divided into multiple curved surface regions in an embodiment of this disclosure. For example... Figure 7 As shown, the surface of the virtual reference sphere can be divided into curved regions using either manual front-end division or algorithmic division. In some embodiments, two sets of concentric circles are used to divide the surface of the virtual reference sphere into multiple curved regions. The centers of the two sets of concentric circles are both the center of the virtual reference sphere, and their radii are the radius of the virtual reference sphere. Each set of concentric circles includes *s* concentric circles, all concentric circles in the same set have the same diameter, and the two diameters corresponding to the two sets of concentric circles are perpendicular. Within the same set of concentric circles, the angle between the planes of two adjacent concentric circles is 360° / s. In this case, the curved regions divided in the target space scene include multiple triangular curved regions and multiple quadrilateral curved regions.
[0187] In some embodiments, the second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region. In some embodiments, the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region serves as representative orientation information configured for the surface region.
[0188] It should be noted that when the center of the virtual reference sphere is the zero point (0, 0, 0), the coordinates of the center point of the surface region and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region can be represented by the same three-dimensional coordinates. That is, the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region can be represented by the coordinates of the center point of the surface region. In this case, the parameter "direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region" does not need to be set in the second region description data.
[0189] After dividing the surface region of the virtual reference sphere, each surface region will have a unique orientation region number (e.g., int32 number). At this time, a row of data can be generated for each surface region as: {orientation region number, second region description data}.
[0190] As an optional approach, each surface region corresponds to a single row of data consisting of: {the orientation region number of the surface region, the coordinates of the center point of the surface region, the coordinates of the lower left vertex of the surface region, and the direction vector from the center of the sphere to the coordinates of the center point of the surface region}. All the data for all surface regions form an orientation mapping table. The orientation information where the intersection of the corresponding ray and the sphere falls within the same surface region is uniformly grouped into the representative orientation information for that surface region, i.e., the coordinates of the center point of that surface region. When orientation information needs to be synchronized, only the orientation region number needs to be synchronized. Furthermore, when the intersection of the corresponding ray and the sphere changes within the same surface region, this is considered orientation jitter. Since it corresponds to the same orientation region number, the orientation information does not need to be synchronized, thus reducing the frequency of data synchronization and avoiding orientation information jitter to some extent.
[0191] It should be noted that, Figure 7 The method of using two sets of concentric circles to divide the surface of the virtual reference sphere shown is merely illustrative and does not limit the technical solution of this disclosure. Other methods can also be used to divide the curved surface region of the sphere, such as spherical triangle network partitioning algorithm, spherical quadrilateral network partitioning algorithm, or spherical latitude and longitude grid partitioning algorithm. Specific partitioning schemes will not be described in detail here.
[0192] See Figure 4D As shown, in some embodiments, step S10212 includes:
[0193] Step S102121: Obtain the coordinates of the intersection point between the orientation of the target object and the surface of the virtual reference sphere when the target object is at the center of the virtual reference sphere, based on the orientation information.
[0194] Step S102122: Based on the previously obtained region orientation number, second region description data, and intersection coordinates, check whether the intersection coordinates are within the surface region corresponding to the previously obtained region orientation number.
[0195] If yes, proceed to step S102123; otherwise, proceed to step S102124.
[0196] Step S102123: Obtain the region orientation number of the surface area currently facing the target object, which is the region orientation number obtained previously.
[0197] Step S102124: Obtain a set of candidate surface regions based on the region orientation number obtained in the previous step. The set of candidate surface regions includes at least one candidate surface region.
[0198] Step S102125: Based on the second region description data and the intersection coordinates, detect whether the intersection coordinates are within one of the candidate surface regions in the candidate surface region set;
[0199] If yes, proceed to step S102126; otherwise, proceed to step S102127.
[0200] Step S102126: Use the region orientation number of the candidate surface region where the intersection coordinates are located as the region orientation number of the surface region to which the target object is facing.
[0201] Step S102127: Update the set of candidate surface regions.
[0202] After step S102127 is completed, the next step (i.e. step S102125) is executed, which involves detecting whether the intersection coordinates are within a candidate surface region of the candidate surface region set based on the second region description data and the intersection coordinates.
[0203] The specific processes of steps S102122 to S102127 are similar to those of the preceding steps S102111 to S102116, and will not be described again here.
[0204] It should be noted that, Figure 4A The illustration only shows, by way of example, the case where step S1021 includes both steps S10211 and S10212, and step S10211 is executed before step S10212. In some embodiments, step S10211 may be executed after step S10212 or simultaneously with step S10212; in other embodiments, step S1021 may include only step S10211 or only step S10212; these cases should also fall within the scope of protection of this disclosure.
[0205] Figure 8 A flowchart illustrating yet another data synchronization method provided in this disclosure. Figure 8 As shown, this data synchronization method includes not only steps S101, S102, S103a, and S103, but also steps S100a and S100a before step S102. Figure 8 The illustration shows the case where steps S100a and S100 are executed before step S101, and step S104 is included after step S100. Figure 8The example diagram illustrates the case where step S104 is executed after step S103. Only steps S100a, S100, and S104 will be described in detail below.
[0206] Step S100a: Obtain mapping data from the service center.
[0207] The client can send a download request to the service center through the discovery mechanism to download the corresponding mapping data.
[0208] Step S100: Store the mapping data.
[0209] The client can store the downloaded mapping data locally.
[0210] In some embodiments, the client can write the downloaded mapping data to disk and save it to the database, while also caching a copy of the data in memory, which helps improve the client's data throughput.
[0211] Step S104: In response to the update of the mapping data used by the target space scene in the service center, the stored mapping data used by the target space scene is updated synchronously.
[0212] The client can also monitor the mapping data in the service center in real time through the watch mechanism. When the mapping data in the service center is updated, the client will synchronize and update the mapping data stored locally (including hard disk and cache).
[0213] In this embodiment of the disclosure, the client can obtain the mapping data in a timely manner and perform online hot updates through the discovery and monitoring mechanisms.
[0214] Based on the same inventive concept, this disclosure also provides a data synchronization method, which is applied to a client and used to receive synchronized data (i.e., the "other clients" involved in the previous embodiments). Figure 9 A flowchart illustrating yet another data synchronization method provided in an embodiment of this disclosure. (See flowchart for example.) Figure 9 As shown, the data synchronization method includes:
[0215] Step S201: Receive the number data sent by the service center.
[0216] Step S202: Map the numbered data to obtain the location information of the target object in the target space scene. The amount of numbered data is less than the amount of location information.
[0217] Compared with related technologies that directly receive location information, the technical solution of this disclosure pre-maps the location information into numbered data with a relatively small amount of data and sends the numbered data to the service center. Then, the client obtains the numbered data from the service center to synchronize the data. The technical solution provided by this disclosure can effectively reduce the amount of synchronized data and save bandwidth.
[0218] In some embodiments, the numbering data includes: location area number and / or orientation area number; the positioning information includes: location information corresponding to the location area number and / or orientation information corresponding to the orientation area number, wherein the data volume of the location area number is less than the data volume of the location information, and the data volume of the orientation area number is less than the data volume of the orientation information.
[0219] Optionally, the target space scene is an n-dimensional space, where n ≥ 2 and n is an integer; the location information is n-dimensional data, and the location region number is 1-dimensional data; the orientation information is n-dimensional data, and the orientation region number is 1-dimensional data.
[0220] As a specific example, the target space scene is a 3D space. Position information is represented by a 3D position coordinate, and orientation information is represented by a 3D direction vector. Each dimension of the position coordinate and direction vector is a 32-bit floating-point data (float32 data); that is, the data volume corresponding to one location information is 6 float32 data. The location region number obtained after mapping the position information is represented by a 1-dimensional 32-bit integer data (int32 data), and the orientation region number obtained after mapping the orientation information is represented by a 1-dimensional 32-bit integer data (int32 data); that is, the data volume corresponding to one number data is 2 int32 data. In other words, compared with the technical solutions in related technologies that directly receive positioning information, the technical solution of this disclosure embodiment, by receiving the number data obtained after mapping the positioning information, can reduce the amount of synchronization data by approximately 66.7%.
[0221] Figure 10 A flowchart illustrating yet another data synchronization method provided in an embodiment of this disclosure. (See flowchart for example.) Figure 10 As shown, Figure 10 The data synchronization method shown is based on Figure 9 A specific embodiment of the data synchronization method shown is provided, wherein step S202 specifically includes step S2021.
[0222] Step S2021: Determine the positioning information corresponding to the numbered data based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different positioning information and numbered data.
[0223] In some embodiments, the positioning information includes location information, and the target space scene is divided into multiple subspaces; the mapping data includes a location mapping table, which records multiple rows of data corresponding one-to-one with the subspaces. Each row of data in the location mapping table includes the region location number of the corresponding subspace and first region description data for describing the area range defined by the corresponding subspace. The first region description data includes at least representative location information pre-configured for the subspace.
[0224] Figure 11 This is a flowchart of an optional implementation scheme for step S2021 in an embodiment of this disclosure. For example... Figure 11 As shown, in some embodiments, step S2021 includes: step S20211.
[0225] Step S20211: Determine the representative location information of the subspace where the target object is located based on the pre-selected location mapping table and the location region number of the target object, and use the determined representative location information as the location information of the target object in the target space scene.
[0226] In some embodiments, the target space scene is a 3D space, and the subspace is a cubic subspace; the first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace, and the coordinates of the center point of the subspace serve as representative location information configured for the subspace.
[0227] It should be noted that the description of the location mapping table and the representative location information of the subspace where the target object is located based on the location mapping table and the location region number in the embodiments of this disclosure can be found in the relevant content in the previous embodiments, and will not be repeated here.
[0228] In some embodiments, the target space scene is a 3D space, and the positioning information includes orientation information, which is a 3D direction vector corresponding to the orientation; the mapping data includes an orientation mapping table, which is generated based on a pre-set virtual reference sphere, and the surface of the virtual reference sphere is divided into multiple curved regions; the orientation mapping table records multiple rows of data that correspond one-to-one with the curved regions, and each row of data in the orientation mapping table includes the region orientation number of the corresponding curved region and second region description data for describing the region range defined by the corresponding curved region, and the second region description data includes at least representative orientation information pre-configured for the curved region.
[0229] See also Figure 11 As shown, in some embodiments, step S2021 includes step S20212.
[0230] Step S20212: Determine the representative orientation information of the curved surface region that the target object faces when it is at the center of the virtual reference sphere, based on the pre-selected orientation mapping table and the orientation region number of the target object, and use the determined representative orientation information as the orientation information of the target object in the target space scene.
[0231] In some embodiments, the surface region is a three-sided surface or a four-sided surface; the second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region; the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region serves as representative orientation information configured for the surface region.
[0232] It should be noted that the description of the orientation mapping table and the representative orientation information of the curved surface region to which the target object is oriented based on the orientation mapping table and the orientation region number in the embodiments of this disclosure can be found in the relevant content in the previous embodiments, and will not be repeated here.
[0233] It should be noted that in practical applications, a single client can simultaneously perform the functions of sending and receiving synchronization data. In other words, the same client can perform both. Figure 2 , Figure 3 , Figure 8 The data synchronization method shown can be used to send synchronization data outwards, or it can be executed. Figure 9 , Figure 10 The data synchronization method shown is used to receive synchronized data.
[0234] Based on the same inventive concept, this disclosure also provides a data synchronization method, which is applied to a service center. Figure 12 A flowchart illustrating yet another data synchronization method provided in an embodiment of this disclosure. (See flowchart for example.) Figure 12 As shown, the data synchronization method includes:
[0235] Step S301: Receive the number data sent by the first client.
[0236] Step S302: Send number data to the second client so that the second client can perform mapping processing on the received number data to obtain the location information of the target object in the target space scene.
[0237] The first client can be the one executed in the previous embodiment. Figure 2 , Figure 3 , Figure 8 The client of the method shown can be the second client that executes the method described in the previous embodiment. Figure 9 , Figure 10 The client for the data synchronization method shown.
[0238] Figure 13 A flowchart illustrating yet another data synchronization method provided in an embodiment of this disclosure. (See flowchart for example.) Figure 13 As shown, this data synchronization method includes not only the aforementioned steps S301 and S302, but also steps S300a and S300 before step S301, and steps S303 and S304 after step S300. Figure 13 The illustration shows the case where steps S303 and S304 are executed after step S302.
[0239] Step S300a: Receive the target space scene mapping data sent by the third client. The mapping data contains the mapping relationship between different positioning information and number data.
[0240] The third client is distinct from the first and second clients. It can send mapping data of the target spatial scene to the service center via a registration mechanism, allowing the service center to store this data. The mapping data stored at the service center can then be downloaded by other clients (e.g., the first and second clients).
[0241] Step S300: Store the mapping data.
[0242] In some embodiments, the service center can write the mapping data sent by the third client to disk and save it to the database, while also caching a copy of the data in memory, which helps improve the data throughput of the service center.
[0243] Step S303: In response to the update of the mapping data in the third client, the stored mapping data is updated synchronously.
[0244] Step S304: In response to the download request sent by the fourth client, send the mapping data requested by the fourth client to the fourth client.
[0245] The fourth client can be any client, for example, the fourth client can be the first client or the second client mentioned above.
[0246] Based on the same inventive concept, this disclosure also provides an electronic device that can be used as a client in the foregoing embodiments. The electronic device includes one or more first processors and a first storage device; the first storage device stores one or more programs, which, when executed by the one or more first processors, cause the one or more first processors to perform the following... Figure 2 , Figure 3 , Figure 8 , Figure 9 and Figure 10 The steps in the data synchronization method provided in any of the embodiments shown.
[0247] Based on the same inventive concept, this disclosure also provides an electronic device that can be used as a service center terminal in the foregoing embodiments. The electronic device includes: one or more second processors and a second storage device; the second storage device stores one or more programs, which, when executed by the one or more second processors, cause the one or more second processors to perform the following... Figure 12 or Figure 13 The steps in the data synchronization method provided in the illustrated embodiment.
[0248] It should be noted that the first processor and the second processor mentioned above are devices with data processing capabilities, including but not limited to central processing units (CPUs); the first storage device and the second storage device are devices with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH). The first / second processor and the first / second storage device can be connected through an I / O interface to realize information exchange between the first / second processor and the first / second storage device. The I / O interface includes but is not limited to a data bus.
[0249] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A data synchronization method, wherein, The data synchronization method is used to drive the real-time synchronization of the positioning information of virtual objects in the target space scene. The target space scene is a virtual digital scene, which includes multiple virtual objects. The virtual objects are the client's mapping in the target space scene. The client is configured to send the location information of the virtual object it maps within the target space scene to the service center, so that the service center can synchronize the location information of the virtual object to other clients; the client is also configured to receive the location information of the virtual object mapped by other clients within the target space scene from the service center. The service center is configured to communicate with multiple clients to synchronize the location information of the virtual object mapped by any one client within the target space scene to other clients. The data synchronization method is applied to the client, and the data synchronization method includes: The positioning information is mapped to obtain corresponding number data, and the amount of number data is less than the amount of positioning information; the target space scene is a 3D space, the positioning information includes location information and orientation information, and the number data includes a location area number corresponding to the location information and an orientation area number corresponding to the orientation information. The number data is sent to the service center so that the service center can send the number data to other clients, enabling other clients to map the number data to obtain the location information of the target object in the target space scene. This achieves at least data synchronization between the client and the other clients regarding the location information of the target object in the target space scene, wherein the target object is a virtual object mapped by the client in the target space scene.
2. The data synchronization method according to claim 1, wherein, The amount of data for the location region number is less than the amount of data for the location information, and the amount of data for the orientation region number is less than the amount of data for the orientation information.
3. The data synchronization method according to claim 2, wherein, The location information is n-dimensional data, and the location region number is 1-dimensional data; The orientation information is n-dimensional data, and the orientation region number is 1-dimensional data; n≥2 and n is an integer.
4. The data synchronization method according to claim 2 or 3, wherein, The steps of mapping the location information to obtain the corresponding number data include: The number data corresponding to the positioning information is determined based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different positioning information and number data.
5. The data synchronization method according to claim 4, wherein, The positioning information includes the location information, and the target space scene is divided into multiple subspaces; The mapping data includes a location mapping table, which contains multiple rows of data that correspond one-to-one with the subspace. Each row of data in the location mapping table includes the location region number of the corresponding subspace and first region description data for describing the area range defined by the corresponding subspace.
6. The data synchronization method according to claim 5, wherein, The target space scene is divided into multiple subspaces with the same shape and equal size; Alternatively, the multiple subspaces divided into the target space scene may not have the same shape and / or the same size.
7. The data synchronization method according to claim 5, wherein, The subspace is a cubic subspace; The first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace.
8. The data synchronization method according to any one of claims 5 to 7, wherein, The step of determining the number data corresponding to the positioning information based on the pre-acquired mapping data configured for the target space scene includes: The subspace where the target object is located is determined based on the first region description data and the location information in the pre-selected location mapping table, and the location region number of the subspace where the target object is located is obtained.
9. The data synchronization method according to claim 8, wherein, The steps of determining the subspace where the target object is located based on the first region description data and the location information in the pre-selected location mapping table, and obtaining the location region number of the subspace where the target object is located, include: Based on the previously obtained location region number, the first region description data, and the location information, detect whether the target object is within the subspace corresponding to the previously obtained location region number; If so, the location region number of the subspace where the target object is currently located is the same as the location region number obtained previously; If not, then the candidate subspace set is obtained based on the location area number obtained previously, and the candidate subspace set includes at least one candidate subspace. Based on the first region description data and the location information, detect whether the target object is located in one of the candidate subspaces in the candidate subspace set; If so, the location region number of the candidate subspace where the target object is located shall be used as the location region number corresponding to the location information; If not, the candidate subspace set is updated, and the step of detecting whether the target object is within one of the candidate subspaces in the candidate subspace set based on the first region description data and the location information continues.
10. The data synchronization method according to any one of claims 4 to 9, wherein, The positioning information includes the orientation information, which is a 3D direction vector corresponding to the orientation. The mapping data includes an orientation mapping table, which is generated based on a pre-set virtual reference sphere, the surface of which is divided into multiple curved regions; The orientation mapping table contains multiple rows of data that correspond one-to-one with the surface regions. Each row of data in the orientation mapping table includes the orientation region number of the corresponding surface region and second region description data for describing the range of the area defined by the corresponding surface region.
11. The data synchronization method according to claim 10, wherein, The multiple curved regions divided by the surface of the virtual reference sphere have the same shape and equal size; Alternatively, the multiple curved regions divided by the surface of the virtual reference sphere may not have the same shape and / or the same size.
12. The data synchronization method according to claim 10, wherein, The curved surface region is a three-sided curved surface or a four-sided curved surface; The second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region.
13. The data synchronization method according to any one of claims 10 to 12, wherein, The step of determining the number data corresponding to the positioning information based on the pre-acquired mapping data configured for the target space scene includes: Based on the second region description data in the pre-selected orientation mapping table and the orientation information, determine the curved surface region that the target object faces when it is at the center of the virtual reference sphere, and obtain the orientation region number of the curved surface region that the target object faces.
14. The data synchronization method according to claim 13, wherein, The steps of determining the curved surface region that the target object faces when it is at the center of the virtual reference sphere, based on the second region description data in the pre-selected orientation mapping table and the orientation information, and obtaining the orientation region number of the curved surface region that the target object faces, include: Based on the orientation information, obtain the coordinates of the intersection point between the orientation of the target object and the surface of the virtual reference sphere when the target object is at the center of the virtual reference sphere; Based on the previously obtained orientation region number, the second region description data, and the intersection point coordinates, detect whether the intersection point coordinates are within the surface region corresponding to the previously obtained orientation region number; If so, the orientation region number of the curved surface region currently facing the target object is the orientation region number obtained previously; If not, then obtain a set of candidate surface regions based on the orientation region number obtained previously, the set of candidate surface regions including at least one candidate surface region. Based on the second region description data and the intersection coordinates, detect whether the intersection coordinates are within one of the candidate surface regions in the candidate surface region set; If so, the orientation region number of the candidate surface region where the intersection coordinates are located shall be used as the orientation region number of the surface region to which the target object is facing; If not, the candidate surface region set is updated, and the step of detecting whether the intersection coordinates are within one of the candidate surface regions in the candidate surface region set is continued based on the second region description data and the intersection coordinates.
15. The data synchronization method according to any one of claims 4 to 14, wherein, Before the step of determining the number data corresponding to the positioning information based on the pre-acquired mapping data, the method further includes: The mapping data is obtained from the service center. Store the mapping data.
16. The data synchronization method according to claim 15, wherein, The steps for storing the mapping data include: The mapping data is written to disk and cached in memory.
17. The data synchronization method according to claim 15 or 16, wherein, After storing the mapping data, the following is also included: In response to an update to the mapping data used by the target space scene within the service center, the stored mapping data used by the target space scene is synchronously updated.
18. The data synchronization method according to any one of claims 1 to 17, wherein, Between the step of mapping the location information to convert it into corresponding number data and the step of sending the number data to the service center, the following method is also included: Check whether the currently obtained number data is the same as the previously obtained number data; If they are the same, then proceed with the step of obtaining the location information of the target object within the target space scene; If they are different, then the step of sending the number data to the service center is performed.
19. The data synchronization method according to claim 18, wherein, When it is detected that the currently obtained number data is the same as the previously obtained number data, the step of obtaining the positioning information of the target object in the target space scene is executed after a set time interval. The data synchronization method further includes: In response to the detection that the currently obtained number data is the same as the previously obtained number data in i consecutive detections, it is determined whether the set time interval has reached the preset maximum time interval; where i≥1 and i is an integer; If it is determined that the set time interval has reached the preset maximum time interval, then the set time interval is maintained unchanged; If it is determined that the set time interval has not reached the preset maximum time interval, then the set time interval is increased; When it is detected that the currently obtained number data is different from the previously obtained number data, the method further includes: setting the set time interval to a preset default time interval; After completing the step of sending the numbered data to the service center and after the preset default time interval has elapsed, the step of obtaining the location information of the target object in the target space scene is executed.
20. The data synchronization method according to any one of claims 1 to 19, wherein, The target space scene includes: virtual game scene or virtual interactive scene.
21. A data synchronization method, wherein, The data synchronization method is used to drive the real-time synchronization of the positioning information of virtual objects in the target space scene. The target space scene is a virtual digital scene, which includes multiple virtual objects. The virtual objects are the client's mapping in the target space scene. The client is configured to send the location information of the virtual object it maps within the target space scene to the service center, so that the service center can synchronize the location information of the virtual object to other clients; the client is also configured to receive the location information of the virtual object mapped by other clients within the target space scene from the service center. The service center is configured to communicate with multiple clients to synchronize the location information of the virtual object mapped by any one client within the target space scene to other clients. The data synchronization method is applied to the client, and the data synchronization method includes: The system receives numbered data from the service center, wherein the numbered data is generated and sent to the service center by the other client using the data synchronization method as described in any one of claims 1 to 20, and the client and the other client are different clients; the target space scene is a 3D space, the positioning information includes location information and orientation information, and the numbered data includes a location area number corresponding to the location information and an orientation area number corresponding to the orientation information. The numbered data is mapped to obtain the location information of the target object mapped by the other client in the target space scene, so as to at least realize the data synchronization between the client and the other client regarding the location information of the target object mapped by the other client in the target space scene. The amount of the numbered data is less than the amount of the location information, and the target object is a virtual object mapped by the other client in the target space scene.
22. The data synchronization method according to claim 21, wherein, The amount of data for the location region number is less than the amount of data for the location information, and the amount of data for the orientation region number is less than the amount of data for the orientation information.
23. The data synchronization method according to claim 22, wherein, The location information is n-dimensional data, and the location region number is 1-dimensional data; The orientation information is n-dimensional data, and the orientation region number is 1-dimensional data; n≥2 and n is an integer.
24. The data synchronization method according to claim 22 or 23, wherein, The steps of mapping the numbered data to obtain the location information of the target object in the target space scene include: The location information corresponding to the numbered data is determined based on the mapping data configured in the target space scene obtained in advance. The mapping data contains the mapping relationship between different location information and numbered data.
25. The data synchronization method according to claim 24, wherein, The positioning information includes the location information, and the target space scene is divided into multiple subspaces; The mapping data includes a location mapping table, which contains multiple rows of data that correspond one-to-one with the subspace. Each row of data in the location mapping table includes the location region number of the corresponding subspace and first region description data for describing the area range defined by the corresponding subspace. The first region description data includes at least representative location information pre-configured for the subspace.
26. The data synchronization method according to claim 25, wherein, The subspace is a cubic subspace; The first region description data includes the coordinates of the center point of the corresponding subspace and the coordinates of a vertex of the corresponding subspace, wherein the coordinates of the center point of the subspace serve as representative location information configured for the subspace.
27. The data synchronization method according to claim 25 or 26, wherein, The step of determining the positioning information corresponding to the numbered data based on the pre-acquired mapping data configured for the target spatial scene includes: Based on the pre-selected location mapping table and the location region number of the target object, the representative location information of the subspace where the target object is located is determined, and the determined representative location information is used as the location information of the target object in the target space scene.
28. The data synchronization method according to any one of claims 24 to 27, wherein, The positioning information includes the orientation information, which is a 3D direction vector corresponding to the orientation. The mapping data includes an orientation mapping table, which is generated based on a pre-set virtual reference sphere, the surface of which is divided into multiple curved regions; The orientation mapping table contains multiple rows of data that correspond one-to-one with the surface regions. Each row of data in the orientation mapping table includes the orientation region number of the corresponding surface region and second region description data for describing the area range defined by the corresponding surface region. The second region description data includes at least representative orientation information pre-configured for the surface region.
29. The data synchronization method according to claim 28, wherein, The curved surface region is a three-sided curved surface or a four-sided curved surface; The second region description data includes the coordinates of the center point of the corresponding surface region, the coordinates of a vertex of the corresponding surface region, and the direction vector from the center of the virtual reference sphere to the center point of the corresponding surface region; The direction vector from the center of the virtual reference sphere to the center point of the corresponding curved surface region serves as the representative orientation information configured for the curved surface region.
30. The data synchronization method according to claim 28 or 29, wherein, The step of determining the positioning information corresponding to the numbered data based on the pre-acquired mapping data configured for the target spatial scene includes: Based on the pre-selected orientation mapping table and the orientation region number of the target object, the representative orientation information of the curved surface region that the target object faces when it is at the center of the virtual reference sphere is determined, and the determined representative orientation information is used as the orientation information of the target object in the target space scene.
31. A data synchronization method, wherein, The data synchronization method is used to drive the real-time synchronization of the positioning information of virtual objects in the target space scene. The target space scene is a virtual digital scene, which includes multiple virtual objects. The virtual objects are the client's mapping in the target space scene. The client is configured to send the location information of the virtual object it maps within the target space scene to the service center, so that the service center can synchronize the location information of the virtual object to other clients; the client is also configured to receive the location information of the virtual object mapped by other clients within the target space scene from the service center. The service center is configured to communicate with multiple clients to synchronize the location information of the virtual object mapped by any one client within the target space scene to other clients. The data synchronization method is applied to the service center end, and the data synchronization method includes: The system receives numbered data sent by the client, wherein the numbered data is generated by the client using the data synchronization method as described in any one of claims 1 to 20; The numbered data is sent to the other clients so that the other clients can perform mapping processing on the received numbered data to obtain the location information of the target object mapped by the client in the target space scene. This at least achieves data synchronization between the client and the other clients regarding the location information of the target object mapped by the client in the target space scene. The amount of data in the numbered data is less than the amount of data in the location information. The other clients are different from the client. The target object is a virtual object mapped by the client in the target space scene.
32. The data synchronization method according to claim 31, wherein, Also includes: Receive the target space scene mapping data sent by the third client, wherein the mapping data contains the mapping relationship between different positioning information and number data; Store the mapping data.
33. The data synchronization method according to claim 32, wherein, The steps for storing the mapping data include: The mapping data is written to disk and cached in memory.
34. The data synchronization method according to claim 32 or 33, wherein, Also includes: In response to an update of the mapping data within the third client, the stored mapping data is synchronously updated.
35. The data synchronization method according to any one of claims 32 to 34, wherein, Also includes: In response to a download request sent by a fourth client, the mapping data requested by the fourth client is sent to the fourth client.
36. An electronic device comprising: One or more first processors; A first storage device, on which one or more programs are stored; When the one or more programs are executed by the one or more first processors, the one or more first processors cause the one or more first processors to implement the method as described in any one of claims 1 to 30.
37. An electronic device comprising: One or more second processors; A second storage device, on which one or more programs are stored; When the one or more programs are executed by the one or more second processors, the one or more second processors implement the method as described in any one of claims 31 to 35.