Data transmission method, device and equipment across spatial coordinate systems, and storage medium

By using a cross-space coordinate system data transmission method, the problem of access cost caused by the difference between the coordinate systems of the logic system and the rendering end is solved, and the free connection without modifying the business logic and the optimization of the data transmission method are achieved.

CN114926577BActive Publication Date: 2026-04-17BEI JING YOU NUO KE JI GU FEN YOU XIAN GONG SI
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEI JING YOU NUO KE JI GU FEN YOU XIAN GONG SI
Filing Date
2022-06-01
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Because the spatial coordinate systems of the logic system and the rendering end are different, the logic system needs to be rewritten when connecting to different rendering ends, which increases the cost of connecting to a new rendering end.

Method used

By constructing the data from the first device based on the second coordinate system used by the second device, first data is obtained and sent to the second device, thereby realizing data transmission across spatial coordinate systems, including the mapping and processing of position, attitude, and scaling information.

Benefits of technology

Without modifying the business logic, it enables seamless integration between different coordinate systems, ensuring business independence, and only requires modification of the data transmission method without adding extra workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114926577B_ABST
    Figure CN114926577B_ABST
Patent Text Reader

Abstract

This application provides a data transmission method, apparatus, device, and storage medium across spatial coordinate systems, relating to the field of computer technology. The method includes: a first device constructing first data based on data from the first device using a second coordinate system used by a second device; and sending the first data to the second device; wherein the first device uses a first coordinate system, and if the first device is a rendering device, the second device is a logic device; or if the first device is a logic device, the second device is a rendering device. The solution of this application allows for free connection between logic devices and rendering devices in different coordinate systems without modifying business logic, ensuring business independence. Furthermore, when adapting the logic device and rendering device, only the data transmission method needs to be modified. Since the rendering device and logic device already require data connection, no new workload is added.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a data transmission method, apparatus, device, and computer-readable storage medium across spatial coordinate systems. Background Technology

[0002] With the rapid advancement of rendering technology, the advantages of various rendering platforms have become increasingly apparent. To enhance rendering capabilities in different areas, more and more products in the Geographic Information System (GIS) industry are beginning to abstract away the rendering layer and attempt to connect to multiple rendering endpoints. However, due to the inherent architecture of the logical system, which possesses a specific spatial coordinate system, the spatial coordinate system of the rendering endpoint is highly likely to differ from that of the logical system. This results in the logical and rendering endpoints needing to work together while using different coordinate systems. This forces many products to rewrite their logical systems to adapt to different rendering endpoints, significantly increasing the cost of integrating new rendering endpoints. Summary of the Invention

[0003] This application provides a data transmission method, apparatus, device, and computer-readable storage medium across spatial coordinate systems, aiming to solve at least one technical problem in the prior art.

[0004] According to one aspect of the embodiments of this application, a data transmission method across spatial coordinate systems is provided, applied to a first device, the method comprising:

[0005] The data from the first device is constructed based on the second coordinate system used by the second device to obtain the first data;

[0006] Send the first data to the second device;

[0007] Wherein, the first device uses a first coordinate system, and if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device.

[0008] In one possible implementation, the method further includes:

[0009] The device receives second data sent by the second device, which is constructed by the second device based on the first coordinate system used by the first device.

[0010] In another possible implementation, the units used by the first coordinate system and the units used by the second coordinate system differ numerically by N, where N is a power of 10.

[0011] The data includes one or more of the following:

[0012] Location information;

[0013] Attitude information;

[0014] Scaling information;

[0015] The location information includes: location point information or offset information, and the attitude information includes: orientation information, Euler angles, or quaternion information.

[0016] In yet another possible implementation, if the data includes location information, the step of constructing the first data based on the second coordinate system used by the second device includes:

[0017] If the first device is a rendering device and the second device is a logic device, then:

[0018] The z-value of the position information in the first coordinate system is mapped to the X-axis direction in the second coordinate system;

[0019] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0020] The position information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0021] The mapped x, y, and z values ​​are multiplied by N to obtain the first data.

[0022] If the first device is a logic device and the second device is a rendering device, then:

[0023] The position information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0024] The z-value of the position information in the first coordinate system is mapped to the Y-axis direction in the second coordinate system;

[0025] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0026] The mapped x, y, and z values ​​are divided by N to obtain the first data.

[0027] In another possible implementation, if the data includes attitude information, and the attitude information is orientation information or Euler angles, the step of constructing the first data based on the data of the first device using the second coordinate system used by the second device includes:

