Version control method and device, electronic equipment, storage medium and program product

By automatically identifying and processing target files in events before and after the generation operation, the problem of low efficiency and accuracy of resource file version control is solved, and an efficient version control process is achieved.

CN123178361APending Publication Date: 2026-11-27GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611407865.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, the efficiency and accuracy of resource file version control are low. Detection and rollback operations are time-consuming and prone to omissions or incorrect additions.

Method used

By responding to the pre-generation events of the generation operation, the target file is determined based on the generation context information and a checkout operation is performed. The post-generation events perform a rollback operation on files with consistent content, and after the rollback operation is completed, the newly added file is registered to the version control system.

Benefits of technology

It enables automatic linkage of version control operations, reduces manual operation, improves processing efficiency and accuracy, and avoids file omissions or incorrect registrations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178361A_ABST
    Figure CN123178361A_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers, and provides a version control method, device, electronic equipment, storage medium and program product. The version control method comprises the following steps: when a pre-generation event is triggered before a resource generation tool executes a generation operation for generating a resource file, determining target files involved according to generation context information of the generation operation; checking out the target files in a version control system, so that the target files are in a checked-out state; when a post-generation event is triggered after the resource generation tool completes the generation operation, rolling back a first file to cancel the checked-out state of the first file, the first file being a file in the target files that is in the checked-out state and has consistent content before and after the execution of the generation operation; and after the rolling back is completed, registering a second file in the version control system, the second file being a file in the target files that has not been registered in the version control system. The present disclosure improves the processing efficiency of version control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, specifically to version control methods, devices, electronic devices, storage media, and program products. Background Technology

[0002] In collaborative development projects, resource files generated by resource generation tools are typically managed within a version control system. Files in a version control system are read-only by default; a checkout operation is required to make a file writable before writing to it. Each generation operation by a resource generation tool actually involves only a very small portion of the total number of files in the repository. However, in related technologies, developers can only perform checkout operations on all files in the resource directory before the generation operation. After the generation operation is complete, they must manually perform rollback operations on a large number of checked-out files whose content has not changed, and then manually identify newly added resource files from the generation results and add them one by one to the version control system. In this process, both checkout and rollback operations need to be performed on a massive number of files, which is time-consuming. Furthermore, some resource file names are not easily identifiable, making it easy to miss or mistakenly add files when manually identifying new ones, thus affecting the accuracy of resource file version management.

[0003] Therefore, there is an urgent need for a version control method to solve the problem of low efficiency and accuracy in version control of resource files in related technologies. Summary of the Invention

[0004] This disclosure provides a version control method, apparatus, electronic device, storage medium, and program product to solve the problem of low efficiency and accuracy in version control of resource files in related technologies.

[0005] Firstly, this disclosure provides a version control method, which includes: In response to a pre-generation event triggered by the resource generation tool before executing the generation operation, the target file involved in the generation operation is determined based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files; Perform a checkout operation on the target file in the version control system to put the target file into the checkout state; In response to the post-generation event triggered by the resource generation tool after the generation operation is completed, a rollback operation is performed on the first file to remove the checkout status of the first file. The first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed. After the rollback operation is completed, the second file will be registered with the version control system. The second file is a file in the target file that has not yet been registered with the version control system.

[0006] Secondly, this disclosure provides a version control device, which includes: The determination module is used to respond to pre-generation events triggered by the resource generation tool before executing the generation operation, and to determine the target files involved in the generation operation based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files; The checkout module is used to perform a checkout operation on the target file in the version control system so that the target file enters the checkout state; The rollback module is used to respond to the post-generation event triggered by the resource generation tool after the generation operation is completed, and to perform a rollback operation on the first file to remove the checkout status of the first file. The first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed. The registration module is used to register the second file to the version control system after the rollback operation is completed. The second file is a file in the target file that has not yet been registered with the version control system.

[0007] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the version control method of the first aspect or any corresponding embodiment described above.

[0008] Fourthly, this disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute the version control method of the first aspect or any corresponding embodiment described above.

[0009] Fifthly, this disclosure provides a computer program product, including computer instructions for causing a computer to execute the version control method described in the first aspect or any corresponding embodiment thereof.

[0010] The version control method provided in this disclosure, by responding to a pre-generation event triggered by the resource generation tool before executing a generation operation, determines the target files involved in the generation operation based on the generation context information. This allows for precise determination of the scope of operations requiring version control before the generation operation is executed, eliminating the need to check out the entire directory containing the files, thus narrowing the scope of the checkout. By performing a checkout operation on the target files to put them into a checkout state, it ensures that subsequent generation operations can successfully write the corresponding files. Furthermore, by responding to a post-generation event, a rollback operation is performed on the first file, which is in a checkout state and whose content remains consistent before and after the generation operation, automatically removing the checkout state of this part of the file, avoiding manual rollback of files whose content has not changed. After the rollback operation is completed, the second file, which has not yet been registered with the version control system, is registered to the version control system, realizing automatic registration of newly added files and avoiding omissions or misregistrations when manually identifying and registering new files. Thus, this disclosure automatically links version control operations such as checkout, rollback, and registration with the generation operation, reducing manual operations and improving the processing efficiency and accuracy of version control. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this disclosure; Figure 2 This is a schematic flowchart of a first version control method according to an embodiment of the present disclosure; Figure 3 This is a second flowchart illustrating the version control method according to an embodiment of the present disclosure; Figure 4 This is a structural block diagram of a version control device according to an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0014] It should be noted that the information (including but not limited to user input information, such as information entered into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, service pressure corresponding to operations performed on all code of the current project, and code development status of the current project), and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and code development status involved in this disclosure were all obtained with full authorization.

[0015] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise expressly specified.

[0016] Before providing a detailed description of the embodiments of this disclosure, some of the nouns and terms involved in the embodiments of this disclosure will be explained.

[0017] (1) Version control system: a system for managing the version and status of files, supporting the modification, submission and traceability of files in multi-person collaborative scenarios.

[0018] (2) Perforce (P4): A version control system that uses a checkout-edit-submit locking model. Controlled files are in read-only state by default, and write permissions must be obtained before modification.

[0019] (3) Checkout (corresponding to the command p4 edit): This is an operation that switches a file from read-only to write-only, which is equivalent to requesting modification permissions for the file from the version control system.

[0020] (4) Revert (corresponding to command p4 revert): This operation undoes the checkout status of a file, used to discard local modifications or release the lock on files that have not been modified. Specifically, p4 revert -a means only reverting to files that have been checked out but whose content has not changed (revert unchanged, i.e., reverting to files that have not been changed).

