Model file processing method and device, terminal equipment and storage medium

By encrypting the buffer view of the three-dimensional model file on the web page, the model encrypted file is generated for transmission, which solves the contradiction between transmission security and resource consumption and realizes efficient and secure model file transmission.

CN120011323APending Publication Date: 2025-05-16CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311561872.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-11-15
Filing Date
2023-11-21
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When transmitting three-dimensional model files on the web page, it is difficult for the prior art to ensure the security of transmission while reducing resource consumption of computer equipment, especially when the data volume is large.

Method used

By obtaining the buffer view of the model file, encrypting it without encrypting the entire model file, the model encrypted file is generated for transmission.

Benefits of technology

This method performs excellently in ensuring the security of model file transmission on the web page, while reducing resource consumption of computer equipment and improving transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011323A_ABST
    Figure CN120011323A_ABST
Patent Text Reader

Abstract

The invention provides a model file processing method and device, terminal equipment and a storage medium, and is suitable for the technical field of computers, the method comprises the following steps: determining a buffer view of a model file; and encrypting the model data in the buffer view, so that the model file is converted into a model encryption file transmitted at a webpage end. According to the method, the buffer view of the webpage side model file is firstly obtained, the buffer view is directly encrypted, and the whole model file does not need to be encrypted, so that the transmission security of the webpage side model file is guaranteed, and meanwhile, the resource consumption of computer equipment can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, terminal device, and storage medium for processing a model file. Background Art

[0002] The ability to perform graphics calculations in web browsers has greatly improved, and the application of 3D models on the web is expected to become increasingly widespread. Due to the inevitable data transmission delay between browsers and servers, GLTF (Graphics Language Transmission Format), with its excellent performance and open source nature, is gradually becoming the standard data format for the 3D web.

[0003] When transmitting 3D model files on a web page, encryption is required to ensure data security. Due to the large size of 3D models, browser encryption consumes considerable resources. Furthermore, to reduce the size of the 3D model during transmission, compression is often used. However, this compressed data has security limitations and is easily cracked.

[0004] Therefore, when it comes to transmitting model files on the web, how to ensure transmission security while reducing the resource consumption of computer equipment is a technical problem that needs to be solved. Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, terminal device and storage medium for processing a model file, which can solve the technical problem of the prior art of how to ensure the transmission security of the model file on the web page while reducing the resource consumption of the computer device.

[0006] In a first aspect, an embodiment of the present application provides a method for processing a model file, the method comprising:

[0007] Determine the buffer view of the model file;

[0008] The model data in the buffer view is encrypted so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

[0009] In an embodiment of the present application, a buffer view of the web page model file is first obtained, and the buffer view is directly encrypted without encrypting the entire model file, thereby ensuring the transmission security of the web page model file while reducing the resource consumption of the computer device.

[0010] In some embodiments, determining the buffer view of the model file includes:

[0011] When the data format of the model file is a graphic language transmission format, a buffer view of the model file is obtained.

[0012] In an embodiment of the present application, the prior art requires compressing the model file in the graphic language transmission format into the GLB format before transmitting the model file on the web page, which is not secure enough. The present application directly processes the model file in the original graphic language transmission format to obtain the buffer view of the model file, which is more scalable and the final transmitted file is more secure.

[0013] In some embodiments, when the data format of the model file is a graphic language transmission format, before obtaining the buffer view of the model file, the method further includes:

[0014] If the data format is a preset model format, the data format of the model file is converted from the preset model format to the graphic language transmission format.

[0015] In the embodiment of the present application, the present application can accept the upload of three-dimensional model files in various formats, and ultimately convert the three-dimensional model files in different formats into a unified target format (graphic language transmission format) to meet the upload requirements of three-dimensional model files in various formats.

[0016] In some embodiments, the method further comprises:

[0017] generating a key for the model file;

[0018] The step of encrypting the model data in the buffer view to convert the model file into a model encryption file includes:

[0019] The model data in the buffer view is encrypted based on the key to convert the model file into a model encryption file.

[0020] In an embodiment of the present application, a key is generated for the model file, and the model data in the buffer view is directly encrypted using the key, thereby reducing the time consumption for encrypting the three-dimensional model file, ensuring the security of the model file transmission on the web page, and reducing the resource consumption of the computer system.

