Continuous storage data processing method, computer readable storage medium and electronic device

By configuring logical frames in the game to run in multi-level subthreads and rendered frames in the main thread, and dynamically adjusting the logical frame frame rate, the frame rate imbalance caused by the increase in the scale of the game unit is solved, and a smoother gaming experience is achieved.

CN119818940APending Publication Date: 2025-04-15BEIJING XIANLAI HUYU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411900566.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the Legional Combat Games of 10,000 Units, the increase in the scale of the game units of the animation leads to a linear increase in the computing power demand of the CPU and GPU, resulting in uneven calculation rates of game logic frames and rendered frames, and problems such as frame drops and lags occur. The game screen display is not smooth and the experience is poor.

Method used

By configuring logical frames to run in multi-level subthreads, rendered frames to run in main thread, and dynamically adjust the logical frame frame rate, the calculation ability of the main thread and the subthread are reasonably allocated to ensure the stability of the game frame rate.

Benefits of technology

It effectively improves the processing capability of complex business logic of units of more than 10,000 units, improves the smoothing effect of the picture, improves the user experience, and avoids game frame drops and lags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119818940A_ABST
    Figure CN119818940A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a continuous storage data processing method, a computer readable storage medium and an electronic device. The method comprises the following steps: configuring a logic frame to run in a multi-level sub-thread; the rendering frame is configured to run in the main thread; running the first frame of the logic frame, acquiring logic frame data and synchronizing the logic frame data into target data; the logic frame and the rendering frame are started at the same time, the rendering frame runs the first frame, and the logic frame runs the second frame; when the rendering frame runs for one frame, judging the relationship between the data moment of the rendering frame and the data moment of the logic frame; if the data moment of the rendering frame is smaller than the data moment of the logic frame, performing difference calculation on the rendering frame according to the target data and the current data of the rendering frame based on the time relationship, and performing rendering by using interpolation calculation data; and if the data moment of the rendering frame is greater than or equal to the data moment of the logic frame, performing data synchronization on the logic frame and the rendering frame, performing primary difference calculation according to the current data of the rendering frame and the target data, and performing rendering by using the data obtained by the difference calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electrical data processing, and in particular relates to a processing method for continuously stored data, a computer-readable storage medium and an electronic device. Background Art

[0002] In online games, especially in legion combat games with tens of thousands of units, the scale of animated game units increases, and the computing power requirements of the CPU and GPU increase linearly, resulting in an imbalance in the calculation rate of game logic frames and rendering frames, causing frame drops and freezes in the game, and the game screen display is not smooth, resulting in a poor experience. Summary of the invention

[0003] In view of this, on one hand, some embodiments disclose a method for processing continuously stored data, the method comprising:

[0004] (1) The logical frame is configured to run in multiple sub-threads according to the logical frame rate;

[0005] (2) The rendering frame is configured to run in the main thread according to the rendering frame rate;

[0006] (3) Run the first frame of the logical frame, obtain the logical frame data, and synchronize the logical frame data with the target data;

[0007] (4) The logic frame and the rendering frame are started at the same time, the rendering frame runs the first frame, and the logic frame runs the second frame;

[0008] (5) When the rendering frame runs to completion for one frame, the relationship between the data time of the rendering frame and the data time of the logic frame is determined;

[0009] If the data time of the rendering frame is less than the data time of the logical frame, the rendering frame performs difference calculation based on the time relationship between the target data and the current data of the rendering frame, and the rendering frame is rendered using the data obtained by the interpolation calculation;

[0010] If the data time of the rendering frame is greater than or equal to the data time of the logical frame, the logical frame and the rendering frame are synchronized;

[0011] After data synchronization, the rendering frame performs a difference calculation based on the current data of the rendering frame and the target data, and uses the data obtained by the difference calculation for rendering.