[0028] If the first device is a rendering device and the second device is a logic device, then:

[0029] The attitude information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0030] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0031] The attitude information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0032] The mapped x, y, and z values ​​are used as the first data;

[0033] If the first device is a logic device and the second device is a rendering device, then:

[0034] The attitude information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0035] The attitude information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0036] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0037] The mapped x, y, and z values ​​are used as the first data.

[0038] In another possible implementation, if the data includes attitude information, and the attitude information is quaternion information, the step of constructing the first data based on the second coordinate system used by the second device to obtain the first data includes:

[0039] The first rotation axis and the first rotation angle are solved from the quaternion information of the first device based on the first coordinate system;

[0040] The first rotation axis is transformed into the second coordinate system to obtain the second rotation axis, and the rotation direction of the first rotation angle is reversed to obtain the second rotation angle;

[0041] The quaternion information is constructed based on the second rotation axis and the second rotation angle of the second coordinate system to obtain the first data.

[0042] In yet another possible implementation, if the data includes scaling information, the step of constructing the first data based on the second coordinate system used by the second device includes:

[0043] If the first device is a rendering device and the second device is a logic device, then:

[0044] The scaling information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0045] The scaling information is mapped from the x-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0046] The scaling information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0047] The mapped x, y, and z values ​​are used as the first data;

[0048] If the first device is a logic device and the second device is a rendering device, then:

[0049] The scaling information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0050] The scaling information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0051] The scaling information is mapped from the x-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0052] The mapped x, y, and z values ​​are used as the first data.

[0053] According to another aspect of the embodiments of this application, a data transmission apparatus for cross-spatial coordinate systems is provided, applied to a first device, the apparatus comprising:

[0054] A construction module is used to construct the first data from the data of the first device based on the second coordinate system used by the second device;

[0055] The sending module sends the first data to the second device;

[0056] Wherein, the first device uses a first coordinate system, and if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device.

[0057] According to another aspect of the embodiments of this application, an electronic device is provided, including: a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method shown in the first aspect.

[0058] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein when the computer program is executed by a processor, it implements the steps of the method shown in the first aspect.

[0059] The beneficial effects of the technical solutions provided in this application are:

[0060] By using a first device with a first coordinate system to construct the data from the second device based on the second coordinate system used by the second device, and then sending the resulting first data to the second device, it is possible to freely connect the logic end and rendering end of different coordinate systems without modifying the business logic, thus ensuring the independence of the business. Moreover, when adapting the logic end and rendering end, only the data transmission method needs to be modified. Since the rendering end and logic end already require data interaction, no new workload is added. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0062] Figure 1 A flowchart illustrating a data transmission method across spatial coordinate systems provided in this application embodiment;

[0063] Figure 2 A schematic diagram of a data transmission device across spatial coordinate systems provided in this application embodiment;

[0064] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0065] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0067] With the rapid advancement of rendering technology, the advantages of various rendering platforms have become increasingly apparent. To enhance rendering capabilities in different areas, more and more products in the GIS industry are beginning to extract the rendering layer and attempt to connect to multiple rendering endpoints. However, due to the inherent architecture of the logical system, which possesses a specific spatial coordinate system, the spatial coordinate system of the rendering endpoint is highly likely to differ from that of the logical system. This results in the logical and rendering endpoints needing to work collaboratively while using different coordinate systems. This forces many products to rewrite their logical systems to adapt to different rendering endpoints, significantly increasing the cost of integrating new rendering endpoints.

[0068] The solution proposed in this application is to abstract the spatial composition of the coordinate system and perform mathematical transformation at the level of spatial composition, so as to achieve the ability to freely switch the same spatial representation on different coordinate systems and achieve collaborative work across spatial coordinate systems.

[0069] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0070] Figure 1 A data transmission method across spatial coordinate systems provided in this application embodiment is applied to a first device, such as... Figure 1 As shown, the method includes:

[0071] S101. The data from the first device is constructed based on the second coordinate system used by the second device to obtain the first data.

[0072] S102, Send the first data to the second device.

[0073] Wherein, the first device uses a first coordinate system, and if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device.

[0074] In this embodiment, by using a first device with a first coordinate system to construct the data of the first device based on the second coordinate system used by the second device, and then sending the obtained first data to the second device, it is possible to freely connect the logic end and rendering end of different coordinate systems without modifying the business logic, thus ensuring the independence of the business. Moreover, when adapting the logic end and the rendering end, only the data transmission method needs to be modified. Since the rendering end and the logic end already need to connect data, no new workload is added.

