Project resource detection method, device, electronic equipment and storage medium
By automatically comparing and updating project resources using the resource detection hook file when the editor starts, errors and efficiency problems caused by expired resources are solved, and rapid detection and efficient development are achieved.
Patent Information
- Application Number
- CN202110879826.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-08-02
AI Technical Summary
During the startup process of the project engine editor, loading expired project resources will lead to errors and resource waste. The existing technology relies on manual inspection, which has lag and system burden, affecting development efficiency.
Load the pre-built resource detection hook file when the editor starts, and automatically detect and update the resources by comparing local and remote resources with the resource server.
It realizes automatic detection and update of project resources, reduces editor startup time and memory usage, and improves development efficiency and resource detection efficiency.
Smart Images

Figure CN113590327B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer application technology, and in particular to a project resource detection method, device, electronic device and storage medium. Background Art
[0002] When starting the Project Engine Editor, you often need to load various project resources required for project development or operation. If you load expired project resources, an error will be reported or a display error will appear during project operation. At this time, you need to close the editor, manually update the project resources, and then restart the editor to use the plug-in.
[0003] Currently, the way to check whether project resources are expired is for professional technicians to manually check after the editor is started, and there is a certain lag in the checking time; if the project resources are expired, the editor needs to be restarted. Since the startup process of the editor involves the loading of many assemblies and the import of resources, it will cause a burden on system resources and waste time, thereby affecting the project development efficiency. Summary of the invention
[0004] The embodiments of the present invention provide a project resource detection method, device, electronic device and storage medium to improve the detection efficiency of project resources and further improve the development efficiency of the project.
[0005] In a first aspect, an embodiment of the present invention provides a project resource detection method, comprising:
[0006] During the startup of the target engine's editor, load the pre-built resource detection hook file;
[0007] Detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server;
[0008] Based on the detection result, it is determined whether to continue to execute the operation of opening the editor of the target engine.
[0009] Optionally, the detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server includes:
[0010] Based on the resource detection hook file, the local configuration file of the local loaded project resource is compared with the remote configuration file of the target loaded project resource in the resource server.
[0011] Optionally, comparing the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server based on the resource detection hook file includes:
[0012] Based on the resource detection class in the resource detection hook file, the local update time information of the local configuration file of the local loaded project resource is compared with the remote update time information of the remote configuration file of the target loaded project resource in the resource server.
[0013] Optionally, the determining whether to continue to execute the operation of opening the editor of the target engine based on the detection result includes:
[0014] If the local configuration file is inconsistent with the remote configuration file, the local loading project resources are updated to the target loading project resources based on the resource update class in the resource detection hook file, and the operation of opening the editor of the target engine is continued.
[0015] Optionally, updating the local loaded item resource to the target loaded item resource based on the resource update class in the resource detection hook file includes:
[0016] The resource update class in the resource detection hook file is called, the target loading project resource is pulled from the resource server based on the remote configuration file, and the local loading project resource is replaced with the corresponding target loading project resource.
[0017] Optionally, the determining whether to continue to execute the operation of opening the editor of the target engine based on the detection result includes:
[0018] If the local configuration file is consistent with the remote configuration file, the operation of opening the editor of the target engine is continued.
[0019] Optionally, the method further includes performing at least one of the following operations:
[0020] Loading the native code library of the target engine;
[0021] Loading the engine plug-in layer assembly of the target engine;
[0022] Load pre-built project engineering assemblies;
[0023] Load pre-built third-party SDK assemblies;
[0024] The loading of the pre-built resource detection hook file includes at least one of the following operations:
[0025] When the native code library of the target engine is loaded, load the pre-built resource detection hook file; or,
[0026] When the engine plug-in layer assembly of the target engine is loaded, the pre-built resource detection hook file is loaded; or,
[0027] When the pre-built project assembly is loaded, load the pre-built resource detection hook file; or,
[0028] When the pre-built third-party SDK assemblies are loaded, load the pre-built resource detection hook files.
[0029] In a second aspect, an embodiment of the present invention further provides a project resource detection device, comprising:
[0030] The hook file loading module is used to load the pre-built resource detection hook file during the startup process of the target engine's editor;
[0031] A project resource detection module, used for detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server;
[0032] The opening operation execution module is used to determine whether to continue to execute the operation of opening the editor of the target engine based on the detection result.
[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0034] one or more processors;
[0035] a storage device for storing one or more programs,
[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the project resource detection method provided by any embodiment of the present invention.
[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a project resource detection method as provided in any embodiment of the present invention.
[0038] The embodiments of the above invention have the following advantages or beneficial effects:
[0039] By loading the pre-built resource detection hook file during the startup of the target engine's editor and the target loaded project resources in the resource server, the locally loaded project resources are detected, and then determining whether to continue to execute the operation of opening the target engine's editor according to the detection result, the automatic detection of project resources during the editor startup process is realized, and there is no need to manually detect whether the project resources are expired after the editor is fully started, so that expired project resources can be quickly discovered during the editor startup process, thereby improving the detection efficiency of project resources, and further improving the project development efficiency; at the same time, the restart of the editor due to the expiration of project resources is avoided, and the memory occupied by the engine operation is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 A schematic diagram of a process flow of a project resource detection method provided in the first embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a process flow of a project resource detection method provided in Embodiment 2 of the present invention;
[0043] Figure 3 A schematic diagram of a process flow of a project resource detection method provided in Embodiment 3 of the present invention;
[0044] Figure 4 A schematic diagram of the structure of a project resource detection device provided in Embodiment 4 of the present invention;
[0045] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0047] Embodiment 1
[0048] Figure 1This is a flowchart of a project resource detection method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case where project resources are detected during the process of starting an editor of an engine. The method can be executed by a project resource detection device, which can be implemented by hardware and / or software. The method specifically includes the following steps:
[0049] S110 . During the startup of the editor of the target engine, a pre-built resource detection hook file is loaded.
[0050] Among them, the target engine can be the engine that is currently starting the editor. Exemplarily, the target engine can be a tool that provides developers with a large number of core technologies, basic support or function calls. For example, the target engine can be a game engine, including but not limited to the Unity engine, the Unreal engine, the script engine, the physics engine, the rendering engine, and the network engine. Taking the rendering engine as an example, the rendering engine can be used to calculate all effects such as character models, animations, light and shadow, special effects, etc. in real time and display them on the screen; taking the physics engine as an example, the physics engine can be used to make the movement of objects in the game follow fixed rules, such as specifying the character's jumping height, running speed, flying speed, and the trajectory of the moves.
[0051] In this embodiment, the startup process of the target engine's editor may include the following steps: 1. Initialize the basic configuration of the target engine; 2. Compile all the codes of the target engine; 3. Import the project resources of the target engine; 4. Import the numerical file of the target engine.
[0052] The entire code of the compiled target engine includes: the native code library of the target engine, the plug-in layer code of the target engine, the entire code of the project engineering of the target engine, and the plug-in library of the third-party library or software development kit of the target engine. The project resources of the target engine may include role models, building models, weapon models, textures, actions, skeletons, prefab prefabs and other resources. The numerical file of the target engine may be a file describing the basic numerical values of the model, the numerical values related to the action or the numerical values related to the scene; for example, the numerical value of the model height, the numerical value of the weapon appearance, the numerical value of the weapon firing, the numerical value of the character action speed, the numerical value of the special effect time, the numerical value of the scene transparency, etc.
[0053] Specifically, this embodiment can load the pre-built resource detection hook file in any step of the startup process of the editor of the target engine.
[0054] In this embodiment, the pre-built resource detection hook file can be a file for performing project resource detection. Specifically, the resource detection hook file can include instructions for calling a project resource detection method. The resource detection hook file can be a hook file, such as a .dll file, a .lab file, etc. Exemplarily, the resource detection hook file can be an EnginePreEntryHook.dll file.
[0055] Optionally, you can pre-build a project EnginePreEntryHook based on the C# dll generation method of the target engine, thereby generating an EnginePreEntryHook.dll file and using it as a resource detection hook file. Optionally, the EnginePreEntryHook.dll file can be placed in the EngineDll directory of the project and maintained separately from other dll files inside the engine; after each writing of the EnginePreEntryHook internal code, the EnginePreEntryHook.dll file under the EngineDll directory of the project is automatically mapped and updated.
[0056] In one embodiment, in order to further improve the detection efficiency of project resources, a pre-built resource detection hook file can be loaded before importing the value file of the target engine during the startup process of the above-mentioned editor, so as to detect the project resources before importing the value file, thereby reducing the detection time of the project resources; or, before importing the project resources of the target engine, a pre-built resource detection hook file can be loaded to detect the project resources before importing the project resources, and update the project resources in time when the project resources expire. Compared with detecting the project resources after importing the project resources, there is no need to re-import the project resources after the project resources expire and the project resources are updated, thereby reducing the startup time of the engine editor and thereby reducing the development time of the project.
[0057] In another embodiment, considering that the operation of compiling all the codes of the target engine may cause changes to the project resources, it is also possible to load a pre-built resource detection hook file after compiling all the codes of the target engine and before importing the project resources of the target engine, thereby improving the detection efficiency of the project resources while ensuring the detection accuracy of the project resources.
[0058] In another implementation, a pre-built resource detection hook file may also be loaded during the process of compiling all codes of the target engine. That is, the project resource detection method provided in this embodiment further includes performing at least one of the following operations:
[0059] Load the native code library of the target engine; load the engine plug-in layer assembly of the target engine; load the pre-built project engineering assembly; load the pre-built third-party software development kit assembly;
[0060] The loading of the pre-built resource detection hook file includes at least one of the following operations:
[0061] When the native code library of the target engine is loaded, the pre-built resource detection hook file is loaded; or, when the engine plug-in layer assembly of the target engine is loaded, the pre-built resource detection hook file is loaded; or, when the pre-built project engineering assembly is loaded, the pre-built resource detection hook file is loaded; or, when the pre-built third-party software development kit assembly is loaded, the pre-built resource detection hook file is loaded.
[0062] Among them, the native code library of the target engine may include the basic code of the target engine; for example, the native code library may include the UnityEngine series dll files. The engine plug-in layer assembly of the target engine may include the plug-in layer code or the program code that calls the native code; for example, it includes the package and plugin series dll files. The pre-built project engineering assembly may include all the program codes of the project engineering; for example, all the program codes of the game engineering may be the Project series dll file codes. The pre-built third-party software development kit assembly may include the plug-in library files of the third-party library or SDK (Software Development Kit). Exemplarily, the third-party software development kit assembly may be Wwise sound effects, game SDK, etc.
[0063] Specifically, in this optional implementation, it may include loading the native code library of the target engine, loading the engine plug-in layer assembly of the target engine, loading a pre-built project engineering assembly, and loading a pre-built third-party software development kit assembly, so as to compile at least one of the native code library, the engine plug-in layer assembly, the project engineering assembly, and the third-party software development kit assembly. Of course, the project resource detection method provided in this embodiment may also include all of the above-mentioned loading steps. It should be noted that when all of the loading steps are included, the loading order is: native code library, engine plug-in layer assembly, project engineering assembly, and third-party software development kit assembly.
[0064] In this optional implementation, the resource detection hook file may be loaded when the native code library of the target engine is loaded; or, the resource detection hook file may be loaded when the engine plug-in layer assembly of the target engine is loaded; or, the pre-built resource detection hook file may be loaded when the pre-built project engineering assembly is loaded; or, the pre-built resource detection hook file may be loaded when the pre-built third-party software development kit assembly is loaded. By loading the pre-built resource detection hook file when the native code library, engine plug-in layer assembly, project engineering assembly, or third-party software development kit assembly is loaded, the detection of project resources may be completed before loading the engine plug-in layer assembly, project engineering assembly, or third-party software development kit assembly, further reducing the inspection time of project resources, improving the inspection efficiency of project resources, and reducing the startup time of the engine's editor, greatly improving the development efficiency of the project.
[0065] Optionally, the resource detection hook file can be sent to the first priority loading queue (native code library loading queue) by modifying the engine loading code of the target engine, so that the resource detection hook file can be loaded after the native code library is loaded. This method only adds the resource detection hook file to the first priority loading queue, without adjusting the entire target engine, which improves the applicability of the project resource detection method provided by this embodiment.
[0066] Of course, this embodiment can also add a hook (resource detection hook file) for compilation when the native code library of the target engine is compiled, and when the pre-built project engineering assembly is compiled, the project resources are detected through the hook trigger.
[0067] S120: Detect the local loading project resources based on the resource detection hook file and the target loading project resources in the resource server.
[0068] The locally loaded project resources may be the project resources corresponding to the editor for starting the target engine stored locally. The target loaded project resources may be the project resources required for starting the editor for the target engine stored in the resource server. The resource server may store the project resources corresponding to each engine locally on the server; or, it may be connected to a warehouse storing project resources and read the project resources from the warehouse.
[0069] Exemplarily, the target loading project resources corresponding to the target engine can be queried in the resource server according to the engine identifier of the target engine. It should be noted that the target loading project resources can be the latest version of the project resources corresponding to the target engine, or they can be project resources that are not the latest version. For example, the version of the target loading project resources corresponding to engine a is 4.1.1; the version of the target loading project resources corresponding to engine b is 4.1.2.
[0070] Specifically, detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server may be: triggering the operation of detecting the local loaded project resources based on the target loaded project resources in the resource server through the resource detection hook file.
[0071] Optionally, detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server may include at least one of the following:
[0072] Detect the resource version of the local loaded project resources based on the resource detection hook file and the resource version of the target loaded project resources in the resource server;
[0073] Detect the version time of the local loaded project resources based on the resource detection hook file and the version time of the target loaded project resources in the resource server;
[0074] Based on the resource detection hook file and the resource version and resource update time of the target loaded project resources in the resource server, the resource version and resource update time of the locally loaded project resources are detected;
[0075] The resource content of the local loaded project resources is detected based on the resource detection hook file and the resource content of the target loaded project resources in the resource server.
[0076] If the resource version of the target loaded project resource is consistent with the resource version of the local loaded project resource, the detection result may be a detection pass. Alternatively, if the resource update time of the target loaded project resource is consistent with the resource update time of the local loaded project resource, the detection result may be a detection pass. Alternatively, if the resource content of the target loaded project resource is consistent with the resource content of the local loaded project resource, the detection result may be a detection pass.
[0077] S130: Determine whether to continue the operation of opening the editor of the target engine based on the detection result.
[0078] In this embodiment, if the detection result is that the detection is passed, it can be determined that the local loaded project resources are not expired, and the operation of starting the editor of the target engine can be continued. If the detection result is that the detection is not passed, the operation of starting the editor of the target engine can be suspended, and the local loaded project resources are updated according to the target loaded project resources. Based on the updated local loaded project resources, the operation of starting the editor of the target engine can be continued.
[0079] Exemplarily, if the resource detection hook file is loaded when the native code library of the target engine is loaded, when the pre-built project engineering assembly is loaded, the local loaded project resources are detected based on the resource detection hook file and the target loaded project resources in the resource server. If the detection result is that the detection passes, the operation of loading the pre-built third-party software development kit assembly can continue, thereby continuing to execute the operation of starting the editor of the target engine; if the detection result is that the detection fails, the operation of starting the editor of the target engine can be stopped.
[0080] The technical solution of this embodiment detects the local loaded project resources through the pre-built resource detection hook file loaded during the startup of the editor of the target engine and the target loaded project resources in the resource server, and then determines whether to continue to execute the operation of opening the editor of the target engine according to the detection result, thereby realizing automatic inspection of project resources during the editor startup process, eliminating the need to manually check whether the project resources are expired after the editor is fully started, so that expired project resources can be quickly discovered during the editor startup process, thereby improving the inspection efficiency of project resources, further reducing the startup time of the engine editor, and improving the development efficiency of the project; at the same time, avoiding the restart of the editor due to expired project resources, and reducing the memory occupied by the engine operation.
[0081] In the prior art, it is necessary to fully start the editor. If the editor reflects a failure, the project resources are manually updated. It takes at least 20 minutes to fully start the editor. Therefore, the prior art solution takes at least 20 minutes to complete the detection of project resources. The project resource detection method proposed in the present application can quickly complete the detection of project resources in a shorter time. For example, within 30 seconds of the startup process of the editor of the target engine, it is possible to detect whether the project resources are expired, and automatically pull the latest project resources when the project resources are expired.
[0082] Embodiment 2
[0083] Figure 2A flow chart of a project resource detection method provided for Embodiment 2 of the present invention. Based on the above embodiments, this embodiment optionally detects local loaded project resources based on a resource detection hook file and a target loaded project resource in a resource server, including: comparing a local configuration file of the local loaded project resource with a remote configuration file of the target loaded project resource in the resource server based on the resource detection hook file.
[0084] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 The project resource detection method provided in this embodiment includes the following steps:
[0085] S210 . During the startup of the editor of the target engine, a pre-built resource detection hook file is loaded.
[0086] S220: Based on the resource detection hook file, compare the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server.
[0087] Among them, the local configuration file can be a file used to describe the resource information of the local loaded project resources; the remote configuration file can be a file used to describe the resource information of the target loaded project resources. Optionally, the remote configuration file can be stored in the resource server, or stored in a database corresponding to the resource server. Exemplarily, this embodiment can read the remote configuration file of the target loaded project resources from the resource server through the engine identifier of the target engine.
[0088] In this embodiment, the local configuration file of the locally loaded project resources is compared with the remote configuration file of the target loaded project resources in the resource server based on the resource detection hook file, which can be: through the resource detection hook file, triggering the operation of comparing the local configuration file of the locally loaded project resources with the remote configuration file of the target loaded project resources in the resource server.
[0089] Specifically, comparing the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server may be: comparing the file version of the local configuration file with the file version of the remote configuration file; or comparing the file content of the local configuration file with the file content of the remote configuration file.
[0090] In one implementation, comparing the file content of the local configuration file with the file content of the remote configuration file may be: determining a local file hash value corresponding to the local configuration file and a remote file hash value corresponding to the remote configuration file, and comparing the local file hash value with the remote file hash value.
[0091] S230: Determine whether to continue the operation of opening the editor of the target engine based on the detection result.
[0092] Specifically, if the file version of the local configuration file is consistent with the file version of the remote configuration file, the detection result is passed; if the file version of the local configuration file is inconsistent with the file version of the remote configuration file, the detection result is failed.
[0093] Alternatively, if the file content of the local configuration file is consistent with the file content of the remote configuration file, the detection result is a pass; if the file content of the local configuration file is inconsistent with the file content of the remote configuration file, the detection result is a fail.
[0094] Optionally, determine whether to continue to execute the operation of opening the editor of the target engine based on the detection result, including: if the local configuration file is inconsistent with the remote configuration file, update the local loaded project resources to the target loaded project resources based on the resource update class in the resource detection hook file, and continue to execute the operation of opening the editor of the target engine.
[0095] The resource update class may be a file class pre-written in the resource detection hook file for updating the local loaded project resources. Specifically, the resource update class may include program code for calling the update method of the local loaded project resources. For example, a C# resource update class PEAssetsUpdater may be written in the EnginePreEntryHook project.
[0096] In this optional implementation, when the local configuration file is inconsistent with the remote configuration file, the locally loaded project resources can be updated to the target loaded project resources according to the resource update class, and the operation of starting the editor of the target engine can be continued after the local loaded project resources are updated, thereby realizing automatic update of project resources without restarting the editor or re-importing project resources, reducing the startup time of the editor, and thereby improving the project development efficiency.
[0097] Optionally, determining whether to continue to execute the operation of opening the editor of the target engine based on the detection result includes: if the local configuration file is consistent with the remote configuration file, continuing to execute the operation of opening the editor of the target engine.
[0098] In a specific implementation, local loaded project resources are updated to target loaded project resources based on a resource update class in a resource detection hook file, including: calling a resource update class in a resource detection hook file, pulling target loaded project resources from a resource server based on a remote configuration file, and replacing local loaded project resources with corresponding target loaded project resources.
[0099] Specifically, the target loaded project resource corresponding to the file identifier of the remote configuration file can be pulled from the resource server through the file identifier of the remote configuration file, and the local loaded project resource is replaced with the target loaded project resource. This optional implementation method realizes the automatic update of project resources, which improves the efficiency of checking project resources and starting the editor compared to the traditional manual update of project resources.
[0100] The technical solution of this embodiment uses a pre-built resource detection hook file to compare the local configuration file of the locally loaded project resources with the remote configuration file of the target loaded project resources in the resource server, so as to detect the project resources through the configuration file, thereby further improving the detection efficiency of the project resources, thereby reducing the startup time of the editor and improving the development efficiency of the project.
[0101] Embodiment 3
[0102] Figure 3 A flow chart of a project resource detection method provided for Embodiment 3 of the present invention. Based on the above embodiments, this embodiment optionally compares a local configuration file of a locally loaded project resource with a remote configuration file of a target loaded project resource in a resource server based on a resource detection hook file, including: based on a resource detection class in the resource detection hook file, comparing local update time information of a local configuration file of a locally loaded project resource with remote update time information of a remote configuration file of a target loaded project resource in a resource server.
[0103] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 3 The project resource detection method provided in this embodiment includes the following steps:
[0104] S310: During the startup of the editor of the target engine, a pre-built resource detection hook file is loaded.
[0105] S320: Based on the resource detection class in the resource detection hook file, compare the local update time information of the local configuration file of the local loaded project resource with the remote update time information of the remote configuration file of the target loaded project resource in the resource server.
[0106] The resource detection class may be a class file pre-written in the resource detection hook file for triggering the comparison between the local configuration file and the remote configuration file. The resource detection class may include program code for calling the configuration file comparison method. For example, a C# resource detection class PAssetsChecking may be written in the EnginePreEntryHook project.
[0107] In this embodiment, the local update time may be the latest modification time of the local configuration file, and the remote update time may be the latest modification time of the remote configuration file.
[0108] Specifically, if the local update time is the same as the remote update time, it can indicate that after the local configuration file is pulled from the resource server, neither the local configuration file nor the remote configuration file in the resource server has been modified, or the local configuration file and the remote configuration file in the resource server have been modified synchronously. If the local update time is different from the remote update time, it can indicate that after the local configuration file is pulled from the resource server, the remote configuration file in the resource server has been modified, or the local configuration file has been modified, or the modification time of the local configuration file and the remote configuration file are different.
[0109] Exemplarily, when the local update time is consistent with the remote update time, the test result is determined to be passed; when the local update time is earlier than the remote update time, the test result is determined to be failed; when the local update time is later than the remote update time, the test result is determined to be passed.
[0110] In an optional implementation, taking into account the possibility that the file update time may be consistent but the local configuration file and the remote configuration file are still different, before comparing the local update time information with the remote update time information, based on the resource detection class in the resource detection hook file, the file version of the local configuration file of the locally loaded project resources and the file version of the remote configuration file of the target loaded project resources in the resource server are compared; if the local file version is consistent with the remote file version, the operation of comparing the local update time information with the remote update time information is performed.
[0111] In other words, the local loaded project resources are detected based on the resource detection hook file and the target loaded project resources in the resource server, including: comparing the file version of the local configuration file with the file version of the remote configuration file, and when the file version of the local configuration file is consistent with the file version of the remote configuration file, comparing the local update time with the remote update time. Specifically, when the local update time is consistent with the remote update time, the detection result is that the detection is passed; when the local update time is inconsistent with the remote update time, or the file version of the local configuration file is inconsistent with the file version of the remote configuration file, the detection result is that the detection is not passed.
[0112] In this optional implementation, a file version comparison may be performed first. When the file versions are inconsistent, there is no need to continue comparing the file update times, thereby further improving the efficiency of comparing the local configuration file with the remote configuration file. At the same time, it avoids the situation where the detection passes even though the file update times are consistent but the file versions are different, thereby improving the comparison accuracy between the local configuration file and the remote configuration file and reducing the situation where numerical or code mismatches due to project resource errors occur.
[0113] Of course, this embodiment can also compare the file content of the local configuration file with the file content of the remote configuration file when the local update time information of the local configuration file is consistent with the remote update time information of the remote configuration file, so as to further ensure the comparison accuracy of the local configuration file and the remote configuration file. The comparison of the file content can be based on the hash value of the file.
[0114] S330: Determine whether to continue the operation of opening the editor of the target engine based on the detection result.
[0115] Exemplarily, if the local update time is consistent with the remote update time, the test result is that the test passes; if the local update time is inconsistent with the remote update time, the test result is that the test fails.
[0116] Of course, after comparing the local update time information with the remote update time information, if the local update time is consistent with the remote update time, the file content of the local configuration file is still compared with the file content of the remote configuration file. At this time, if the file content of the local configuration file is consistent with the file content of the remote configuration file, the test result is passed; if the file content of the local configuration file is inconsistent with the file content of the remote configuration file, the test result is failed.
[0117] The technical solution of this embodiment uses the resource detection class of the resource detection hook file to compare the local update time information of the local configuration file with the remote update time of the remote configuration file, and determines the comparison result as the detection result, so as to realize the detection of project resources through the file update time, further improve the detection efficiency of project resources, reduce the startup time of the editor, and further improve the development efficiency of the project.
[0118] Embodiment 4
[0119] Figure 4 This is a structural diagram of a project resource detection device provided in Example 4 of the present invention. This embodiment is applicable to the situation where project resources are detected during the process of starting the engine editor. The device specifically includes: a hook file loading module 410, a project resource detection module 420 and an opening operation execution module 430.
[0120] The hook file loading module 410 is used to load the pre-built resource detection hook file during the startup process of the editor of the target engine;
[0121] A project resource detection module 420, configured to detect local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server;
[0122] The opening operation execution module 430 is used to determine whether to continue to execute the operation of opening the editor of the target engine based on the detection result.
[0123] Optionally, the project resource detection module 420 includes a file comparison unit, which is used to compare the local configuration file of the locally loaded project resources with the remote configuration file of the target loaded project resources in the resource server based on the resource detection hook file.
[0124] Optionally, the file comparison unit is specifically used for:
[0125] Based on the resource detection class in the resource detection hook file, the local update time information of the local configuration file of the local loaded project resource is compared with the remote update time information of the remote configuration file of the target loaded project resource in the resource server.
[0126] Optionally, the start operation execution module 430 includes a resource update unit, which is used to update the local loaded project resources to the target loaded project resources based on the resource update class in the resource detection hook file if the local configuration file is inconsistent with the remote configuration file, and continue to execute the operation of starting the editor of the target engine.
[0127] Optionally, the resource updating unit is specifically used for:
[0128] If the local configuration file is inconsistent with the remote configuration file, the resource update class in the resource detection hook file is called, the target loading project resources are pulled from the resource server based on the remote configuration file, and the local loading project resources are replaced with the corresponding target loading project resources.
[0129] Optionally, the start operation execution module 430 further includes a continuing start unit, which is used to continue to execute the operation of starting the editor of the target engine if the local configuration file is consistent with the remote configuration file.
[0130] Optionally, the project resource detection device further includes a code loading module, and the code loading module is used to perform at least one of the following operations:
[0131] Loading the native code library of the target engine;
[0132] Loading the engine plug-in layer assembly of the target engine;
[0133] Load pre-built project engineering assemblies;
[0134] Load pre-built third-party SDK assemblies;
[0135] The hook file loading module 410 includes a file loading unit, and the file loading unit is used to perform at least one of the following operations:
[0136] When the native code library of the target engine is loaded, load the pre-built resource detection hook file; or,
[0137] When the engine plug-in layer assembly of the target engine is loaded, the pre-built resource detection hook file is loaded; or,
[0138] When the pre-built project assembly is loaded, load the pre-built resource detection hook file; or,
[0139] When the pre-built third-party SDK assemblies are loaded, load the pre-built resource detection hook files.
[0140] In this embodiment, a pre-built resource detection hook file is loaded during the startup of the editor of the target engine through a hook file loading module, and the local loaded project resources are detected based on the resource detection hook file and the target loaded project resources in the resource server through a project resource detection module, and then through the start operation execution module, it is determined whether to continue to execute the operation of opening the editor of the target engine according to the detection result, thereby realizing automatic inspection of project resources during the startup of the editor, and eliminating the need to manually check whether the project resources are expired after the editor is fully started, so that expired project resources can be quickly discovered during the startup of the editor, thereby improving the inspection efficiency of project resources, and further improving the development efficiency of the project; at the same time, it avoids the restart of the editor due to the expiration of project resources, and reduces the memory occupied by the engine operation.
[0141] The project resource detection device provided in the embodiment of the present invention can execute the project resource detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0142] It is worth noting that the various units and modules included in the above system are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0143] Embodiment 5
[0144] Figure 5 It is a structural schematic diagram of an electronic device provided in Embodiment 5 of the present invention. Figure 5 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The electronic device 12 shown is only an example and should not bring any limitation to the functions and application scope of the embodiments of the present invention. The device 12 is typically an electronic device that is responsible for detecting project resources when the engine editor is started.
[0145] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 connecting the various components (including the memory 28 and the processing unit 16).
[0146] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0147] The electronic device 12 typically includes a variety of computer readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0148] The memory 28 may include computer device readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer storage media. By way of example only, the storage device 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a read-only optical disk (Compact Disc-Read Only Memory, CD-ROM), a digital video disk (Digital Video Disc-Read Only Memory, DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product 40, which has a set of program modules 42, which are configured to perform the functions of various embodiments of the present invention. The program product 40 may be stored in, for example, the memory 28, and such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each of which or some combination may include the implementation of a network environment. The program module 42 generally performs the functions and / or methods in the embodiments described in the present invention.
[0149] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, mouse, camera, etc., and display), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (RAID) devices, tape drives, and data backup storage devices.
[0150] The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, for example, implementing the project resource detection method provided in the above embodiment of the present invention, including:
[0151] During the startup of the target engine's editor, load the pre-built resource detection hook file;
[0152] Detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server;
[0153] Based on the detection result, it is determined whether to continue to execute the operation of opening the editor of the target engine.
[0154] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the project resource detection method provided by any embodiment of the present invention.
[0155] Embodiment 6
[0156] Embodiment 6 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the project resource detection method provided in any embodiment of the present invention are implemented. The method includes:
[0157] During the startup of the target engine's editor, load the pre-built resource detection hook file;
[0158] Detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server;
[0159] Based on the detection result, it is determined whether to continue to execute the operation of opening the editor of the target engine.
[0160] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can 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 (non-exhaustive list) of computer-readable storage media include: 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 this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0161] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media 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.
[0162] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0163] Computer program code for performing the operation of embodiments of the present invention 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 a user's computer, partially on a user's computer, as an independent software package, partially on a 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).
[0164] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A project resource detection method, characterized in that: include: During the startup of the editor of the target engine, a pre-built resource detection hook file is loaded; wherein the resource detection hook file contains instructions for calling a project resource detection method; Detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server; Determine whether to continue to execute the operation of opening the editor of the target engine based on the detection result; The detecting of the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server includes: Comparing the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server based on the resource detection hook file; The comparing the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server based on the resource detection hook file includes: Based on the resource detection class in the resource detection hook file, the local update time information of the local configuration file of the local loaded project resource is compared with the remote update time information of the remote configuration file of the target loaded project resource in the resource server; The step of determining whether to continue to open the editor of the target engine based on the detection result includes: If the local configuration file is inconsistent with the remote configuration file, the local loaded project resources are updated to the target loaded project resources based on the resource update class in the resource detection hook file, and the operation of opening the editor of the target engine is continued; If the local configuration file is consistent with the remote configuration file, the operation of opening the editor of the target engine is continued.
2. The method according to claim 1, characterized in that The updating of the local loaded project resources to the target loaded project resources based on the resource update class in the resource detection hook file includes: The resource update class in the resource detection hook file is called, the target loading project resource is pulled from the resource server based on the remote configuration file, and the local loading project resource is replaced with the corresponding target loading project resource.
3. The method according to claim 1, characterized in that It also includes performing at least one of the following operations: Loading the native code library of the target engine; Loading the engine plug-in layer assembly of the target engine; Load pre-built project engineering assemblies; Load pre-built third-party SDK assemblies; The loading of the pre-built resource detection hook file includes at least one of the following operations: When the native code library of the target engine is loaded, load the pre-built resource detection hook file; or, When the engine plug-in layer assembly of the target engine is loaded, the pre-built resource detection hook file is loaded; or, When the pre-built project assembly is loaded, load the pre-built resource detection hook file; or, When the pre-built third-party SDK assemblies are loaded, load the pre-built resource detection hook files.
4. A project resource detection device, characterized in that: include: A hook file loading module, used to load a pre-built resource detection hook file during the startup process of the editor of the target engine; wherein the resource detection hook file contains instructions for calling a project resource detection method; A project resource detection module, used for detecting the local loaded project resources based on the resource detection hook file and the target loaded project resources in the resource server; An opening operation execution module, used for determining whether to continue to execute the operation of opening the editor of the target engine based on the detection result; Wherein, the project resource detection module includes a file comparison unit; Wherein, the file comparison unit is used to compare the local configuration file of the local loaded project resource with the remote configuration file of the target loaded project resource in the resource server based on the resource detection hook file; The file comparison unit is specifically used to compare the local update time information of the local configuration file of the local loaded project resource with the remote update time information of the remote configuration file of the target loaded project resource in the resource server based on the resource detection class in the resource detection hook file; Wherein, the start-up operation execution module includes a resource update unit and a continue start-up unit; The resource updating unit is configured to update the local loaded project resources to the target loaded project resources based on the resource updating class in the resource detection hook file if the local configuration file is inconsistent with the remote configuration file, and continue to execute the operation of opening the editor of the target engine; The continuing starting unit is used to continue to execute the operation of opening the editor of the target engine if the local configuration file is consistent with the remote configuration file.
5. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the project resource detection method as described in any one of claims 1-3.
6. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the project resource detection method as described in any one of claims 1 to 3 is implemented.