[0021] (5) Add (corresponding command p4 add): The operation of registering a new file that has not yet been included in the version control system to the version control system.

[0022] (6) Submit: The operation of officially submitting local file changes to the version control system server.

[0023] (7) Audio middleware: Software tools used to manage, edit and package audio resources. Common audio middleware includes Wwise, FMOD and others.

[0024] (8) SoundBank (audio library): The runtime audio resource package generated by the audio middleware, usually with the file extension .bnk. Among them, Init.bnk is the initialization audio library file, and SoundbanksInfo is the index file that records information about each audio library.

[0025] (9) Pre-Generation Step / Post-Generation Step: The script extension interface provided by the audio middleware is triggered before and after the SoundBank generation operation, respectively. It allows the execution of custom commands and passes context information to the commands through macro variables.

[0026] (10) Macro Variable: Context parameters passed by the audio middleware when calling the script, such as $(SoundBankList) (list of audio libraries generated this time), $(SoundBankPath) (output path), $(LanguageList) (language list), $(WwiseExePath) (Wwise executable path).

[0027] (11) .wem file (Wwise Encoded Media): A streaming audio file generated by the audio middleware, named with a unique digital identifier (UID, Unique Identifier), such as 876543210.wem.

[0028] (12) Metadata file: A file used to describe information related to the audio library. The format can be .txt (text format), .json (a lightweight structured data exchange format), or .xml (extensible markup language format), which records information about the streaming audio files associated with the audio library.

[0029] (13) MD5 fingerprint: The hash value calculated by using MD5 (Message-Digest Algorithm 5) on the file content can be used to determine whether the file content has changed.

[0030] (16) token: the smallest text unit obtained after splitting the text according to the delimiter.

[0031] (17) CSV (Comma-Separated Values): A plain text data storage format that separates fields by commas.

[0032] (18) CI / CD (Continuous Integration / Continuous Delivery): A development practice that automatically executes tasks such as building, testing, and releasing on the server side. It can be achieved through a continuous integration platform and in collaboration with a distributed version control system.

[0033] As one optional application scenario of this disclosure embodiment, such as Figure 1 As shown, the system to which this version control method is applicable may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0034] The terminal device runs a resource generation tool to generate resource files. Server 103 provides a version control system to manage and version control the files it manages. The terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, including but not limited to the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0035] It should be noted that, Figure 1This is merely an example of an application scenario and does not limit the scope of protection of this disclosure. The version control method provided in the embodiments of this disclosure can be executed by the aforementioned terminal device, a relay device, or a server; the actions described relative to the terminal device can be executed by the terminal device or by the terminal device and the server 103 in a coordinated manner.

[0036] In related technologies, resource files generated by resource generation tools are usually managed in version control systems that use a lock-modify-unlock model. However, the lack of coordination between generation and version control operations leads to problems such as a broad detection range, the need for manual rollback of unchanged files and manual registration of newly added files, resulting in cumbersome operations and low processing efficiency. This disclosure provides a version control method that accurately determines the scope of version control operations and automatically completes detection, rollback, and registration, thereby improving the processing efficiency of version control.

[0037] According to an embodiment of this disclosure, a version control method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0038] This embodiment provides a version control method that can be used in the aforementioned terminal devices, such as desktop computers and laptops, as well as in the aforementioned relay devices or servers. Figure 2 This is a flowchart of a version control method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S201: In response to a pre-generation event triggered by the resource generation tool before executing the generation operation, the target file involved in the generation operation is determined based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files.

[0039] Resource generation tools are tools that can produce resource files based on predetermined inputs or configurations. For example, they are tools used to process and package raw materials into output files that can be read or used by other programs at runtime. Resource files are the files produced by this generation operation, such as output files obtained after packaging, encoding, or compilation.

[0040] A generation operation refers to a processing step performed by a resource generation tool to produce the aforementioned resource files.

[0041] Pre-generation events refer to events triggered by the resource generation tool before it actually begins the generation operation. These events precede the actual execution of the generation operation. Accordingly, these events can serve as trigger points to perform relevant processing before the generation operation occurs.

[0042] Contextual information refers to information associated with the current generation operation that reflects the scope or object of the current generation operation, such as descriptive information like the object identifier and output location targeted by the current generation operation.

[0043] The target file refers to the file involved in this generation operation, that is, the file that this generation operation may write to or produce.

[0044] Since pre-build events are triggered before the actual build operation, the build context information can be used to predict in advance which files will be involved in the build operation, thus precisely limiting the scope of version control operations to these target files. It's important to note that determining the target files based on the build context ensures that the scope of the target files originates from the context of the build operation itself, rather than being fixed or estimated based on experience. Therefore, regardless of the actual number of files involved in the build operation, a set of target files matching the current build operation can be obtained. For example, when the build operation involves only a few files, the determined target files will correspondingly only include those few files, without including irrelevant files.

[0045] Step S202: Perform a checkout operation on the target file in the version control system to put the target file into the checkout state.

[0046] A version control system is a system that manages the versions of files. It can manage the status of controlled files, such as whether a file is allowed to be modified.

[0047] Checkout operations refer to the operations performed on a file in a version control system that change the file from an unmodifiable state to a modifiable state (i.e., obtain modification permissions).

[0048] The checkout status refers to the state in which a file is allowed to be modified after a checkout operation.

[0049] After the target files are identified in step S201, a checkout operation is performed on these target files in the version control system, putting them into a checkout state. It should be noted that since the checkout operation only applies to the target files identified in step S201 that match the current generation operation, it only affects the files actually involved in this generation operation and does not need to be performed on all files managed by the version control system. Furthermore, once the target files are in a checkout state, subsequent generation operations will have the corresponding modification permissions when writing to these files, thus ensuring that the generation operation can successfully write to the target files.

[0050] Step S203: In response to the post-generation event triggered by the resource generation tool after the generation operation is completed, a rollback operation is performed on the first file to remove the checkout status of the first file. The first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed.

[0051] Post-generation events refer to events triggered by the resource generation tool after the generation operation is completed. They occur later than the actual execution of the generation operation and can serve as triggers for related processing after the generation operation is completed.

[0052] A rollback operation is an operation performed on a file that is in a checked-out state to remove it from the checked-out state.

[0053] The first file refers to a file among the target files that simultaneously meets two conditions: first, the file is currently in a checked-out state; second, the content of the file remains consistent before and after the generation operation is performed, that is, although the file is checked out, the generation operation does not actually change its content.