[0075] In some embodiments, the method further includes:

[0076] S103 (not shown in the figure): Receive the second data sent by the second device. The second data is constructed by the second device based on the first coordinate system used by the first device.

[0077] In the above embodiments, the units used by the first coordinate system and the units used by the second coordinate system differ numerically by N, where N is a power of 10.

[0078] The data includes one or more of the following:

[0079] Location information;

[0080] Attitude information;

[0081] Scaling information;

[0082] The location information includes: location point information or offset information, and the attitude information includes: orientation information, Euler angles, or quaternion information.

[0083] It should be noted that, in this embodiment, based on the Cartesian coordinate system, the spatial composition can be abstracted into three parts, namely position information, attitude information, and scaling information.

[0084] 1.1 Location Information

[0085] Static position information is represented by a point, indicating the object's current position; dynamic position information is represented by displacement, indicating the direction and distance the object moves; both are represented by three-dimensional vectors.

[0086] 1.2 Attitude Information

[0087] Static attitude information is orientation, which represents the object's current posture. Orientation can be represented using a three-dimensional vector. Dynamic attitude information is rotation, which represents the object's posture transformation process. Rotation can be represented using Euler angles or quaternions, and support for both Euler angles and quaternions is required.

[0088] 1.3 Scaling Information

[0089] Scaling information is relatively simple and can be represented by a three-dimensional vector. Static vectors represent the current scaling information in three dimensions, while dynamic vectors represent the scaling transformation information in three dimensions.

[0090] In the implementation of the embodiments of this application, the GIS logic system uses the A coordinate system corresponding to WebGL, while real-time rendering uses another B coordinate system corresponding to UE4. The following description will provide a detailed explanation of the solution of the embodiments of this application based on the collaboration of the A and B coordinate systems.

[0091] In one possible implementation, if the data includes location information, S101 may specifically include:

[0092] If the first device is a rendering device and the second device is a logic device, then:

[0093] The z-value of the position information in the first coordinate system is mapped to the X-axis direction in the second coordinate system;

[0094] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0095] The position information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0096] The mapped x, y, and z values ​​are multiplied by N to obtain the first data.

[0097] If the first device is a logic device and the second device is a rendering device, then:

[0098] The position information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0099] The z-value of the position information in the first coordinate system is mapped to the Y-axis direction in the second coordinate system;

[0100] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0101] The mapped x, y, and z values ​​are divided by N to obtain the first data.

[0102] In other words, in this embodiment, the location information may include a location point and offset information, specifically:

[0103] 2.1.1 Location point conversion

[0104] Let the position point in coordinate system A be ALocation, and the position point in coordinate system B be BLocation.

[0105] When ALocation is constructed by passing in BLocation, it means that the position points in the B coordinate system are represented using the A coordinate system. Comparing the coordinate axis directions, we map the Y value to the X axis, the Z value to the Y axis, and the X value to the negative Z axis direction. Since the unit of the B coordinate system is cm and the unit of the A coordinate system is m, the values ​​need to be divided by 100.

[0106] ALocaiton.x=BLocation.y / 100;

[0107] ALocaiton.y=BLocation.z / 100;

[0108] ALocaiton.z=-BLocation.x / 100;

[0109] When BLocation is constructed by passing in ALocation, it means that the position points in coordinate system A are represented using coordinate system B. Comparing the coordinate axis directions, we map the z-value to the X-axis, the x-value to the negative Y-axis, and the y-value to the Z-axis. Since the unit of coordinate system B is cm and the unit of coordinate system A is m, the values ​​need to be multiplied by 100.

[0110] BLocaiton.x=ALocation.z*100;

[0111] BLocaiton.y=-ALocation.x*100;

[0112] BLocaiton.z=ALocation.y*100.

[0113] 2.1.2 Offset Information Conversion

[0114] Let the offset of coordinate system A be AOffset and the offset of coordinate system B be BOffset. Similar to the conversion of position point information, the mutual conversion is as follows:

[0115] AOffset.x = BOffset.y / 100;

[0116] AOffset.y = BOffset.z / 100;

[0117] AOffset.z = -BOffset.x / 100;

[0118] BOffset.x = AOffset.z * 100;

[0119] BOffset.y = -AOffset.x * 100;

[0120] BOffset.z = AOffset.y * 100.