[0012] Furthermore, in some embodiments of the processing method for continuously storing data, in the process of continuous operation of the logical frame and the rendering frame, each time the rendering frame completes one frame, the content of (5) is repeated, a judgment is made on the relationship between the data time of the rendering frame and the data time of the logical frame, and data is selected for rendering based on the time relationship.

[0013] Some embodiments disclose a method for processing continuously stored data, which performs initialization before running the first frame of the logical frame, so that the current data of the logical frame, the rendering frame data and the target data are synchronized to the same logical frame 0 frame data, and the data has a consistent element index.

[0014] The method for processing continuously stored data disclosed in some embodiments further includes a step of dynamically adjusting the frame rate of the logical frame, specifically including:

[0015] After each logical frame is run, the relationship between the calculation time of the current logical frame and the data time of the logical frame is calculated. If the current calculation time of the logical frame exceeds the data time of the logical frame, the frame rate of the logical frame is adjusted so that the calculation time of the next logical frame does not exceed the data time of the logical frame.

[0016] Furthermore, in some embodiments of the processing method for continuously stored data disclosed, if the current calculation time of a logical frame exceeds 90% of the logical frame data time, the frame rate of the logical frame is reduced when the next logical frame runs; if the current calculation time of the logical frame exceeds the logical frame data time by no more than 40%, the frame rate of the logical frame is increased when the next logical frame runs.

[0017] Some embodiments disclose a method for processing continuously stored data, in which the frame rate of a logical frame is set to five levels from high to low, namely 30, 15, 10, 5, and 1 frames per second, and the frame rate of rendering is set to 60 frames per second; if the current calculation time of a logical frame exceeds 90% of the logical frame data time, the frame rate of the next logical frame is reduced by one level; if the current calculation time of a logical frame exceeds the logical frame data time by no more than 40%, the frame rate of the next logical frame is increased by one level.

[0018] In some embodiments of the method for processing continuously stored data, the data synchronization process of the logical frame and the rendering frame includes:

[0019] The rendering frame updates the current target data to the current data of the rendering frame;

[0020] Then the logic frame synchronization command is called, and the logic frame updates the current data to the new target data;

[0021] Then run the next logical frame; specifically, the logical frame synchronizes the current data to the target data, and then the logical frame performs deletion and addition operations, and starts calculating the next logical frame;

[0022] Rendering frame deletes current data;

[0023] During the data update process, the data index is ensured to remain consistent.

[0024] Some embodiments disclose a method for processing continuously stored data, in which data updating includes first deleting data and then adding data; wherein, the method for deleting data is to first delete the element to be deleted in the data, and then copy the last element in the data to the position of the deleted element, thereby reducing the data length; the method for adding data is to add elements at the end of the data, thereby increasing the data length.

[0025] On the other hand, some embodiments disclose a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method for processing continuously stored data disclosed in the embodiments of the present invention is implemented.

[0026] On the other hand, some embodiments disclose an electronic device, including a processor and a memory; a computer program is stored in the memory, and when the processor reads and executes the computer program, the method for processing continuously stored data disclosed in the embodiments of the present invention is implemented.

[0027] The method for processing continuously stored data disclosed in the embodiment of the present invention configures the logical frame to run in a multi-level sub-thread, and configures the rendering frame to run in the main thread, and reasonably allocates and utilizes the computing power of the main thread and the sub-thread, which can effectively improve the processing capability of complex business logic of units of more than 10,000 scales; further, by dynamically adjusting the frame rate of the logical frame, the frame rate of the logical frame can be adjusted according to different logical frame data to adapt to different logical frame data to complete calculation processing; the method for processing continuously stored data can effectively improve the smoothing effect of the picture and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 , Schematic diagram of a process flow of a method for continuously storing data in Example 1;

[0029] Figure 2 , Schematic diagram of a processing method for continuously storing data in Example 2. DETAILED DESCRIPTION

