Material rendering processing methods, devices, electronic equipment and storage media
By comparing the byte segments in the source files and rendering only the modified parts, the problem of resource waste caused by repeated rendering in the source files is solved, and a more efficient rendering process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MIGU CO LTD
- Filing Date
- 2023-11-01
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, after modifying rendering materials, too many files are rendered repeatedly, resulting in wasted resources.
By comparing whether the byte segments in the first byte array are the same as the byte segments in the corresponding second byte array, only the modified first target byte array is rendered, and its rendered data is concatenated with the pre-rendered data to form the target rendered data.
This reduces the repetitive rendering of unmodified data, decreases resource waste, and improves rendering efficiency.
Smart Images

Figure CN117407455B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a material rendering processing method, apparatus, electronic device and storage medium. Background Technology
[0002] Rendering refers to the process of converting digital information into images, videos, audio, and other human-readable information. In related technologies, after modifying rendering materials, all rendering files of the materials need to be uploaded to a computer for re-rendering. However, only some rendering files in the materials are modified. When the data volume of the rendering files is large, too many files are repeatedly rendered, resulting in a waste of resources. Summary of the Invention
[0003] The purpose of this application is to provide a material rendering processing method, apparatus, electronic device, and storage medium, which can solve the problem of excessive resource waste caused by repeated rendering of existing rendering materials after modification.
[0004] In a first aspect, embodiments of this application provide a material rendering processing method, the method comprising:
[0005] Obtain a first material file, which includes N first byte arrays, where N is a positive integer greater than 1. The first material file is a modified material file based on a second material file, which includes N second byte arrays, and the N second byte arrays correspond one-to-one with the N first byte arrays.
[0006] For each of the first byte arrays, determine whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a portion of the bytes in the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array;
[0007] Render the first target byte array to obtain the first rendering data, wherein the first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array;
[0008] The first rendering data and the second rendering data are concatenated to form the target rendering data of the first material file. The second rendering data is the rendering data corresponding to the second target byte array. The second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays.
[0009] Secondly, embodiments of this application provide a material rendering processing apparatus, the apparatus comprising:
[0010] The first acquisition module is used to acquire a first material file, which includes N first byte arrays, where N is a positive integer greater than 1. The first material file is a modified material file based on a second material file, which includes N second byte arrays, and the N second byte arrays correspond one-to-one with the N first byte arrays.
[0011] The determining module is used to determine, for each first byte array, whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a part of the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array;
[0012] The rendering module is used to render the first target byte array to obtain the first rendering data, wherein the first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array;
[0013] The splicing module is used to splice the first rendering data and the second rendering data into the target rendering data of the first material file. The second rendering data is the rendering data corresponding to the second target byte array, and the second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays.
[0014] Thirdly, embodiments of this application provide an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the steps of the material rendering processing method as described in the first aspect.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the material rendering processing method as described in the first aspect.
[0016] In this embodiment, the modified first target byte array is determined from N first byte arrays by comparing whether the first byte segment in the first byte array is the same as the second byte segment in the corresponding second byte array. When rendering the first material file, only the first target byte array needs to be rendered, and the obtained first rendering data is concatenated with the pre-rendered second rendering data to obtain the target rendering data of the first material file. Compared with the prior art, the material rendering processing method provided in this embodiment only needs to render the first target byte array, that is, only the modified data needs to be rendered, avoiding repeated rendering of unmodified data and reducing resource waste. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic flowchart illustrating the material rendering process provided in this application embodiment;
[0019] Figure 2 This is a schematic diagram of the structure of the material rendering processing apparatus provided in the embodiments of this application;
[0020] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0022] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0023] The material rendering processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0024] like Figure 1 The diagram shown is a flowchart illustrating the material rendering method provided in this embodiment. The material rendering method of this embodiment specifically includes the following steps:
[0025] Step 101: Obtain a first material file. The first material file includes N first byte arrays, where N is a positive integer greater than 1. The first material file is a modified material file based on a second material file. The second material file includes N second byte arrays, and the N second byte arrays correspond one-to-one with the N first byte arrays.
[0026] The execution entity of the material rendering processing method provided in this application embodiment can be a cloud rendering platform. In the first rendering process, the second material file is uploaded to the cloud rendering platform. The second material file includes N second byte arrays, each of which corresponds to a sub-material file. The cloud rendering platform renders the N sub-material files based on the N second byte arrays to obtain the visualized rendering data of the N sub-material files, thereby obtaining the visualized rendering data of the second material file. The second material file can be text, images, videos, audio, etc.
[0027] Optionally, users can modify the second source file to obtain the first source file, and then upload the first source file to the cloud rendering platform for rendering. The second source file can be either the original source file (the one used during the first rendering) or the source file from a previous rendering. It should be noted that modifying the second source file generally involves not minor changes, but rather modifications to a large number of bytes in the byte array. The modification methods can include at least one of the following: byte replacement, byte addition, or byte deletion.
[0028] Step 102: For each of the first byte arrays, determine whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a portion of the bytes in the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array.
[0029] In this embodiment, the first byte segment may include one or more sub-byte segments, where each sub-byte segment refers to a contiguous set of bytes in the first byte array; similarly, the second sub-byte segment also includes one or more sub-byte segments, where each sub-byte segment refers to a contiguous set of bytes in the second byte array. The number of sub-byte segments included in the first byte segment is the same as the number of sub-byte segments included in the second byte segment, and based on the position of the sub-byte segments, the sub-byte segments included in the first byte segment and the sub-byte segments included in the second byte segment correspond one-to-one and have the same length. The matching of the position of the second byte segment in the second byte array with the position of the first byte segment in the first byte array can be understood as:
[0030] The relative positions of the first or last byte in the sub-byte segments of the first byte segment and the corresponding sub-byte segments of the second byte segment are consistent within their respective byte arrays. For example, if the length of the first byte array is L1 and the length of the second byte array is L2, the first byte in the sub-byte segment of the first byte segment is the byte located at position 1 / 4L1 in the first byte array, and the first byte in the sub-byte segment of the second byte segment is the byte located at position 1 / 4L2 in the second byte array. It can be understood that when L1 and L2 are consistent, consistent relative positions mean that the byte positions are completely identical. When L1 and L2 are inconsistent, consistent relative positions mean that the length corresponding to the byte position is the same as the proportion of the total length of the corresponding byte array.
[0031] If the first and second byte segments match in their respective byte array positions, compare whether they are identical. Specifically, compare the sub-byte segments included in the first byte segment with those included in the corresponding second byte segment. Based on the comparison result, determine whether the first byte array has been modified relative to the second byte array. If the first and second byte segments are identical, it means the first byte array has not been modified; if they are different, it means the first byte array has been modified.
[0032] Step 103: Render the first target byte array to obtain the first rendering data. The first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array.
[0033] In this embodiment, the first byte array among the N first byte arrays, where the first byte segment differs from the second byte segment in the corresponding second byte array, is determined as the first target byte array. The sub-material file corresponding to the first target byte array is the sub-material file in the first material file that has been modified relative to the second material file.
[0034] Only the first target byte array is uploaded to the cloud rendering platform. After rendering the first target byte array, the first rendering data is obtained, which is the visual rendering data of the modified sub-material file.
[0035] Step 104: Concatenate the first rendering data and the second rendering data to form the target rendering data of the first material file. The second rendering data is the rendering data corresponding to the second target byte array. The second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays.
[0036] The second rendering data refers to the remaining rendering data obtained from rendering the second source file by the cloud rendering platform, excluding the rendering data corresponding to the second target byte data. In other words, it's the rendering data that hasn't been modified compared to the first source file. This second rendering data is stored on the cloud rendering platform during the rendering of the second source file and doesn't require repeated rendering. The unmodified second rendering data is then concatenated with the modified first rendering data to obtain the target rendering data corresponding to the first source file.
[0037] In the material rendering method provided in this application embodiment, the modified first target byte array is determined from N first byte arrays by comparing whether the first byte segment in the first byte array is the same as the second byte segment in the corresponding second byte array. When rendering the first material file, only the first target byte array needs to be rendered, and the obtained first rendering data is concatenated with the pre-rendered second rendering data to obtain the target rendering data of the first material file. Compared with the prior art, the material rendering method provided in this application embodiment only needs to render the first target byte array, that is, only the modified data needs to be rendered, avoiding repeated rendering of unmodified data and reducing resource waste.
[0038] Optionally, before determining whether the second byte segments in the corresponding second byte arrays of each first byte array are the same, the method further includes:
[0039] For each of the first byte arrays, obtain the first byte segment in the first byte array and the second byte segment in the second byte array;
[0040] Both the first byte segment and the second byte segment include at least two sub-byte segments from the head byte segment, the middle byte segment, and the tail byte segment of the byte array.
[0041] In this embodiment, the head byte segment of the byte array includes the first byte of the byte array, the middle byte segment of the byte array includes the byte located in the middle position of the byte array, and the tail byte segment of the byte array includes the last byte of the byte array.
[0042] When a large number of bytes have been modified in a sub-material file, the modified bytes are likely located in the header, middle, or tail byte segments of the sub-material file's byte array. Therefore, for a set of corresponding first and second byte arrays, it is only necessary to extract at least two sub-byte segments from the header, tail, and middle byte segments of the byte data for comparison. It is not necessary to compare every byte of the first and second byte arrays, which reduces the amount of data to be compared, thereby improving the comparison efficiency and the efficiency of determining the first target byte array.
[0043] Optionally, the head byte segment of the byte array is a byte segment extracted from the byte array according to a first method, the middle byte segment of the byte array is a byte segment extracted from the byte array according to a second method, and the tail byte segment of the byte array is a byte segment extracted from the byte array according to a third method;
[0044] The first method includes: starting from the first byte of the byte array, extracting a byte segment that satisfies a first preset length;
[0045] The second method includes: starting from the byte located in the middle position in the byte array, extracting a byte segment that satisfies the second preset length forward or backward;
[0046] The third method includes: starting from the last byte of the byte array, extracting a byte segment that satisfies the third preset length.
[0047] In this embodiment, the length of the head byte segment of the byte array is the same as the first preset length, the length of the middle byte segment of the byte data is the same as the second preset length, and the length of the tail byte segment of the byte array is the same as the third preset length. The first preset length, the second preset length, and the third preset length can be the same or different.
[0048] The second method has multiple implementations: for example, after determining the middle byte in the byte array, extract a byte segment that meets the second preset length starting from the middle byte; for example, after determining the middle byte, extract a byte segment that meets the second preset length starting from the middle byte; for example, after determining the middle byte, extract a byte segment of length s1 starting from the middle byte and extract a byte segment of length s2 starting from the middle byte, the total length of s1 and s2 is consistent with the second preset length, and concatenate the byte segments corresponding to s1 and s2 to obtain the middle byte segment of the byte array.
[0049] Optionally, in addition to the head, tail, and middle byte segments of the byte array, more sub-byte segments can be obtained from the byte array for comparison, as follows:
[0050] Obtain the fourth preset length and the calculation pointer array. The calculation pointer array includes multiple segment parameters, which are used to indicate bytes in the byte array. Using the bytes indicated by the segment parameters as a reference, select multiple sub-byte segments that satisfy the fourth preset length. For example, if the length of the byte array is L3, the fourth preset length is S, and the calculation pointer array is (16 / 15, 8 / 7, 4 / 3, 2, 4, 8, 16), based on the 7 segment parameters in the calculation pointer array, determine 7 bytes in the byte array. The lengths corresponding to the positions of these 7 bytes in the byte array are (15 / 16L3, 7 / 8L3, 3 / 4L3, 1 / 2L3, 1 / 4L3, 1 / 8L3, 1 / 16L3). Using these 7 bytes as a reference, 7 sub-byte segments of length S can be selected. The sub-byte segment can be selected either by selecting a sub-byte segment of length S from the reference forward and backward, or by selecting a byte segment of length S / 2 from the reference forward and then selecting a byte segment of length S / 2 from the reference backward, and then concatenating the two byte segments of length S / 2 to obtain a sub-byte segment of length S.
[0051] It should be noted that when obtaining the sub-byte segments of the first preset length, second preset length, third preset length, and fourth preset length, there may be cases where the first byte array is smaller than the above preset length. In this case, all bytes of the first byte array that are smaller than the preset length will be used as the first byte segment for comparison.
[0052] In this embodiment, a base byte is selected from the byte array, and then multiple bytes are selected from the base byte. The multiple bytes and the base byte are concatenated to obtain a sub-byte segment that meets the preset length. The above method can ensure that the positions of the sub-byte segments included in the first byte segment and the sub-byte segments included in the second byte segment are matched, thereby ensuring the accuracy of the result of judging whether the first byte array and the second byte array are the same.
[0053] Optionally, the first material file is a video or audio file.
[0054] The rendering of the first target byte array to obtain the first rendering data includes:
[0055] Obtain the target sub-byte segment from at least two sub-byte segments of the first target byte array, wherein the target sub-byte segment is different from the sub-byte segment whose position matches in the corresponding second byte array;
[0056] Extract the sub-byte segment to be rendered from the first target byte array based on the target sub-byte segment;
[0057] The sub-byte segment to be rendered is rendered to obtain first rendering sub-data. The first rendering data includes the first rendering sub-data and the second rendering sub-data. The second rendering sub-data is the data corresponding to the byte segment of the first target byte array excluding the sub-byte segment to be rendered.
[0058] In this embodiment, starting from the first byte of the target sub-byte segment in the first target byte array, a byte segment of length s3 is selected forward, and starting from the last byte of the target sub-byte segment, a byte segment of length s4 is selected backward. The byte segment of length s3, the byte segment of length s4, and the target sub-byte segment are concatenated to obtain the sub-byte segment to be rendered.
[0059] In this embodiment, when the first material file is a video or audio file, the sub-material file corresponding to each first byte array is also a video or audio file. Based on the characteristic that video and audio can be spliced, when rendering the first target byte array, only the modified byte segments to be rendered in the first target byte array need to be rendered, without rendering all the data of the first material file, which further reduces the amount of data to be rendered and improves the rendering efficiency of the first material file.
[0060] Optionally, the extraction method of the sub-byte segment to be rendered includes:
[0061] A first sub-byte segment and a second sub-byte segment are determined from at least two sub-byte segments of the first target byte array, wherein the first sub-byte segment is the preceding sub-byte segment of the target sub-byte segment, and the second sub-byte segment is the following sub-byte segment of the target sub-byte segment;
[0062] Extract the byte segment from the last byte of the first sub-byte segment to the first byte of the second sub-byte segment from the first target byte array.
[0063] For example, select eight sub-byte segments A, B, C, D, E, F, G, and H sequentially from the first target byte array, where C is the target sub-byte segment. Then, take the sub-byte segment B before C as the first sub-byte segment, take the sub-byte segment D after C as the second sub-byte segment, and extract the byte segment between the last byte of B and the first byte of D as the sub-byte segment to be rendered.
[0064] It should be noted that, if the target sub-byte segment is the first sub-byte segment (i.e., there is no preceding sub-byte segment), the byte segment between the first byte of the target sub-byte segment and the first byte of the second sub-byte segment is extracted as the sub-byte segment to be rendered. If the target sub-byte segment is the last sub-byte segment (i.e., there is no following sub-byte segment), the byte segment between the last byte of the first sub-byte segment and the last byte of the target sub-byte segment is extracted as the sub-byte segment to be rendered.
[0065] In this embodiment, by determining the sub-byte segment to be rendered in the above manner, it is possible to ensure to the greatest extent that no modified bytes are missed in the sub-byte segment to be rendered, thereby improving the accuracy of the sub-byte segment to be rendered and thus improving the accuracy of the first rendering data.
[0066] Optionally, the first material file is a video or audio file.
[0067] Before obtaining the first material file, the method further includes:
[0068] Obtain the preset segmentation length and the overall byte array corresponding to the first material file;
[0069] Based on the preset segmentation length, the overall byte array is divided into the N first byte arrays, wherein the length of each first byte array is less than or equal to the preset segmentation length.
[0070] If the first source file is video or audio, it's reasonable to assume the second source file is also video or audio. When uploading either the first or second source file to the cloud rendering platform, it can be divided into N first byte arrays and N second byte arrays according to a preset segmentation length. This ensures that the length of each byte array is less than the preset segmentation length, avoiding uploading excessively large files at once and improving upload speed.
[0071] like Figure 2 As shown in the figure, this application embodiment also provides a material rendering processing apparatus 200, which includes:
[0072] The first acquisition module 201 is used to acquire a first material file, the first material file including N first byte arrays, where N is a positive integer greater than 1, the first material file is a material file modified based on a second material file, the second material file including N second byte arrays, and the N second byte arrays and the N first byte arrays correspond one-to-one;
[0073] The determining module 202 is used to determine, for each first byte array, whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a part of the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array;
[0074] Rendering module 203 is used to render the first target byte array to obtain first rendering data, wherein the first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array;
[0075] The splicing module 204 is used to splice the first rendering data and the second rendering data into the target rendering data of the first material file, wherein the second rendering data is the rendering data corresponding to the second target byte array, and the second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays.
[0076] Optionally, the material rendering processing device 200 also includes:
[0077] The second acquisition module is used to acquire, for each of the first byte arrays, the first byte segment in the first byte array and the second byte segment in the second byte array;
[0078] Both the first byte segment and the second byte segment include at least two sub-byte segments from the head byte segment, the middle byte segment, and the tail byte segment of the byte array.
[0079] Optionally, the head byte segment of the byte array is a byte segment extracted from the byte array according to a first method, the middle byte segment of the byte array is a byte segment extracted from the byte array according to a second method, and the tail byte segment of the byte array is a byte segment extracted from the byte array according to a third method;
[0080] The first method includes: starting from the first byte of the byte array, extracting a byte segment that satisfies a first preset length;
[0081] The second method includes: starting from the byte located in the middle position in the byte array, extracting a byte segment that satisfies the second preset length forward or backward;
[0082] The third method includes: starting from the last byte of the byte array, extracting a byte segment that satisfies the third preset length.
[0083] Optionally, the first material file is a video or audio file, and the rendering module 203 includes:
[0084] The acquisition submodule is used to acquire a target sub-byte segment from at least two sub-byte segments of the first target byte array, wherein the target sub-byte segment is different from the sub-byte segment whose position matches in the corresponding second byte array;
[0085] An extraction submodule is used to extract the sub-byte segment to be rendered from the first target byte array based on the target sub-byte segment;
[0086] The rendering submodule is used to render the sub-byte segment to be rendered to obtain first rendering sub-data. The first rendering data includes the first rendering sub-data and the second rendering sub-data. The second rendering sub-data is the data corresponding to the byte segment of the first target byte array excluding the sub-byte segment to be rendered.
[0087] Optionally, the extraction submodule is also used for:
[0088] A first sub-byte segment and a second sub-byte segment are determined from at least two sub-byte segments of the first target byte array, wherein the first sub-byte segment is the preceding sub-byte segment of the target sub-byte segment, and the second sub-byte segment is the following sub-byte segment of the target sub-byte segment;
[0089] Extract the byte segment from the last byte of the first sub-byte segment to the first byte of the second sub-byte segment from the first target byte array.
[0090] Optionally, the first material file is a video or audio file, and the material rendering processing device 200 further includes:
[0091] The third acquisition module is used to acquire the preset segmentation length and the overall byte array corresponding to the first material file;
[0092] The segmentation module is used to segment the overall byte array into N first byte arrays based on the preset segmentation length, wherein the length of each first byte array is less than or equal to the preset segmentation length.
[0093] The material rendering processing apparatus 200 provided in this application determines the modified first target byte array from N first byte arrays by comparing whether the first byte segment in the first byte array is the same as the second byte segment in the corresponding second byte array. When rendering the first material file, only the first target byte array needs to be rendered, and the obtained first rendering data is concatenated with the pre-rendered second rendering data to obtain the target rendering data of the first material file.
[0094] It should be noted that the embodiments provided in this application are capable of achieving the following: Figure 1 The entire technical process of the material rendering method shown in the embodiment, and the same technical effect, will not be described again here to avoid repetition.
[0095] This application also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the above-described functionality. Figure 1 The various processes of the material rendering processing method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0096] For details, see Figure 3 As shown in the figure, this application embodiment also provides an electronic device, including a bus 301, a transceiver 302, an antenna 303, a bus interface 304, a processor 305, and a memory 306.
[0097] In this embodiment, the electronic device further includes a computer program stored in the memory 306 and executable on the processor 305. The computer program, when executed by the processor 305, can perform tasks such as... Figure 1 The various processes of the material rendering method shown in the embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0098] exist Figure 3In this document, a bus architecture (represented by bus 301) is used. Bus 301 can include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 305 and memory represented by memory 306. Bus 301 can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 304 provides an interface between bus 301 and transceiver 302. Transceiver 302 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 305 is transmitted over a wireless medium via antenna 303, which further receives data and transmits it to processor 305.
[0099] Processor 305 manages bus 301 and general processing, and also provides various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Memory 306 can be used to store data used by processor 305 during operation.
[0100] Optionally, the processor 305 can be a CPU, ASIC, FPGA, or CPLD.
[0101] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described material rendering processing method or embodiments of the material rendering processing method, and achieves the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be, for example, ROM, RAM, magnetic disk, or optical disk.
[0102] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0104] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for rendering source materials, characterized in that, The method includes: Obtain a first material file, which includes N first byte arrays, where N is a positive integer greater than 1. The first material file is a modified material file based on a second material file, which includes N second byte arrays, and the N second byte arrays correspond one-to-one with the N first byte arrays. For each of the first byte arrays, determine whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a portion of the bytes in the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array; Render the first target byte array to obtain the first rendering data, wherein the first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array; The first rendering data and the second rendering data are concatenated to form the target rendering data of the first material file. The second rendering data is the rendering data corresponding to the second target byte array. The second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays. Before determining, for each of the first byte arrays, whether the second byte segments in the corresponding second byte arrays are the same, the method further includes: For each of the first byte arrays, obtain the first byte segment in the first byte array and the second byte segment in the second byte array; Both the first byte segment and the second byte segment include at least two sub-byte segments from the following: the header byte segment, the middle byte segment, and the tail byte segment of the byte array; The first source file is a video or audio file. The rendering of the first target byte array to obtain the first rendering data includes: Obtain the target sub-byte segment from at least two sub-byte segments of the first target byte array, wherein the target sub-byte segment is different from the sub-byte segment whose position matches in the corresponding second byte array; Extract the sub-byte segment to be rendered from the first target byte array based on the target sub-byte segment; The sub-byte segment to be rendered is rendered to obtain first rendering sub-data. The first rendering data includes the first rendering sub-data and the second rendering sub-data. The second rendering sub-data is the data corresponding to the byte segment of the first target byte array excluding the sub-byte segment to be rendered. The extraction methods for the sub-byte segments to be rendered include: A first sub-byte segment and a second sub-byte segment are determined from at least two sub-byte segments of the first target byte array, wherein the first sub-byte segment is the preceding sub-byte segment of the target sub-byte segment, and the second sub-byte segment is the following sub-byte segment of the target sub-byte segment; Extract the byte segment from the last byte of the first sub-byte segment to the first byte of the second sub-byte segment from the first target byte array.
2. The method as described in claim 1, characterized in that, The head byte segment of the byte array is a byte segment extracted from the byte array according to the first method, the middle byte segment of the byte array is a byte segment extracted from the byte array according to the second method, and the tail byte segment of the byte array is a byte segment extracted from the byte array according to the third method. The first method includes: starting from the first byte of the byte array, extracting a byte segment that satisfies a first preset length; The second method includes: starting from the byte located in the middle position of the byte array, extracting a byte segment that meets the second preset length forward or backward; The third method includes: starting from the last byte of the byte array, extracting a byte segment that satisfies a third preset length.
3. The method according to any one of claims 1 to 2, characterized in that, The first source file is a video or audio file. Before obtaining the first material file, the method further includes: Obtain the preset segmentation length and the overall byte array corresponding to the first material file; Based on the preset segmentation length, the overall byte array is divided into the N first byte arrays, wherein the length of each first byte array is less than or equal to the preset segmentation length.
4. A material rendering and processing device, characterized in that, The device includes: The first acquisition module is used to acquire a first material file, which includes N first byte arrays, where N is a positive integer greater than 1. The first material file is a modified material file based on a second material file, which includes N second byte arrays, and the N second byte arrays correspond one-to-one with the N first byte arrays. The determining module is used to determine, for each first byte array, whether the second byte segment in the second byte array corresponding to the first byte segment in the first byte array is the same, wherein the first byte segment is a part of the first byte array, and the position of the second byte segment in the second byte array matches the position of the first byte segment in the first byte array; The rendering module is used to render the first target byte array to obtain the first rendering data, wherein the first byte segment of the first target byte array is different from the second byte segment in the corresponding second byte array; The splicing module is used to splice the first rendering data and the second rendering data into the target rendering data of the first material file, wherein the second rendering data is the rendering data corresponding to the second target byte array, and the second target byte array is the byte array other than the second byte array corresponding to the first target byte array among the N second byte arrays; The device further includes: The second acquisition module is used to acquire, for each of the first byte arrays, the first byte segment in the first byte array and the second byte segment in the second byte array; Both the first byte segment and the second byte segment include at least two sub-byte segments from the following: the header byte segment, the middle byte segment, and the tail byte segment of the byte array; The first source file is a video or audio file, and the rendering module includes: The acquisition submodule is used to acquire a target sub-byte segment from at least two sub-byte segments of the first target byte array, wherein the target sub-byte segment is different from the sub-byte segment whose position matches in the corresponding second byte array; An extraction submodule is used to extract the sub-byte segment to be rendered from the first target byte array based on the target sub-byte segment; The rendering submodule is used to render the sub-byte segment to be rendered to obtain first rendering sub-data. The first rendering data includes the first rendering sub-data and the second rendering sub-data. The second rendering sub-data is the data corresponding to the byte segment of the first target byte array excluding the sub-byte segment to be rendered. The extraction submodule is also used for: A first sub-byte segment and a second sub-byte segment are determined from at least two sub-byte segments of the first target byte array, wherein the first sub-byte segment is the preceding sub-byte segment of the target sub-byte segment, and the second sub-byte segment is the following sub-byte segment of the target sub-byte segment; Extract the byte segment from the last byte of the first sub-byte segment to the first byte of the second sub-byte segment from the first target byte array.
5. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the material rendering processing method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the material rendering processing method as described in any one of claims 1 to 3.