[0121] In another possible implementation, if the data includes attitude information, and the attitude information is orientation information or Euler angles, the step of constructing the first data based on the data of the first device using the second coordinate system used by the second device includes:

[0122] If the first device is a rendering device and the second device is a logic device, then:

[0123] The attitude information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0124] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0125] The attitude information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0126] The mapped x, y, and z values ​​are used as the first data;

[0127] If the first device is a logic device and the second device is a rendering device, then:

[0128] The attitude information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0129] The attitude information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0130] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0131] The mapped x, y, and z values ​​are used as the first data.

[0132] In other words, in this embodiment, the attitude information may include orientation information and rotation information, wherein the rotation information is Euler angles, specifically:

[0133] 2.2.1 Towards Information Transformation

[0134] Define the orientation of coordinate system A as ADirection and coordinate system B as BDirection. Since orientation is independent of distance, no unit scaling is needed.

[0135] When ADirection is constructed by passing BDirection, it means that the orientation of the B coordinate system is represented through the A coordinate system. Comparing the coordinate axis directions, we map Y values ​​to the X-axis, Z values ​​to the Y-axis, and X values ​​to the negative Z-axis direction.

[0136] ADirection.x=BDirection.y;

[0137] ADirection.y=BDirection.z;

[0138] ADirection.z=-BDirection.x;

[0139] When BDirection is constructed by passing ADirection, it means that the orientation of coordinate system A is represented by coordinate system B. Comparing the coordinate axis directions, we map z values ​​to the X-axis, x values ​​to the negative Y-axis, and y values ​​to the Z-axis.

[0140] BDirection.x=ADirection.z;

[0141] BDirection.y=-ADirection.x;

[0142] BDirection.z=ADirection.y.

[0143] 2.2.2 Rotation Information Conversion

[0144] 2.2.2.1 Euler Angle Conversion

[0145] Let the Euler angles of coordinate system A be AEuler and the Euler angles of coordinate system B be BEuler. Similar to the conversion of orientation information, the conversions are as follows:

[0146] AEuler.x = BEuler.y;

[0147] AEuler.y = BEuler.z;

[0148] AEuler.z = -BEuler.x;

[0149] BEuler.x = AEuler.z;

[0150] BEuler.y = -AEuler.x;

[0151] BEuler.z = AEuler.y.

[0152] In another possible implementation, if the data includes attitude information, and the attitude information is quaternion information, S101 may specifically include:

[0153] The first rotation axis and the first rotation angle are solved from the quaternion information of the first device based on the first coordinate system;

[0154] The first rotation axis is transformed into the second coordinate system to obtain the second rotation axis, and the rotation direction of the first rotation angle is reversed to obtain the second rotation angle;

[0155] The quaternion information is constructed based on the second rotation axis and the second rotation angle of the second coordinate system to obtain the first data.

[0156] In other words, in this embodiment, the rotation information included in the attitude information is quaternion information. A quaternion (x, y, z, w) can be used to represent the meaning of rotation α radians about the rotation axis Axis, so cos(α / 2) = w;

[0157] X = Axis.x*sin(α / 2);

[0158] Y = Axis.y*sin(α / 2);

[0159] z = Axis.z*sin(α / 2); therefore,

[0160] First, the current axis of rotation and radians can be solved from a quaternion based on the current coordinate system;

[0161] Then, the rotation axis is transformed into the target coordinate system;

[0162] Then, because the current coordinate system and the target coordinate system have different orbital sequences, the rotation direction is reversed;

[0163] Finally, a rotation quaternion is constructed based on the rotation axis and radian of the target coordinate system.

[0164] In the optimization of the scheme in this application, since the angle in both coordinate systems uses (α / 2), we do not need to calculate α again, and we can directly let α represent (α / 2).

[0165] Specifically:

[0166] 2.2.2.2 Quaternion Information Conversion

[0167] Let AQuat be the quaternion for coordinate system A, and BQuat be the quaternion for coordinate system B.

[0168] When AQuat is constructed by passing in BQuat, it means that the quaternion rotation in the B coordinate system is represented in the A coordinate system. Due to the complexity of quaternions, it is necessary to first solve the quaternion into rotation angle and rotation axis, then transform the rotation axis according to the orientation information, invert the rotation angle, and finally recombin the two to calculate the transformed quaternion.

[0169] (Rotation angle α)Alpha = acos(BQuat.w);

[0170] Old_x = BQuat.x / sin(Alpha);

[0171] Old_y = BQuat.y / sin(Alpha);