[0030] The word "embodiment" is used here exclusively, and any embodiment described as "exemplary" need not be interpreted as being superior or better than other embodiments. Performance index tests in the embodiments of the present invention are conducted using conventional test methods in the art unless otherwise specified. It should be understood that the terms described in the embodiments of the present invention are only used to describe specific implementation methods and are not intended to limit the contents disclosed in the embodiments of the present invention.

[0031] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as commonly understood by ordinary technicians in the technical field to which the embodiments of the present invention belong; other experimental methods and technical means not specifically specified in the embodiments of the present invention refer to experimental methods and technical means commonly used by ordinary technicians in the field.

[0032] The terms "substantially" and "approximately" used herein are used to describe small fluctuations. For example, they can refer to less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. The numerical data represented or presented in the range format herein are used only for convenience and brevity, and should therefore be flexibly interpreted as including not only the values ​​clearly listed as the limits of the range, but also all independent values ​​or sub-ranges contained in the range. For example, the numerical range of "1-5%" should be interpreted as including not only the clearly listed values ​​of 1% to 5%, but also the independent values ​​and sub-ranges within the range shown. Therefore, independent values ​​such as 2%, 3.5% and 4% and sub-ranges such as 1%-3%, 2%-4% and 3%-5% are included in this numerical range. This principle also applies to the range of only one numerical value. In addition, such an interpretation applies regardless of the width of the range or the characteristics described.

[0033] In this document, including in the claims, transitional words such as "comprises," "includes," "with," "having," "containing," "involving," "accommodating," etc. are understood to be open-ended, i.e., meaning "including but not limited to." Only the transitional words "consisting of" and "composed of" are closed transitional words.

[0034] In order to better illustrate the present invention, numerous specific details are provided in the specific examples below. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In the embodiments, some methods, means, instruments, equipment, etc. well known to those skilled in the art are not described in detail in order to highlight the gist of the present invention.

[0035] Under the premise of no conflict, the technical features disclosed in the embodiments of the present invention may be arbitrarily combined, and the resulting technical solutions belong to the contents disclosed in the embodiments of the present invention.

[0036] In some embodiments, the method for processing continuously stored data includes:

[0037] (1) The logical frame is configured to run in multiple sub-threads according to the logical frame rate;

[0038] (2) The rendering frame is configured to run in the main thread according to the rendering frame rate;

[0039] Generally, multi-threaded operation of logic frames and main thread operation of rendering frame data is for multi-unit and multi-task type application scenarios with large processing and relatively long processing time; among them, processing logic-related data in the sub-thread is called logic frame, and processing rendering-related data in the main thread is called rendering frame; and the sub-thread of the logic frame is set to multi-threaded processing, and the processed data is synchronized to the main thread, and the main thread rendering frame performs data interpolation calculation and then renders;

[0040] The logic frame is used to process specific business logic. For multi-unit and multi-task application scenarios, it involves complex logic of tens of thousands of similar units, including the specific business logic of a single unit, such as adding unit logic, deleting unit logic, querying units, and modifying units. As the number of units increases, the processing cost increases linearly. The rendering frame determines the target data to be synchronized, and then performs interpolation calculations based on the time ratio between the current data and the target data, and then renders after calculating the current data.

[0041] Generally, the calculation time of multi-threaded logic frames is longer, so it can handle more and more complex logic businesses; rendering frames only do rendering and data synchronization processing, and the amount of calculation is very small, so the logic frame runs in multi-level sub-threads and the rendering frame runs in the main thread, so that the entire game will not experience lag or frame drops;

[0042] (3) Run the first frame of the logical frame, obtain the logical frame data, and synchronize the logical frame data with the target data;

[0043] Usually, before running the first logical frame, initialization is usually required. The logical frame and the rendering frame will initialize a sufficiently large continuous memory space, and at the same time initialize the time and data length of the current target data generation. The logical frame will initialize the flag of whether the calculation is completed. After the initialization is completed, the current data, the rendering frame data and the target data are synchronized to the same logical frame 0 frame data, and the current data, the target data and the rendering frame data have the same element index;