[0054] After the generation operation is complete, some of the previously checked target files may not actually have had their content changed during the generation process. For these first files whose content remains consistent, a rollback operation can be performed on them in response to the post-generation event to remove their checked-out status. It's important to note that determining whether a file's content remains consistent before and after the generation operation essentially involves identifying files that were checked out but not substantially modified by the generation operation. Removing the checked-out status of these first files prevents unchanged files from continuing to occupy the checked-out status, allowing the focus to remain on files whose content has indeed changed.

[0055] Step S204: After the rollback operation is completed, register the second file to the version control system. The second file is a file in the target file that has not yet been registered to the version control system.

[0056] Registration refers to adding files that are not yet managed by the version control system to the system, making them files managed by that system.

[0057] The second file refers to a file in the target file that has not yet been registered with the version control system, that is, a newly generated file in this generation operation that was not previously managed by the version control system.

[0058] After the rollback operation in step S203 is completed, the second file is then registered with the version control system. It's important to note that scheduling the registration after the rollback operation has a clear temporal significance: after the rollback, the first file, whose content has not changed, has been de-checked. At this point, the remaining files to be processed in the target file pool mainly consist of existing files whose content has indeed changed and the second file, which has not yet been registered. Their states are relatively clear. Registering the second file based on this ensures that the newly generated file is accurately included in the version control system, avoiding omissions. Through this step, the newly generated file from this generation operation is automatically registered with the version control system.

[0059] In summary, the version control method provided in this disclosure determines the target files involved in the current generation operation based on the generation context information and checks them out when an event is triggered before generation. This ensures that the operation objects of version control are precisely limited to the files actually involved in the current generation operation, without needing to process all controlled files. By rolling back the first file with consistent content when an event is triggered after generation, the checkout status of files that have not been substantially modified is automatically removed. Furthermore, by registering the second file, which has not yet been registered, to the version control system after the rollback is completed, automatic management of newly generated files is achieved. Thus, this method automatically associates version control operations such as checkout, rollback, and registration with the events before and after the generation operation, reducing manual intervention and improving the processing efficiency and accuracy of version control.

[0060] This embodiment provides a version control method that can be used in the aforementioned terminal devices, such as desktop computers and laptops, as well as in the aforementioned relay devices or servers. Figure 3 This is a flowchart of a version control method according to an embodiment of the present disclosure, such as... Figure 3 As shown, the process includes the following steps: Step S301: In response to a pre-generation event triggered by the resource generation tool before executing the generation operation, the target file involved in the generation operation is determined based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files.

[0061] In practical applications, the generation context information can be proactively provided by the resource generation tool. As an optional implementation, the method further includes: Receive generation context information passed by the resource generation tool when triggering a pre-generation event. The generation context information includes at least one of the following: a list of resource repositories for the generation operation, an output path, and a list of languages.

[0062] The resource library list indicates the various resource libraries targeted in this generation operation. A resource library can be understood as a collection of resources formed by organizing and packaging several resources. For example, the resource library list can be a list consisting of the names of the resource libraries selected in this generation operation. The output path indicates the output location of the output file of this generation operation, such as the path of a disk directory. The language list indicates the language versions involved in this generation operation, such as a list containing multiple language items such as Chinese and English.

[0063] "Transmission" refers to the delivery of the above information by the resource generation tool when triggering pre-generation events. For example, it can be passed in via command-line parameters, or provided via configuration files, environment variables, etc. This embodiment does not limit the specific transmission method.

[0064] By receiving the generation context information transmitted by the resource generation tool when the generation event is triggered, the range information matching the current generation operation can be obtained without additional querying or manual input, providing a data foundation for accurately determining the target file in the future.

[0065] After obtaining the generation context information, there are several ways to determine the target file based on it. As one optional implementation, determining the target file involved in the generation operation based on the generation context information includes: Step S3011: Determine the global file, which is a file that is updated every time a generation operation is performed.

[0066] Global files are files that are updated every time a build operation is performed, regardless of which repositories the current build operation targets. Examples include initialization files and global index files. Since these files are written to every build, they are always included in the scope of the target files.

[0067] Step S3012: Based on the resource library list, determine the resource library file and metadata file corresponding to each resource library. The metadata file records the file information of the streaming resource files associated with the corresponding resource library.

[0068] A repository file refers to the output file corresponding to the repository ontology; a metadata file refers to a file used to describe information related to the repository, which records file information of the streaming resource files associated with the corresponding repository. The file information may include, for example, the file name or file path of the streaming resource file.

[0069] Step S3013: Determine the streaming resource files associated with each resource library based on the file information recorded in the metadata file.

[0070] Streaming resource files refer to resource files that are loaded or played in a streaming manner. These files are usually not packaged into the resource library body, but exist as independent files and are associated with the resource library through metadata files.

[0071] Step S3014: The global file, the library file, the metadata file, and the streaming resource file are identified as the target files.

[0072] Determining global files can be achieved by pre-configuring a list of global file names; determining resource library files and metadata files based on a resource library list can be achieved by traversing each resource library name in the list and locating it in the output position according to the name; determining streaming resource files based on file information can be achieved by parsing the contents of the metadata file and extracting the file information recorded therein.

[0073] As can be seen, this implementation method unfolds the analysis layer by layer according to the hierarchy of global files, resource library files and metadata files, and streaming resource files: the first layer covers the files that are updated with each generation, the second layer covers the ontology files and metadata files of each resource library targeted in this generation, and the third layer further covers the streaming resource files associated with each resource library by parsing the metadata.

[0074] Considering that metadata files may use different formats, as an optional implementation, the streaming resource files associated with each repository are determined based on the file information recorded in the metadata files, including: When the metadata file is in text format, it is split into a sequence of terms according to a preset delimiter. Keywords representing streaming resources are located in the term sequence. From the terms following the keywords, file information is extracted from each streaming resource record with the number of terms occupied by a single streaming resource record as the step size. When the metadata file is in structured data format, the media entries in the metadata file are traversed, and file information is extracted from the media entries with a streaming identifier of true. Based on the extracted file information, the streaming resource files associated with each resource library are determined.

[0075] Here, text format refers to the format of organizing content in plain text; preset delimiters refer to pre-agreed characters used to divide text content, such as tabs and newlines; term sequence refers to a sequence of terms obtained by splitting the content of the metadata file according to preset delimiters; keywords representing streaming resources refer to fields in the metadata file used to identify segments of streaming resource records. Locating these keywords determines the starting area of ​​the streaming resource record in the term sequence; the number of terms occupied by a single streaming resource record refers to the fixed number of terms occupied by each streaming resource record in the term sequence. For example, if a streaming resource record contains multiple fields such as filename, resource identifier, format, and file size, and each field corresponds to one term, the number of terms occupied by the record is its number of fields.