[0172] Old_z = BQuat.z / sin(Alpha);

[0173] New_x = Old_y;

[0174] New_y = Old_z;

[0175] New_z = -Old_x;

[0176] Alpha = -Alpha;

[0177] AQuat.x = sin(Alpha) * new_x;

[0178] AQuat.y = sin(Alpha) * new_y;

[0179] AQuat.z = sin(Alpha) * new_z;

[0180] AQuat.w = cos(Alpha).

[0181] When BQuat is constructed by passing AQuat, it means that the quaternion in coordinate system A is rotated and represented in coordinate system B. Due to the complexity of quaternions, we need to first solve the quaternion into rotation angle and rotation axis, then transform the rotation axis according to the orientation information, invert the rotation angle, and finally recombine the two to calculate the transformed quaternion.

[0182] Alpha = acos(AQuat.w);

[0183] Old_x = BQuat.x / sin(Alpha);

[0184] Old_y = BQuat.y / sin(Alpha);

[0185] Old_z = BQuat.z / sin(Alpha);

[0186] New_x = Old_z;

[0187] New_y = -Old_x;

[0188] New_z = Old_y;

[0189] Alpha = -Alpha;

[0190] BQuat.x = sin(Alpha) * new_x;

[0191] BQuat.y = sin(Alpha) * new_y;

[0192] BQuat.z = sin(Alpha) * new_z;

[0193] BQuat.w = cos(Alpha).

[0194] In yet another possible implementation, if the data includes scaling information, the step of constructing the first data based on the second coordinate system used by the second device includes:

[0195] If the first device is a rendering device and the second device is a logic device, then:

[0196] The scaling information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0197] The scaling information is mapped from the x-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0198] The scaling information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0199] The mapped x, y, and z values ​​are used as the first data;

[0200] If the first device is a logic device and the second device is a rendering device, then:

[0201] The scaling information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0202] The scaling information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0203] The scaling information is mapped from the x-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0204] The mapped x, y, and z values ​​are used as the first data.

[0205] In other words, in this embodiment, specifically:

[0206] 2.3 Scaling Information Transformation

[0207] Set the scaling of coordinate system A to AScale and the scaling of coordinate system B to BScale. Since scaling is independent of distance, unit scaling is not required. Also, scaling is independent of left-hand and right-hand frames, so inversion is not necessary.

[0208] When AScale is constructed by passing in BScale, it means that the scaling information of the B coordinate system is represented using the A coordinate system. Comparing the coordinate axis directions, we map Y values ​​to the X-axis, Z values ​​to the Y-axis, and X values ​​to the Z-axis.

[0209] AScale.x = BScale.y;

[0210] AScale.y = BScale.z;

[0211] AScale.z = BScale.x.

[0212] When BScale is constructed using AScale as input, it means that the scaling information of coordinate system A is represented using coordinate system B. Comparing the coordinate axis directions, we map z values ​​to the X-axis, x values ​​to the Y-axis, and y values ​​to the Z-axis.

[0213] BScale.x = AScale.z;

[0214] BScale.y = AScale.x;

[0215] BScale.z = AScale.y.

[0216] It should be understood that, in the embodiments of this application, position, orientation, and scaling information in a spatial coordinate system do not necessarily appear individually; they can also be represented as a unified whole. Typically, this comprehensive spatial information can be represented using matrices. Therefore, it is necessary to consider transforming the matrices within the spatial coordinate system simultaneously.

[0217] 3. Spatial integrated information transformation

[0218] Let AMat be the matrix for coordinate system A and BMat be the matrix for coordinate system B. We use the first, second, and third rows of the matrix to represent the X, Y, and Z axes of the current Cartesian coordinate system, and the first, second, and third elements of the fourth row to represent the offset distance of the object relative to the X, Y, and Z axes.

[0219] When AMat is constructed by passing in BMat, it means that the spatial information of the B coordinate system is represented by the A coordinate system.

[0220] AMat[1][1] = BMat[2][2];

[0221] AMat[1][2] = BMat[2][3];

[0222] AMat[1][3] = -BMat[2][1];

[0223] AMat[1][4] = 0;

[0224] AMat[2][1] = BMat[3][2];

[0225] AMat[2][2] = BMat[3][3];

[0226] AMat[2][3] = -BMat[3][1];

[0227] AMat[2][4]=0;

[0228] AMat[3][1] = -BMat[1][2];

[0229] AMat[3][2] = -BMat[1][3];

[0230] AMat[3][3] = BMat[1][1];