[0021] In some embodiments, the buffer view includes attribute data for a plurality of buffers;

[0022] The encrypting the model data in the buffer view based on the key to convert the model file into a model encryption file includes:

[0023] The attribute data of each buffer of the buffer view is encrypted based on the key, so as to convert the model file into a model encryption file.

[0024] In an embodiment of the present application, the attribute data of each buffer of each buffer view is encrypted by a key, making the three-dimensional model file and the core data more complex, making the cost of cracking the model encryption file higher, and making transmission on the web page more secure.

[0025] In some embodiments, generating a key for the model file includes:

[0026] Obtain model content information and copyright related information of the model file;

[0027] Generate a key for the model file according to the model content information and the copyright-related information.

[0028] In the embodiment of the present application, when generating a key for the model file, the present application realizes the data security and copyright protection of the three-dimensional model file, ensuring that the data and copyright information of the web page model file are not leaked.

[0029] In some embodiments, the method further comprises:

[0030] The model file is compressed.

[0031] In the embodiment of the present application, the model file can be compressed before or after encryption to reduce the file size of the model file during transmission on the web page and save resource consumption of the computer device.

[0032] In some embodiments, compressing the model file includes:

[0033] Determining the application scenario type of the model file;

[0034] Determine the compression method corresponding to the application scenario type;

[0035] Compress the model file according to the compression method.

[0036] In an embodiment of the present application, when a user uploads a model file, an application scenario type will also be selected for it. Different scenario types correspond to different compression methods. Compressing the model file according to the compression method corresponding to the scenario type can further reduce the file size of the model file during transmission on the web page and reduce resource consumption.

[0037] In a second aspect, the present application further proposes a model file processing device, comprising:

[0038] A first determining module, configured to determine a buffer view of a model file;

[0039] The encryption module is used to encrypt the model data in the buffer view so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

[0040] In a third aspect, the present application further proposes another method for processing a model file, the method comprising:

[0041] Get the model encrypted file on the web page;

[0042] Determining a buffer view corresponding to the model encryption file;

[0043] The model data of the buffer view is decrypted to obtain a model file.

[0044] In an embodiment of the present application, when a user needs to view the model file on the web page, he only needs to decrypt the buffer view corresponding to the model encryption file, without having to decrypt the entire model file, thereby ensuring the transmission security of the model file on the web page while reducing the resource consumption of the computer device.

[0045] In some embodiments, obtaining the model encryption file on the web page includes:

[0046] Responding to a model resource acquisition request initiated by a user to obtain a model encryption file and key on the web page, wherein the user's login information satisfies a preset login status;

[0047] Decrypting the model data of the buffer view to obtain a model file includes:

[0048] The model data of the buffer view is decrypted using the key to obtain a model file.

[0049] In the embodiment of the present application, when the user logs in successfully, the model encryption file and key will be provided, providing double verification, further ensuring the security of the web page of the model file.

[0050] In some embodiments, the buffer view includes attribute data for a plurality of buffers;

[0051] Decrypting the model data of the buffer view by using the key to obtain a model file includes:

[0052] The attribute data of each buffer of the buffer view is decrypted based on the key to convert the model encryption file into a model file.

[0053] In an embodiment of the present application, the present application decrypts the attribute data of each buffer of each buffer view through a key, thereby ensuring the complexity of the model file and thus protecting data security, and also reducing the decryption resource cost.

[0054] In some embodiments, after decrypting the model data of the buffer view to obtain the model file, the method further includes:

[0055] The model file is loaded to display the model data on the web page.

[0056] In the embodiment of the present application, after the decryption of the model encrypted file is completed, the model file can be used and rendered and loaded normally, and the loading is smoother and faster than the conventional method.

[0057] In some embodiments, before loading the model file to display the model data on the web page, the method further includes:

[0058] Determining the application scenario type of the model file;

[0059] Determine the decompression method corresponding to the application scenario type;

[0060] Decompress the model encrypted file according to the decompression method.

[0061] In an embodiment of the present application, when a user wants to view the model file on the web page, the web page will determine its application scenario type by default. Different scenario types correspond to different decompression methods. The model encrypted file is decompressed according to the decompression method corresponding to the scenario type, which can further reduce the decompression time of the model file during the loading process on the web page.

[0062] In a fourth aspect, the present application further proposes another model file processing device, comprising:

[0063] The acquisition module is used to obtain the model encryption file on the web page;

[0064] A second determining module is used to determine a buffer view corresponding to the model encryption file;

[0065] The decryption module is used to decrypt the model data of the buffer view to obtain a model file.

[0066] In the fifth aspect, the present application also proposes a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the methods described in the first and third aspects above when executing the computer program.

[0067] In a sixth aspect, the present application further proposes a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method described in the first and third aspects above.

[0068] It can be understood that the beneficial effects of the second, fourth, fifth and sixth aspects mentioned above can be found in the relevant descriptions of the beneficial effects of the first and third aspects mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0070] Figure 1 A flowchart of a first embodiment of a method for processing a model file provided by the present application;

[0071] Figure 2 A flowchart of another embodiment of a method for processing a model file provided by the present application;

[0072] Figure 3 A flowchart of another embodiment of a method for processing a model file provided by the present application;

[0073] Figure 4 A structural block diagram of a model file processing device provided in this application;

[0074] Figure 5 A flowchart of a second embodiment of a method for processing a model file provided by the present application;

[0075] Figure 6 A structural block diagram of another model file processing device provided by this application;

[0076] Figure 7 This is a schematic diagram of the structure of an embodiment of a terminal device for processing model files provided by the present application. DETAILED DESCRIPTION

[0077] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0078] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0079] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0080] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0081] In the description of the embodiments of the present application, the term "plurality" refers to two or more (including two), unless otherwise clearly and specifically defined.

[0082] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0083] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0084] glTF (Graphics Language Transmission Format) is a royalty-free specification for efficiently transmitting and loading 3D scenes and models between engines and applications. glTF minimizes the size of 3D assets and the runtime processing required to unpack and use them. It defines an extensible publishing format that simplifies authoring workflows and interactive services by enabling interoperable use of 3D content across the industry. glTF is an efficient 3D file format for transmitting 3D models and scene data.

[0085] As a widely used, open-source 3D model data format, GLTF is supported by mainstream modeling software and is also widely used in the Web field.

[0086] However, the applicant discovered that in the Web field, for 3D model files on the web page, the model files are actually stored in the background server. When the user uses a browser to view the model file on the web page, the browser will obtain the model file through the URL (full URL) of the model file. The user can use some simple methods through the browser to download the file or content represented by the URL to the local computer separately. The GLFT model is a public file format, so there are a large number of tools to view and edit the model. Once the file is downloaded and opened and edited normally using other tools, it will be difficult to determine the copyright of the model later, which is more likely to cause data leakage of the model file. Therefore, the model data on the web page is very easy to leak and modify, posing a great threat to the data security of the model file.

[0087] The existing technology uses a fixed encryption method for encrypting three-dimensional model files on the web page. The encryption method has a high degree of regularity. With the advancement of AI technology, the cost of cracking has dropped significantly, and it can no longer effectively protect the data security of the model file. In the end-side encryption solution, the entire content of the model file will be encrypted. Although it has high security, the encryption and decryption of the model file consumes a lot of resources, and good performance cannot be guaranteed in the Web field. In another existing solution, in order to reduce the transmission volume of the model file on the web page, the GLTF file will be converted into a GLB (GLTF Binary, GLTF binary format) format file. The model file is transmitted to the web page only by taking advantage of the fact that the GLB format is not easy to read and avoiding direct observation of the data. However, there is a public conversion method between GLB and GLTF, which can be simply converted to GLTF with the help of tools, but the security is very poor.

[0088] Based on the above considerations, in order to solve the technical problem of how to ensure the transmission security of web page model files while reducing the resource consumption of computer devices in the existing technology, a model file processing method, apparatus, terminal device and storage medium are provided. Specifically, the present application provides the following embodiments to illustrate the technical solution of the present application:

[0089] Example 1

[0090] The model file processing method provided in this embodiment can be applied to the terminal devices used by R&D personnel who develop web page programs. The web page programs developed by the R&D personnel have the function of loading model data of three-dimensional model files. For example, the basic web page of the web page program is a graphical interactive interface containing map information. When a customer using a browser clicks on a coordinate on the map information, the corresponding model file (a visual three-dimensional building model) can be loaded and displayed on the web page.

[0091] The processing method of the model file in this embodiment mainly includes the following steps:

[0092] Step S10: determining a buffer view of the model file.

[0093] It should be noted that the executor of this embodiment is a terminal computer device that can upload model files to the web page. Before determining the buffer view of the model file, the computer needs to respond to the user (who may be the R&D personnel who develops the web page program) to upload the model file of the web page. The model file can be a 3D model file such as a three-dimensional building model, a three-dimensional human body model, a three-dimensional vehicle model, etc.

[0094] Step S20: encrypt the model data in the buffer view so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

[0095] This embodiment first obtains the buffer view of the web page model file and directly encrypts the buffer view without encrypting the entire model file, thereby ensuring the transmission security of the web page model file while reducing the resource consumption of the terminal device.

[0096] Specifically, in one embodiment, the step S10 specifically includes: when the data format of the model file is the graphics language transmission format GLTF, obtaining the buffer view bufferViews of the model file.

[0097] It should be noted that the model file of this embodiment adopts the storage method of a separate resource file, and the model file is divided into: a model description file (.json) and a data file (.bin); wherein, the model description file (.json) of the model file includes buffer views bufferViews;

[0098] It can be understood that the buffer view bufferViews can be regarded as an array, which stores the relationship between the model file and the model data (stored through the data file .bin), and each item in the array corresponds to a buffer buffer.

[0099] That is, the buffer view bufferViews includes multiple buffers buffer (also called model blocks, or called an item in the array bufferViews), and each buffer buffer contains attribute data of the model file (stored through the data file .bin).

[0100] For example, this model file is a 3D model image of a human body. It can be understood that a human body model may be divided into components such as the head, torso, and limbs. At the same time, the files describing information such as the head skin color and the head shape are different files. There is a separate file that saves all the shape information of the model, but the arrangement is disordered. This embodiment requires adding a buffer view structure in the head skin description to point to the detailed shape data of the head. The human body model may be divided into components such as the head, torso, and limbs, which are respectively allocated to each buffer of the buffer view bufferViews as the attribute data of the buffer buffer. The attribute data of each buffer is part of the three-dimensional data shape of the model file, and the attribute data may specifically include data index, length, and offset. The data index can be regarded as the mapping relationship between the part of the buffer and the model file, and the length and offset are used to determine the position distance between the buffer attribute data.

[0101] This embodiment directly processes the original GLTF (Graphics Language Transmission Format) 3D model file, and thus can obtain the buffer view bufferViews of the 3D model file; since the method of modifying the 3D model in the original GLTF format is simple and fast, without the help of additional tools, and the original GLTF model structure is more extensible, it is convenient to add custom attributes later. For each component of the model file, corresponding strategies can also be configured and different methods can be used for processing.

[0102] The model data of the buffer view bufferViews can be understood as the core data of the entire model file. If the attribute data in the buffer view bufferViews cannot be correctly parsed, the model cannot be rendered correctly.

[0103] In addition, if the data format of the model file uploaded by the user is not in GLTF format (Graphic Language Transmission Format), and the data format is a preset model format, the data format of the model file is converted from the preset model format to the graphic language transmission format. Among them, the preset model format can be some conventional 3D file formats, which can include STL, OBJ, FBX, 3DS, DXF, STP and other file formats. The upload process includes checking the model file to confirm that the model is not damaged and can be used normally. Different formats have different characteristics, but they all contain basic information about the model composition. For file uploads, the system does not require users to log in. The system can provide an upload interface that can support users to upload model files in multiple formats. The above-mentioned model files that meet the preset model format can be uniformly converted into a graphic language transmission format after processing, which helps the model files to be better transmitted on the web page.

[0104] Furthermore, in one embodiment, the method for processing the model file of this embodiment further includes:

[0105] Step S01: Generate a key for the model file;

[0106] Specifically, the system will first obtain the model content information and copyright-related information of the model file. In a specific implementation, when users upload the model file, they will also need to upload the copyright-related information of the model file simultaneously, and verify the copyright-related information to ensure the integrity of the copyright-related information. Copyright-related information includes the name of the copyright holder and a unique identifier such as an ID card or company registration number. The input of copyright-related information and the upload of the model file can be performed simultaneously.

[0107] Then, a key for the model file is generated according to the model content information and the copyright-related information. The key includes an encryption key and a decryption key. In the first embodiment, the encryption key is mainly used to encrypt the model file.