[0076] Splitting refers to dividing text content into terms according to preset delimiters; locating refers to finding the position of keywords in the term sequence; step-by-step extraction refers to extracting file information from the beginning of a streaming resource record at fixed intervals of a fixed number of terms, thereby obtaining the file information in each streaming resource record one by one. For example, if there are several header terms after a keyword is located, the file information of the first streaming resource record is located at the corresponding position after the header terms. Thereafter, the number of terms occupied by each single record is the file information of the next record, and the extraction is repeated until the end of the record.

[0077] Structured data format refers to a format that organizes content in a structured way. In this format, content exists in the form of hierarchical entries. Media entries are entries in metadata files used to describe media resources. Streaming identifiers are fields in media entries that indicate whether the resource described by the entry is a streaming resource; a true streaming identifier indicates that the corresponding resource is a streaming resource. Under this format, file information can be extracted by traversing each media entry and filtering out entries with true streaming identifiers.

[0078] By employing appropriate parsing methods for different metadata file formats, the file information of streaming resource files can be accurately extracted regardless of whether the metadata file is in text or structured data format, thus improving the compatibility and parsing accuracy of metadata files of different formats.

[0079] In some embodiments, the files obtained from the above-described layer-by-layer analysis can be deduplicated, and the deduplicated set of files can be used as the target file to avoid the same file being processed repeatedly. This layer-by-layer analysis method covers all types of files that may be written in this generation operation, while limiting the target file to the scope relevant to this generation operation. It balances the completeness of coverage with the accuracy of the scope, reducing the possibility of file omissions or scope redundancy.

[0080] Furthermore, considering that resource files may exist in multiple languages, as an optional implementation, based on the resource repository list, the resource repository files and metadata files corresponding to each resource repository are determined, including: Based on the language list, locate the resource library files and metadata files corresponding to each resource library in the output path and the language subdirectories corresponding to each language in the language list.

[0081] The language subdirectory refers to the subdirectories under the output path divided according to language. For example, there are subdirectories under the output path corresponding to Chinese and English respectively. Resource library files and metadata files for different language versions can be stored in the corresponding language subdirectories.

[0082] Locating refers to finding and determining the location of the corresponding file in the appropriate directory according to the name of the resource library. For example, the resource library name can be concatenated with the preset file extension, and then the file can be searched in the main directory of the output path and the subdirectories of each language.

[0083] By locating the files in the main directory and each language subdirectory, the resource library files and metadata files for each language version can be included in the target file scope, avoiding the omission of files for some language versions in multilingual scenarios.

[0084] Step S302: Perform a checkout operation on the target file in the version control system to put the target file into the checkout state.

[0085] During the checkout process, individual files may fail to be checked out. If the entire process is interrupted due to the failure of a single file, processing efficiency will be affected; however, ignoring failures indiscriminately may introduce risks. Therefore, as an optional implementation method, the checkout operation for target files in the version control system includes: Perform a checkout operation on each file in the target file one by one; if the checkout of any file fails, the failed file is identified as an abnormal file, and the reason for the checkout failure is determined; if the reason for the checkout failure is that the abnormal file has not been registered with the version control system, skip the abnormal file and continue to perform the checkout operation on the remaining files, which are the files in the target file that have not yet been checked out; if the reason for the checkout failure is that the abnormal file has been checked out by another user, continue to perform the checkout operation on the remaining files; if the reason for the checkout failure is that the connection with the version control system has failed, stop the checkout operation and cause the resource generation tool to stop the generation operation.

[0086] Execution one by one means initiating checkout sequentially at the individual file level, rather than initiating in batches by directory or wildcard. In this way, the failure of checking out a single file will not block the checkout of other files; abnormal files are files that failed to be checked out; the reason for checkout failure refers to the specific reason for the failure, which can be determined based on the prompt information returned by the version control system, such as distinguishing different failure types based on the key fields in the returned information.

[0087] This implementation adopts differentiated handling strategies for different reasons for detection failure: If the abnormal file has not yet been registered with the version control system, it means that the file is a new file to be generated in this generation operation, and there is no need to detect it; it can be skipped and the file can be processed in the subsequent registration stage; if the abnormal file has been detected by other users, and the version control system supports multiple users to detect the same file at the same time, the detection of subsequent files can continue normally; if the connection with the version control system fails, it is an abnormality that affects the overall process. In this case, the detection operation is stopped, and the resource generation tool is stopped from generating. For example, the resource generation tool can be prevented from executing the current generation operation by returning an exit code that indicates an abnormality.

[0088] The reason for suspending the generation operation when a connection fails is that a connection failure means the target file has not entered the checkout state. If the generation operation continues, it will fail due to insufficient write permissions. By handling failures according to their causes, we can avoid individual file anomalies blocking the overall process and promptly mitigate losses when global anomalies occur, thus improving the robustness and reliability of the checkout process.

[0089] Furthermore, considering that the pre-generation and post-generation stages are two different processing phases, in order to still know the file state before the generation operation was executed after the generation operation is completed, as an optional implementation method, the method further includes: After the detection operation is executed and before the generation operation is executed, the content fingerprint of the existing files in the target file is calculated, and the mapping relationship between the file path of the existing files and the content fingerprint is stored as a snapshot file. The existing files are the files that existed in the target file before the generation operation was executed. In response to the post-generation event, the snapshot file is read. The snapshot file is used to determine the first file and / or the second file.

[0090] Content fingerprint refers to a feature value calculated based on the content of a file that can characterize the file content. When the file content changes, its content fingerprint changes accordingly. Therefore, it is possible to determine whether the file content has changed by comparing the content fingerprint. For example, the content fingerprint can be a hash value calculated using a message digest algorithm.

[0091] An existing file refers to a file in the target file that already exists in the storage location before the generation operation is executed. Conversely, a file in the target file that did not exist before the generation operation was executed but is newly generated by this generation operation is not considered an existing file.

[0092] A snapshot file is a file that records the above mapping relationship. Its form can be a comma-separated value file, a structured data file, etc. This embodiment does not limit this.