[0231] AMat[3][4]=0;

[0232] AMat[4][1]=BMat[4][2] / 100;

[0233] AMat[4][2]=BMat[4][3] / 100;

[0234] AMat[4][3]=-BMat[4][1] / 100;

[0235] AMat[4][4]=1.

[0236] When BMat is constructed by passing in AMat, it means that the spatial information of coordinate system A is represented by coordinate system B.

[0237] BMat[1][1] = AMat[3][3];

[0238] BMat[1][2] = -AMat[3][1];

[0239] BMat[1][3] = -AMat[3][2];

[0240] BMat[1][4] = 0;

[0241] BMat[2][1] = -AMat[1][3];

[0242] BMat[2][2] = AMat[1][1];

[0243] BMat[2][3] = AMat[1][2];

[0244] BMat[2][4] = 0;

[0245] BMat[3][1] = -AMat[2][3];

[0246] BMat[3][2] = AMat[2][1];

[0247] BMat[3][3] = AMat[2][2];

[0248] BMat[3][4] = 0;

[0249] BMat[4][1]=-AMat[4][3]*100;

[0250] BMat[4][2]=AMat[4][1]*100;

[0251] BMat[4][3]=AMat[4][2]*100;

[0252] BMat[4][4]=1.

[0253] Since rotation and scaling describe linear transformations, vectors can be directly multiplied by matrices to obtain the transformation result. Both rotation and scaling can be represented by 3x3 matrices, so a transformation representing rotation and scaling can be obtained by multiplying the matrices in the order of transformation.

[0254] However, translation matrices are not linear transformations and cannot be directly obtained by multiplying vectors and matrices. Therefore, we can place the vectors into homogeneous space, expanding them to 4 dimensions (x, y, z, 1), and at the same time expand the matrix to 4*4. The first three elements of the fourth row of the matrix represent the offset values ​​of the X, Y, and Z axes, respectively. In this way, after multiplying the vectors and matrices, the offsets can be directly added to each axis.

[0255] Therefore, the top-left 3x3 matrix of the 4x4 transformation matrix is ​​a combined transformation matrix of rotation and scaling, while the first three elements of the fourth row are the offset values ​​for the X, Y, and Z axes. Then, according to the description of the basis vectors of orthogonal matrices in linear algebra, each row or column of a 3x3 matrix can serve as a basis for the matrix. Therefore, only a basis transformation of the matrix is ​​needed.

[0256] Finally, when processing the three translation parameters, the translation vector is transformed into a vector in the target coordinate system, and then the value is assigned in the fourth row of the new matrix.

[0257] 4. Add transformation during data transmission to achieve cross-coordinate system adaptation.

[0258] 4.1 Data Transformation

[0259] When the rendering end receives data from the logic end, the previous direct assignment has been changed to a method where the B coordinate system data is constructed by passing in the A coordinate system data. That is, the logic data sent to the rendering end is logic data, and the rendering end constructs its own rendering data from the logic data.

[0260] 4.2 Data Transformation

[0261] When the logic side receives data from the rendering side, it changes from direct assignment to constructing data from coordinate system B by passing in coordinate system A data, as described above. In other words, the rendering data sent to the logic side is the rendering data itself, and the logic side constructs its own logical data from the rendering data.

[0262] In summary, the data transmission method across spatial coordinate systems provided in this application constructs the first data by using a first device with a first coordinate system based on a second coordinate system used by a second device, and then sends the first data to the second device. This allows for seamless integration between logic and rendering ends of different coordinate systems without modifying the business logic, ensuring business independence. Furthermore, adapting the logic and rendering ends only requires modifying the data transmission method; since the rendering and logic ends already require data integration, no new workload is added.

[0263] Figure 2 This application provides a data transmission device across spatial coordinate systems, which is applied to a first device, such as... Figure 2 As shown, the device 20 may include a construction module 201 and a transmission module 202. Wherein,

[0264] The construction module 201 is used to construct the first data based on the second coordinate system used by the second device.

[0265] The sending module 202 is used to send the first data to the second device.

[0266] Wherein, the first device uses a first coordinate system, and if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device.

[0267] Furthermore, it also includes: a receiving module, used to receive second data sent by the second device, the second data being constructed by the second device based on the first coordinate system used by the first device.

[0268] Furthermore, the units used in the first coordinate system and the units used in the second coordinate system differ numerically by N, where N is a power of 10;

[0269] The data includes one or more of the following:

[0270] Location information;