[0108] In the process of generating the key for the model file in this embodiment, a preset key algorithm can be used to obtain the summary of the model file based on the model content information, and the copyright-related information (such as name + displacement identity + digital signature) is also added to the algorithm. Finally, the algorithm output result is used as the generation parameter of the encryption key and decryption key.

[0109] It should be noted that the key generation in this embodiment depends on the preset key algorithm used, and the preset key algorithm is an algorithm capable of performing content digest;

[0110] The preset key algorithm may include at least one of the SM3 cryptographic hash algorithm, MD series algorithm (MD2 algorithm, MD5 algorithm, etc.), SHA series algorithm (SHA-1, SHA-2, SHA-3, etc.), MAC algorithm, RipeMD series algorithm, Tiger algorithm, GOST3411 algorithm, Whirlpool algorithm, etc.;

[0111] The key algorithm can be generated at any time before encrypting the model file and after uploading the model file.

[0112] Accordingly, the step S20 specifically includes:

[0113] Step S201: Encrypting the model data in the buffer view based on the key to convert the model file into a model encryption file.

[0114] The computer system encrypts the attribute data of each buffer of the buffer view based on the key, so as to convert the model file into a model encryption file.

[0115] It is understandable that due to the large overall data volume of the 3D model file, if all the data of the model file is encrypted, it will take too long to decrypt it during use, affecting performance.

[0116] This embodiment will first analyze the GLTF data format of the three-dimensional model file. The buffer view bufferViews in its model description file (.json) is the core data of the entire three-dimensional model file. The buffer view bufferViews is regarded as an array. The array bufferViews stores the model block buffer and the attribute data of each buffer. The attribute data may specifically include data index, length and offset. The data index can be regarded as the mapping relationship between the part of the buffer and the model file. The length and offset are used to determine the position distance between the buffer attribute data. It is a key file that affects the parsing and loading of the model file. Therefore, this embodiment finally encrypts the model file using a partial data encryption method. The attribute data of each buffer of the buffer view will be encrypted based on the key to avoid the performance consumption caused by full encryption, while also ensuring the security of the model data.

[0117] The specific encryption process of this embodiment is as follows (the attribute data of each buffer in the buffer view bufferViews is encrypted in the same manner). Specifically, based on the key, the encryption process can also be performed by adding salt, including the following sub-steps:

[0118] Sub-step 1: For each attribute data in buffer , convert the attribute value from a number to a string S. You can add a hexadecimal number to the header according to the number of bits (hexadecimal can represent a length of 0-15 bits, up to and including the number 10^16-1, which is sufficient to represent the model data);

[0119] It should be noted that, in this embodiment, numbers are added to the header in order to separate the real data from the salted random string after decryption. The specific location of the addition can be preset according to the needs of the user (program developer).

[0120] For example, it is agreed that the 3rd to 5th bits of the decrypted string specifically represent a length L (the number represented by the character can also be specified manually), and the L bits starting from the 10th bit (which is manually agreed upon and does not cause conflict) are the original data, and the rest are randomly salted.

[0121] Sub-step 2: Generate a certain number of random strings and add salt to the source string S to make it reach a certain length, such as 128 bytes; then form an intermediate string T with the structure of "{original data bits}{original data}{random data}";

[0122] Sub-step 3: Use the AES encryption algorithm to encrypt the intermediate string T to obtain the target string R.

[0123] It should be noted that the encryption method of this embodiment is not limited to the AES algorithm, and other symmetric encryption algorithms may also be used, such as DES, 3DES, TDEA, IDEA, Blowfish, RC5, or asymmetric encryption algorithms such as RSA, Elgamal, Rabin, DH, ECC, etc.

[0124] Sub-step 4: Store the encrypted target string R into the corresponding buffer position in the buffer view bufferViews, and continue to encrypt the attribute data at the next buffer position using the same encryption method (sub-steps 1 to 4).

[0125] This embodiment directly processes the buffer views in the original GLTF format model file, and processes the attribute data of each buffer by encryption and salting to convert the model file into a model encryption file, thereby further enhancing the security of the model file.

[0126] Furthermore, in this embodiment, after generating a key for the model file, step S30 will be executed: the key and the model encryption file will be stored so that when other client browsers using the web page program load the model file, the model encryption file will be transmitted on the web page.