[0093] Calculating content fingerprints can be done by calculating the entire content of a file at once, or by reading the file content in blocks of a preset size and calculating each block separately to reduce memory usage. Storing as a snapshot file means persistently writing the correspondence between the file path of each existing file and its content fingerprint into the snapshot file, for example, recording it line by line in the form of "file path, content fingerprint".

[0094] It should be noted that the processing of events before and after response generation may be executed by two separate programs, making direct communication between them difficult. Snapshot files, existing as persistent files, can serve as a data channel between these two stages. When a post-generation event is triggered, reading the snapshot file reveals which files existed before the generation operation and their content fingerprints prior to generation. This helps determine which files maintained the same content before and after generation (i.e., the first file) and / or which files were new files that did not exist before generation (i.e., the second file). By establishing a data bridge between the pre- and post-generation stages using snapshot files, reliable data is provided for cross-stage file status assessments, improving the accuracy of subsequent rollback and registration processes.

[0095] After the checkout operation is completed, the resource generation tool performs the generation operation. Since the target file has been checked out, the generation operation can write to the target file normally, thereby producing the resource file.

[0096] Step S303: In response to the post-generation event triggered by the resource generation tool after the generation operation is completed, a rollback operation is performed on the first file to remove the checkout status of the first file. The first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed.

[0097] Regarding the granularity of the rollback operation, as an optional implementation, performing the rollback operation on the first file includes: Perform a rollback operation on the output directory of the generation operation to remove the checkout status of files in the output directory that were in a checkout state and whose contents remained consistent before and after the generation operation.

[0098] The output directory refers to the directory containing the output files of the generation operation, such as the directory indicated by the aforementioned output path. Performing a rollback operation on the output directory means initiating a rollback process on a directory-by-directory basis. The version control system then unchecks out all files in the directory that are currently checked out and whose content has not changed. For example, this can be achieved by calling a "rollback unchanged files" command provided by the version control system. Compared to checking and rolling back file by file, performing a rollback operation at the output directory level only requires initiating a single process to cover all relevant files in the output directory. This method is simpler and has lower processing overhead. Furthermore, this rollback operation only affects the checkout status of the current user's local machine and does not affect the operation status of other users on related files.

[0099] Step S304: After the rollback operation is completed, register the second file to the version control system. The second file is a file in the target file that has not yet been registered to the version control system.

[0100] As an optional implementation of the registration process, registering the second file to the version control system includes: An add request is sent to each file in the target file one by one, so that the version control system skips add requests for files that are already registered in the version control system, and in response to the add request for the second file, registers the second file to the version control system.

[0101] An add request is a request to the version control system to register a file as a controlled file, such as calling the add command provided by the version control system. Initiating add requests one by one means initiating add requests sequentially at the file-by-file level, without pre-identifying which files are already registered and which are not: for files already registered with the version control system, the system will reject the corresponding add request and skip it, for example, returning a message indicating that the file already exists; while for a second file that has not yet been registered, the version control system will respond to the corresponding add request and register it as a controlled file.

[0102] This implementation method leverages the version control system's own ability to judge add requests to distinguish between registered and unregistered files. It eliminates the need to maintain and compare a list of registered files locally, making the implementation simple and preventing the omission of new files. Especially when the filenames of new files are not readable and it is difficult to manually determine whether they are new files, this automatic registration method effectively reduces the possibility of omissions or incorrect registrations.

[0103] Based on the above embodiments, the version control method provided in this embodiment can be applied to audio resource generation scenarios. As an optional implementation, the resource generation tool is audio middleware, and the resource files include at least one of an audio library file, a metadata file corresponding to the audio library file, and a streaming audio file.

[0104] Among them, audio middleware refers to the tools used to manage and package audio resources; audio library files refer to the audio resource package files generated by audio middleware for runtime use; the metadata files corresponding to audio library files refer to the files used to describe the relevant information of audio library files; and streaming audio files refer to audio files that are loaded or played in a streaming manner.

[0105] In this scenario, the files involved in each audio library file generated by the audio middleware usually only account for a small portion of the total number of files managed by the version control system. Furthermore, the filenames of streaming audio files are often named using numerical identifiers, making it difficult to manually identify whether they are new files. Therefore, applying the aforementioned version control method to this scenario can fully leverage its ability to accurately determine the scope of operations, automatically roll back, and automatically register, thereby effectively improving the processing efficiency and accuracy of version control in audio resource generation scenarios.

[0106] In summary, the version control method of this disclosure, in response to a pre-generation event triggered by the resource generation tool before the generation operation, receives and, based on at least one of the generation context information including a resource library list, output path, and language list, determines the target files involved in the generation operation layer by layer according to the hierarchy of global files, resource library files and metadata files, and streaming resource files. Combined with language subdirectory positioning and differentiated metadata parsing methods for text and structured data formats, the method accurately and completely determines the range of target files matching the current generation operation before the generation operation is executed. Based on this, a checkout operation is performed on each target file, and the failure reasons for checkout are categorized and processed. This ensures that the checkout process is not blocked by anomalies in individual files, and that the generation operation can be stopped in time to mitigate losses in the event of global anomalies such as connection failures. Furthermore, by storing the mapping relationship between the file path and content fingerprint of existing files as a snapshot file after the checkout operation and before the generation operation, and reading this snapshot file when a post-generation event is triggered, a data bridge is established between the two independent processing stages before and after generation, providing data basis for cross-stage file status judgment.

[0107] After the generation operation is completed, a rollback operation is performed on the output directory in response to the post-generation event. This automatically removes the checkout status of the first file, whose content remained consistent before and after generation. Following the rollback, add requests are initiated for each file individually. Leveraging the version control system's skip mechanism for registered files, unregistered second files are automatically registered to the version control system. This rollback-then-registration sequence avoids ambiguity caused by files being in an intermediate state of both being checked out and actually added. Thus, the version control process, which originally relied on multiple manual steps, is transformed into an automated process that completes automatically with the generation operation. This reduces manual intervention, narrows the scope of version control operations, lowers the possibility of missed or incorrectly registered files, and improves the efficiency and accuracy of version control.

[0108] To better illustrate the version control method of this disclosure, a preferred embodiment will be provided below. This embodiment is intended to describe the implementation process of this disclosure in detail, but is not intended to limit the scope of protection of this disclosure.

