CN-122006261-A - Configuration data detection method, device, equipment, medium and product
Abstract
The application relates to the technical field of computers and discloses a method, a device, equipment, a medium and a product for detecting configuration data, wherein the method comprises the steps of obtaining an original configuration file obtained based on source configuration data conversion; the original configuration file comprises at least one sub-configuration file, corresponding file processing threads are respectively created for the sub-configuration files in the original configuration file, the original configuration file is analyzed to generate a target configuration file in a standardized format corresponding to the sub-configuration file, the target configuration file is detected and processed according to corresponding detection rules based on the file processing threads to determine detection results of the target configuration files, and the detected configuration file is generated according to the detection results of the target configuration files. The method and the device can detect the configuration file timely and quickly, can flexibly adapt to detection requirements in various projects, and have higher universality.
Inventors
- Shen Huangzheng
- LI YANG
- LIN ZHONGYU
- LIU HAN
- Tan Cirong
Assignees
- 网易(杭州)网络有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251202
Claims (13)
- 1. A method for detecting configuration data, the method comprising: The method comprises the steps of obtaining an original configuration file obtained based on source configuration data conversion, wherein the original configuration file comprises at least one sub-configuration file; Creating corresponding file processing threads for each sub-configuration file in the original configuration file respectively; Analyzing the original configuration file to generate a target configuration file in a standardized format corresponding to the sub-configuration file; Based on the file processing thread, detecting the target configuration files according to corresponding detection rules, and determining detection results of the target configuration files; And generating a detected configuration file according to the detection result of each target configuration file.
- 2. The method of claim 1, wherein the number of sub-profiles is a plurality; the creating a corresponding file processing thread for each sub-configuration file in the original configuration file respectively includes: Creating a main process and a plurality of sub-processes; And allocating at least one sub-configuration file to be detected to each sub-process based on the main process, and creating a corresponding file processing thread for each allocated sub-configuration file based on the sub-process.
- 3. The method according to claim 2, wherein the detecting the target configuration files according to the corresponding detection rules based on the file processing thread, and determining the detection result of each target configuration file includes: For a first file processing thread for detecting a first target configuration file, acquiring a second target configuration file corresponding to an association detection rule based on the first file processing thread when the detection rule of the first target configuration file comprises the association detection rule; and detecting the first target configuration file and the second target configuration file according to the association detection rule based on the first file processing thread, and determining an association detection result of the first target configuration file.
- 4. The method of claim 3, wherein the obtaining, based on the first file processing thread, the second target profile corresponding to the association detection rule comprises: Initiating a data acquisition request to a first subprocess corresponding to the first file processing thread based on the first file processing thread, wherein the data acquisition request is used for acquiring a second target configuration file corresponding to the association detection rule; acquiring the second target configuration file based on the first subprocess and sending the second target configuration file to the first file processing thread under the condition that the second target configuration file is the target configuration file distributed to the first subprocess; And forwarding the data acquisition request to the main process based on the first sub-process to acquire the second target configuration file from the main process and sending the second target configuration file to the first file processing thread in the case that the second target configuration file is not the target configuration file allocated to the first sub-process.
- 5. The method of claim 4, wherein the obtaining the second target profile based on the first sub-process comprises: forwarding the data acquisition request to a second file processing thread for detecting the second target configuration file based on the first sub-process; And sending the second target configuration file to the first subprocess based on the second file processing thread.
- 6. The method of claim 4, wherein the forwarding the data acquisition request to the host process based on the first sub-process to acquire the second target profile from the host process comprises: Forwarding the data acquisition request to the main process based on the first sub-process; determining a second subprocess for distributing the second target configuration file based on the main process, and forwarding the data acquisition request to the second subprocess; Forwarding the data acquisition request to a second file processing thread for detecting the second target profile based on the second sub-process; and sending the second target configuration file to the second subprocess based on the second file processing thread so as to send the second target configuration file to the first subprocess through the second subprocess and the main process in sequence.
- 7. The method according to claim 4, wherein the method further comprises: For a second file processing thread for detecting the second target configuration file, judging whether loading of the second target configuration file is completed or not under the condition that a data acquisition request for acquiring the second target configuration file is received; And under the condition that the second target configuration file is not loaded, caching the data acquisition request, and after loading is completed, responding to the cached data acquisition request so as to return the second target configuration file.
- 8. The method according to claim 2, wherein the method further comprises: After the subprocess completes the detection task of each allocated target configuration file, caching the subprocess; and destroying the main process and each sub-process in response to a destroying instruction for the main process.
- 9. The method of claim 1, wherein the obtaining the original configuration file converted based on the source configuration data comprises: determining a root directory for recording an original configuration file converted based on the source configuration data; And acquiring the original configuration file from the root directory.
- 10. A device for detecting configuration data, the device comprising: the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an original configuration file obtained based on source configuration data conversion, and the original configuration file comprises at least one sub-configuration file; the creation module is used for respectively creating corresponding file processing threads for each sub-configuration file in the original configuration file; the analysis module is used for analyzing the original configuration file and generating a target configuration file in a standardized format corresponding to the sub-configuration file; The processing module is used for detecting the target configuration files according to the corresponding detection rules based on the file processing threads, determining the detection results of the target configuration files, and generating the detected configuration files according to the detection results of the target configuration files.
- 11. An electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of detecting configuration data according to any one of claims 1 to 9.
- 12. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method of detecting configuration data according to any one of claims 1 to 9.
- 13. A computer program product comprising computer instructions for causing a computer to perform the method of detecting configuration data according to any one of claims 1 to 9.
Description
Configuration data detection method, device, equipment, medium and product Technical Field The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a medium, and a product for detecting configuration data. Background The game runtime typically requires a configuration file as part of the data source for the game runtime. In each game item, editing configuration is generally performed based on a table (such as Excel), and configured content is exported as a configuration file (such as json format file) with a code capable of being directly read, so that the configuration file is convenient for reading when the game runs. Since configuration contents may have errors, it is necessary to perform necessary data detection on the configuration contents. The current data detection means easily introduce uncertainty into the normal development flow and basically have no cross-project generality. Disclosure of Invention In view of the above, the present application provides a method, apparatus, device, medium and product for detecting configuration data, so as to solve the problem of poor versatility of configuration data detection. In a first aspect, the present application provides a method for detecting configuration data, the method comprising: The method comprises the steps of obtaining an original configuration file obtained based on source configuration data conversion, wherein the original configuration file comprises at least one sub-configuration file; Creating corresponding file processing threads for each sub-configuration file in the original configuration file respectively; Analyzing the original configuration file to generate a target configuration file in a standardized format corresponding to the sub-configuration file; Based on the file processing thread, detecting the target configuration files according to corresponding detection rules, and determining detection results of the target configuration files; And generating a detected configuration file according to the detection result of each target configuration file. In a second aspect, the present application provides a device for detecting configuration data, the device comprising: the system comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for acquiring an original configuration file obtained based on source configuration data conversion, and the original configuration file comprises at least one sub-configuration file; the creation module is used for respectively creating corresponding file processing threads for each sub-configuration file in the original configuration file; the analysis module is used for analyzing the original configuration file and generating a target configuration file in a standardized format corresponding to the sub-configuration file; The processing module is used for detecting the target configuration files according to the corresponding detection rules based on the file processing threads, determining the detection results of the target configuration files, and generating the detected configuration files according to the detection results of the target configuration files. In a third aspect, the present application provides an electronic device, including a memory and a processor, where the memory and the processor are communicatively connected to each other, and the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the method for detecting configuration data according to the first aspect or any implementation manner corresponding to the first aspect. In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the method for detecting configuration data of the first aspect or any of its corresponding embodiments. In a fifth aspect, the present application provides a computer program product comprising computer instructions for causing a computer to perform the method of detecting configuration data of the first aspect or any of its corresponding embodiments. The method for detecting the configuration data provided by the application can detect the exported original configuration file, can quickly find problems, exports and detects the problems, is not delayed in finding, does not need to invade the exported flow, is non-invasive, does not influence the exported flow, is independent of the exported flow and the running flow in the follow-up game, can be used by plug and play, is friendly to items which are not designed in advance and are added later in data detection, and basically does not influence the original workflow. In the detection process, analysis processing of a standard format is carried out on the original configuration file, various types of configuration files can be adapted, file detection is carried out on the ba