[0127] In a specific implementation, the encrypted model file is renamed as a model encrypted file and stored again, making it easier to adopt the corresponding decryption process according to the extension. At the same time, since this application uses a method of dynamically generating keys for encryption, the keys need to be saved. When the client browser needs to use the encrypted three-dimensional model file, the key can be sent to the client account after the user identity is authenticated on the client browser using the web page program, and the decryption process of the model file is completed through the client browser. Ultimately, the model encrypted file can only be processed on the designated client browser platform, and the client browser can only be used normally after logging in and authenticating, thus ensuring the security and copyright protection of the three-dimensional model file on the web page.

[0128] Furthermore, in one embodiment, before the model encryption file is transmitted to the web page, the method further includes compressing the model file.

[0129] Specifically, this embodiment can compress the data of a 3D model file in GLTF format by using a preset compression method. Since the model file in this embodiment is stored as a separate resource file, the model file is divided into: a model description file (.json) and a data file (.bin). This embodiment can compress the model file using the mesh compression method MeshOpt.

[0130] In addition, the present application can further reduce the resource cost of decompression by mapping the application scenario type of the model file and the compression method in advance.

[0131] It is understandable that when the R&D personnel upload the model file to the web page, they will also select the corresponding application scenario for the model file. Different application scenario types correspond to different compression and decompression methods. When a customer using a web program containing a 3D model file views a 3D model, there will be multiple different application scenario types. For example, the application scenario type can include "single model viewing" type and "city-level display". For the "single model viewing" type, there is a higher requirement for fineness. The first compression method (simple compression) can be configured for the "single model viewing" type, and the customer only enables a simple compression method in the "single model viewing" scenario to meet the customer's viewing needs for the precision details of the 3D model image; for the "city-level display" type, the customer's need is only to obtain a rough image, so the system can configure a second compression method (complex compression) for the "city-level display" type, and the customer enables a complex encryption method in the "city-level display" scenario. For example, different compression methods can be set for the description file, texture map, and shape data of the model file, thereby making the second compression method very complex, which can effectively reduce the file size of the model file during transmission on the web page and reduce resource consumption.

[0132] In a specific implementation, when the user uploads the model file, the application scenario type of the model file will be synchronously determined. The system will then determine the compression method corresponding to the application scenario type and compress the model file according to the compression method.

[0133] It should be noted that, in this embodiment, the compression of the model file can be performed before the step S20 of encrypting the model file (e.g. Figure 2 Of course, it can also be performed after step S20 of encrypting the model file (as shown in Figure 3 shown);

[0134] refer to Figure 2 If the model file is compressed before step S20 of encrypting the model file, step S02 is executed to compress the entire model file, wherein the attribute data of each buffer in the buffer view bufferViews needs to be compressed and then the attribute data of each buffer in the compressed buffer view bufferViews is encrypted.

[0135] refer to Figure 3If the model file is compressed after step S20 of encrypting the model file, step S02 is executed to compress the model encrypted file of the model file. That is, after obtaining the model encrypted file, the attribute data of each buffer of the encrypted bufferViews needs to be compressed. Only after the compression, the model encrypted file can be used for transmission.

[0136] The beneficial effect of this embodiment is that the model file can be compressed before or after encryption to reduce the file size of the model file during transmission on the web page and save resource consumption of the computer device.

[0137] Furthermore, in one embodiment, if Figure 4 As shown, the present invention also provides a device for processing a model file, comprising:

[0138] A first determining module 10 is used to determine a buffer view of a model file;

[0139] The encryption module 20 is used to encrypt the model data in the buffer view so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

[0140] It should be noted that the model file processing device of this embodiment can be understood as a virtual device, which can be a web page program developed by R&D personnel, or a browser. The web page program and browser developed by R&D personnel have the function of loading model data of three-dimensional model files.

[0141] The information interaction, execution process, etc. between the above-mentioned devices / modules are based on the same concept as the first embodiment of the method of this application. Their specific functions and technical effects can be found in the method embodiment section.

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0143] Example 2

[0144] Corresponding to the above embodiments, the model file processing method provided in this embodiment 2 can be applied to the client browser side using the web page program. For example, the basic web page of the web page program is a graphical interactive interface containing map information. When the customer opens the web page of the web page program of embodiment 1, the customer can click on a coordinate on the map information and then load the corresponding model file (a visual three-dimensional building model) for display on the web page.