[0109] In this preferred embodiment, a game audio resource generation scenario using the audio middleware Wwise in conjunction with the version control system Perforce is used as a specific example for illustration. This scenario was chosen as the preferred example because it possesses typical characteristics of the problem addressed in this embodiment: First, Perforce employs a locking model, with files being read-only by default, requiring a check-out before writing to the file during the generation operation; second, large game projects involve a vast number of audio output files, while a single generation actually involves only a small portion of these files, making the drawbacks of full-scale operations particularly prominent in this scenario; third, Wwise provides a complete Pre / Post-Generation Step script extension interface and macro variable mechanism, facilitating a clear demonstration of the complete process of this embodiment. It should be understood that this embodiment is not limited to this example; the resource generation tool can also be other audio middleware such as FMOD or other types of resource generation tools, and the version control system can also be other version control systems employing a locking model; furthermore, this embodiment can be implemented as a version control method, or correspondingly as a device, electronic device, or storage medium executing the method. The following description will focus on the method flow.

[0110] In this scenario, audio resources are managed and packaged by Wwise to generate SoundBanks. The generated artifact files are then incorporated into Perforce for collaborative management by multiple users. For example, a project containing 2100 SoundBanks, 780 .wem streaming audio files, and four language versions can have over 17300 artifact files, totaling more than 4.7GB. In related technologies, developers typically use a full directory operation: first, a full checkout of the entire audio resource directory (approximately 10 minutes), then a full rollback after generating the SoundBanks (approximately 10 minutes), and finally, manual selection and addition of new files (approximately 5 to 10 minutes). The entire process involves about 5 steps and takes about 30 minutes, during which the Perforce client may experience lag. Furthermore, .wem files are named with numerical identifiers, making it difficult for humans to determine whether a file is new based on its filename, leading to omissions or incorrect additions. Another related technology employs a CI / CD server-side solution, which uses Git to pull the full audio resources on the Jenkins platform, calls Wwise via command line to generate the full dataset, and then uploads it. However, this type of solution is geared towards release build scenarios and cannot meet the daily iteration needs of developers in the editor. Therefore, this preferred implementation method embeds the automation program into Wwise's Pre / Post-Generation Step interface to achieve automatic linkage between generation events and version control operations.

[0111] The version control method of this disclosure, in both Wwise and Perforce scenarios, includes the following overall process: The user selects the SoundBank to be generated in the Wwise editor and clicks "Generate"; Wwise triggers the Pre-Generation Step, calling the pre-built automatic checkout program P4PreCheckout.exe; the Pre-stage program parses macro variables, constructs an accurate file list, checks out each file, and saves an MD5 snapshot; Wwise performs the SoundBank generation operation; after generation, Wwise triggers the Post-Generation Step, calling P4PostAdd.exe; the Post-stage program first rolls back the unchanged files, then initiates file-by-file addition; the user confirms the changes and submits in Perforce. The following provides a detailed explanation.

[0112] For program deployment, place the compiled P4PreCheckout.exe in the directory where the Wwise executable is located, and configure the Pre-Generation Step command line in the Wwise project's User Settings: "P4PreCheckout.exe"$(SoundBankList)$(SoundBankPath)$(LanguageList)$(WwiseExePath); Here, $(SoundBankList) is the list of audio libraries generated this time, $(SoundBankPath) is the output path, $(LanguageList) is the language list, and $(WwiseExePath) is the path to the Wwise executable file. When the user selects the SoundBank to be generated (e.g., 15) in the Wwise editor and clicks "Generate," Wwise triggers the Pre-Generation Step before actually performing the generation operation. This step replaces the above macro variables with their actual values ​​and then calls the Pre-stage program.

[0113] After parsing the aforementioned macro variables, the Pre-stage program constructs a list of files involved in this generation through a three-layer analysis. The first layer consists of globally fixed files, which are updated every time a generation operation is performed. These include Init.bnk, Init metadata description files for various formats, and the SoundbanksInfo index file; these files are always included in the list. The second layer consists of the audio library ontology files. It iterates through each audio library name in $(SoundBankList), locating the .bnk file and its corresponding .txt / .json / .xml metadata description files in the main path and each language subdirectory. The third layer is streaming file dependency resolution, which parses the metadata description file of each audio library and extracts the path to its associated .wem streaming audio file. Specifically, for .txt format metadata files, the entire text is split into a token array using tabs and newlines as delimiters. The position of the keyword "Streamed Audio" is located within this array and denoted as index N. The 10 tokens following the keyword form the header field of the paragraph. Therefore, the filename field of the first streaming file record is located at index N+11 (where 11 is the token offset, not the byte offset). Since each streaming audio record occupies 7 tokens, corresponding to the filename, audio identifier, format, file size, duration, sampling rate, and channel, the filename field of subsequent records is extracted in a loop with a step size of 7. For .json format metadata files, the entries in the SoundBanks[0].Media[] array (i.e., the media entry array under the first audio library entry) are traversed, and the Path field is extracted from the entries where the Streaming identifier is true. After the three-layer analysis is completed, the list is deduplicated, and the final file set is output. In a directory of over 17,300 files, the actual scope of operation determined by the above method is usually only 10 to 60 files.

[0114] Subsequently, the Pre-stage program calls p4 edit to check out each file in the deduplicated list. The key to this approach, which uses a file-by-file method instead of wildcard batching, is that a failure to check out a single file will not block the checkout of other files, and the process can be tailored to the cause of the failure: if the returned information indicates that the file is not in the repository (not in depot), it means that the file is a new file to be generated in this generation, and it can be skipped after logging; the file will be registered by the add operation in the Post stage. If the returned information indicates that the file has already been checked out by another user (already opened by user), since Perforce supports multiple users checking out simultaneously, it can continue normally. If the connection with the Perforce server fails, it is a serious error; the program logs the error and exits with a non-zero exit code. Wwise, upon receiving a non-zero exit code, aborts the generation. This is a safety strategy because a Pre-stage failure means the file has not been unlocked, and continuing the generation operation will fail due to insufficient write permissions. Correspondingly, if the Pre-stage program fails partially due to a catchable exception (such as individual files not being in the version control), the program logs the error and continues to check out the remaining files without interrupting the overall process.

[0115] After detection, the Pre-stage program calculates the MD5 hash value for each file that actually exists in the file list, using 4KB blocks, and writes the mapping relationship between all absolute paths and MD5 values ​​to the snapshot file md5_data.csv in the program's running directory. At this point, the Pre-stage processing is complete, and Wwise begins the SoundBank generation operation. Since the relevant files have been unlocked, the generation operation will not fail due to insufficient permissions.

[0116] For program deployment, configure the Post-Generation Step command line: "P4PostAdd.exe"$(SoundBankList)$(SoundBankPath); After the generation operation is complete, Wwise triggers the Post-Generation Step and calls the Post-phase program. The Post-phase executes the following processes in sequence.