[0044] Usually, in order to achieve data synchronization between the logic frame and the rendering frame, the first logic frame needs to be run first after initialization is completed, and the rendering frame needs to wait until the first logic frame is completed, and the first rendering frame and the second logic frame start running synchronously; this running method ensures that the logic frame is always completed one frame earlier than the rendering frame during data processing;

[0045] (4) The logic frame and the rendering frame are started at the same time, the rendering frame runs the first frame, and the logic frame runs the second frame;

[0046] (5) When the rendering frame runs to complete one frame, determine the relationship between the data time of the rendering frame and the data time of the logical frame; generally, the data time of the logical frame refers to the time required to complete the calculation of the logical frame data, which can be calculated based on the frame rate of the logical frame; the data time of the rendering frame refers to the time when one frame of the rendering frame is completed, which can be calculated based on the frame rate of the rendering frame; for example, if the frame rate of the rendering frame is 60 frames / second and the frame rate of the logical frame is 15 frames / second, then the data time when the first frame of the rendering frame is completed is 1 / 60 second, and the data time when the second frame of the logical frame calculation is completed is 1 / 15 second;

[0047] If the data time of the rendering frame is less than the data time of the logical frame, the rendering frame performs difference calculation based on the time relationship between the target data and the current data of the rendering frame, and the rendering frame uses the data obtained by interpolation calculation for rendering; usually, the interpolation calculation is performed based on the relationship time, and the rendering frame retains the current frame data. After obtaining the target data, the current data offset is calculated based on the time relationship between the target data and the current frame data, and the current data is used for rendering;

[0048] If the data time of the rendering frame is greater than or equal to the data time of the logical frame, the logical frame and the rendering frame are synchronized;

[0049] After data synchronization, the rendering frame performs a difference calculation based on the current data of the rendering frame and the target data, and uses the data obtained by the difference calculation for rendering;

[0050] (6) The logic frame and the rendering frame run continuously. After each frame of the rendering frame is completed, the relationship between the data time of the rendering frame and the data time of the logic frame is judged, and data is selected and determined for rendering according to the time relationship. Specifically, it includes:

[0051] If the data time of the rendering frame is less than the data time of the logical frame, the rendering frame performs difference calculation based on the time relationship between the target data and the current data of the rendering frame, and the rendering frame is rendered using the data obtained by the interpolation calculation;

[0052] If the data time of the rendering frame is greater than or equal to the data time of the logical frame, the logical frame and the rendering frame are synchronized;

[0053] After data synchronization, the rendering frame performs a difference calculation based on the current data of the rendering frame and the target data, and uses the data obtained by the difference calculation for rendering.

[0054] In some embodiments of the method for processing continuously stored data, the data synchronization process of the logical frame and the rendering frame includes:

[0055] The rendering frame updates the current target data to the current data of the rendering frame; during the data update process, the element index of the data is ensured to remain consistent;

[0056] Then the logic frame synchronization command is called, and the logic frame updates the current data to the new target data;

[0057] Then run the next logic frame;

[0058] Rendering frame deletes current data;

[0059] Usually, after the logical frame calculation is completed, the data will not be actively synchronized to the target data, but wait for the data synchronization command of the rendering frame; the rendering frame first synchronizes the target data completely to itself, and then the logical frame calls the data synchronization command to synchronize the current data of the logical frame to the target data; then, the next logical frame is calculated, and the rendering frame performs data deletion operations.

[0060] Some embodiments disclose a method for processing continuously stored data, in which data updating includes first deleting data and then adding data; wherein, the method for deleting data is to first delete the element to be deleted in the data, and then copy the last element in the data to the position of the deleted element, thereby reducing the data length; the method for adding data is to add elements at the end of the data, thereby increasing the data length.