[0145] like Figure 5 As shown, the model file processing method of the second embodiment mainly includes the following steps:

[0146] Step A1: Get the model encrypted file on the web page.

[0147] Specifically, the client browser responds to the model resource acquisition request initiated by the user to obtain the model encryption file and key on the web page, wherein the user's login information satisfies the preset login status;

[0148] The pre-set login status indicates that the user account has successfully logged into the platform. Specifically, when a customer views the 3D rendering of the encrypted 3D model file, the backend server can authenticate the customer account. Once the authentication is successful, the server sends the key to the customer account. The customer can log in through methods including, but not limited to, scanning a QR code, using an account number and password, and obtaining system access permissions to complete the user authentication process.

[0149] Step A2: determining the buffer view corresponding to the model encryption file;

[0150] It is understandable that the buffer view includes attribute data of multiple buffers; and the attribute data of the buffers are all encrypted. The data of the buffers in the encrypted buffer view cannot be identified by the computer as the various components of the model file, let alone the data relationship between the model file and the various components of the 3D model. Therefore, it needs to be decrypted so that the computer can identify the model data of the model file and the data relationship between the model file and the various components of the 3D model data. Only after identification can it be successfully loaded and rendered.

[0151] Step A3: Decrypt the model data of the buffer view to obtain a model file.

[0152] Step A4: Load the model file to display the model data on the web page.

[0153] Specifically, this embodiment decrypts the attribute data of each buffer of the buffer view based on the key, so as to convert the model encryption file into a model file.

[0154] This embodiment will obtain the decryption key in the first embodiment to decrypt the model encrypted file. In the specific implementation, the model encrypted file can be decrypted in the following way:

[0155] Sub-step 1: confirm the suffix of the model encrypted file and the decryption method to be adopted;

[0156] Sub-step 2: using the decryption key obtained in Example 1, performing a decryption operation of the corresponding encryption algorithm on the attribute data of each buffer of the encrypted buffer view bufferViews in the model description file of the GLTF format model file to obtain a decrypted string H;

[0157] Sub-step 3: Based on the first character of the string H, extract the original data string S (corresponding to the string S encrypted in Example 1) and convert it into the corresponding number, and discard the rest;

[0158] Sub-step 4, after the attribute data of each buffer is decrypted, the decrypted original data string S is stored in the corresponding buffer buffer position in the buffer view bufferViews, and the description file bin is restored to obtain the complete model file, which is convenient for subsequent loading and rendering of the model file.

[0159] After the client account is authenticated, this embodiment sends a key to the client account to complete the model file decryption process. After decryption is complete, the model file can be used and rendered and loaded normally. Ultimately, the encrypted model file can only be processed by the designated client browser platform. The client browser can only be used normally after login authentication, ensuring the security and copyright protection of the 3D model file on the web page.

[0160] Furthermore, in one embodiment, before A4, the method further includes:

[0161] Determine the application scenario type of the model file, determine a decompression method corresponding to the application scenario type, and decompress the model encrypted file according to the decompression method.

[0162] It is understandable that in the first embodiment of the present application, the model file is compressed according to the scenario requirements when it is uploaded, and different compression methods have different decompression requirements (such as the example described in the first embodiment above).

[0163] The second embodiment needs to decompress the compressed file of the first embodiment. Web page decryption tools such as WebWorker and WebAssembly can be used to decrypt the compressed file of the first embodiment to achieve better performance.

[0164] It should be noted that the order of decompression and decryption can be set according to the configuration requirements of the R&D personnel. It only needs to correspond to the order of compression and encryption when uploading the solution in the first embodiment. For example, if the first embodiment adopts Figure 2 The model file is compressed in this way, then the second embodiment needs to decrypt the model encryption file first and then decompress the entire model file; if the first embodiment adopts Figure 3 If the model file is compressed in this way, the second embodiment needs to first decompress the entire model encrypted file and then decrypt the buffer view in the model encrypted file.

[0165] The beneficial effect of this embodiment is that: when the user wants to view the model file on the web page, the web page will determine its application scenario type by default. Different scenario types correspond to different decompression methods. The model encrypted file is decompressed according to the decompression method corresponding to the scenario type, which can further reduce the decompression time of the model file during the loading process on the web page.