[0271] Attitude information;

[0272] Scaling information;

[0273] The location information includes: location point information or offset information, and the attitude information includes: orientation information, Euler angles, or quaternion information.

[0274] Furthermore, if the data includes location information, the construction module 201 is specifically used for:

[0275] If the first device is a rendering device and the second device is a logic device, then:

[0276] The z-value of the position information in the first coordinate system is mapped to the X-axis direction in the second coordinate system;

[0277] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0278] The position information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0279] The mapped x, y, and z values ​​are multiplied by N to obtain the first data.

[0280] If the first device is a logic device and the second device is a rendering device, then:

[0281] The position information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0282] The z-value of the position information in the first coordinate system is mapped to the Y-axis direction in the second coordinate system;

[0283] The x-value of the position information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0284] The mapped x, y, and z values ​​are divided by N to obtain the first data.

[0285] Furthermore, if the data includes attitude information, and the attitude information is orientation information or Euler angles, the construction module 201 is specifically used for:

[0286] If the first device is a rendering device and the second device is a logic device, then:

[0287] The attitude information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0288] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system;

[0289] The attitude information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0290] The mapped x, y, and z values ​​are used as the first data;

[0291] If the first device is a logic device and the second device is a rendering device, then:

[0292] The attitude information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0293] The attitude information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0294] The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system;

[0295] The mapped x, y, and z values ​​are used as the first data.

[0296] Furthermore, if the data includes attitude information, and the attitude information is quaternion information, the construction module 201 is specifically used for:

[0297] The first rotation axis and the first rotation angle are solved from the quaternion information of the first device based on the first coordinate system;

[0298] The first rotation axis is transformed into the second coordinate system to obtain the second rotation axis, and the rotation direction of the first rotation angle is reversed to obtain the second rotation angle;

[0299] The quaternion information is constructed based on the second rotation axis and the second rotation angle of the second coordinate system to obtain the first data.

[0300] Furthermore, if the data includes scaling information, the construction module 201 is specifically used for:

[0301] If the first device is a rendering device and the second device is a logic device, then:

[0302] The scaling information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0303] The scaling information is mapped from the x-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0304] The scaling information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0305] The mapped x, y, and z values ​​are used as the first data;

[0306] If the first device is a logic device and the second device is a rendering device, then:

[0307] The scaling information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system;

[0308] The scaling information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system;

[0309] The scaling information is mapped from the x-value in the first coordinate system to the Z-axis direction in the second coordinate system;

[0310] The mapped x, y, and z values ​​are used as the first data.

[0311] The apparatus in this application embodiment can execute the method provided in this application embodiment. Its implementation principle and the effect it can achieve are similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.

[0312] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the calibration method provided in this application. Compared with the prior art, this method allows for the following: by using a first device with a first coordinate system, the data of the first device is constructed based on a second coordinate system used by a second device. After obtaining the first data, it is sent to the second device. This allows for free connection between the logic end and the rendering end of different coordinate systems without modifying the business logic, ensuring the independence of the business. Moreover, when adapting the logic end and the rendering end, only the data transmission method needs to be modified. Since the rendering end and the logic end already require data connection, no new workload is added.

[0313] like Figure 3 The illustrated electronic device 30 includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302.

[0314] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0315] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0316] The memory 303 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0317] The memory 303 is used to store computer programs that execute the embodiments of this application, and the execution is controlled by the processor 301. The processor 301 is used to execute the computer programs stored in the memory 303 to implement the steps shown in the foregoing method embodiments.

[0318] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.

[0319] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.

[0320] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0321] It should be understood that although arrows indicate various operation steps in the flowcharts of the embodiments of this application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of the embodiments of this application, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and the embodiments of this application do not limit this.