[0061] Usually, when updating and synchronizing data, operations such as adding, deleting, and modifying data are required. Since the data is a continuous data group, all data is arranged in a certain order. The operation of deleting data means that if an element in the middle of the data group needs to be deleted, the last element is copied to the position of the element to be deleted in the middle, and the length is reduced by one. The result of the final element deletion operation is the length reduced by one, and the data group does not need to be copied. The operation of adding data is to directly add the elements to be added after the sequential queue of the data group, and the length is added accordingly.

[0062] Usually, the deletion and addition operations for logical frame data and rendering frame data are implemented in the same way; the only difference is in the processing time; for logical frames, the addition operation is processed before starting data synchronization, and the deletion operation is processed after data synchronization; for rendering frames, the deletion operation of local data is processed before data synchronization, and the data addition operation is processed after data synchronization is completed, so as to ensure that the index of the rendering frame and the logical frame elements are consistent; for example, if the data in the logical frame is at the fourth position, it is still at the fourth position in the rendering frame after data synchronization is completed. Since the element index is consistent, all changes to the data are to replace the elements of the corresponding index.

[0063] In some embodiments, the initialization phase includes a data synchronization process of a logical frame and a rendering frame, specifically including:

[0064] The rendering frame triggers the logic frame synchronization logic, and the logic frame updates the current 0th frame data to the target data;

[0065] The logic frame updates the current data, including deletion and addition operations. For example, if the game unit state is in the destroy state, a deletion operation is required.

[0066] The logical frame starts the calculation of the first frame;

[0067] The rendering frame deletes the current data; the rendering frame 1 needs to wait;

[0068] After the first frame of the logic frame is completed, the current data of the logic frame is the first frame data, and the target data at this time is the 0th frame data.

[0069] In some embodiments of the method for processing continuously stored data, when the first rendering frame and the second logical frame are started and run synchronously, the data synchronization process includes:

[0070] The current data of the rendering frame is the data of the 0th frame, and the target data is the data of the 0th frame. When the rendering frame starts to synchronize, the rendering frame retains the data of the 0th frame and synchronizes the target data to the current data of the rendering frame;

[0071] The logic frame synchronizes the first frame data to the target data, and the target data is updated to the first frame data;

[0072] The rendering frame calls the data synchronization logic, and the logic frame updates the first frame data to the target data. The updated target data is the first frame data.

[0073] The logical frame updates the current data;

[0074] Start running the second logical frame;

[0075] Render frame and delete frame 0 data;

[0076] The rendering frame performs a difference calculation based on the current data and the target data, and renders according to the difference calculation result.

[0077] The method for processing continuously stored data disclosed in some embodiments further includes a step of dynamically adjusting the frame rate of the logical frame, specifically including:

[0078] After each logical frame is run, the relationship between the calculation time of the current logical frame and the data time of the logical frame is calculated. If the current calculation time of the logical frame exceeds the data time of the logical frame, the frame rate of the logical frame is adjusted so that the calculation time of the next logical frame does not exceed the data time of the logical frame. Usually, the calculation time of the current logical frame refers to the actual time when the current logical frame data is calculated according to the set logical frame frame rate, and the logical frame data time is the time required for the current logical frame data to be completely calculated; usually, the logical frame processing thread is a child thread, and the calculation is performed according to the determined logical frame frame rate. Due to the complexity of the logical frame data, under normal circumstances, when the calculation is performed according to the set logical frame frame rate, the logical frame data cannot be processed normally, and there is an error with the actually required logical frame data time, which will cause the logical frame calculation to fail to complete, the logical frame and the rendering frame do not match, the rendering frame cannot be rendered normally, the data processing process appears stuck, and the screen display is not smooth; for this reason, the logical frame frame rate is dynamically adjusted to adapt to the logical frame data processing requirements in a timely manner, so that the calculation time of the logical frame and the logical frame data time are matched as much as possible to prevent stuck, non-smooth and other problems; therefore, each time the logical frame calculation is completed, it is necessary to calculate the relationship between the calculation time of the current logical frame and the logical frame data. If the current calculation time of the logical frame exceeds the data time of the logical frame, the frame rate of the logical frame is adjusted so that the calculation time of the next logical frame operation does not exceed the data time of the logical frame.