[0117] Step 1 (must be executed before the add operation): Execute `p4 revert -a`, which rolls back the operation on unchanged files in the generated output directory, automatically reverting the locks on all checked-out files whose content has not changed. In a typical scenario, the user selects 15 audio libraries to trigger generation. The Pre stage checks out approximately 40 files, while the generation operation may only substantially modify 8 of them. `p4 revert -a` automatically releases the locks on the remaining 32 files. It should be noted that this rollback operation applies to the specified output directory path and only affects the checkout status of the current user's local machine, not other users; directory-level rollback is used for simplicity and process reliability.

[0118] The second step involves reading the MD5 snapshot, specifically loading the md5_data.csv file saved in the Pre-stage to obtain the file state before the generation operation. It's important to note that the Pre-stage program (P4PreCheckout.exe) and the Post-stage program (P4PostAdd.exe) are two independently called processes by Wwise and cannot communicate directly. The MD5 snapshot file serves as the data channel between them. The Post-stage reads this snapshot to determine which files existed before generation, aiding in cross-stage file state judgment. Furthermore, MD5, as a file content fingerprint, provides a local verification method independent of the Perforce server verification, working in conjunction with the rollback operation in the first step to form a double layer of protection.

[0119] Step 3 (executed after rollback): Execute `p4 add`, which iterates through the complete list of files generated this time and initiates the addition of each file one by one. For files that already exist in the repository, Perforce will automatically report an error and skip them (returning "can't add existing file", meaning it cannot add an existing file), so only truly new files will be registered to the repository.

[0120] Regarding the above operation sequence, the rollback in the first step must strictly precede the addition in the third step. The reason is that if the order is reversed, some files might be in an intermediate state where they have been checked out but are actually newly added files, leading to ambiguity in status determination. By first clearing all unmodified checked-out files through rollback, the remaining files are either modified existing files awaiting submission or newly generated files awaiting registration, making their status clear and definite. Furthermore, if the program encounters exceptions such as connection failures to the server during the Post phase, it can log the exceptions and exit without blocking subsequent Wwise processes, as the generation operation has already been successfully completed at this point.

[0121] Once the Post phase is complete, users can see a list of files containing only the actual changes in the Pending tab of the Perforce client. After confirming, they can submit the changes.

[0122] In the aforementioned project, which included 2100 SoundBanks, 780 .wem files, 4 languages, a total of over 17300 files, and more than 4.7GB of data: using the traditional workflow, a full scan took approximately 10 minutes, a full rollback after generating the SoundBanks took approximately 10 minutes, and then manual selection and addition of new files took approximately 5 to 10 minutes, totaling approximately 30 minutes. Using this preferred implementation method, the operator selects the audio library to be generated (e.g., 15 files) in Wwise and clicks generate. The Pre-stage automatically detects 38 relevant files (approximately 2 to 10 seconds), Wwise performs the generation (usually a few seconds to tens of seconds), and the Post-stage automatically completes the rollback and addition (a few seconds), totaling approximately 1 to 2 minutes. This represents a performance improvement of approximately 15 to 30 times, and the entire process requires no manual version control.

[0123] This embodiment compresses the version control process from 5 steps and approximately 30 minutes of manual operation into a single operation that is automatically completed within 1 to 2 minutes after clicking "generate". The version control operation only applies to the dozens of files actually involved in this generation, rather than the total of more than 17,000 files. Newly added files are automatically identified and registered, and the lock on unmodified files is automatically released. Only the actual changes are shown in the list to be submitted, avoiding omissions and redundancy. Furthermore, the entire process is fully embedded in the daily workflow of the audio middleware, without the need to switch external tools.

[0124] This embodiment also provides a version control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0125] This embodiment provides a version control device, such as... Figure 4 As shown, it includes: The determination module 401 is used to respond to a pre-generation event triggered by the resource generation tool before executing the generation operation, and determine the target file involved in the generation operation based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files; The detection module 402 is used to perform a detection operation on the target file in the version control system so that the target file enters the detection state; The rollback module 403 is used to respond to the post-generation event triggered by the resource generation tool after the generation operation is completed, and to perform a rollback operation on the first file to remove the checkout status of the first file. The first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is executed. Registration module 404 is used to register the second file to the version control system after the rollback operation is completed. The second file is a file in the target file that has not yet been registered with the version control system.

[0126] In some alternative implementations, the determining module 401 is further configured to: Receive generation context information passed by the resource generation tool when triggering a pre-generation event. The generation context information includes at least one of the following: a list of resource repositories for the generation operation, an output path, and a list of languages.

[0127] In some alternative implementations, the determining module 401 is configured to: Define the global file, which is the file that is updated every time a build operation is performed; Based on the list of resource repositories, determine the resource repository files and metadata files corresponding to each resource repository. The metadata files record the file information of the streaming resource files associated with the corresponding resource repository. Based on the file information recorded in the metadata file, determine the streaming resource files associated with each resource repository; The global file, repository file, metadata file, and streaming resource file are identified as target files.

[0128] In some alternative implementations, the determining module 401 is configured to: When the metadata file is in text format, the metadata file is split into a sequence of terms according to a preset delimiter. Keywords that represent streaming resources are located in the sequence of terms. From the terms following the keywords, the file information in each streaming resource record is extracted with the number of terms occupied by a single streaming resource record as the step size. When the metadata file is in a structured data format, iterate through the media entries in the metadata file and extract file information from the media entries whose streaming identifier is true; Based on the extracted file information, determine the streaming resource files associated with each resource repository.

[0129] In some alternative implementations, the determining module 401 is configured to: Based on the language list, locate the resource library files and metadata files corresponding to each resource library in the output path and the language subdirectories corresponding to each language in the language list.

[0130] In some alternative implementations, the detection module 402 is used for: Perform the checkout operation on each file in the target file one by one; If the detection of any file fails, the file that failed to be detected is identified as an abnormal file, and the reason for the detection failure corresponding to the abnormal file is determined. If the checkout fails because the abnormal file has not been registered in the version control system, skip the abnormal file and continue to perform the checkout operation on the remaining files, which are the files in the target file that have not yet been checked out. If the detection failed because the abnormal file had already been detected by another user, continue to perform the detection operation on the remaining files; If the failure to detect the source of the failure is due to a connection failure with the version control system, the detection operation will be aborted, and the resource generation tool will also stop its generation operation.