[0322] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A method of data transmission across spatial coordinate systems, characterized by, Applied to a first device, the method includes: The data from the first device is constructed based on the second coordinate system used by the second device to obtain the first data; Send the first data to the second device; Wherein, the first device uses a first coordinate system; if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device. The method further includes: Receive second data sent by the second device, wherein the second data is constructed by the second device based on the first coordinate system used by the first device; The units used in the first coordinate system and the units used in the second coordinate system differ numerically by N, where N is a power of 10. The data includes one or more of the following: Location information; Attitude information; Scaling information; The location information includes: location point information or offset information, and the attitude information includes: orientation information, Euler angles, or quaternion information. If the data includes location information, the step of constructing the first data based on the second coordinate system used by the second device includes: If the first device is a rendering device and the second device is a logic device, then: The z-value of the position information in the first coordinate system is mapped to the X-axis direction in the second coordinate system; The x-value of the position information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system; The position information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are multiplied by N to obtain the first data. If the first device is a logic device and the second device is a rendering device, then: The position information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system; The z-value of the position information in the first coordinate system is mapped to the Y-axis direction in the second coordinate system; The x-value of the position information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system; The mapped x, y, and z values ​​are each divided by N to obtain the first data. If the data includes scaling information, the step of constructing the first data based on the second coordinate system used by the second device to obtain the first data includes: If the first device is a rendering device and the second device is a logic device, then: The scaling information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system; The scaling information is mapped from the x-value in the first coordinate system to the Y-axis direction in the second coordinate system; The scaling information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are used as the first data; If the first device is a logic device and the second device is a rendering device, then: The scaling information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system; The scaling information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system; The scaling information is mapped from the x-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are used as the first data.

2. The method of claim 1, wherein, If the data includes attitude information, and the attitude information is orientation information or Euler angles, the step of constructing the first data based on the data of the first device using the second coordinate system used by the second device includes: If the first device is a rendering device and the second device is a logic device, then: The attitude information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system; The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system; The attitude information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are used as the first data; If the first device is a logic device and the second device is a rendering device, then: The attitude information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system; The attitude information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system; The x-value of the attitude information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system; The mapped x, y, and z values ​​are used as the first data.

3. The method of claim 1, wherein, If the data includes attitude information, and the attitude information is quaternion information, the step of constructing the first data based on the data of the first device using the second coordinate system used by the second device includes: The first rotation axis and the first rotation angle are solved from the quaternion information of the first device based on the first coordinate system; The first rotation axis is transformed into the second coordinate system to obtain the second rotation axis, and the rotation direction of the first rotation angle is reversed to obtain the second rotation angle; The quaternion information is constructed based on the second rotation axis and the second rotation angle of the second coordinate system to obtain the first data.

4. A data transmission device for a cross-spatial coordinate system, characterized in that, Applied to a first device, the device includes: A construction module is used to construct the first data from the data of the first device based on the second coordinate system used by the second device; The sending module sends the first data to the second device; Wherein, the first device uses a first coordinate system; if the first device is a rendering device, the second device is a logic device; if the first device is a logic device, the second device is a rendering device. The data transmission device for the cross-spatial coordinate system further includes: Receive second data sent by the second device, wherein the second data is constructed by the second device based on the first coordinate system used by the first device; The units used in the first coordinate system and the units used in the second coordinate system differ numerically by N, where N is a power of 10. The data includes one or more of the following: Location information; Attitude information; Scaling information; The location information includes: location point information or offset information, and the attitude information includes: orientation information, Euler angles, or quaternion information. If the data includes location information, the step of constructing the first data based on the second coordinate system used by the second device includes: If the first device is a rendering device and the second device is a logic device, then: The z-value of the position information in the first coordinate system is mapped to the X-axis direction in the second coordinate system; The x-value of the position information in the first coordinate system is mapped to the negative direction of the Y-axis in the second coordinate system; The position information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are multiplied by N to obtain the first data. If the first device is a logic device and the second device is a rendering device, then: The position information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system; The z-value of the position information in the first coordinate system is mapped to the Y-axis direction in the second coordinate system; The x-value of the position information in the first coordinate system is mapped to the negative direction of the Z-axis in the second coordinate system; The mapped x, y, and z values ​​are each divided by N to obtain the first data. If the data includes scaling information, the step of constructing the first data based on the second coordinate system used by the second device to obtain the first data includes: If the first device is a rendering device and the second device is a logic device, then: The scaling information is mapped from the z-value in the first coordinate system to the X-axis direction in the second coordinate system; The scaling information is mapped from the x-value in the first coordinate system to the Y-axis direction in the second coordinate system; The scaling information is mapped from the y-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are used as the first data; If the first device is a logic device and the second device is a rendering device, then: The scaling information is mapped from the y-value in the first coordinate system to the X-axis direction in the second coordinate system; The scaling information is mapped from the z-value in the first coordinate system to the Y-axis direction in the second coordinate system; The scaling information is mapped from the x-value in the first coordinate system to the Z-axis direction in the second coordinate system; The mapped x, y, and z values ​​are used as the first data.

5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the data transmission method across spatial coordinate systems according to any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the data transmission method across spatial coordinate systems as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Map rendering method and system

    CN103390369A