[0079] In some embodiments, the dynamic adjustment method of the logical frame frame rate is that after each logical frame is completed, the relationship between the calculation time of the current logical frame and the logical frame data time is calculated. If the calculation time of the current logical frame exceeds 90% of the logical frame data time, the frame rate of the logical frame is reduced when the next logical frame is run; if the calculation time of the current logical frame exceeds the logical frame data time by no more than 40%, the frame rate of the logical frame is increased when the next logical frame is run.

[0080] Some embodiments disclose a method for processing continuously stored data, in which the frame rate of a logical frame is set to five levels from high to low, namely 30, 15, 10, 5, and 1 frames / second, and the frame rate of the rendering is set to 60 frames / second; if the current calculation time of the logical frame exceeds 90% of the logical frame data time, and the frame rate of the logical frame is 15 frames / second, the frame rate of the next logical frame is reduced by one level and adjusted to 10 frames / second; if the current calculation time of the logical frame exceeds the logical frame data time by no more than 40%, and the frame rate of the logical frame is 15 frames / second, the frame rate of the next logical frame is increased by one level and adjusted to 30 frames / second.

[0081] Some embodiments disclose a computer-readable storage medium, in which a computer program is stored. When the computer program is executed, the method for processing continuously stored data disclosed in the embodiments of the present invention is implemented.

[0082] Some embodiments disclose an electronic device, including a processor and a memory; a computer program is stored in the memory, and when the processor reads and executes the computer program, the method for processing continuously stored data disclosed in the embodiments of the present invention is implemented.

[0083] The technical details are further illustrated below in conjunction with embodiments.

[0084] Example 1

[0085] The method for processing continuously stored data disclosed in Example 1 is as follows: Figure 1 As shown, including:

[0086] (1) The logical frame is configured to run in multiple sub-threads according to the logical frame rate;

[0087] (2) The rendering frame is configured to run in the main thread according to the rendering frame rate;

[0088] (3) Run the first frame of the logical frame, obtain the logical frame data, and synchronize the logical frame data with the target data;

[0089] (4) The logic frame and the rendering frame are started at the same time, the rendering frame runs the first frame, and the logic frame runs the second frame;

[0090] (5) When the rendering frame runs to completion for one frame, the relationship between the data time of the rendering frame and the data time of the logic frame is determined;

[0091] If the data time of the rendering frame is less than the data time of the logical frame, the rendering frame performs difference calculation based on the time relationship between the target data and the current data of the rendering frame, and the rendering frame is rendered using the data obtained by the interpolation calculation;

[0092] If the data time of the rendering frame is greater than or equal to the data time of the logical frame, the logical frame and the rendering frame are synchronized;

[0093] After data synchronization, the rendering frame performs a difference calculation based on the current data of the rendering frame and the target data, and uses the data obtained by the difference calculation for rendering.

[0094] (6) The logic frame and the rendering frame run continuously. After each rendering frame is completed, the relationship between the data time of the rendering frame and the data time of the logic frame is judged, and the data is selected for rendering based on the time relationship. The specific method is the same as (5).

[0095] Example 2

[0096] In Example 2, Figure 2 As shown, the logic frame runs in the multi-level sub-threads, and the logic frame rate is 15 frames per second; the rendering frame runs in the main thread, and the rendering frame rate is 60 frames per second; t represents the time axis;

[0097] At time 0, initialization is performed so that the current data of the logical frame, the rendering frame data, and the target data are synchronized to the same 0th frame data and have consistent element indexes;

[0098] Run logical frame L1, render frame X1 and wait;

