Data updating method and equipment
By determining the update method based on the number of references counts of the target segment by the editing engine in video editing, the editing engine is stopped and system lag caused by the increase in material, and the editing efficiency is improved.
Patent Information
- Application Number
- CN202311121253.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-31
AI Technical Summary
In the prior art, the editing engine stops running due to the increase in material in video editing, resulting in system lag and low editing efficiency.
By responding to the user's data update operation, the target clip is determined in the video edited clip, and based on the number of references to the target clip by the editing engine, it is decided to use a deep copy or lock mechanism to update the data to avoid read and write conflicts.
It realizes updating data without stopping the editing engine, avoiding system lag and improving editing efficiency.
Smart Images

Figure CN119544891A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data updating method and device. Background Art
[0002] When editing a video, the editing engine often generates a preview image by calling the material in the corresponding clip according to the information of the required clips (English: clip) at different time points recorded in the timeline during the editing process. In the above process, in order to meet some needs, users often introduce new materials to enrich the video editing effect.
[0003] In the prior art, when new material is introduced, the editing engine is often stopped. After the material is added to the corresponding clip, the entire timeline is updated. During the update process, the editing engine converts the format of the material in each clip according to the definition of the data model to ensure that the changes made during the video editing process can be correctly applied.
[0004] However, the conventional method requires the editing engine to stop the editing operation, which causes the system to freeze and the editing efficiency is too low. Summary of the invention
[0005] The present invention provides a data updating method and device to solve the problem in the prior art that the increase of materials causes a freeze in editing and affects the editing efficiency.
[0006] In a first aspect, an embodiment of the present disclosure provides a data updating method, including:
[0007] In response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation is determined in at least one segment, wherein the segment includes data to be edited that is required to be referenced by an editing engine corresponding to the video editing;
[0008] According to the count of the number of times the target segment is referenced by the editing engine, determining whether to perform an update operation on the data in the target segment in a manner of locking the target segment or copying and then replacing the target segment;
[0009] The timeline corresponding to the video editing is updated, and the timeline records information of the clips that the editing engine needs to reference at different time points.
[0010] In a second aspect, an embodiment of the present disclosure provides a data updating device, the device comprising:
[0011] A first determination module is used to determine, in response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation in at least one segment, where the segment is used to store the data to be edited that is required to be referenced by an editing engine corresponding to the video editing;
[0012] A second determination module, configured to determine whether to perform an update operation on the data in the target segment by locking the target segment or by copying and replacing the target segment according to the count of the number of times the target segment is referenced by the editing engine;
[0013] The updating module is used to update the timeline corresponding to the video editing, and the timeline records the information of the clips that the editing engine needs to reference at different time points.
[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
[0015] The memory stores computer-executable instructions; the transceiver is used to send and receive data;
[0016] The processor executes the computer-executable instructions stored in the memory to implement the data updating method as described in the first aspect above.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the data updating method described in the first aspect above.
[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the data updating method as described in the first aspect above.
[0019] The data updating method and device provided by the disclosed embodiment, in response to the user's update operation on the data in the video editing, determines in at least one segment the target segment corresponding to the update operation, the segment includes the to-be-edited data that the editing engine corresponding to the video editing needs to reference, and determines to perform the update operation on the data in the target segment by locking the target segment or by copying and replacing it according to the count of the number of times the target segment is referenced by the editing engine, and then updates the timeline corresponding to the video editing, which records the information of the segments that the editing engine needs to reference at different time points. In this technical solution, the number of times the segment involved in the data update is referenced by the editing engine is counted to determine whether the update of the segment needs to be updated by copying and replacing it, or by directly locking it, so as to avoid the read-write conflict caused by the editing engine calling the segment, thereby ensuring the smooth operation of the editing engine and improving the editing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] Figure 1 A flow chart of a data updating method provided by the prior art;
[0022] Figure 2 A schematic diagram of the data updating method architecture provided by the present disclosure;
[0023] Figure 3 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 1 ;
[0024] Figure 4 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 2 ;
[0025] Figure 5 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 3 ;
[0026] Figure 6 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 4 ;
[0027] Figure 7 A schematic diagram of the structure of a data updating device provided in an embodiment of the present disclosure;
[0028] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0029] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0031] Before introducing the embodiments of the present disclosure, the professional terms and application background involved in the embodiments of the present disclosure are first explained:
[0032] Editing materials on the timeline: refers to the process of editing, modifying and processing materials in video editing software. Non-linear editing refers to the editing method that allows you to select and combine material clips at will according to personal needs, without having to edit in a linear order;
[0033] Data model layer: It is the data structure used in editing software to manage and store materials and editing information;
[0034] Sequence: refers to a separate editing sequence created in the editing software, which contains multiple video tracks and audio tracks and is used to organize and manage the order of materials;
[0035] Clip: A data model layer object that represents a clip of a material, which contains the material's content, duration, attributes, and other information. It is the basic unit on the timeline and can be placed on different tracks;
[0036] Track: A data model layer object that represents a track, used to manage and organize the order of clips. On the timeline, you can create multiple tracks and place different clips on different tracks to achieve the desired editing effect;
[0037] The relationship between the model layer, the engine layer (i.e., the editing engine), and the business layer is as follows: the model layer is responsible for managing the data model in the editing software, the engine layer is responsible for implementing the core functions and algorithms of the editing software, and the business layer provides the interface and operation logic of the editing software to the outside world, which involves data updates, etc.
[0038] The business layer calls Modify Clip: This means that the business layer in the editing software calls the Modify Clip function to modify the properties of the material clip or perform other editing operations;
[0039] Deep copy and Lock mechanism: These are two different ways to handle modification conflicts. Deep copy means making a copy of the data before modifying it, and then modifying it, thus avoiding conflicts between multiple operations. Using the Lock mechanism means that when modifying the data, a lock operation is performed first, and other operations need to wait for the lock to be released before continuing, to ensure that only one operation can modify the data at the same time. Which method to use should be determined according to the specific situation to avoid data conflicts and ensure data consistency;
[0040] Timeline: It is the main interface used in editing software to organize and display clips and editing operations. It can contain multiple tracks, and each track can hold multiple clips of the material.
[0041] Clip engine ref count: refers to the number of times the clip object is referenced in the engine layer, which is used to track the use of the clip. When the clip reference count is zero, it means that the clip is not used anywhere and can be released or recycled;
[0042] In non-linear editing, editing of materials on the timeline often requires the use of data models to convert the data to be edited into the timeline. The editing engine calls the data required for editing based on the timeline. In order to meet their needs, users often introduce new data during editing to meet their own editing needs.
[0043] In the prior art, when updating data, the editing engine is often controlled to stop running. After the data is added, the data model rebuilds a new timeline based on user needs and the updated data. The editing engine calls the required data for the reconstructed timeline, continues to complete the editing operation, and obtains the editing result.
[0044] Right now, Figure 1 A flow chart of a data updating method provided by the prior art, such as Figure 1 As shown, the process of the prior art includes:
[0045] Step 11, start;
[0046] Step 12: Stop the engine layer.
[0047] Step 13: Update the data of Sequence (ie, Modify Sequence);
[0048] Step 14: Completely create a timeline (i.e., timeline);
[0049] Step 15: Start the engine layer operation;
[0050] Step 16, end.
[0051] In the prior art, the data model layer modifies / accesses the Track+clip object of the Sequence layer, and the engine layer accesses the Track+clip object of the Sequence layer.
[0052] However, there are the following problems in the prior art:
[0053] 1. Since the editing engine needs to stop editing operations, the system may freeze;
[0054] 2. After the engine stops running, it takes a long time to restart, resulting in low editing efficiency;
[0055] 3. The user experience is poor.
[0056] On the basis of the above-mentioned technical problems, the inventor's technical conception is as follows: in the existing operation of stopping the engine when updating data, the purpose is to prevent the engine layer from accessing and consuming the Sequence during operation. However, in fact, the data really needed by the engine layer are all obtained from the clip, that is, there is a conflict between the read operation on the clip and the write operation on the clip when updating the data. If, when updating the data, the clip involved in the updated data can be analyzed, and the count number of times the clip is referenced by the engine layer is determined, then the data can be updated by using a deep copy or a Lock mechanism according to the count number, thereby ensuring that the consumption of the engine layer is not affected. Then, on the basis of realizing data updating, the problems existing in the prior art can be solved. That is, the present disclosure proposes a data updating method and device.
[0057] The technical solution of the present disclosure is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0058] It is worth noting that the application fields of the data updating method and device disclosed in the present invention are not limited and may include: the field of computer technology. Among them, the execution subject of the present invention is an electronic device, which may be a mobile phone, a tablet, a computer, a server and other devices.
[0059] Before introducing the method embodiment of the present invention, the implementation architecture process involved in the method of the present invention is described. Figure 2 ( Figure 2 As shown in the data updating method architecture diagram provided by the present disclosure, the process of the present disclosure includes:
[0060] Step 21, start;
[0061] Step 22: Update the data of Sequence in a thread-safe manner (ie, ModifySequence with thread safety);
[0062] Among them, thread safety can be ensured by copying or locking;
[0063] Step 23: incrementally update the timeline (i.e., only update the clips involved in updating the data in the timeline);
[0064] Step 24, end.
[0065] In the present disclosure, the data model layer modifies / accesses the Track+Clip object of the Sequence layer, and the engine layer accesses the clip object of the Sequence layer, that is, thread safety is narrowed down to the clip.
[0066] It should be understood that: Figure 2 Only the general architecture of the present disclosure is introduced, and the contents not described in detail are explained by the embodiments involved in the following data updating method.
[0067] Figure 3 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 1 ,like Figure 3 As shown, the method may include the following steps:
[0068] Step 31: In response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation is determined in at least one segment;
[0069] The clip includes the data to be edited which is required to be referenced by the editing engine corresponding to the video editing.
[0070] In this step, during the video editing process, when the user needs to update the edited data, the electronic device responds to the user's update operation and determines the target clip involved in the update operation from multiple chips.
[0071] The data to be edited may be materials such as videos, pictures, and audios to be edited; and the updated data may include: modifying data, adding data, deleting data, and the like.
[0072] In this implementation, the objects in the data model layer that the editing engine can access are limited, and thread safety is ensured for a small number of objects. That is, the editing engine can currently access the Track+Clip objects of the Sequence layer (Filter currently supports hot updates through a lock mechanism and is not considered), but the data that the editing engine actually needs during operation is actually obtained from the clip. Some information that needs to be obtained from the Track can also be synchronized from the Track to the clip. By limiting the Sequence objects that the editing engine can access, the editing engine can only access the clip. Therefore, it only needs to determine the clip involved in the update operation (i.e., the target clip).
[0073] In a possible implementation, the user needs to add background music during the editing process, and at this time, the clip involved in the background music is determined as the target clip.
[0074] Optionally, step 31 may be implemented as follows:
[0075] Step 1: In response to the update operation, listen to the corresponding event of the update operation to obtain the fragments involved in the corresponding event;
[0076] Step 2: In at least one segment, a segment involved in the corresponding event is determined as a target segment.
[0077] After receiving the relevant instruction of the user for the data update operation, the electronic device monitors the corresponding event in response to the instruction, determines the involved clip from the corresponding event, and uses the clip as the target clip involved in the update operation.
[0078] That is, the clip involved in the data corresponding to the update operation is determined.
[0079] Step 32: According to the count of the number of times the target segment is referenced by the editing engine, determine whether to update the data in the target segment by locking the target segment or by copying and replacing the target segment.
[0080] In this scheme, the copy-after-replace or lock method involves a deep copy or lock mechanism, respectively;
[0081] In this step, the clip engine refcount is used to track the usage of the clip. When the clip count is zero, it means that the editing engine is not using the clip anywhere; when the clip count is not zero, it means that the editing engine will consume the clip.
[0082] Furthermore, based on the count of the number of times the target clip is referenced by the editing engine, it is determined whether to update the data of the target clip under a deep copy or a lock mechanism.
[0083] Among them, deep copy is to copy data before modifying it, so that each operation has its own copy to modify, avoiding modification conflicts. The lock mechanism is to lock the shared resources and block the access of other operations during the modification, ensuring that only one operation can modify the resources at the same time, avoiding concurrency conflicts. That is, for materials that are frequently modified (i.e. data), deep copy will be more efficient, and locking will trigger frequent lock mutual exclusion. For materials that are not frequently modified, locking is more efficient.
[0084] Both of the above methods can ensure data consistency and avoid conflicts. In editing, deep copy and lock mechanisms can be used to handle modification conflicts of clip and Track objects to ensure the correctness and consistency of editing operations.
[0085] Step 33: Update the timeline corresponding to the video editing.
[0086] The timeline records information about clips that the editing engine needs to reference at different time points.
[0087] In this step, the consumption of the editing engine relies on reading the information on the timeline to implement the editing event. After the above data is updated, the timeline is updated.
[0088] Optionally, step 33 may be implemented as follows:
[0089] Step 1: Mark the target fragment as dirty;
[0090] Step 2: After the data in the target segment is updated, the dirty target segment is re-rendered or a corresponding operation is performed on the timeline.
[0091] Optionally, the data corresponding to the update operation may be marked dirty to determine the update point of the data, and then the clip corresponding to the update point may be re-rendered or a corresponding operation may be performed.
[0092] The dirty processing may be achieved by setting a dirty flag on a target. For example, the target may be a target clip or data corresponding to an update operation.
[0093] In a possible implementation, after clip A is updated, clip A is re-rendered on the timeline, that is, the re-rendered clip A on the updated timeline moves compared to the previous clip A.
[0094] In this implementation, the timeline display is updated or related operations are performed according to the modified content of the target clip. The specific update method can be determined according to business needs, such as updating the properties of the target clip, adjusting the position of the target clip on the timeline, etc. It is important to keep the data of the timeline and the target clip synchronized to ensure that the editing results are correctly presented on the timeline.
[0095] Optionally, each position on the timeline represents a specific time point in the video. Different clips can be added, deleted, adjusted, and combined on the timeline. The editing engine is responsible for processing and rendering the operations on the timeline to achieve the final video editing effect.
[0096] The data updating method provided by the disclosed embodiment determines the target segment corresponding to the update operation in at least one segment in response to the user's update operation on the data in the video editing, and the segment is used to store the to-be-edited data required to be referenced by the editing engine corresponding to the video editing, and determines to perform the update operation on the data in the target segment by locking the target segment or by copying and replacing it according to the count of the number of times the target segment is referenced by the editing engine, and then updates the timeline corresponding to the video editing, which records the information of the segments that the editing engine needs to reference at different time points. In this technical solution, the number of times the segment involved in the data update is referenced by the editing engine is counted to determine whether the update of the segment needs to be updated by copying and replacing it, or by directly locking it, so as to avoid the read-write conflict caused by the editing engine calling the segment, thereby ensuring the smooth operation of the editing engine and improving the editing efficiency.
[0097] Based on the above embodiments, Figure 4 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 2 ,like Figure 4 As shown, the above step 32 may include the following steps:
[0098] Step 41: If the count of the number of times the target segment is referenced by the editing engine is greater than 0, copy the target segment to generate a copy segment corresponding to the target segment;
[0099] In this step, when it is determined that the target clip is referenced by the editing engine by a count greater than 0, it means that the editing engine will consume the target clip, that is, the target clip is frequently modified. When updating the data of the target clip, a deep copy will be more efficient.
[0100] At this time, a copy operation is performed on the target clip to obtain a copy clip corresponding to the target clip.
[0101] Optionally, the target clip still provides services for the editing engine and does not affect the operation of the editing engine.
[0102] Step 42: Update the data in the replica fragment and replace the updated replica fragment with the target fragment.
[0103] In this step, the data in the copy clip is updated according to the matters corresponding to the update operation, and after the update is completed, the updated copy clip is replaced with the target clip.
[0104] That is, the editing engine consumes the updated copy clip.
[0105] The data updating method provided by the embodiment of the present disclosure copies the target clip if the count of the number of times the target clip is referenced by the editing engine is greater than 0, generates a copy clip corresponding to the target clip, updates the data in the copy clip, and replaces the updated copy clip with the target clip. In this technical solution, when the editing engine consumes the target clip, the target clip is copied and the data is updated to avoid interfering with the normal operation of the editing engine.
[0106] Based on the above embodiments, Figure 5 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 3 ,like Figure 5 As shown, the above step 32 may include the following steps:
[0107] Among them, after step 51, steps 52 and 53 may be executed; or steps 54, 55 and 56 may be executed, depending on the actual situation.
[0108] Step 51: If the count of the number of times the target segment is referenced by the editing engine is equal to 0, the target segment is locked, and the count of the number of times the target segment is referenced by the editing engine is determined again;
[0109] In this step, when it is determined that the target clip is referenced by the editing engine and the count is equal to 0, it means that the editing engine will not consume the target clip, that is, there is no change to the target clip. When updating the data of the target clip, a lock mechanism can be used.
[0110] Before modifying the data in the target clip, a lock operation is performed first, and other operations need to wait for unlocking (i.e., the release of the lock) before continuing, to ensure that only one operation can modify the data at the same time.
[0111] Furthermore, it is necessary to determine again the count of the number of times the target clip is referenced by the editing engine.
[0112] In this implementation, a double check is used to more accurately determine whether the target clip is being consumed, so as to avoid affecting the normal operation of the editing engine. Specifically:
[0113] First judgment: In order to improve the code execution efficiency, since the singleton mode only needs to create an instance once, after creating an instance, it is unnecessary to enter the synchronization code block when calling the getInstance method again, and there is no need to compete for the lock. Just return the previously created instance directly.
[0114] Second judgment: This check is to prevent the secondary creation of instances. If there is a situation, for example, when singleton has not been created, thread t1 calls the getInstance method. Since the first judgment singleton == null, thread t1 is ready to continue execution, but because the resources are preempted by thread t2, t2 calls the getInstance method at this time.
[0115] Step 52: If it is determined again that the count of the number of times the target segment is referenced by the editing engine is equal to 0, the data in the target segment is updated.
[0116] In this step, after two determinations, if the count of the number of times the target clip is referenced by the editing engine is still equal to 0, it means that the editing engine will not consume the target clip and perform an update operation on the target clip.
[0117] Step 53: unlock the updated target fragment;
[0118] In this step, after the target clip is updated, the updated target clip needs to be unlocked to prevent the editing engine and the like from performing corresponding read and write operations on the updated target clip in subsequent editing operations.
[0119] Step 54: If it is determined again that the count of the number of times the target segment is referenced by the editing engine is greater than 0, the target segment is unlocked;
[0120] After step 51, if it is determined again that the target clip is referenced by the editing engine and the count is greater than 0, the target clip needs to be updated according to the above steps 41-43 (ie, steps 55-56), which will not be repeated here, and please refer to the above embodiment.
[0121] Step 55: copy the target segment to generate a copy segment corresponding to the target segment;
[0122] Step 56: Update the data in the replica fragment and replace the updated replica fragment with the target fragment.
[0123] The data updating method provided by the embodiment of the present disclosure is as follows: if the target clip is referenced by the editing engine, the target clip is locked, and the target clip is referenced by the editing engine again. If the target clip is referenced by the editing engine again, the target clip is updated. If the target clip is referenced by the editing engine again, the target clip is unlocked. In addition, if the target clip is referenced by the editing engine again, the target clip is unlocked. The target clip is copied to generate a copy clip corresponding to the target clip. The data in the copy clip is updated and the updated copy clip is replaced with the target clip. In this technical solution, when the editing engine does not consume the target clip, the target clip is referenced by the editing engine again to determine whether the deep copy or lock mechanism is used for the update operation. The double check method can more accurately determine whether the target clip is being consumed. When it is determined that the target clip is not consumed, the lock mechanism is used to prevent the access of other operations from being blocked during the modification period, so as to ensure that only one operation can modify the resource at the same time, avoid concurrent conflicts, and improve the modification efficiency and system fluency.
[0124] Based on the above embodiments, Figure 6 A schematic diagram of the data updating method provided in the embodiment of the present disclosure Figure 4 ,like Figure 6 As shown, the above step 32 is described again, and the step may include:
[0125] Step 1. Start;
[0126] Step 2: Start updating the clip (i.e. the target clip)
[0127] Step 3: Determine whether the count is greater than 0; if so, go to step 4; if not, go to step 7;
[0128] Step 4: Copy the clip to get a copy of the clip;
[0129] Step 5: Modify the copy clip;
[0130] Step 6: End;
[0131] Step 7. Lock the clip;
[0132] Step 8: Determine whether the count is greater than 0; if so, go to step 9; if not, go to step 10;
[0133] Step 9. Unlock the clip and execute step 4;
[0134] Step 10: Modify the clip;
[0135] Step 11. Unlock the clip and execute step 6.
[0136] The data updating method provided in the embodiment of the present disclosure has similar implementation principles and technical effects to those of the above-mentioned embodiment, and will not be described in detail here.
[0137] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0138] Figure 7 This is a schematic diagram of the structure of the data updating device provided in the embodiment of the present disclosure. Figure 7 As shown, the device includes:
[0139] A first determining module 71 is used to determine, in response to a user's update operation on data in video editing, a target segment corresponding to the update operation in at least one segment, wherein the segment includes the to-be-edited data required to be referenced by an editing engine corresponding to the video editing;
[0140] A second determination module 72, configured to determine whether to perform an update operation on the data in the target segment by locking the target segment or by copying and replacing the target segment according to the count of the number of times the target segment is referenced by the editing engine;
[0141] The updating module 73 is used to update the timeline corresponding to the video editing, and the timeline records the information of the clips that the editing engine needs to reference at different time points.
[0142] According to one or more embodiments of the present disclosure, the second determining module 72 is specifically configured to:
[0143] If the count of the number of times the target segment is referenced by the editing engine is greater than 0, the target segment is copied to generate a copy segment corresponding to the target segment;
[0144] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0145] According to one or more embodiments of the present disclosure, the second determining module 72 is specifically configured to:
[0146] If the count of the number of times the target segment is referenced by the editing engine is equal to 0, the target segment is locked, and the count of the number of times the target segment is referenced by the editing engine is determined again;
[0147] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is equal to 0, updating the data in the target segment;
[0148] Unlock the updated target fragment.
[0149] According to one or more embodiments of the present disclosure, after locking the target clip and determining again the count of the number of times the target clip is referenced by the engine layer, the second determination module 72 is further configured to:
[0150] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is greater than 0, unlocking the target segment;
[0151] Copying the target segment to generate a copy segment corresponding to the target segment;
[0152] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0153] According to one or more embodiments of the present disclosure, the update module 73 is specifically configured to:
[0154] Performing dirty marking on the target fragment;
[0155] After the data in the target segment is updated, the dirty target segment is re-rendered or a corresponding operation is performed on the timeline.
[0156] According to one or more embodiments of the present disclosure, the first determining module 71 is specifically configured to:
[0157] In response to the update operation, monitoring a corresponding event of the update operation to obtain a fragment involved in the corresponding event;
[0158] A segment involved in the corresponding event is determined as the target segment in the at least one segment.
[0159] The data updating device provided in the embodiments of the present disclosure may be used to execute the data updating method in any of the above embodiments, and its implementation principle and technical effects are similar and will not be described in detail here.
[0160] It should be noted that it should be understood that the division of the various modules of the above devices is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together or implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0161] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as Figure 8 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure, and the electronic device may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
[0162] Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0163] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 81, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 82 or a program loaded from a storage device 88 to a random access memory (RAM) 83. Various programs and data required for the operation of the electronic device are also stored in the RAM 83. The processing device 81, the ROM 82, and the RAM 83 are connected to each other via a bus 84. An input / output (I / O) interface 85 is also connected to the bus 84.
[0164] Typically, the following devices may be connected to the I / O interface 85: input devices 86 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 87 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 88 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 89. The communication device 89 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0165] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 810, or installed from the storage device 88, or installed from the ROM 82. When the computer program is executed by the processing device 81, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0166] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0167] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0168] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0169] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0170] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0171] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0172] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0173] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0174] The electronic device provided in the embodiments of the present disclosure may be used to execute the data updating method provided in any of the above method embodiments, and its implementation principle and technical effects are similar and will not be described in detail here.
[0175] An embodiment of the present disclosure provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the above-mentioned data updating method.
[0176] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0177] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0178] An embodiment of the present disclosure also provides a computer program product, which includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, the above-mentioned data update method can be implemented.
[0179] also:
[0180] In a first aspect, a data updating method is provided, comprising:
[0181] In response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation is determined in at least one segment, wherein the segment includes data to be edited that is required to be referenced by an editing engine corresponding to the video editing;
[0182] According to the count of the number of times the target segment is referenced by the editing engine, determining whether to update the data in the target segment by locking the target segment or by copying and replacing the target segment;
[0183] The timeline corresponding to the video editing is updated, and the timeline records information of the clips that the editing engine needs to reference at different time points.
[0184] According to one or more embodiments of the present disclosure, determining to update data in the target segment by copying and then replacing the target segment according to the count of the number of times the target segment is referenced by the editing engine includes:
[0185] If the count of the number of times the target segment is referenced by the editing engine is greater than 0, copy the target segment to generate a copy segment corresponding to the target segment;
[0186] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0187] According to one or more embodiments of the present disclosure, determining to update data in the target segment in a manner of locking the target segment according to a count of the number of times the target segment is referenced by the editing engine includes:
[0188] If the count of the number of times the target segment is referenced by the editing engine is equal to 0, the target segment is locked, and the count of the number of times the target segment is referenced by the editing engine is determined again;
[0189] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is equal to 0, updating the data in the target segment;
[0190] Unlock the updated target fragment.
[0191] According to one or more embodiments of the present disclosure, after locking the target segment and determining again the count of the number of times the target segment is referenced by the editing engine, the method further includes:
[0192] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is greater than 0, unlocking the target segment;
[0193] Copying the target segment to generate a copy segment corresponding to the target segment;
[0194] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0195] According to one or more embodiments of the present disclosure, updating the timeline corresponding to the video editing includes:
[0196] Performing dirty marking on the target fragment;
[0197] After the data in the target segment is updated, the dirty target segment is re-rendered or a corresponding operation is performed on the timeline.
[0198] According to one or more embodiments of the present disclosure, in response to an update operation performed by a user on data in video editing, determining a target segment corresponding to the update operation in at least one segment includes:
[0199] In response to the update operation, monitoring a corresponding event of the update operation to obtain a fragment involved in the corresponding event;
[0200] A segment involved in the corresponding event is determined as the target segment in the at least one segment.
[0201] In a second aspect, an embodiment of the present disclosure provides a data updating device, the device comprising:
[0202] A first determining module, configured to determine, in response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation in at least one segment, wherein the segment includes data to be edited that is required to be referenced by an editing engine corresponding to the video editing;
[0203] A second determination module, configured to determine whether to perform an update operation on the data in the target segment by locking the target segment or by copying and replacing the target segment according to the count of the number of times the target segment is referenced by the editing engine;
[0204] The updating module is used to update the timeline corresponding to the video editing, and the timeline records the information of the clips that the editing engine needs to reference at different time points.
[0205] According to one or more embodiments of the present disclosure, the second determining module is specifically configured to:
[0206] If the count of the number of times the target segment is referenced by the editing engine is greater than 0, the target segment is copied to generate a copy segment corresponding to the target segment;
[0207] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0208] According to one or more embodiments of the present disclosure, the second determining module is specifically configured to:
[0209] If the count of the number of times the target segment is referenced by the editing engine is equal to 0, the target segment is locked, and the count of the number of times the target segment is referenced by the editing engine is determined again;
[0210] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is equal to 0, updating the data in the target segment;
[0211] Unlock the updated target fragment.
[0212] According to one or more embodiments of the present disclosure, after locking the target clip and determining again the count of the number of times the target clip is referenced by the engine layer, the second determination module is further configured to:
[0213] If it is determined again that the count of the number of times the target segment is referenced by the editing engine is greater than 0, unlocking the target segment;
[0214] Copying the target segment to generate a copy segment corresponding to the target segment;
[0215] The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
[0216] According to one or more embodiments of the present disclosure, the update module is specifically configured to:
[0217] Performing dirty marking on the target fragment;
[0218] After the data in the target segment is updated, the dirty target segment is re-rendered or a corresponding operation is performed on the timeline.
[0219] According to one or more embodiments of the present disclosure, the first determining module is specifically configured to:
[0220] In response to the update operation, monitoring a corresponding event of the update operation to obtain a fragment involved in the corresponding event;
[0221] A segment involved in the corresponding event is determined as the target segment in the at least one segment.
[0222] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0223] The memory stores computer-executable instructions;
[0224] The processor executes the computer-executable instructions stored in the memory to implement the data updating method as described in the first aspect above.
[0225] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the data updating method described in the first aspect above.
[0226] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the data updating method as described in the first aspect above.
[0227] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0228] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0229] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A data updating method, characterized in that: include: In response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation is determined in at least one segment, wherein the segment includes data to be edited that is required to be referenced by an editing engine corresponding to the video editing; According to the count of the number of times the target segment is referenced by the editing engine, determining whether to update the data in the target segment by locking the target segment or by copying and replacing the target segment; The timeline corresponding to the video editing is updated, and the timeline records information of the clips that the editing engine needs to reference at different time points.
2. The method according to claim 1, characterized in that According to the count of the number of times the target segment is referenced by the editing engine, determining to update the data in the target segment in a manner of copying and then replacing the target segment includes: If the count of the number of times the target segment is referenced by the editing engine is greater than 0, copy the target segment to generate a copy segment corresponding to the target segment; The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
3. The method according to claim 1, characterized in that According to the count of the number of times the target segment is referenced by the editing engine, determining to update the data in the target segment in a manner of locking the target segment includes: If the count of the number of times the target segment is referenced by the editing engine is equal to 0, the target segment is locked, and the count of the number of times the target segment is referenced by the editing engine is determined again; If it is determined again that the count of the number of times the target segment is referenced by the editing engine is equal to 0, updating the data in the target segment; Unlock the updated target fragment.
4. The method according to claim 3, characterized in that After locking the target segment and determining again the count of the number of times the target segment is referenced by the editing engine, the method further includes: If it is determined again that the count of the number of times the target segment is referenced by the editing engine is greater than 0, unlocking the target segment; Copying the target segment to generate a copy segment corresponding to the target segment; The data in the replica fragment is updated, and the updated replica fragment is replaced with the target fragment.
5. The method according to any one of claims 1 to 4, characterized in that: The updating of the timeline corresponding to the video editing includes: Performing dirty marking on the target fragment; After the data in the target segment is updated, the dirty target segment is re-rendered or a corresponding operation is performed on the timeline.
6. The method according to any one of claims 1 to 4, characterized in that: In response to the user performing an update operation on data in video editing, determining a target segment corresponding to the update operation in at least one segment includes: In response to the update operation, monitoring a corresponding event of the update operation to obtain a fragment involved in the corresponding event; A segment involved in the corresponding event is determined as the target segment in the at least one segment.
7. A data updating device, characterized in that: include: A first determining module, configured to determine, in response to an update operation performed by a user on data in video editing, a target segment corresponding to the update operation in at least one segment, wherein the segment includes data to be edited that is required to be referenced by an editing engine corresponding to the video editing; A second determination module, configured to determine whether to perform an update operation on the data in the target segment by locking the target segment or by copying and replacing the target segment according to the count of the number of times the target segment is referenced by the editing engine; The updating module is used to update the timeline corresponding to the video editing, and the timeline records the information of the clips that the editing engine needs to reference at different time points.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
User portrait and live video file editing method based on viewing behavior
CN113115055A
Video processing method and device, equipment and medium
CN116567351A
Instant video editing and associated methods and systems
US11289127B1
