Webpage version simulation result playing method and system, electronic equipment 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
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-21
AI Technical Summary
In the prior art, due to the memory limitations of the browser, there are problems of instability and incompleteness during the playback of the video simulation results.
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, the purpose of loading while playing is achieved, and the memory is released 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 CN119893210A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video playback technology, and more specifically, to a web version of a simulation result playback method, system, electronic device and storage medium. Background Art
[0002] Traditional CAE software is generally heavyweight software and generally needs to be run on a computer with a higher configuration. With the continuous development of computer technology, the computer running CAE software is required to have strong computing power in displaying geometry, rendering data of results, and simulation calculation process. In order to solve the problem of strong computing power required in the simulation calculation process, cloud CAE software can be made to generate corresponding Software as a Service (SaaS). In this way, only an ordinary computer is needed to log in online using a browser to view the corresponding video simulation results, that is, play the corresponding video simulation results.
[0003] However, the cloud CAE software has the problem that each time you view the video simulation results, you need to load them from the backend, that is, you need to obtain the video simulation results to be played through network transmission, which takes a long time. And the corresponding video simulation results can only be played with the help of the corresponding browser, and the browser has certain memory limitations, which leads to 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, which is prone to unstable and incomplete video playback. Summary of the invention
[0004] In view of this, the present application provides a web version of a simulation result playback method, system, electronic device and storage medium to solve the problem in the prior art that the video simulation result playback process is unstable and incomplete due to certain memory limitations of the browser.
[0005] The first aspect of the present application provides a web version of a simulation result playback method, which is applied to a simulation result player, and the method comprises:
[0006] 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;
[0007] Based on the grid data and physical quantity 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 a plurality of target frame data;
[0008] 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;
[0009] 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;
[0010] 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;
[0011] 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.
[0012] Optionally, the processing of 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 includes:
[0013] Determine whether the video simulation result includes multiple frame data or one frame data;
[0014] If the video simulation result includes a plurality of 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 the first result type or the second result type;
[0015] If the result type of the video simulation result is the first result type, performing 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, taking the video simulation result as the target video simulation result;
[0017] If the video simulation result includes 1 frame data, the result type of the video simulation result is determined to be a third result type, and interpolation and grid transformation processing are performed on the frame data in the video simulation result to obtain a corresponding target video simulation result.
[0018] Optionally, determining the result type corresponding to the video simulation result according to the grid data of each frame data includes:
[0019] Determining whether the grid data of each frame data are the same;
[0020] 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;
[0021] 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.
[0022] Optionally, determining 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 includes:
[0023] Acquire playback information of the simulation result player, wherein the playback information includes the memory space and playback speed of the simulation result player;
[0024] Determine the playback time interval according to the playback speed of the player of the simulation result;
[0025] 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.
[0026] Optionally, 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:
[0027] 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;
[0028] 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;
[0029] 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.
[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, 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;
[0032] A processing unit, configured to process 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 a plurality of target frame data;
[0033] 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;
[0034] 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;
[0035] 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;
[0036] 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.
[0037] Optionally, the processing unit includes:
[0038] A first judging unit, used for judging whether the video simulation result includes a plurality of frame data or one frame data;
[0039] A third determining unit, configured to determine, if the video simulation result includes a plurality of frame data, a result type corresponding to the video simulation result according to grid data of each frame data; wherein the result type is a first result type or a second result type;
[0040] A first processing subunit is used for, if the result type of the video simulation result is a first result type, performing interpolation and grid transformation processing on each frame data in the video simulation result to obtain a target video simulation result;
[0041] A second processing subunit, configured to use the video simulation result as a target video simulation result if the result type of the video simulation result is a second result type;
[0042] The third processing subunit is used to determine that the result type of the video simulation result is a third result type if the video simulation result includes one frame data, and to 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 determining unit includes:
[0044] A second judging unit, used for judging whether the grid data of each frame data are the same;
[0045] 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;
[0046] 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.
[0047] The third aspect of the present application provides an electronic device, comprising: 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; and the memory is used to store a program, wherein the program is used to implement a web version of a simulation result playback method as provided in the first aspect of the present application.
[0048] The 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 web version of a simulation result playback method provided in the first aspect of the present application.
[0049] The present application provides a web version of a simulation result playback method, system, electronic device and storage medium. After obtaining a video simulation result to be played, the video simulation result can be processed based on the grid data and physical quantity 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 can be determined, so that the number of preloaded frames can be determined 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, so that while playing the target frame data to be played in the memory, the target frame data of the preloaded number of frames are loaded into the memory as the target frame data to be played, so as to achieve the purpose of loading while playing. In the present application, the target frame data to be played that has been played can also be released in real time, so as to 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 the problem of unstable and incomplete video playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0051] Figure 1 A flowchart of a method for playing simulation results on a web page provided in an embodiment of the present application;
[0052] Figure 2 An example diagram of another web version of a simulation result playback method provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of the structure of a web version of a simulation result playback system provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0057] See also Figure 1 , shows a flow chart of a web version of a simulation result playback method provided in an embodiment of the present application, which is applied to a simulation result player. The web version of the simulation result playback method specifically includes the following steps:
[0058] S101: Obtain 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.
[0059] In the embodiment of the present application, the simulation result player may also be referred to as a video player, which is not limited in the embodiment 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 results smoothly, the data of a later period of time can be gradually cached during the playback process without caching the entire video simulation results. In this way, when displaying the corresponding video simulation results, there is no need to perform time-consuming calculation processes. It only takes microseconds to display the data cached in the memory.
[0061] It should also be noted that the frame rate and resolution of the simulation result player can also be pre-set; among them, frame rate: because the visual persistence effect of the human eye is about 0.1s, when the corresponding video is played, the time interval between the two frames is less than 0.1s, so that the video played is basically smooth to the human eye, and the reciprocal of this time interval to seconds is the so-called frame rate; resolution: refers to the resolution of each frame (the number of pixels in the horizontal and vertical directions of the picture). In order to compress the volume of the video, the part of the pixels of the two frames that do not move may be compressed, and then parsed and restored to a complete image when playing.
[0062] It should also be noted that the simulation result player can also realize 3D display and interaction; WEBGL technology is required to realize 3D display, so when realizing 3D display, corresponding operations such as rotating video, panning and zooming can be performed; for the attributes attached to the network data and grid data in the video simulation results, the user can pick up the corresponding grid data with the mouse.
[0063] Among them, the video simulation results also have the concept of steps, and each step is each frame; in 3D display, the video simulation results are generally composed of mesh data and attributes attached to the mesh data; the attributes attached to the mesh data can be called physical quantities; the physical quantity 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 when viewing the corresponding video simulation results.
[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 easy distinction, the video currently to be played is called the video to be played), wherein the video simulation result includes multiple frame data or 1 frame data; for each frame data, the corresponding grid data can be extracted from the frame data, and the physical quantity 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, the video simulation result is processed to obtain a target video simulation result, wherein the target video simulation result includes a plurality of target frame data.
[0066] In the process of specifically executing 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 the number of frame data contained 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; wherein, the video simulation result includes 1 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 may be the same or different.
[0067] It should be noted that each frame of data includes a grid of data and several physical quantities.
[0068] Optionally, the process of determining the result type corresponding to the video simulation result based on the grid data of each frame data can be: 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 based on the grid data of each frame data; wherein 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, 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 that the result type of the video simulation result is the third result type, and interpolating and grid transforming the frame data in the video simulation result to obtain the corresponding target video simulation result.
[0069] In some embodiments, if the video simulation result contains only one frame of data, that is, the video simulation result contains only one frame of data, then the result type of the video simulation result can be directly determined as the third result type; if the video simulation result contains multiple frame data, then the network data of each frame data can be compared, and the result type corresponding to the video simulation result can be determined based on the comparison result obtained, wherein the result type of the video simulation result can be the first result type, or the second result type.
[0070] As a preferred method of an embodiment of the present application, the process of determining the result type corresponding to the video simulation result based on the grid data of each frame data can be: judging 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 there are frame data with different grid data in each frame data, determining that the result type corresponding to the video simulation result is the second result type.
[0071] In actual application, the result types of video simulation results can be divided into three categories: the first result type, the second result type and the third result type; specifically, if the video simulation result contains only one frame data, then the result type of the video simulation result can be directly determined to be the third result type; in the case where the video simulation result contains multiple frame data, it can be further determined whether the grid data of all frame data of 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 grids between the frame data, that is, all frame data use one grid, and only the displayed physical quantity needs to be replaced during the playback process. In this case, the resources and time required for calculation between the two frame data are less, and at this time, the result type of the video simulation result can be considered to be the first result type; in the case where the grid data of all frame data of the video simulation result are different, that is, each step has a different grid, there is no need to redisplay the grid data between any two frames, and the result type of the video simulation result can be considered to be the second result type.
[0072] It should be noted that, when the grid data of each frame data is different, if the corresponding frame data is directly added to the 3D viewport during the playback process, it will consume huge resources and cannot guarantee 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 that needs to be played later can be pre-loaded into the memory of the simulation result player, that is, execute step S103 and its subsequent steps; however, before executing step S103, it is necessary to process the video simulation results according to the result type of the video simulation results to obtain the corresponding target video simulation results.
[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, the physical quantity of each frame data in the video simulation result can be interpolated according to the visualization requirements to obtain the initial frame data; it is detected whether there is a grid transformation requirement of the user at present, and if so, the grid data of each frame data can be grid transformed according to the deformation amount indicated by the user's grid transformation requirement and the displacement of each frame data to obtain the target video simulation result, wherein the target video simulation result obtained at this time includes multiple frames of target frame data with different grid data. If not, the obtained initial frame data can be directly used as the target video simulation result, wherein the target video simulation result at this time includes multiple frames of 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, the physical quantities of the frame data in the video simulation result can be interpolated according to the visualization requirements to achieve the splitting of individual frame data; according to the deformation amount indicated in the grid transformation requirements uploaded by the user and the displacement of each frame data obtained by the splitting, the grid of each frame data obtained by the splitting is changed to obtain multiple target frame data with different grid data.
[0075] It should be noted that visualization needs to include the interpolation number. For example, when the interpolation number is 10 and the physical quantity is temperature, when the video simulation result contains only one frame of data, one frame of data can be interpolated into the grid transformation according to the interpolation data in the visualization requirement, and the physical quantity of the frame data is interpolated according to the interpolation number in the visualization requirement to obtain 10 new frames of data, wherein the grid data of the 10 new frames of data are the same; by performing grid transformation on the grid data of the 10 new frames of data according to the deformation indicated in the grid transformation requirement uploaded by the user and the displacement of the 10 new frames of data, 10 target frames of 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] In the process of specifically executing step S103, after obtaining the target video simulation result, you can arbitrarily select a target frame data that has not been played from the target video simulation result as the target frame data to be played, and load the target frame data to be played into the memory of the simulation result player. At the same time, 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 for 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 into the simulation result player and the memory space of the simulation result player after loading the target frame data to be played into the simulation result player.
[0078] For example, before loading the target frame data to be played, the time and memory space recorded in the simulation result player are 16.10.30.100 and 5G respectively; after loading the target frame data to be played, the time recorded in the simulation result player is 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 interactive data of the target frame data to be played is not loaded into the simulation result player. This can reduce the memory space occupied by each frame of target frame data, so that the memory of the simulation result player can cache more frames of target frame data.
[0080] S104: 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.
[0081] In an embodiment of the present application, in order to reduce resource consumption and avoid playback jams, a portion of frame data that needs to be played later can be pre-loaded into the memory of the simulation result player. However, how much data needs to be loaded into the memory of the simulation result player in advance needs to be calculated based on actual conditions. 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 of the target frame data to be played, and required memory space.
[0082] It should be noted that the memory space required for the target frame data to be played may be the memory space required for each target frame data.
[0083] It should also be noted that the playback speed of the simulation result player can be preset by the user. Among them, a suitable playback speed can be calculated in advance based on 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 actual applications, and this is not limited in the embodiments of the present application.
[0084] Optionally, the process of determining the number of preloaded frames based on the playback information of the simulation result player, the loading time of the target frame data to be played, and the required memory space can be: obtaining the playback information of the simulation result player, wherein the playback information includes the memory space and playback speed of the simulation result player; determining the playback time interval based on the playback speed of the simulation result player; and calculating the number of preloaded frames based on the playback speed, memory space, and the loading time of the target frame data to be played and the required memory space.
[0085] As a preferred method of an embodiment of the present application, the remaining memory space of the simulation result player can be calculated based on 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 based on the loading time, playback time interval and playback time of the target frame data to be played; the number of preloaded frames can be calculated based on 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.
[0086] Specifically, the playback time interval between two frames of data can be calculated 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, how many target frame data can be played by loading one frame of the target frame data to be played, that is, the target loading frame number is calculated, and the total required memory space is calculated according to the target loading frame number; the remaining memory space of the simulation result player is calculated according to the memory space and the required memory space of the target frame data to be played, and it is judged 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 to, the corresponding prompt information can be output. If it is equal, the target loading frame number can be directly used as the preloaded frame number; if it is greater than, the total required memory space can be subtracted from the remaining memory space to obtain the available memory space; it is judged 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 than, the preloaded frame number can be determined according to the available memory space, the required memory space of the target frame data to be played and the target loading frame number; if it is less than, the target loading frame number can be directly used as the preloaded frame number.
[0087] For example, the required memory space of the target frame data to be played is 1G, the loading time of the target frame data to be played is 400ms, and the playing speed of the simulation result player is 5fps; according to the playing speed of the simulation result player, it can be calculated that the playing time interval between two needle data is 200ms, and the loading time of the target frame data to be played (400ms) is divided by the playing time interval (200ms), and it can be obtained that loading one frame of the target frame data to be played can play two frames of the target frame data, that is, the target loading frame number is 2; since the required memory space of one frame of the target frame data to be played is 1G, the memory space occupied by two frames of the 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 excluding the necessary display data in the simulation result player, the current memory space of the simulation result player is 5G. Since the memory space required 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 total required memory space can be subtracted from the remaining memory space to obtain the available memory space of 1G; since the memory space required for one frame of target frame data to be played is 1G, therefore, based on the target number of loaded frames, 1 more frame of target frame data can be loaded (some memory space remaining for other uses), so the number of preloaded frames can be determined to be 3.
[0088] S105: 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.
[0089] In the process of specifically executing step S105, after determining the number of preloaded frames, the target frame data to be played in the memory can be played, and the target frame data of the preloaded frames that have not been played can be filtered out from the various target frame data in the target video simulation result, and the filtered target frame data of the preloaded frames can be used as the target frame data to be played, so as to load the target frame data of the preloaded frames into the memory of the simulation result player.
[0090] S106: releasing the target frame data to be played that has been played in real time.
[0091] In the specific execution process of step S106, when a frame of target frame data to be played is played, the target frame data to be played after being played can be marked as played target frame data, and the corresponding memory can be directly released, that is, the target frame data to be played after being played is deleted from the memory, and the target frame data to be played stored in the memory continues to be played, and the execution of step S103 is returned to reselect a target frame data to be played from each target frame data, and the reselected target frame data is loaded into the memory of the simulation result player 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 jams.
[0092] Furthermore, in an 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 command triggered by the user); when it is detected that there is a pause event, the playback is paused, the target frame data to be played that is currently being played is recorded, and the target frame data to be played stored in the memory of the simulation result player is released; when the play command is detected again, the target frame data to be played that was previously recorded is reloaded into the memory, and the process returns to execute step S104 and detect in real time whether there is a pause event.
[0093] It should be noted that pausing the playback while releasing the target frame data to be played stored in the memory can make the memory of the simulation result player available for other tasks during the playback pause process, which can not only meet the needs of users but also balance the memory resources of the simulation result player.
[0094] In order to better understand the content of this application, the following example illustrates the content after obtaining the target video simulation result. 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: Records the loading time and memory space required to load the target frame data to be played into the memory.
[0097] A3: Get the memory space and playback speed of the simulation result player, and calculate the playback time interval between two frames of data based on the playback speed.
[0098] A4: Calculate the target number of loaded 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 according to the target number of loaded frames 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; wherein the remaining memory space is calculated according to the memory space of the player and the required memory space based on the simulation results.
[0100] A6: Set the target loading frame number as the preloading frame number.
[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. 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 preloaded frames into the memory as the target frame data to be played.
[0103] A9: releasing the target frame data to be played that has been played in real time, and continuing to play the target frame data to be played stored in the memory, and returning to execute A1 until there is no target frame data to be played or a pause time is detected.
[0104] Furthermore, in an embodiment of the present application, the simulation result player provided by the present application has two legend modes, namely a fixed legend and a legend that changes with each step; since each step (each frame data) has a corresponding physical quantity range (for example, the displacement values of the first few steps (first few frames) are very small, and the displacement values of the last few steps are very large), the user can view the simulation results of each frame data according to a 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] Further, 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 steps in the video simulation result are generally not many, the user can quickly see the changes in the video simulation result during the playback process. Therefore, the user can adjust the frame rate of the simulation result player according to actual needs. For example, the video simulation result includes 20 frames of data, and the user can set the frame rate of the simulation result player to 60 frames / s. In this case, the user only needs 1 / 3s to watch the entire playback process of the video simulation result.
[0106] The present application provides a web version of a simulation result playback method. After obtaining the 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 the 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 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 can be determined, so as to determine the number of preloaded 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, so that while playing the target frame data to be played in the memory, the preloaded number of target frame data is loaded into the memory as the target frame data to be played, so as to achieve the purpose of loading while playing. In the present application, the target frame data to be played that has been played can also be released in real time, so as to 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 the problem of unstable and incomplete video playback.
[0107] Based on the web version of the simulation result playback method provided in the above embodiment of the present application, correspondingly, the embodiment of the present application also provides a web version of the simulation result playback system, such as Figure 3 As shown, it is applied to the simulation result player. The web version of the simulation result playback system includes:
[0108] The video simulation result acquisition unit 31 is used to acquire the video simulation result of the video to be played; wherein the video simulation result includes one frame data or multiple frame data;
[0109] A processing unit 32 is used to process 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 a plurality of target frame data;
[0110] A first determining unit 33 is used 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] The second determining unit 34 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;
[0112] The playing and loading unit 35 is used to play the target frame data to be played in the memory, and at the same time 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;
[0113] The releasing unit 36 is used to release the target frame data to be played that has been played in real time, and return to execute the first determining unit until there is no target frame data to be played in each target frame data.
[0114] The specific principles and execution processes of each unit in the web version of the simulation result playback system disclosed in the above-mentioned embodiment of the present application are the same as the web version of the simulation result playback method disclosed in the above-mentioned embodiment of the present application. Please refer to the corresponding parts of the web version of the simulation result playback method disclosed in the above-mentioned embodiment of the present application, and no further details will be given here.
[0115] The present application provides a web version of a simulation result playback system. After obtaining the 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 the 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 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 can be determined, so as to determine the number of preloaded 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, so that while playing the target frame data to be played in the memory, the preloaded number of target frame data is loaded into the memory as the target frame data to be played, so as to achieve the purpose of loading while playing. In the present application, the target frame data to be played that has been played can also be released in real time, so as to 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 the problem of unstable and incomplete video playback.
[0116] Optionally, a processing unit comprising:
[0117] A first judging unit, used for judging whether the video simulation result includes a plurality of frame data or one frame data;
[0118] A third determining unit is used to determine 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;
[0119] A first processing subunit is used for, if the result type of the video simulation result is the first result type, performing interpolation and grid transformation processing on each frame data in the video simulation result to obtain a target video simulation result;
[0120] A second processing subunit is used for taking the video simulation result as a target video simulation result if the result type of the video simulation result is a second result type;
[0121] The third processing subunit is used to determine that the result type of the video simulation result is a third result type if the video simulation result includes one frame data, and to perform interpolation and grid transformation processing on the frame data in the video simulation result to obtain a corresponding target video simulation result.
[0122] Optionally, the third determining unit includes:
[0123] A second judging unit, used to judge whether the grid data of each frame data are the same;
[0124] A fourth determining unit, configured to determine that the result type corresponding to the video simulation result is the first result type if the grid data of each frame data is the same;
[0125] The fifth determining unit is configured to determine that the result type corresponding to the video simulation result is the second result type if frame data having different grid data exists in each frame data.
[0126] Optionally, the second determining unit includes:
[0127] A play information acquisition unit, used to acquire play information of the simulation result player, wherein the play information includes the memory space and play speed of the simulation result player;
[0128] A sixth determining unit, configured to determine a playback time interval according to a playback speed of a player of a simulation result;
[0129] The preloaded frame book calculation unit is used to calculate 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.
[0130] Optionally, preload the frame book calculation unit, including:
[0131] A first calculation unit, used for 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;
[0132] A second calculation unit, used for calculating a target number of loaded frames according to a loading time and a playback time interval of target frame data to be played;
[0133] The seventh determination unit is used to determine the number of preloaded frames 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.
[0134] The present application also provides a storage medium, in which computer executable instructions are stored. When the computer readable instructions are loaded and executed by a processor, any one of the above-mentioned web version simulation result playback method embodiments is implemented.
[0135] The present application also provides an electronic device, such as Figure 4 As shown, the electronic device includes a processor 401 and a memory 402, and the processor and the memory are connected via a bus; a program is stored in the memory; the processor calls the program in the memory to execute any one of the above-mentioned web version simulation result playback method embodiments.
[0136] The processor in the present application may be a CPU of a terminal, or an MCU integrated in the terminal, or a combination of a CPU and an MCU. Moreover, the processor includes a kernel, which retrieves a corresponding program from a memory, and one or more kernels may be provided.
[0137] The memory may include non-permanent memory in a computer-readable medium, 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 memory chip.
[0138] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between 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 partial description of the method embodiment. The system and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0139] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0140] The above 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 may 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 will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0141] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection 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 quantity 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 a plurality of target frame data; 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 step of processing the video simulation result based on the grid data and physical quantity of the frame data in the video simulation result to obtain the target video simulation result includes: Determine whether the video simulation result includes multiple frame data or one frame data; If the video simulation result includes a plurality of 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 the first result type or the second result type; If the result type of the video simulation result is the first result type, performing interpolation and grid transformation processing on 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, taking the video simulation result as the target video simulation result; If the video simulation result includes 1 frame data, the result type of the video simulation result is determined to be a third result type, and interpolation and grid transformation processing are performed on the frame data in the video simulation result to obtain a corresponding target video simulation result.
3. The method according to claim 2, 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 a first result type; If frame data having 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.
4. 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.
5. The method according to claim 4, 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.
6. 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, configured to process 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 a plurality of target frame data; 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.
7. The system according to claim 6, characterized in that The processing unit comprises: A first judging unit, used for judging whether the video simulation result includes a plurality of frame data or one frame data; A third determining unit, configured to determine, if the video simulation result includes a plurality of frame data, a result type corresponding to the video simulation result according to grid data of each frame data; wherein the result type is a first result type or a second result type; A first processing subunit is used for, if the result type of the video simulation result is a first result type, performing interpolation and grid transformation processing on each frame data in the video simulation result to obtain a target video simulation result; A second processing subunit, configured to use the video simulation result as a target video simulation result if the result type of the video simulation result is a second result type; The third processing subunit is used to determine that the result type of the video simulation result is a third result type if the video simulation result includes one frame data, and to perform interpolation and grid transformation processing on the frame data in the video simulation result to obtain a corresponding target video simulation result.
8. The system according to claim 7, 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.
9. 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-5.
10. 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-5.
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
Dynamic adaptation of interactive video players using behavioral analytics
US20210258647A1