[0099] The rendering frame starts to perform data synchronization operations, and the logical frame synchronizes the 0th frame data to the target data;

[0100] The logical frame performs deletion and addition operations and starts running the L1 frame;

[0101] Get the L1 frame data of the logical frame; after the L1 frame logical frame calculation is completed, the L1 frame data will not be synchronized to the target data, and data synchronization will be performed after receiving the rendering frame with data synchronization conditions and sending a data synchronization command to the logical frame;

[0102] The rendering frame starts running the X1 frame, and the logic frame starts running the L2 frame; the current data of the rendering frame is the 0th frame data, and the target data is the 0th frame data;

[0103] First, the rendering frame sends a data synchronization instruction to the logic frame to start data synchronization:

[0104] The logical frame synchronizes the L1 frame data to the target data, and the target data is updated to the L1 frame data;

[0105] The logical frame performs deletion and addition operations;

[0106] Then, the logical frame starts the L2 frame calculation, and the rendering frame starts the X1 frame calculation;

[0107] The rendering frame runs the X1 frame. When the calculation is completed, the data time of the X1 frame of the rendering frame is 1, and the data time of the logical frame is 4. The rendering frame performs difference calculation based on the relationship between the L1 frame of the logical frame and the data time 1. The rendering frame uses the data obtained by the interpolation calculation for rendering;

[0108] The rendering frame runs the X2 frame. When the calculation is completed, the data time of the X2 frame of the rendering frame is 2, and the data time of the logical frame is 4. The rendering frame performs difference calculation based on the relationship between the L1 frame of the logical frame and the data time 2. The rendering frame uses the data obtained by the interpolation calculation for rendering;

[0109] The rendering frame runs the X3 frame. When the calculation is completed, the data time of the X3 frame of the rendering frame is 3, and the data time of the logical frame is 4. The rendering frame performs difference calculation based on the relationship between the L1 frame of the logical frame and the data time 3. The rendering frame uses the data obtained by the interpolation calculation for rendering;

[0110] The rendering frame runs the X4th frame. When the calculation is completed, the data time of the X2th frame of the rendering frame is 4, the data time of the logical frame is 4, and the data time of the rendering frame is equal to the data time of the logical frame; data synchronization is performed;

[0111] After data synchronization, the rendering frame performs difference calculation based on the X4 frame data of the rendering frame and the L1 frame data of the target data, and renders using the interpolation calculation result;

[0112] After that, the logic frame runs the L3 frame, and the rendering frame runs the X5, X6, X7, and X8 frames in sequence;

[0113] After each frame of the rendering frame is completed, the relationship between the data time of the rendering frame and the data time of the logical frame is judged, and the data is selected and determined for rendering according to the time relationship; the specific method is carried out with reference to the above content of this embodiment;

[0114] The logic frame and the rendering frame are continuously run according to the above method, so that continuous data processing can be achieved.

[0115] The method for processing continuously stored data disclosed in the embodiment of the present invention configures the logical frame to run in a multi-level sub-thread, and configures the rendering frame to run in the main thread, and reasonably allocates and utilizes the computing power of the main thread and the sub-thread, which can effectively improve the processing capability of complex business logic of units of more than 10,000 scales; further, by dynamically adjusting the frame rate of the logical frame, the frame rate can be adjusted according to different logical frame data to adapt to different logical frame data to complete calculation processing; the method for processing continuously stored data can effectively improve the smoothing effect of the picture and improve the user experience.

[0116] The technical solutions disclosed in the embodiments of the present invention and the technical details disclosed in the embodiments are merely illustrative of the inventive concept of the present invention and do not constitute a limitation on the technical solutions of the embodiments of the present invention. Any conventional changes, replacements or combinations of the technical details disclosed in the embodiments of the present invention have the same inventive concept as the present invention and are within the protection scope of the claims of the present invention.

Claims