[0166] Furthermore, in one embodiment, if Figure 6 As shown, the present invention also provides another device for processing a model file, comprising:

[0167] The acquisition module 101 is used to obtain the model encryption file on the web page;

[0168] The second determining module 201 is used to determine the buffer view corresponding to the model encryption file;

[0169] The decryption module 301 is used to decrypt the model data of the buffer view to obtain a model file.

[0170] It should be noted that the model file processing device of this embodiment can be understood as a virtual device, which can be a browser used by a client. The client browser has the function of loading model data of a three-dimensional model file.

[0171] The information interaction, execution process, etc. between the above-mentioned devices / modules are based on the same concept as the first embodiment of the method of this application. Their specific functions and technical effects can be found in the method embodiment section.

[0172] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.

[0173] 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 computer-readable storage medium. Based on this understanding, the present application implements all or part of the process of the above-mentioned method embodiment by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard drive, magnetic disk, or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.

[0174] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0175] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A method for processing a model file, characterized in that: The method comprises: Determine the buffer view of the model file; The model data in the buffer view is encrypted so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

2. The method according to claim 1, characterized in that The step of determining the buffer view of the model file includes: When the data format of the model file is a graphic language transmission format, a buffer view of the model file is obtained.

3. The method according to claim 2, characterized in that When the data format of the model file is a graphic language transmission format, before obtaining the buffer view of the model file, the method further includes: If the data format is a preset model format, the data format of the model file is converted from the preset model format to the graphic language transmission format.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: generating a key for the model file; The step of encrypting the model data in the buffer view to convert the model file into a model encryption file includes: The model data in the buffer view is encrypted based on the key to convert the model file into a model encryption file.

5. The method according to claim 4, characterized in that The buffer view includes attribute data of a plurality of buffers; The step of encrypting the model data in the buffer view based on the key to convert the model file into a model encryption file includes: The attribute data of each buffer of the buffer view is encrypted respectively based on the key to convert the model file into a model encryption file.

6. The method according to claim 4, characterized in that The step of generating a key for the model file comprises: Obtain model content information and copyright related information of the model file; Generate a key for the model file according to the model content information and the copyright related information.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The model file is compressed.

8. The method according to claim 7, characterized in that The compressing the model file comprises: Determine the application scenario type of the model file; Determine the compression method corresponding to the application scenario type; The model file is compressed according to the compression method.

9. A model file processing device, characterized in that: include: A first determining module, used for determining a buffer view of a model file; The encryption module is used to encrypt the model data in the buffer view so that the model file is converted into a model encryption file, and the model encryption file is used for transmission on the web page.

10. A method for processing a model file, characterized in that: The method comprises: Get the model encryption file on the web page; Determine a buffer view corresponding to the model encryption file; The model data of the buffer view is decrypted to obtain a model file.

11. The method according to claim 10, characterized in that The step of obtaining the encrypted model file on the web page includes: Responding to a model resource acquisition request initiated by a user to obtain a model encryption file and a key on the web page, wherein the login information of the user satisfies a preset login status; The decrypting of the model data of the buffer view to obtain the model file includes: The model data of the buffer view is decrypted by using the key to obtain a model file.

12. The method according to claim 11, characterized in that The buffer view includes attribute data of a plurality of buffers; Decrypting the model data of the buffer view by using the key to obtain a model file includes: The attribute data of each buffer of the buffer view is decrypted based on the key respectively, so as to convert the model encryption file into a model file.

13. The method according to any one of claims 10 to 12, characterized in that: After decrypting the model data of the buffer view to obtain the model file, the method further includes: The model file is loaded to display the model data on the web page.

14. The method according to claim 13, characterized in that The method of loading the model file to display the model data on the web page further includes: Determine the application scenario type of the model file; Determine a decompression method corresponding to the application scenario type; Decompress the model encrypted file according to the decompression method.

15. A model file processing device, characterized in that: include: The acquisition module is used to obtain the model encryption file on the web page; A second determination module is used to determine a buffer view corresponding to the model encryption file; The decryption module is used to decrypt the model data of the buffer view to obtain a model file.

16. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 and 10 to 14 is implemented.

17. A storage medium, wherein the storage medium is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 and 10 to 14 is implemented.