[0131] In some alternative implementations, the detection module 402 is further configured to: After the detection operation is executed and before the generation operation is executed, the content fingerprint of the existing files in the target file is calculated, and the mapping relationship between the file path and the content fingerprint of the existing files is stored as a snapshot file. The existing files are the files that existed in the target file before the generation operation was executed. In response to a post-generation event, a snapshot file is read, which is used to determine the first file and / or the second file.

[0132] In some alternative implementations, the rollback module 403 is used for: Perform a rollback operation on the output directory of the generation operation to remove the checkout status of files in the output directory that were in a checkout state and whose contents remained consistent before and after the generation operation.

[0133] In some alternative implementations, the registration module 404 is used for: An add request is sent to each file in the target file one by one, so that the version control system skips add requests for files that are already registered in the version control system, and in response to the add request for the second file, registers the second file to the version control system.

[0134] In some alternative implementations, the resource generation tool is an audio middleware, and the resource files include at least one of an audio library file, a metadata file corresponding to the audio library file, and a streaming audio file.

[0135] The version control device provided in this disclosure can execute the version control method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0136] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.

[0137] The following is a detailed reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present disclosure. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0138] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0139] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the version control method of embodiments of this disclosure.

[0140] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0141] This disclosure also provides a computer-readable storage medium in which the methods described in this disclosure can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded over a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the version control method shown in the above embodiments.

[0142] A portion of this disclosure can be applied to computer program products, such as computer program instructions, which, when executed by a computer, can invoke or provide methods and / or technical solutions according to this disclosure through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, and installation package files. Accordingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions; the computer compiling the instructions and then executing the corresponding compiled program; the computer reading and executing the instructions; or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0143] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A version control method, characterized in that, The method includes: In response to a pre-generation event triggered by the resource generation tool before performing a generation operation, the target file involved in the generation operation is determined based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files; Perform a checkout operation on the target file in the version control system to put the target file into a checkout state; In response to a post-generation event triggered by the resource generation tool after the generation operation is completed, a rollback operation is performed on the first file to remove the checkout status of the first file, wherein the first file is the file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed; After the rollback operation is completed, the second file is registered to the version control system. The second file is a file in the target file that has not yet been registered to the version control system.

2. The method according to claim 1, characterized in that, The method further includes: The resource generation tool receives the generation context information when it triggers the pre-generation event. The generation context information includes at least one of the following: a list of resource libraries, an output path, and a list of languages ​​for the generation operation.

3. The method according to claim 2, characterized in that, Determining the target file involved in the generation operation based on the generation context information of the generation operation includes: Determine the global file, which is the file that is updated each time the generation operation is performed; Based on the resource library list, determine the resource library file and metadata file corresponding to each resource library. The metadata file records the file information of the streaming resource file associated with the corresponding resource library. Based on the file information recorded in the metadata file, determine the streaming resource files associated with each resource repository; The global file, the resource library file, the metadata file, and the streaming resource file are identified as the target file.

4. The method according to claim 3, characterized in that, The step of determining the streaming resource files associated with each resource repository based on the file information recorded in the metadata file includes: If the metadata file is in text format, the metadata file is split into a sequence of terms according to a preset delimiter. Keywords that characterize streaming resources are located in the sequence of terms. From the terms following the keywords, the file information in each streaming resource record is extracted with the number of terms occupied by a single streaming resource record as the step size. If the metadata file is in a structured data format, the media entries in the metadata file are traversed, and the file information is extracted from the media entries whose streaming identifier is true; Based on the extracted file information, the streaming resource files associated with each resource repository are determined.

5. The method according to claim 3, characterized in that, The step of determining the resource library file and metadata file corresponding to each resource library based on the resource library list includes: Based on the language list, locate the resource library files and metadata files corresponding to each resource library in the output path and the language subdirectories corresponding to each language in the language list under the output path.

6. The method according to claim 1, characterized in that, The step of performing a checkout operation on the target file in the version control system includes: The detection operation is performed on each file in the target file one by one; If the detection of any file fails, the file that failed to be detected is identified as an abnormal file, and the reason for the detection failure corresponding to the abnormal file is determined. If the reason for the detection failure is that the abnormal file has not been registered in the version control system, the abnormal file is skipped, and the detection operation is continued on the remaining files, which are the files in the target file that have not yet undergone the detection operation. If the reason for the detection failure is that the abnormal file has been detected by another user, continue to perform the detection operation on the remaining files; If the detection failure is due to a connection failure with the version control system, the detection operation is aborted, and the resource generation tool is also aborted in the generation operation.

7. The method according to claim 1, characterized in that, The method further includes: After the detection operation is performed and before the generation operation is performed, the content fingerprint of the existing files in the target file is calculated, and the mapping relationship between the file path of the existing files and the content fingerprint is stored as a snapshot file. The existing files are the files that existed in the target file before the generation operation was performed. In response to the post-generation event, the snapshot file is read, which is used to determine the first file and / or the second file.

8. The method according to claim 1, characterized in that, The rollback operation on the first file includes: The rollback operation is performed on the output directory of the generation operation to remove the checkout state from the files in the output directory that are in the checkout state and whose content remains consistent before and after the generation operation.

9. The method according to claim 1, characterized in that, Registering the second file to the version control system includes: An add request is initiated for each file in the target file one by one, so that the version control system skips the add request for files already registered in the version control system, and in response to the add request for the second file, the second file is registered to the version control system.

10. The method according to any one of claims 1 to 9, characterized in that, The resource generation tool is an audio middleware, and the resource file includes at least one of an audio library file, a metadata file corresponding to the audio library file, and a streaming audio file.

11. A version control device, characterized in that, The device includes: The determination module is used to respond to a pre-generation event triggered by the resource generation tool before performing a generation operation, and determine the target file involved in the generation operation based on the generation context information of the generation operation, wherein the generation operation is used to generate resource files; The checkout module is used to perform a checkout operation on the target file in the version control system so that the target file enters the checkout state; The rollback module is used to respond to a post-generation event triggered by the resource generation tool after the generation operation is completed, and to perform a rollback operation on the first file to release the checkout status of the first file, wherein the first file is a file in the target file that is in the checkout status and whose content remains consistent before and after the generation operation is performed; The registration module is used to register the second file to the version control system after the rollback operation is completed. The second file is a file in the target file that has not yet been registered with the version control system.

12. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the version control method according to any one of claims 1 to 10 by executing the computer instructions.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the version control method according to any one of claims 1 to 10.

14. A computer program product, characterized in that, It includes computer instructions for causing a computer to perform the version control method according to any one of claims 1 to 10.