1. A method for processing continuously stored data, characterized in that: The method comprises: (1) The logical frame is configured to run in multiple sub-threads according to the logical frame rate; (2) The rendering frame is configured to run in the main thread according to the rendering frame rate; (3) Run the first frame of the logical frame, obtain the logical frame data, and synchronize the logical frame data with the target data; (4) The logic frame and the rendering frame are started at the same time, the rendering frame runs the first frame, and the logic frame runs the second frame; (5) When the rendering frame runs to completion for one frame, the relationship between the data time of the rendering frame and the data time of the logic frame is determined; If the data time of the rendering frame is less than the data time of the logical frame, the rendering frame performs difference calculation based on the target data and the current data of the rendering frame according to the time relationship, and the rendering frame is rendered using the data obtained by the interpolation calculation; If the data time of the rendering frame is greater than or equal to the data time of the logical frame, the logical frame and the rendering frame are synchronized; After data synchronization, the rendering frame performs a difference calculation based on the current data of the rendering frame and the target data, and uses the data obtained by the difference calculation for rendering.

2. The method for processing continuously stored data according to claim 1, characterized in that: In the process of continuous operation of the logic frame and the rendering frame, the content of (5) is repeated each time the rendering frame completes one frame.

3. The method for processing continuously stored data according to claim 1, characterized in that: Initialization is performed before running the first frame of the logical frame, so that the current data of the logical frame, the rendering frame data, and the target data are synchronized to the same logical frame 0 frame data, and the data have a consistent element index.

4. The method for processing continuously stored data according to claim 1, characterized in that: The step of dynamically adjusting the frame rate of the logical frame is also included, specifically including: After each logical frame is run, the relationship between the calculation time of the current logical frame and the data time of the logical frame is calculated. If the current calculation time of the logical frame exceeds the data time of the logical frame, the frame rate of the logical frame is adjusted so that the calculation time of the next logical frame does not exceed the data time of the logical frame.

5. The method for processing continuously stored data according to claim 4, characterized in that: If the current calculation time of the logical frame exceeds 90% of the logical frame data time, the frame rate of the logical frame will be reduced when the next logical frame runs; if the current calculation time of the logical frame exceeds the logical frame data time by no more than 40%, the frame rate of the logical frame will be increased when the next logical frame runs.

6. The method for processing continuously stored data according to claim 5, characterized in that: The frame rate of the logical frame can be set in five levels from high to low, namely 30, 15, 10, 5, and 1 frames / second, and the frame rate of the rendering is set to 60 frames / second; if the current calculation time of the logical frame exceeds 90% of the logical frame data time, the frame rate of the next logical frame will be reduced by one level; if the current calculation time of the logical frame exceeds the logical frame data time by no more than 40%, the frame rate of the next logical frame will be increased by one level.

7. The method for processing continuously stored data according to claim 1, characterized in that: The data synchronization process between the logical frame and the rendering frame includes: The rendering frame updates the current target data to the current data of the rendering frame; Then the logic frame synchronization command is called, and the logic frame updates the current data to the new target data; Then run the next logical frame; specifically, the logical frame synchronizes the current data to the target data, and then the logical frame performs deletion and addition operations, and starts calculating the next logical frame; Render frame and delete current data; During the data update process, the data index is ensured to remain consistent.

8. The method for processing continuously stored data according to claim 7, characterized in that: Data updating includes deleting data first and then adding data; among them, the method of deleting data is to first delete the elements to be deleted in the data, and then copy the last element in the data to the position of the deleted element, and the data length is reduced; the method of adding data is to add elements at the end of the data, and the data length is increased.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method for processing continuously stored data according to any one of claims 1 to 8 is implemented.

10. An electronic device, characterized in that The invention comprises a processor and a memory, wherein a computer program is stored in the memory, and when the processor reads and executes the computer program, the method for processing continuously stored data according to any one of claims 1 to 8 is implemented.