Web version simulation result playback method, system, electronic device and storage medium
By processing and preloading the frame data of video simulation results, the unstable and incomplete video playback caused by browser memory limitations are solved, and a smoother and complete video simulation result playback is achieved.
Patent Information
- Application Number
- CN202510336863.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-21
AI Technical Summary
In the prior art, due to the memory limitations of the browser, the video simulation results are instability and incomplete when playing.
By obtaining the frame data of the video simulation results, processing and generating the target video simulation results, loading the target frame data into memory, and determining the number of preloaded frames based on the playback information and memory space, realizing the method of loading while playing, freeing memory in real time to avoid exceeding the memory limit.
It effectively avoids the unstable and incomplete video playback problems caused by memory limitations, and achieves smoother and complete video simulation results playback.
Smart Images

Figure CN119893210B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of video playback, and more specifically, to a method, system, electronic device, and storage medium for playing simulation results in a web version. Background Art
[0002] Traditional CAE software is generally heavyweight software and generally needs to run on a computer with a relatively high configuration. With the continuous development of computer technology, in the process of displaying geometry, rendering data of results, and simulation calculations, it is required that the computer running CAE software has strong computing power. To solve the problem of the need for strong computing power in the simulation calculation process, cloud CAE software can be made to generate the corresponding software as a service (SaaS). In this way, only an ordinary computer is needed, and by logging in to the online through a browser, the corresponding video simulation results can be viewed, that is, the corresponding video simulation results can be played.
[0003] However, there is a situation where the cloud CAE software needs to be loaded from the backend every time the video simulation results are viewed, that is, the video simulation results to be played are obtained through network transmission. This transmission method has a long transmission time. And it can only play the corresponding video simulation results with the help of the corresponding browser, and the browser has certain memory limitations, resulting in certain limitations on the data that can be loaded into the memory each time. When the memory space required for the video simulation results is large, it is easy to exceed the memory limit, and problems such as unstable and incomplete video playback are likely to occur. Summary of the Invention
[0004] In view of this, this application provides a method, system, electronic device, and storage medium for playing simulation results in a web version to solve the problems of instability and incompleteness that occur in the process of playing video simulation results due to certain memory limitations of the browser in the prior art.
[0005] The first aspect of this application provides a method for playing simulation results in a web version, which is applied to a simulation result player. The method includes:
[0006] Obtain the video simulation results of the video to be played; wherein, the video simulation results include 1 frame data or multiple frame data;
[0007] Based on the grid data and physical quantities of the frame data in the video simulation results, process the video simulation results to obtain target video simulation results, wherein the target video simulation results include multiple target frame data;
[0008] Load any target frame data to be played from each of the target frame data into the memory of the simulation result player, and determine the loading time and required memory space of the target frame data to be played;
[0009] Determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time and required memory space of the target frame data to be played;
[0010] Play the target frame data to be played in the memory, and at the same time load the target frame data of the number of pre-loaded frames as the target frame data to be played into the memory; wherein, the target frame data of the number of pre-loaded frames are the unplayed target frame data in each target frame data;
[0011] Release the played target frame data to be played in real time, and return to execute loading any target frame data to be played from each of the target frame data into the memory of the simulation result player until there is no target frame data to be played in each of the target frame data.
[0012] Optionally, the processing of the video simulation result based on the grid data and physical quantities of the frame data in the video simulation result to obtain a target video simulation result includes:
[0013] Judge whether the video simulation result includes multiple frame data or 1 frame data;
[0014] If the video simulation result includes multiple frame data, determine the result type corresponding to the video simulation result according to the grid data of each frame data; wherein, the result type is the first result type or the second result type;
[0015] If the result type of the video simulation result is the first result type, perform interpolation and grid transformation processing on each frame data in the video simulation result to obtain a target video simulation result;
[0016] If the result type of the video simulation result is the second result type, use the video simulation result as the target video simulation result;
[0017] If the video simulation result includes 1 frame data, determine that the result type of the video simulation result is the third result type, and perform interpolation and grid transformation processing on the frame data in the video simulation result to obtain the corresponding target video simulation result.
[0018] Optionally, the determining the result type corresponding to the video simulation result according to the grid data of each frame data includes:
[0019] Judge whether the grid data of each frame data are all the same;
[0020] If the grid data of each of the frame data is the same, determine that the result type corresponding to the video simulation result is the first result type;
[0021] If there is frame data with different grid data among the frame data, determine that the result type corresponding to the video simulation result is the second result type.
[0022] Optionally, the determining the number of pre-loaded frames according to the playback information of the simulation result player, the loading time and the required memory space of the target frame data to be played includes:
[0023] Obtain the playback information of the simulation result player, where the playback information includes the memory space and the playback speed of the simulation result player;
[0024] Determine the playback time interval according to the playback speed of the simulation result player;
[0025] Calculate the number of pre-loaded frames according to the playback time interval, the memory space, the loading time and the required memory space of the target frame data to be played.
[0026] Optionally, the calculating the number of pre-loaded frames according to the playback time interval, the memory space, the loading time and the required memory space of the target frame data to be played includes:
[0027] Calculate the remaining memory space of the simulation result player according to the memory space and the required memory space of the target frame data to be played;
[0028] Calculate the target number of loaded frames according to the loading time of the target frame data to be played and the playback time interval;
[0029] Determine the number of pre-loaded frames according to the target number of loaded frames and the remaining memory space; where the number of pre-loaded frames is not less than the target number of loaded frames.
[0030] The second aspect of the present application provides a web version of a simulation result playback system, which is applied to a simulation result player, and the system includes:
[0031] A video simulation result acquisition unit, configured to acquire a video simulation result of a video to be played; where the video simulation result includes 1 frame data or multiple frame data;
[0032] A processing unit, configured to process the video simulation result based on the grid data and physical quantities of the frame data in the video simulation result to obtain a target video simulation result, where the target video simulation result includes multiple target frame data;
[0033] The first determination unit is configured to load any target frame data to be played from each of the target frame data into the memory of the simulation result player, and determine the loading time and required memory space of the target frame data to be played;
[0034] The second determination unit is configured to determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time and required memory space of the target frame data to be played;
[0035] The playback and loading unit is configured to play the target frame data to be played in the memory, and at the same time load the number of target frame data of the pre-loaded frames as the target frame data to be played into the memory; wherein, the number of target frame data of the pre-loaded frames is the target frame data that has not been played among each target frame data;
[0036] The release unit is configured to release in real time the target frame data to be played that has been played, and return to execute the first determination unit until there is no target frame data to be played among each of the target frame data.
[0037] Optionally, the processing unit includes:
[0038] The first judgment unit is configured to judge whether the video simulation result includes multiple frame data or 1 frame data;
[0039] The third determination unit is configured to, if the video simulation result includes multiple frame data, determine the result type corresponding to the video simulation result according to the grid data of each frame data; wherein, the result type is the first result type or the second result type;
[0040] The first processing subunit is configured to, if the result type of the video simulation result is the first result type, perform interpolation and grid transformation processing on each frame data in the video simulation result to obtain a target video simulation result;
[0041] The second processing subunit is configured to, if the result type of the video simulation result is the second result type, use the video simulation result as the target video simulation result;
[0042] The third processing subunit is configured to, if the video simulation result includes 1 frame data, determine that the result type of the video simulation result is the third result type, and perform interpolation and grid transformation processing on the frame data in the video simulation result to obtain a corresponding target video simulation result.
[0043] Optionally, the third determination unit includes:
[0044] The second judgment unit is configured to judge whether the grid data of each frame data are all the same;
[0045] A fourth determination unit, configured to determine that the result type corresponding to the video simulation result is a first result type if the grid data of all the frame data is the same;
[0046] A fifth determination unit, configured to determine that the result type corresponding to the video simulation result is a second result type if there is frame data with different grid data among all the frame data.
[0047] A third aspect of the present application provides an electronic device, including: a processor and a memory, where the processor and the memory are connected through a bus; wherein, the processor is configured to call and execute a program stored in the memory; the memory is configured to store a program, and the program is used to implement a method for playing a simulation result in a web version provided in the first aspect of the present application.
[0048] A fourth aspect of the present application provides a storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used to execute a method for playing a simulation result in a web version provided in the first aspect of the present application.
[0049] The present application provides a method, a system, an electronic device, and a storage medium for playing a simulation result in a web version. After obtaining a video simulation result to be played, the video simulation result can be processed based on the grid data and physical quantities of the frame data in the video simulation result to obtain a target video simulation result; in order to reduce resource consumption and avoid playback jams, any target frame data to be played can be loaded from each of the target frame data into the memory of the simulation result player, and the loading time and required memory space of the target frame data to be played are determined, so as to determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time, and the required memory space of the target frame data to be played. In this way, while playing the target frame data to be played in the memory, the target frame data of the number of pre-loaded frames is loaded into the memory as the target frame data to be played, achieving the purpose of loading while playing; and the present application can also release the target frame data to be played that has been played in real time, which can avoid exceeding the memory limit of the simulation result player. Even if the memory space required for the video simulation result is large, it will not exceed the memory limit of the simulation result player, thereby avoiding problems such as unstable and incomplete video playback. Description of the Drawings
[0050] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0051] Figure 1 It is a schematic flowchart of a method for playing simulation results in a web version provided by an embodiment of the present application;
[0052] Figure 2 It is an example diagram of another method for playing simulation results in a web version provided by an embodiment of the present application;
[0053] Figure 3 It is a schematic structural diagram of a system for playing simulation results in a web version provided by an embodiment of the present application;
[0054] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.
[0056] In the present application, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0057] Refer to Figure 1 , which shows a schematic flowchart of a method for playing simulation results in a web version provided by an embodiment of the present application, applied to a simulation result player. The method for playing simulation results in the web version specifically includes the following steps:
[0058] S101: Obtain the video simulation result of the video to be played; wherein, the video simulation result includes 1 frame of data or multiple frames of data.
[0059] In the embodiments of the present application, the simulation result player can also be referred to as a video player, and no limitation is imposed herein in the embodiments of the present application.
[0060] It should be noted that the simulation result player includes corresponding memory. In order to be able to play the corresponding video simulation result smoothly, the data of a certain period of time after the current time can be gradually cached during the playing process, without caching the entire video simulation result. In this way, when displaying the corresponding video simulation result, there is no need to perform time-consuming calculation processes, and the data cached in the memory can be displayed only in microseconds.
[0061] It should also be noted that the frame rate and resolution of the simulation result player can also be preset; wherein, frame rate: due to the visual persistence effect of the human eye being approximately 0.1 s, when playing the corresponding video, the time interval between the display of two consecutive frames is less than 0.1 s. In this way, the video being played basically appears smooth to the human eye. The reciprocal of this time interval in seconds is the so-called frame rate; resolution: refers to the resolution of each frame of the image (the number of pixel points in the horizontal and vertical directions of the picture). In order to compress the volume of the video, the parts of the pixel points that do not move between two consecutive frames may be compressed and then parsed and restored to a complete image during playback.
[0062] It should also be noted that the simulation result player can also implement 3D display and interaction; WEBGL technology is required to implement 3D display. In this way, when implementing 3D display, operations such as rotating the video and panning and zooming can be performed; for the network data and the attributes attached to the mesh data in the video simulation result, the user can pick up the corresponding mesh data with the mouse.
[0063] Among them, there is also the concept of step in the video simulation result, and each step is each frame; in 3D display, the video simulation result generally consists of mesh data and the attributes attached to the network data; the attributes attached to the mesh data can be called physical quantities; the physical quantities can be displacement, stress, temperature, etc.; these attributes are attached to the mesh data and can be displayed to the user through different colors and legends, so that the user can quickly discover the changes in the corresponding physical quantities during the process of viewing the corresponding video simulation result.
[0064] During the specific execution of step S101, the simulation result player can obtain the video simulation result of the video to be played (for the sake of distinction, the video to be played currently is called the video to be played). Among them, the video simulation result includes multiple frame data or one frame data; for each frame data, the corresponding grid data can be extracted from the frame data, and at the same time, the physical quantities attached to the grid data can also be extracted.
[0065] S102: Based on the grid data and physical quantities of the frame data in the video simulation result, process the video simulation result to obtain the target video simulation result, where the target video simulation result includes multiple target frame data.
[0066] During the specific execution of step S102, after obtaining the grid data of each frame data, the result type of the video simulation result can be determined according to the frame data and its quantity included in the video simulation result, so as to process the video simulation result according to the result type of the video simulation result to obtain the corresponding target video simulation result; among them, the video simulation result includes one frame data or multiple frame data, and the target video simulation result includes multiple target frame data; the grid data of each target frame data can be the same or different.
[0067] It should be noted that each frame data includes a grid data and several physical quantities.
[0068] Optionally, the process of determining the result type corresponding to the video simulation result according to the grid data of each frame data can be: judge whether the video simulation result includes multiple frame data or one frame data; if the video simulation result includes multiple frame data, determine the result type corresponding to the video simulation result according to the grid data of each frame data; among them, the result type is the first result type or the second result type; if the result type of the video simulation result is the first result type, perform interpolation and grid transformation on each frame data in the video simulation result to obtain the target video simulation result; if the result type of the video simulation result is the second result type, use the video simulation result as the target video simulation result; if the video simulation result includes one frame data, determine the result type of the video simulation result as the third result type, and perform interpolation and grid transformation processing on the frame data in the video simulation result to obtain the corresponding target video simulation result.
[0069] In some embodiments, if there is only one frame of data in the video simulation result, that is, the video simulation result only contains one frame of data, then the result type of the video simulation result can be directly determined as the third result type; if there are multiple frames of data in the video simulation result, then the network data of each frame of data can be compared, and the result type corresponding to the video simulation result can be determined according to the obtained comparison result, where the result type of the video simulation result can be the first result type or the second result type.
[0070] As a preferred way of the embodiments of the present application, the process of determining the result type corresponding to the video simulation result according to the grid data of each frame of data can be: determining whether the grid data of each frame of data are the same; if the grid data of each frame of data are the same, determining the result type corresponding to the video simulation result as the first result type; if there are frames of data with different grid data among each frame of data, determining the result type corresponding to the video simulation result as the second result type.
[0071] In the actual application process, the result type of the video simulation result can be divided into three categories: the first result type, the second result type, and the third result type; specifically, if there is only one frame of data in the video simulation result, then the result type of the video simulation result can be directly determined as the third result type; in the case where there are multiple frames of data in the video simulation result, it can be further determined whether the grid data of all frames of data in the video simulation result are the same, that is, whether the grids of all steps have changed; if the grids of all steps have not changed, then during the playback of the video simulation result, there is no need to redisplay the grid between each frame of data, that is, all frames of data share one grid, and only the physical quantity to be displayed needs to be replaced during the playback. In this case, the resources and time consumed for calculation between two frames of data are less. At this time, it can be considered that the result type of the video simulation result is the first result type; in the case where the grid data of all frames of data in the video simulation result are not the same, that is, there are different grids in each step, there is no need to redisplay the grid data between any two frames, and it can be considered that the result type of the video simulation result is the second result type.
[0072] It should be noted that in the case where the grid data of each frame of data are different, if the corresponding frame of data is directly added to the 3D viewport during playback, it will consume huge resources and cannot ensure the stability of the frame rate of the simulation result player, resulting in obvious playback jams. Therefore, in order to reduce resource consumption and avoid playback jams, a part of the frame data to be played subsequently can be pre-loaded into the memory of the simulation result player in advance, that is, step S103 and its subsequent steps are executed; however, before executing step S103, the video simulation result needs to be processed according to the result type of the video simulation result to obtain the corresponding target video simulation result.
[0073] In an embodiment of the present application, when it is determined that the result type of the video simulation result is the first result type, interpolation processing can be performed on the physical quantities of each frame data in the video simulation result according to the visualization requirements to obtain initial frame data; it is detected whether there is a user's grid transformation requirement currently. If there is, the grid data of each frame data can be subjected to grid transformation according to the deformation amount indicated by the user's grid transformation requirement and the displacement of each frame data to obtain a target video simulation result, where the obtained target video simulation result at this time includes multiple target frame data with different grid data. If not, the obtained initial frame data can be directly used as the target video simulation result, where the target video simulation result at this time includes multiple target frame data with the same grid data, and the target frame data at this time is the initial frame data.
[0074] When it is determined that the result type of the video simulation result is the third result type, interpolation processing can be performed on the physical quantities of the frame data in the video simulation result according to the visualization requirements to split each frame data; according to the deformation amount indicated in the grid transformation requirement uploaded by the user and the displacement of each frame data obtained by splitting, grid transformation is performed on each frame data obtained by splitting to obtain multiple target frame data with different grid data.
[0075] It should be noted that the visualization requirements include the number of interpolations. For example, when the number of interpolations is 10 and the physical quantity is temperature, in the case where the video simulation result only includes one frame data, the interpolation data in the visualization requirements can be used to interpolate the one frame data into the grid transformation, and interpolation processing is performed on the physical quantity of the frame data according to the number of interpolations in the visualization requirements to obtain 10 new frame data, where the grid data of these 10 new frame data is the same; by performing grid transformation on the grid data of these 10 new frame data according to the deformation amount indicated in the grid transformation requirement uploaded by the user and the displacement of the 10 new frame data, 10 target frame data with different grid data can be obtained.
[0076] S103: Load any target frame data to be played from each target frame data into the memory of the simulation result player, and determine the loading time and required memory space of the target frame data to be played.
[0077] During the specific execution of step S103, after obtaining the target video simulation result, an unplayed target frame data can be arbitrarily selected from the target video simulation result as the target frame data to be played, and the target frame data to be played is loaded into the memory of the simulation result player. Meanwhile, record the loading time required to load the target frame data to be played into the simulation result player, and calculate the required memory space of the target frame data to be played based on the memory space of the simulation result player before loading the target frame data to be played and the memory space of the simulation result player after loading the target frame data to be played.
[0078] For example, before loading the target frame data to be played, record the time and memory space of the simulation result player as 16.10.30.100 and 5G respectively; after loading the target frame data to be played, record the time of the simulation result player as 16.10.30.500. It can be seen that the loading time of the target frame data to be played is 400ms, and the required memory space is 1G.
[0079] It should be noted that only the display data related to the target frame data to be played is loaded into the simulation result player, and the interaction data of the target frame data to be played is not loaded into the simulation result player, which can reduce the memory space occupied by each frame of target frame data and enable the memory of the simulation result player to cache more frames of target frame data.
[0080] S104: Determine the number of pre-loaded frames based on the playback information of the simulation result player, the loading time, and the required memory space of the target frame data to be played.
[0081] In the embodiment of the present application, in order to reduce resource consumption and avoid playback jitter, a part of the frame data that needs to be played subsequently can be pre-loaded into the memory of the simulation result player in advance. However, the specific amount of data that needs to be pre-loaded into the memory of the simulation result player needs to be calculated according to the actual situation. Specifically, the playback information of the simulation result player can be obtained first, where the playback information includes the memory space and playback speed of the simulation result player, so as to calculate the number of pre-loaded frames based on the memory space, playback speed, loading time, and required memory space of the target frame data to be played.
[0082] It should be noted that the required memory space of the target frame data to be played can be the required memory space of each target frame data.
[0083] It should also be noted that the playback speed of the simulation result player can be pre-set by the user. Among them, a suitable playback speed can be calculated in advance according to the historical playback speed of the simulation result player, and the calculated playback speed can be recommended to the user, so that the user can set the playback speed of the simulation result player according to the recommended playback speed. The playback speed of the simulation result player can be set according to the actual application, and the embodiments of the present application do not limit this here.
[0084] Optionally, the process of determining the number of pre-loaded frames according to the playback information of the simulation result player, the loading time of the target frame data to be played, and the required memory space may be: obtaining the playback information of the simulation result player, where the playback information includes the memory space and playback speed of the simulation result player; determining the playback time interval according to the playback speed of the simulation result player; calculating the number of pre-loaded frames according to the playback speed, memory space, loading time of the target frame data to be played, and required memory space.
[0085] As a preferred method of the embodiments of the present application, the remaining memory space of the simulation result player can be calculated according to the memory space and the required memory space of the target frame data to be played; the target number of loaded frames can be calculated according to the loading time, playback time interval, and playback time of the target frame data to be played; the number of pre-loaded frames can be calculated according to the target number of loaded frames and the remaining memory space; where the number of pre-loaded frames is not less than the target number of loaded frames.
[0086] Specifically, the playback time interval between two frames of data can be calculated first according to the playback speed of the simulation result player, and then according to the playback time interval and the loading time of the target frame data to be played, calculate how many target frame data can be played when loading one frame of the target frame data to be played, that is, calculate the target number of loaded frames, and calculate the total required memory space according to the target number of loaded frames; calculate the remaining memory space of the simulation result player according to the memory space and the required memory space of the target frame data to be played, and judge whether the total required memory space is greater than or equal to the remaining memory space of the simulation result player; if it is not greater than or equal, corresponding prompt information can be output. If it is equal, the target number of loaded frames can be directly used as the number of pre-loaded frames; if it is greater, the remaining memory space minus the total required memory space can be used to obtain the available memory space; judge whether the available memory space is less than the required memory space of the target frame data to be played, if it is not less, the number of pre-loaded frames can be determined according to the available memory space, the required memory space of the target frame data to be played, and the target number of loaded frames; if it is less, the target number of loaded frames can be directly used as the number of pre-loaded frames.
[0087] For example, the required memory space for the target frame data to be played is 1G, the loading time of the target frame data to be played is 400ms, and the playback speed of the simulation result player is 5fps. According to the playback speed of the simulation result player, the playback time interval between two frames of data can be calculated as 200ms. Dividing the loading time (400ms) of the target frame data to be played by the playback time interval (200ms), it can be obtained that loading one frame of the target frame data to be played can play 2 frames of target frame data, that is, the target loading frame number is 2. Since the required memory space for one frame of the target frame data to be played is 1G, the memory space occupied by 2 frames of target frame data is 2G, that is, the total required memory space is 2G. The memory space of the simulation result player is generally 8G. After removing the necessary display data in the simulation result player, the current memory space of the simulation result player is 5G. Since the required memory space for the loaded target frame data to be played is 1G, it can be determined that the remaining memory space of the simulation result player is 4G. Since the remaining memory space is greater than the total required memory space, the remaining memory space can be subtracted from the total required memory space to obtain an available memory space of 1G. Since the required memory space for one frame of the target frame data to be played is 1G, therefore, based on the target loading frame number, 1 more frame of target frame data can be loaded (leaving some memory space for other uses), so it can be determined that the preloading frame number is 3.
[0088] S105: Play the target frame data to be played in the memory, and load the number of target frame data of the preloading frame number as the target frame data to be played into the memory; wherein, the number of target frame data of the preloading frame number is the target frame data that has not been played among each target frame data.
[0089] In the specific process of executing step S105, after determining the preloading frame number, the target frame data to be played in the memory can be played, and the number of target frame data of the preloading frame number that has not been played is screened out from each target frame data in the target video simulation result, and the screened number of target frame data of the preloading frame number is used as the target frame data to be played, so as to load the number of target frame data of the preloading frame number into the memory of the simulation result player.
[0090] S106: Release the target frame data to be played that has been played in real time.
[0091] During the specific execution of step S106, when a target frame data to be played is finished being played, the played target frame data can be marked as the played target frame data, and the corresponding memory can be directly released, that is, the played target frame data to be played is deleted from the memory. At the same time, continue to play the target frame data to be played stored in the memory, and return to execute step S103 to reselect a target frame data to be played from each target frame data, and load the reselected target frame data into the memory of the simulation result player, so as to achieve the purpose of loading while playing until there is no target frame data to be played in each target frame data. This can not only reduce the corresponding computing resources, but also avoid the phenomenon of playback jamming.
[0092] Further, in the embodiment of the present application, when the simulation result player starts to play the target frame data to be played, it can detect in real time whether there is a pause event (a pause instruction triggered by the user) currently; when it is detected that there is a pause event currently, pause the playback, record the target frame data to be played currently being played, and at the same time release the target frame data to be played stored in the memory of the simulation result player; when a playback instruction is detected again, reload the previously recorded target frame data to be played into the memory, and return to execute step S104 and detect in real time whether there is a pause event currently.
[0093] It should be noted that releasing the target frame data to be played stored in the memory while pausing the playback can make the memory of the simulation result player available for other work during the pause playback process, which can not only meet the user's needs but also balance the memory resources of the simulation result player.
[0094] To better understand the content of the present application, the following uses an example to illustrate the content after obtaining the target video simulation result, as Figure 2 shown.
[0095] A1: Load any target frame data to be played from the target video simulation result into the memory of the simulation player.
[0096] A2: Record the loading time and the required memory space for loading the target frame data to be played into the memory.
[0097] A3: Obtain the memory space and playback speed of the simulation result player, and calculate the playback time interval between two frames of data according to the playback speed.
[0098] A4: Calculate the target loading frames according to the loading time and the playback time interval of the target frame data to be played.
[0099] A5: Determine the total memory space based on the target number of frames to be loaded and the required memory space, and determine whether the total memory space is greater than or equal to the remaining memory space; if equal, execute step A6; where the remaining memory space is calculated based on the memory space of the simulation result player and the required memory space.
[0100] A6: Use the target number of frames to be loaded as the pre-loaded number of frames.
[0101] A7: Play the target frame data to be played in the memory of the simulation result player in real time, and detect whether there is a pause event currently. If no pause event is detected, execute A8; if a pause event is detected, pause the playback and release the memory at the same time, that is, delete the target frame data to be played stored in the memory.
[0102] A8: Load the target frame data of the pre-loaded number of frames as the target frame data to be played into the memory.
[0103] A9: Release the target frame data to be played that has been played in real time, continue to play the target frame data stored in the memory at the same time, and return to execute A1 until there is no target frame data to be played or a pause event is detected.
[0104] Furthermore, in the embodiment of the present application, there are two legend modes for the simulation result player provided by the present application, namely the fixed legend and the step-by-step changing legend; since each step (each frame data) has a corresponding physical quantity range (for example, the displacement values of the first few steps (the first few frames) are very small, and the displacement values of the last few steps are very large), so the user can view the simulation results of each frame data according to the legend of a fixed physical quantity range, and the user can also see the changes in the physical quantities corresponding to each frame data.
[0105] Furthermore, the present application can also adjust the frame rate of the simulation result player according to the frame rate sent by the user. Because the number of steps in the video simulation result is generally not many, for the user, the changes in the video simulation result during playback can be seen quickly, so the user can adjust the frame rate of the simulation result player according to actual needs. For example, the video simulation result includes 20 frame data, and the user can set the frame rate of the simulation result player to 60 frames / s. In this way, the user only needs 1 / 3 s to finish watching the entire playback process of the video simulation result.
[0106] The present application provides a method for playing simulation results in a web version. After obtaining the video simulation results to be played, the video simulation results can be processed based on the grid data and physical quantities of the frame data in the video simulation results to obtain the target video simulation results. To reduce resource consumption and avoid playback jitter, any target frame data to be played can be loaded from each target frame data into the memory of the simulation result player, and the loading time and required memory space of the target frame data to be played are determined, so as to determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time and required memory space of the target frame data to be played. In this way, while playing the target frame data to be played in the memory, the number of target frame data equal to the number of pre-loaded frames is loaded into the memory as the target frame data to be played, achieving the purpose of loading while playing. In addition, the present application can also release the target frame data to be played that has been played in real time, which can avoid exceeding the memory limit of the simulation result player. Even if the required memory space of the video simulation results is large, it will not exceed the memory limit of the simulation result player, thus avoiding problems such as unstable and incomplete video playback.
[0107] Based on the method for playing simulation results in a web version provided by the embodiments of the present application, correspondingly, the embodiments of the present application also provide a system for playing simulation results in a web version, as Figure 3 shown, which is applied to a simulation result player. The system for playing simulation results in a web version includes:
[0108] A video simulation result acquisition unit 31, configured to acquire the video simulation results of the video to be played; wherein, the video simulation results include one frame data or multiple frame data;
[0109] A processing unit 32, configured to process the video simulation results based on the grid data and physical quantities of the frame data in the video simulation results to obtain the target video simulation results, wherein the target video simulation results include multiple target frame data;
[0110] A first determination unit 33, configured to load any target frame data to be played from each target frame data into the memory of the simulation result player, and determine the loading time and required memory space of the target frame data to be played;
[0111] A second determination unit 34, configured to determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time and required memory space of the target frame data to be played;
[0112] A playback and loading unit 35, configured to play the target frame data to be played in the memory, and at the same time load the number of target frame data equal to the number of pre-loaded frames into the memory as the target frame data to be played; wherein, the number of target frame data equal to the number of pre-loaded frames is the target frame data that has not been played in each target frame data;
[0113] A release unit 36 is configured to release in real time the target frame data to be played that has been played, and return to execute the first determination unit until there is no target frame data to be played in each piece of target frame data.
[0114] For the specific principles and execution processes of each unit in the web-based simulation result playback system disclosed in the embodiments of the present application above, they are the same as those in the web-based simulation result playback method disclosed in the embodiments of the present application above. Refer to the corresponding parts in the web-based simulation result playback method disclosed in the embodiments of the present application above, and details will not be elaborated here.
[0115] The present application provides a web-based simulation result playback system. After obtaining the video simulation result to be played, it can process the video simulation result based on the grid data and physical quantities of the frame data in the video simulation result to obtain the target video simulation result. To reduce resource consumption and avoid playback jitter, any target frame data to be played can be loaded from each piece of target frame data into the memory of the simulation result player, and the loading time and required memory space of the target frame data to be played are determined, so as to determine the number of pre-loaded frames according to the playback information of the simulation result player, the loading time of the target frame data to be played, and the required memory space. In this way, while playing the target frame data to be played in the memory, the number of target frame data equal to the number of pre-loaded frames is loaded into the memory as the target frame data to be played, achieving the purpose of playing while loading. And in the present application, the target frame data to be played that has been played can be released in real time, which can avoid exceeding the memory limit of the simulation result player. Even if the memory space required for the video simulation result is large, it will not exceed the memory limit of the simulation result player, thereby avoiding problems such as unstable and incomplete video playback.
[0116] Optionally, the processing unit includes:
[0117] A first judgment unit is configured to judge whether the video simulation result includes multiple pieces of frame data or 1 piece of frame data;
[0118] A third determination unit is configured to, if the video simulation result includes multiple pieces of frame data, determine the result type corresponding to the video simulation result according to the grid data of each piece of frame data; wherein, the result type is the first result type or the second result type;
[0119] A first processing sub-unit is configured to, if the result type of the video simulation result is the first result type, perform interpolation and grid transformation processing on each piece of frame data in the video simulation result to obtain the target video simulation result;
[0120] A second processing sub-unit is configured to, if the result type of the video simulation result is the second result type, use the video simulation result as the target video simulation result;
[0121] A third processing subunit, configured to determine that the result type of the video simulation result is the third result type if there is one frame data in the video simulation result, and perform interpolation and mesh transformation processing on the frame data in the video simulation result to obtain a corresponding target video simulation result.
[0122] Optionally, the third determination unit includes:
[0123] A second judgment unit, configured to judge whether the mesh data of each frame data is the same;
[0124] A fourth determination unit, configured to determine that the result type corresponding to the video simulation result is the first result type if the mesh data of each frame data is the same;
[0125] A fifth determination unit, configured to determine that the result type corresponding to the video simulation result is the second result type if there is frame data with different mesh data in each frame data.
[0126] Optionally, the second determination unit includes:
[0127] A playback information acquisition unit, configured to acquire the playback information of the simulation result player, where the playback information includes the memory space and playback speed of the simulation result player;
[0128] A sixth determination unit, configured to determine a playback time interval according to the playback speed of the simulation result player;
[0129] A preloading frame number calculation unit, configured to calculate the preloading frame number according to the playback time interval, the memory space, the loading time of the target frame data to be played, and the required memory space.
[0130] Optionally, the preloading frame number calculation unit includes:
[0131] A first calculation unit, configured to calculate the remaining memory space of the simulation result player according to the memory space and the required memory space of the target frame data to be played;
[0132] A second calculation unit, configured to calculate the target loading frame number according to the loading time of the target frame data to be played and the playback time interval;
[0133] A seventh determination unit, configured to determine the preloading frame number according to the target loading frame number and the remaining memory space; where the preloading frame number is not less than the target loading frame number.
[0134] The present application also provides a storage medium, in which computer-executable instructions are stored, and when the computer-readable instructions are loaded and executed by a processor, the embodiments of any of the above-mentioned web version simulation result playback methods are implemented.
[0135] The present application also provides an electronic device, such as Figure 4 shown. The electronic device includes a processor 401 and a memory 402, and the processor and the memory are connected through a bus; a program is stored in the memory; the processor calls the program in the memory to execute any of the above-described method embodiments for playing the simulation result of the web version.
[0136] The processor in the present application may be the CPU of the terminal, or an MCU integrated in the terminal, or a combination of the CPU and the MCU. Moreover, the processor includes a kernel, and the corresponding program is retrieved from the memory by the kernel, and one or more kernels may be provided.
[0137] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0138] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. The system and system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.
[0139] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0140] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but rather is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0141] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A web version of a simulation result playback method, characterized in that: Applied to a simulation result player, the method comprises: Obtaining a video simulation result of a video to be played; wherein the video simulation result includes one frame of data or multiple frames of data; Based on the grid data and physical quantities of the frame data in the video simulation result, the video simulation result is processed to obtain a target video simulation result, wherein the target video simulation result includes multiple target frame data; based on the grid data and physical quantities of the frame data in the video simulation result, the video simulation result is processed to obtain a target video simulation result, including: judging whether the video simulation result includes multiple frame data or 1 frame data; if the video simulation result includes multiple frame data, determining the result type corresponding to the video simulation result according to the grid data of each frame data; wherein the result type is a first result type or a second result type; if the result type of the video simulation result is the first result type, interpolating and grid transforming each frame data in the video simulation result to obtain a target video simulation result; if the result type of the video simulation result is the second result type, using the video simulation result as the target video simulation result; if the video simulation result includes 1 frame data, determining the result type of the video simulation result to be a third result type, and interpolating and grid transforming the frame data in the video simulation result to obtain a corresponding target video simulation result; Loading any one of the target frame data to be played from each of the target frame data into the memory of the simulation result player, and determining the loading time and required memory space of the target frame data to be played; Determine the number of preloaded frames according to the playback information of the simulation result player, the loading time of the target frame data to be played and the required memory space; Play the target frame data to be played in the memory, and load the preloaded frame number of target frame data as the target frame data to be played into the memory; wherein the preloaded frame number of target frame data is the target frame data that has not been played among the target frame data; The target frame data to be played that has been played is released in real time, and the process of loading any target frame data to be played from each of the target frame data into the memory of the simulation result player is returned until there is no target frame data to be played in each of the target frame data.
2. The method according to claim 1, characterized in that: The determining the result type corresponding to the video simulation result according to the grid data of each frame data includes: Determining whether the grid data of each frame data are the same; If the grid data of each frame data are the same, determining that the result type corresponding to the video simulation result is the first result type; If frame data with different grid data exists in each of the frame data, it is determined that the result type corresponding to the video simulation result is the second result type.
3. The method according to claim 1, characterized in that: The determining of the number of preloaded frames according to the playback information of the player of the simulation result, the loading time of the target frame data to be played and the required memory space comprises: Acquire playback information of the simulation result player, wherein the playback information includes the memory space and playback speed of the simulation result player; Determine the playback time interval according to the playback speed of the player of the simulation result; The number of preloaded frames is calculated according to the playback time interval, the memory space, the loading time of the target frame data to be played, and the required memory space.
4. The method according to claim 3, characterized in that The calculating the number of preloaded frames according to the playback time interval, the memory space, the loading time of the target frame data to be played, and the required memory space includes: Calculating the remaining memory space of the simulation result player according to the memory space and the required memory space of the target frame data to be played; Calculate the target number of loaded frames according to the loading time of the target frame data to be played and the playing time interval; The number of preloaded frames is determined according to the target number of loaded frames and the remaining memory space; wherein the number of preloaded frames is not less than the target number of loaded frames.
5. A web version of the simulation result playback system, characterized in that: Applied to a simulation result player, the system comprises: A video simulation result acquisition unit, used to acquire a video simulation result of a video to be played; wherein the video simulation result includes one frame of data or multiple frames of data; A processing unit, for processing the video simulation result based on the grid data and physical quantity of the frame data in the video simulation result to obtain a target video simulation result, wherein the target video simulation result includes multiple target frame data; the processing unit includes: a first judgment unit, for judging whether the video simulation result includes multiple frame data or 1 frame data; a third determination unit, for determining the result type corresponding to the video simulation result according to the grid data of each frame data if the video simulation result includes multiple frame data; wherein the result type is the first result type or the second result type; a first processing sub-unit, for interpolating and grid transforming each frame data in the video simulation result to obtain the target video simulation result if the result type of the video simulation result is the first result type; a second processing sub-unit, for using the video simulation result as the target video simulation result if the result type of the video simulation result is the second result type; a third processing sub-unit, for determining that the result type of the video simulation result is the third result type if the video simulation result includes 1 frame data, and interpolating and grid transforming the frame data in the video simulation result to obtain the corresponding target video simulation result; A first determining unit is used to load any one of the target frame data to be played from each of the target frame data into the memory of the simulation result player, and determine the loading time and required memory space of the target frame data to be played; A second determining unit is used to determine the number of preloaded frames according to the playback information of the simulation result player, the loading time of the target frame data to be played and the required memory space; a playing and loading unit, used for playing the target frame data to be played in the memory, and loading the preloaded frame number of target frame data as the target frame data to be played into the memory; wherein the preloaded frame number of target frame data is the target frame data that has not been played among the target frame data; The releasing unit is used to release the to-be-played target frame data that has been played in real time, and return to execute the first determining unit until there is no to-be-played target frame data in each of the target frame data.
6. The system according to claim 5, characterized in that The third determining unit includes: A second judging unit, used for judging whether the grid data of each frame data are the same; A fourth determining unit, configured to determine that the result type corresponding to the video simulation result is a first result type if the grid data of each frame data is the same; The fifth determining unit is configured to determine that the result type corresponding to the video simulation result is a second result type if frame data having different grid data exists in each of the frame data.
7. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement a web version of a simulation result playback method as described in any one of claims 1-4.
8. A storage medium, characterized in that: The storage medium stores computer executable instructions, and the computer executable instructions are used to execute a web version of a simulation result playback method as described in any one of claims 1-4.
Citation Information
Patent Citations
Video playing method and device, electronic equipment and storage medium
CN117135404A
Browser-side video resource processing method, device and equipment and medium
CN118381976A