Intelligent game engine configuration file analysis method and device, equipment and storage medium

By dynamically parsing and verifying the YAML file of the intelligent game engine, the target configuration class is generated, which solves the problems of cumbersome configuration of YAML file parameters and low parsing efficiency, and realizes efficient configuration file processing.

CN119201217APending Publication Date: 2024-12-27PENG CHENG LAB
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411142946.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The configuration of YAML file parameters of the intelligent game engine is cumbersome and lacks unified specifications, resulting in low parsing efficiency and is complex and inefficient when converting to JSON or XML.

Method used

By obtaining the initial YAML file of the intelligent game engine, extracting configuration items and configuration parameters, generating target configuration classes based on business logic, dynamic analysis and verification, describing configuration information as class objects, avoiding layer by layer analysis, and improving processing speed and efficiency.

Benefits of technology

It improves the parsing efficiency of the intelligent game engine configuration file, simplifies configuration data processing, reduces development and maintenance costs, and avoids complex string operations and data structure conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201217A_ABST
    Figure CN119201217A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an intelligent game engine configuration file analysis method and device, equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the steps of obtaining at least one initial configuration YAML file of an intelligent game engine, extracting configuration items and configuration parameters from the initial configuration YAML file, generating at least one target configuration class according to service logic and configuration types, generating field names and field types of the target configuration classes according to the configuration items, and sending the field names and the field types to the intelligent game engine. And generating attribute values corresponding to the field names according to the configuration parameters, performing parameter verification on the configuration parameters based on attribute rules, and instantiating the target configuration class to obtain a configuration file analysis result after all the attribute values pass verification. In the prior art, the analysis process is complex and the calculation amount is large. In the embodiment, the data in the initial configuration YAML file is directly mapped to the attribute of the class object, so that each hierarchy is prevented from being analyzed one by one, and the processing speed and efficiency of the configuration related data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and storage medium for parsing a configuration file of an intelligent game engine. Background Art

[0002] An intelligent game engine is an artificial intelligence computer system used to simulate and solve various types of game problems. It usually integrates multiple artificial intelligence algorithms such as machine learning, reinforcement learning, and deep learning to achieve modeling and optimization of complex game strategies. When developing an intelligent game engine, developers usually use a dedicated intelligent game engine development platform for training and learning. This process involves configuring the parameters of the intelligent game engine on the development platform.

[0003] In the related art, the parameters of the intelligent game engine are usually stored in the form of a data serialization language (YAML, i.e. YAML Ain't Markup Language) file. However, the parameter configuration of the YAML file is usually cumbersome, and the YAML files between different intelligent game engines lack unified standardization, which leads to low processing efficiency of directly parsing the YAML file. If the YAML file is converted into a JSON object or an XML file, the process of these two conversion methods is relatively complicated and the conversion efficiency is not high. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a method, device, equipment and storage medium for parsing a configuration file of an intelligent game engine, so as to improve the parsing efficiency of the configuration file of the intelligent game engine.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for parsing a configuration file of an intelligent gaming engine, comprising:

[0006] Obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file;

[0007] Generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file;

[0008] Generate a field name and field type of the target configuration class according to the configuration item, and generate an attribute value corresponding to the field name according to the configuration parameter;

[0009] The attribute rules corresponding to the configuration parameters are obtained, and the configuration parameters are verified based on the attribute rules. When all attribute values ​​are verified, the target configuration class is instantiated to obtain the configuration file parsing result.

[0010] In some embodiments, generating at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file includes:

[0011] Obtaining the configuration type of the configuration item of the at least one initial configuration YAML file;

[0012] Generate the target configuration class corresponding to all the configuration types;

[0013] The business configuration process of each of the initial configuration YAML files is determined according to the business logic, and the corresponding relationship between the initial configuration YAML file and the target configuration class is determined based on the business configuration process.

[0014] In some embodiments, generating the target configuration classes corresponding to all the configuration types includes:

[0015] When the configuration type is a meta-information configuration type, the engine meta-information configuration class is generated as the target configuration class; when the configuration type is a static configuration type, the engine static configuration information class is generated as the target configuration class; when the configuration type is a dynamic configuration type, the engine dynamic configuration information class is generated as the target configuration class.

[0016] In some embodiments, when the target configuration class is the engine dynamic configuration information class, generating the attribute value corresponding to the field name according to the configuration parameter includes:

[0017] Determine at least one configuration step from the configuration parameters, and obtain configuration information in the configuration step for passing to the next configuration step, wherein the configuration information is used to indicate an execution action of the next configuration step;

[0018] The configuration information of the configuration step is written into the attribute value corresponding to the field name.

[0019] In some embodiments, the acquiring the attribute rule corresponding to the configuration parameter and performing parameter verification on the configuration parameter based on the attribute rule includes:

[0020] Based on the business logic, obtain the attribute rule corresponding to the configuration parameter from the initial configuration YAML file, and obtain the type constraint, value range constraint and / or candidate value constraint from the attribute rule;

[0021] The parameter type of the configuration parameter is checked according to the type constraint, and / or at least one of the default value, maximum value and minimum value of the configuration parameter is checked based on the value range constraint, and / or the candidate value of the configuration parameter is checked based on the candidate value constraint.

[0022] In some embodiments, instantiating the target configuration class to obtain a configuration file parsing result includes:

[0023] Performing transactional operations on the target configuration class;

[0024] When the result of the transactional operation indicates that all are successfully executed, the configuration file parsing result is obtained according to the target configuration class, and when the result of the transaction indicates that all are rolled back, a parsing error conclusion is generated.

[0025] In some embodiments, obtaining the configuration file parsing result according to the target configuration class includes:

[0026] Instantiate the target configuration class to obtain a configuration class instance, serialize the configuration class instance to obtain the configuration file parsing result;

[0027] The parsing result of the configuration file is persistently stored.

[0028] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present application proposes a smart game engine configuration file parsing device, comprising:

[0029] Configuration data acquisition module: used to obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file;

[0030] Target configuration class generation module: used to generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file;

[0031] Attribute value filling module: used to generate the field name and field type of the target configuration class according to the configuration item, and generate the attribute value corresponding to the field name according to the configuration parameter;

[0032] Instantiation module: used to obtain the attribute rules corresponding to the configuration parameters, perform parameter verification on the configuration parameters based on the attribute rules, and when all attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result.

[0033] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0034] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0035] The intelligent game engine configuration file parsing method, device, equipment and storage medium proposed in the embodiment of the present application obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and the configuration parameters of each configuration item from the initial configuration YAML file, generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file, generate the field name of the target configuration class according to the configuration item, generate the attribute value corresponding to the field name according to the configuration parameter, obtain the attribute rule corresponding to the configuration parameter, perform parameter verification on the configuration parameter based on the attribute rule, and when all the attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result. The embodiment of the present application converts the initial configuration YAML file into the form of a class instance, and describes the configuration related information as a class object through the process of dynamic parsing and dynamic verification. Different from the conversion and parsing process of JSON or XML in the related art, which involves more string operations and data structure conversions, these processes are usually more complicated and have a large amount of calculation. In this embodiment, the data in the initial configuration YAML file is directly mapped to the attributes of the class object, thereby avoiding parsing each level one by one, and improving the processing speed and efficiency of configuration related data. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flowchart of the intelligent gaming engine configuration file parsing method provided in an embodiment of the present application.

[0037] Figure 2 It is a flowchart provided by an embodiment of the present application for generating at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file.

[0038] Figure 3 It is a schematic diagram of the target configuration class provided in the embodiment of the present application.

[0039] Figure 4 This is a flowchart of generating attribute values ​​corresponding to field names according to configuration parameters provided in an embodiment of the present application.

[0040] Figure 5 This is a flowchart of obtaining attribute rules corresponding to configuration parameters provided in an embodiment of the present application, and performing parameter verification on the configuration parameters based on the attribute rules.

[0041] Figure 6 It is a schematic diagram of the overall process of the intelligent gaming engine configuration file parsing method provided in an embodiment of the present application.

[0042] Figure 7 It is a schematic diagram of the application process of the intelligent game engine configuration file parsing method provided in an embodiment of the present application.

[0043] Figure 8 This is a structural block diagram of an intelligent gaming engine configuration file parsing device provided by another embodiment of the present application.

[0044] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0048] First, some nouns involved in this application are analyzed:

[0049] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0050] An intelligent game engine is an artificial intelligence computer system used to simulate and solve various types of game problems. It usually integrates multiple artificial intelligence algorithms such as machine learning, reinforcement learning, and deep learning to achieve modeling and optimization of complex game strategies. When developing an intelligent game engine, developers usually use a dedicated intelligent game engine development platform for training and learning. This process involves configuring the parameters of the intelligent game engine on the development platform.

[0051] The parameters of the smart game engine are usually stored in the form of a data serialization language (YAML Ain't Markup Language, YAML) file. However, the parameter configuration of the YAML file of the smart game engine is usually cumbersome, mainly because the parameter configuration of the smart game engine has the requirements of variable length and variable type, and the YAML files between different smart game engines lack unified standardization. In addition, if multiple YAML files appear in the configuration, all YAML files need to be read at one time to constrain each other, which leads to low parsing efficiency of YAML files during the development of the smart game engine.

[0052] In the related art, the parameters of the YAML file are usually converted into a new JSON object, thereby forming a new YAML file data structure. This method will not lose the information content in the YAML file, and can prevent file modification errors from causing system abnormalities. However, when converting a YAML file into a JSON object or XML file, due to the relatively free structure of YAML, when facing some YAML files with complex data volumes, the parsing and reading process of the YAML file in these two conversion methods becomes extremely slow, which will cause performance bottlenecks, low conversion efficiency, and prone to conversion errors.

[0053] Based on this, the embodiments of the present application provide a method, device, equipment and storage medium for parsing configuration files of an intelligent gaming engine, which converts the initial configuration YAML file into the form of a class instance, and describes the configuration-related information as a class object through a process of dynamic parsing and dynamic verification. Different from the related technologies such as JSON or XML, the conversion and parsing process involves more string operations and data structure conversions, which results in these processes being usually more complex and computationally intensive. In this embodiment, the data in the initial configuration YAML file is directly mapped to the attributes of the class object, thereby avoiding parsing each level one by one and improving the processing speed and efficiency of configuration-related data.

[0054] The embodiments of the present application provide a method, apparatus, device and storage medium for parsing a configuration file of an intelligent gaming engine, which are specifically described through the following embodiments. First, the method for parsing a configuration file of an intelligent gaming engine in the embodiments of the present application is described.

[0055] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0056] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0057] The intelligent game engine configuration file parsing method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The intelligent game engine configuration file parsing method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be a computer program running in a terminal or a server side. For example, a computer program can be a native program or software module in an operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a client that supports configuration file parsing, or it can be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plug-in. Among them, the terminal communicates with the server via a network. The intelligent game engine configuration file parsing method can be executed by a terminal or a server, or by a terminal and a server in collaboration.

[0058] In some embodiments, the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer or a smart watch. The server may be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; or a service node in a blockchain system, wherein each service node in the blockchain system forms a peer-to-peer (P2P, PeerTo Peer, P2P) network, and the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. The terminal and the server may be connected via Bluetooth, Universal Serial Bus (USB) or a network or other communication connection methods, which are not limited in this embodiment.

[0059] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0060] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0061] The following describes the intelligent gaming engine configuration file parsing method in an embodiment of the present application.

[0062] Figure 1 is an optional flowchart of the intelligent gaming engine configuration file parsing method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps 110 to 140. It can also be understood that this embodiment Figure 1 The order of step 110 to step 140 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0063] Step 110: Obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file.

[0064] In one embodiment, the learning process of the intelligent game engine can be managed by the intelligent game engine development platform. The development platform is capable of managing the intelligent game engines of different development teams, and only the initial configuration YAML file of the intelligent game engine needs to be uploaded to the platform. After that, the intelligent game engine development platform will parse these uploaded initial configuration YAML files in the background. It can be seen that the embodiment of the present application can perform the parsing process of the initial configuration YAML files in batches. It is understandable that this batch processing can cover multiple initial configuration YAML files of the same intelligent game engine, or multiple initial configuration YAML files corresponding to different intelligent game engines, etc. In the embodiment of the present application, there is no limit on the number of initial configuration YAML files.

[0065] In one embodiment, after obtaining at least one initial configuration YAML file of the intelligent gaming engine, the basic structure of the initial configuration YAML file is read and parsed using a related YAML processing library, and the configuration items and configuration parameters in each configuration item are extracted and mapped layer by layer.

[0066] Step 120: Generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file.

[0067] In one embodiment, for an intelligent game engine, if you want to ensure that the corresponding intelligent agent runs efficiently in the game environment, you need to follow the environment and rules of the game during the configuration process. For example, in a cooperative game, all intelligent agents share a global reward function and need to cooperate with each other to maximize the overall benefits. The adversarial game emphasizes the competitive relationship between intelligent agents. Therefore, each intelligent game engine has corresponding business logic, which can be reflected in the business configuration process of different initial configuration YAML files. Figure 2 , Figure 2This is a flowchart of generating at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file provided by an embodiment of the present application, which specifically includes the following steps:

[0068] Step 210: Obtain the configuration type of a configuration item of at least one initial configuration YAML file.

[0069] In one embodiment, for the intelligent game engine, the configuration items of the initial configuration YAML file are classified into multiple configuration types according to their functions, such as a meta-information configuration type, a static configuration type, and a dynamic configuration type.

[0070] Among them, the meta-information configuration type is used to describe the configuration of basic parameters in the intelligent game engine. Its main function is to provide the engine with the necessary basic information so that the engine can be loaded and run correctly. In this embodiment, the basic parameters can be the engine name and version number, code file directory, dependency library information or operating environment parameters, etc., where the engine name and version number are used to identify the game engine used and its version; the code file directory contains the storage location of the engine's source code, resource files and other related documents; the dependency library information is used to specify the third-party library and its version required by the engine; the operating environment parameters include the operating system type, the required hardware support (such as GPU acceleration), etc.

[0071] Among them, the static configuration type refers to information that will not change during the entire configuration process of the intelligent game engine. This information is usually the basic configuration of the engine, such as the basic algorithm logic of the engine, map list data in certain game projects, and other parameters. These parameters are fixed at compile time and will not change at runtime.

[0072] The dynamic configuration type will be determined according to the developer's choice. Different settings correspond to different dynamic configuration types. For example, changes in the number of participants may lead to different numbers and types of agents. For example, different simulation environments may lead to different actions performed by agents. It is understandable that in the configuration process of an intelligent game engine, the dynamic configuration type is set according to demand, that is, the dynamic configuration type may or may not appear in the business configuration process.

[0073] Step 220: Generate target configuration classes corresponding to all configuration types.

[0074] In one embodiment, for each configuration type, a target configuration class is set according to the development language of the intelligent game engine development platform, such as a Java class object. When the configuration type is a meta information configuration type, the engine meta information configuration class is generated as the target configuration class. When the configuration type is a static configuration type, the engine static configuration information class is generated as the target configuration class. When the configuration type is a dynamic configuration type, the engine dynamic configuration information class is generated as the target configuration class.

[0075] In one embodiment, the target configuration class is also easy to expand and maintain. When the structure of the initial configuration YAML file changes, the objectified data structure of the target configuration class is easier to adjust and expand, and the updated content can be quickly adapted by modifying the attribute values ​​of the object.

[0076] It is understandable that, during a parsing process, the number of target configuration classes is determined according to the initial configuration YAML file. In addition, even the same configuration type may correspond to more than one target configuration class, for example, multiple target configuration classes may be configured simultaneously using parallel processing. It can be seen that the embodiment of the present application does not limit the number of target configuration classes.

[0077] Step 230: Determine the business configuration process of each initial configuration YAML file according to the business logic, and determine the corresponding relationship between the initial configuration YAML file and the target configuration class based on the business configuration process.

[0078] In one embodiment, under different business logics, the business configuration process of the configuration items in the initial configuration YAML file may be in different orders, so the correspondence between the initial configuration YAML file and the target configuration class is determined according to the business configuration process. It is understandable that in an embodiment of the present application, the relationship between the initial configuration YAML file and the target configuration class is not a one-to-one correspondence, but a many-to-many relationship. This means that an initial configuration YAML file may contain relevant configuration information of multiple target configuration classes, and at the same time, a target configuration class may also be composed of the configuration information of multiple initial configuration YAML files. If the same attribute of the same target configuration class is repeatedly configured by different initial configuration YAML files, the attribute value applied last will overwrite the previously set value.

[0079] In one embodiment, referring to Figure 3 , Figure 3 It is a schematic diagram of the target configuration class provided in the embodiment of the present application. Figure 3 In the following, three initial configuration YAML files and two different target configuration classes are used as examples to illustrate the correspondence between the two. The target configuration classes are the engine static configuration information class and the engine dynamic configuration information class. Figure 3As shown, for different initial configuration YAML files, the configuration data related to the corresponding static configuration type and dynamic configuration type need to be extracted respectively. Then sort these data according to the business logic. According to the sorting results, the configuration data of the static configuration type is corresponded to the engine static configuration information class in turn, and the configuration data of the dynamic configuration type is corresponded to the engine dynamic configuration information class in turn. In this way, an initial configuration YAML file can correspond to the two target configuration classes of the engine static configuration information class and the engine dynamic configuration information class respectively, and each engine configuration information class (whether static or dynamic) can be configured by multiple initial configuration YAML files.

[0080] Step 130: Generate the field name and field type of the target configuration class according to the configuration item, and generate the attribute value corresponding to the field name according to the configuration parameter.

[0081] In one embodiment, after determining the correspondence between the initial configuration YAML file and the target configuration class, the content of the target configuration class is filled according to the configuration items in the initial configuration YAML file and the configuration parameters corresponding to the configuration items. In this embodiment, the filling process includes two parts, the first part uses the configuration items to fill the field names and field types of the target configuration class, and the second part generates the attribute values ​​corresponding to the field names according to the configuration parameters.

[0082] In one embodiment, each configuration item in the initial configuration YAML file will be reflected by a corresponding field name in the target configuration class, so the number of fields corresponds to the configuration items. In addition, the field type of the field, that is, the data type, is determined according to the data type of the configuration item.

[0083] In one embodiment, the field name needs to be converted according to actual needs. For example, the configuration items in the initial configuration YAML file are named in the "all lowercase + underscore" format, such as database_url. When converting it into the field name in the target configuration class, it is necessary to convert it according to the corresponding language specification. Taking the target configuration class as a Java class object as an example, the field name of the target configuration class is named in camel case, that is, the first letter is lowercase and the first letter of subsequent words is uppercase, such as databaseUrl. The purpose of converting between field names and configuration item names in the embodiment of the present application is to improve the readability and consistency of the parsing process, so that the naming style of configuration items in different initial configuration YAML files is consistent after conversion to the target configuration class.

[0084] In one embodiment, after the field name and field type of the target configuration class are filled, the configuration parameters corresponding to the configuration items are used to fill in the attribute values ​​corresponding to the field names.

[0085] For static configuration types and meta-information configuration types, the configuration parameters of the configuration items are filled into the fields corresponding to the field names as attribute values.

[0086] Refer to the following example of the static configuration type section of the initial configuration YAML file:

[0087]

[0088] Among them, "-name" is used to indicate the name of the configuration item, "type" is used to indicate the data type of the configuration item, "default_value" is used to indicate the default value of the configuration parameter, "min_value" is used to indicate the minimum value of the configuration parameter, and "max_value" is used to indicate the maximum value of the configuration parameter.

[0089] For the filling process in the above example, it is necessary to set a field named "players" in the target configuration class, with a field type of "int". At the same time, some variables are used to store the default value "2", the minimum value "1" and the maximum value "4". After the filling is completed, the attribute value of the field is obtained.

[0090] In one embodiment, considering the particularity of the intelligent game engine, there are often different configuration steps when configuring in the dynamic configuration type, and the configuration steps are associated with each other. Therefore, the additional information brought by the configuration steps needs to be considered when filling. Different from the YAML file in the related art, the embodiment of the present application adds additional configuration information as special filling content to the configuration items of the dynamic configuration type of the initial configuration YAML file. Therefore, when the target configuration class is the engine dynamic configuration information class, it is also necessary to obtain the configuration information therein. Figure 4 , Figure 4 This is a flowchart of generating attribute values ​​corresponding to field names according to configuration parameters provided by an embodiment of the present application, which specifically includes the following steps:

[0091] Step 410: Determine at least one configuration step from the configuration parameters, and obtain configuration information in the configuration step for passing to the next configuration step.

[0092] Step 420: Write the configuration information of the configuration step into the attribute value corresponding to the field name.

[0093] In one embodiment, some configuration steps are used to indicate different actions, so a configuration information is set in the configuration step to indicate the execution action of the next configuration step.

[0094] See the following example of the dynamic configuration type section in the initial configuration YAML file:

[0095] -name:env_id

[0096] type:str

[0097] default_value:"adversarial_pursuit_v4"

[0098] choices:${ALL_ENV_NAMES}

[0099] Tips: "Choose a simulation environment supported by an agent, such as adversarial_pursuit_v4, etc."

[0100] -name:anonymous

[0101] type:bool

[0102] default_value:true

[0103] Tips: "Choose whether to log in to Slumbot in anonymous mode. If true, you do not need to enter your account name and password."

[0104] -rule:"${anonymous}==false"

[0105] key:SlumbotConfigStep3

[0106] -rule:"${anonymous}==true"

[0107] key:"SlumbotConfigStep4"

[0108] -rule:"${env_id}=='adversarial_pursuit_v4'"

[0109] key:"APConfigStep"

[0110] Among them, "env_id" is a string type configuration item, which is used to indicate the configuration step of selecting the simulation environment. Its default value is "adversarial_pursuit_v4". "choices" is used to indicate the list of optional values. The optional values ​​corresponding to the simulation environment come from the ${ALL_ENV_NAMES} list. "tips" is used to indicate the operation prompt information. "adversarial_pursuit_v4" indicates an optional simulation environment. "anonymous" is a Boolean type configuration item, which is used to indicate whether to perform the configuration step in anonymous mode. Its default value is true. The prompt information indicates whether to log in to Slumbot in anonymous mode. If true, you do not need to enter the account name and password.

[0111] Among them, "-rule:"${anonymous}==false"key:SlumbotConfigStep3" is a regular expression. If anonymous is equal to false, the operation associated with SlumbotConfigStep3 is executed. "-rule:"${anonymous}==true"key:"SlumbotConfigStep4"" is a regular expression. If anonymous is equal to true, the operation associated with SlumbotConfigStep4 is executed. "-rule:"${env_id}=='adversarial_pursuit_v4'"key:APConfigStep" is a regular expression. If the adversarial_pursuit_v4 simulation environment is selected, the operation associated with APConfigStep is executed.

[0112] In one embodiment, for a configuration item of a dynamic configuration type, it can be agreed that the existing configuration information is written into the configuration parameter corresponding to the default value. Two configuration steps are illustrated, namely the configuration step "env_id" and the configuration step "anonymous", where the configuration information corresponding to "env_id" is "no-limit-texas-holdem", which is used to indicate that the operation associated with APConfigStep is performed in the next configuration step "anonymous". The configuration information corresponding to "anonymous" is "true", which is used to indicate that the operation associated with SlumbotConfigStep4 needs to be performed in the next configuration step.

[0113] Combined with the above steps, other configuration information in the configuration process is also described as the attribute value corresponding to the field name, so as to complete the filling of all field attribute values, and then obtain the target configuration class. Considering that if the target configuration class does not meet the configuration specifications or the attribute value cannot be read, the corresponding initial configuration YAML file may not be successfully parsed and applied to the smart game engine. In addition, if there are specific format problems in the target configuration class, it may also cause the smart game engine to fail to work properly. Therefore, the attribute values ​​of the target configuration class are verified next to ensure the reliability and efficiency of the smart game engine in actual operation.

[0114] Step 140: Obtain the attribute rules corresponding to the configuration parameters, perform parameter verification on the configuration parameters based on the attribute rules, and when all attribute values ​​pass the verification, instantiate the target configuration class to obtain the configuration file parsing result.

[0115] In one embodiment, after the attribute values ​​corresponding to the field names are filled, the attribute values ​​need to be verified. Figure 5 , Figure 5 This is a flowchart of obtaining attribute rules corresponding to configuration parameters provided by an embodiment of the present application, and performing parameter verification on the configuration parameters based on the attribute rules, which specifically includes the following steps:

[0116] Step 510: Based on the business logic, obtain the attribute rules corresponding to the configuration parameters from the initial configuration YAML file, and obtain the type constraints and value range constraints from the attribute rules.

[0117] In one embodiment, under different business logics, the attribute rules of the configuration parameters may be different. The attribute rules are similar to a set of defined constraints, which are used to ensure that the data in the configuration parameters meet specific conditions. For example, the value of a configuration parameter must be a number, within a certain range, or a string in a specific format.

[0118] It is understandable that in the embodiment of the present application, the attribute rules corresponding to different configuration parameters in the initial configuration YAML file are read based on the business logic to automatically verify the attribute value, which is equivalent to referring to the pre-defined constraint relationship in the initial configuration YAML file to check whether the actual attribute value meets the requirements when the business logic is executed. For example, if the type of a configuration item is int type, then its minimum and maximum values ​​should also be configured as int type. If the type of a configuration item is choice type, then the corresponding attribute value must give a set of options. In this way, the intelligent game engine ensures that the loaded attribute values ​​are accurate and valid, avoids configuration errors caused by incorrect attribute values, and thus avoids runtime errors or abnormal operation behavior.

[0119] In one embodiment, the attribute rule includes three constraints, namely, type constraint, value range constraint and candidate value constraint. Among them, the type constraint is used to clarify the data type of each attribute value, such as integer (int), floating point number (float) and string (string). For example, if an attribute value represents a game score, then the attribute value should be an integer type to ensure that the score is an accurate value, not a decimal or text. The value range constraint is used to set a value range for the attribute value, which helps to maintain the attribute value within a reasonable limit and prevent abnormal values ​​from interfering with the operation of the intelligent game engine. For example, the attribute value represents the number of moves in a board game, and its value range should be limited to a reasonable number of steps, such as 1 to 10, to prevent the number of steps exceeding the game rules from being input. For some attribute values, it may correspond to a set of candidate values, which are specific options that the attribute value can take, and the possible values ​​of the attribute value are further limited by the candidate value to meet expectations. For example, if the attribute value represents the type of chess piece, the candidate value can be "king", "queen", "elephant", etc., to ensure the correctness and consistency of the chess piece type.

[0120] Step 520: Check the parameter type of the configuration parameter based on the type constraint, and / or check at least one of the default value, maximum value and minimum value of the configuration parameter based on the value range constraint, and / or check the candidate value of the configuration parameter based on the candidate value constraint.

[0121] In one embodiment, the above three constraint conditions are checked respectively to check whether the parameter type of the configuration parameter satisfies the type constraint, and to check whether the default value, maximum value and minimum value of the configuration parameter satisfy the value range constraint, and to check whether the candidate value of the configuration parameter satisfies the candidate value constraint. It can be understood that one of these three checks can be selected or all can be selected for checking, and the selection of the checking process is set according to actual needs.

[0122] In one embodiment, when all attribute values ​​are verified, the target configuration class is considered to be filled completely and correctly, that is, the target configuration class of the intelligent game engine is obtained. If the verification fails, the developer will be informed that the parsing failed. It is understandable that the target configuration class finally generated will vary depending on the specific configuration of the intelligent game engine.

[0123] In one embodiment, after obtaining the target configuration class, the target configuration class needs to be instantiated to obtain the configuration file parsing result, which specifically includes: performing a transactional operation on the target configuration class, and when the result of the transactional operation indicates that all are successfully executed, obtaining the configuration file parsing result according to the target configuration class, and when the result of the transactional operation indicates that all are rolled back, generating a parsing error conclusion.

[0124] Among them, transactionalization is a set of operations that treat the target configuration class as a whole unit, either all executed successfully or all rolled back, using this feature to ensure the data consistency and integrity of the target configuration class. Therefore, when the target configuration class is transactionalized, if all executed successfully, the configuration file parsing result is obtained according to the target configuration class at this time. Otherwise, all rolled back, indicating that an error occurred during the execution of the target configuration class, so a parsing error conclusion is generated. By introducing transactional operations as an error handling mechanism, the parsing error conclusion is obtained through detailed error information, thereby improving the stability of the parsing result.

[0125] In one embodiment, the process of obtaining the configuration file parsing result according to the target configuration class specifically includes: instantiating the target configuration class to obtain the configuration class instance, serializing the configuration class instance to obtain the configuration file parsing result, and persistently storing the configuration file parsing result.

[0126] In one embodiment, instantiating the target configuration class refers to creating an instance object of the target configuration class, where the target configuration class can be understood as a template for defining an object, and instantiation is to convert this template into a specific instance object. Through the instantiation process, the target configuration class corresponding to the initial configuration YAML file is converted into a configuration class instance corresponding to the language required by the developer.

[0127] It can be understood that the obtained configuration class instance can be reused in the code, and the configuration process of the intelligent game engine is modularized by encapsulating data as objects, thereby reducing development costs and maintenance costs.

[0128] Next, according to the storage requirements, the serialization library (such as Java's ObjectOutputStream) is used to convert the configuration class instance into a byte stream, and the byte stream is used as the configuration file parsing result. The file or object database is used to persistently store the configuration file parsing result, so that even if the intelligent game engine is restarted, the corresponding configuration information will not be lost. It is understandable that different application scenarios can select different serialization methods, and this embodiment does not limit this.

[0129] In addition, in the subsequent process, the serialized configuration file parsing result can be obtained directly by calling the database or reading the file. It can also be deserialized into a configuration class instance according to the usage requirements. Deserialization refers to reading the byte stream corresponding to the configuration file parsing result and converting it back to the original class object structure, and then performing the display light operation on the deserialized configuration class instance. Compared with formats such as JSON and XML, the serialization and deserialization process based on the target configuration class in the embodiment of the present application is less time-consuming and more efficient.

[0130] In one embodiment, referring to Figure 6 , Figure 6 It is a schematic diagram of the overall process of the intelligent gaming engine configuration file parsing method provided in an embodiment of the present application.

[0131] Reference Figure 6 , first obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and the configuration parameters of each configuration item from the initial configuration YAML file. For the intelligent game engine, the configuration items of the initial configuration YAML file are classified into multiple configuration types according to their functions, such as meta information configuration type, static configuration type and dynamic configuration type. Therefore, the corresponding target configuration class is generated for these three configuration types. When the configuration type is the meta information configuration type, the engine meta information configuration class is generated as the target configuration class. When the configuration type is the static configuration type, the engine static configuration information class is generated as the target configuration class. When the configuration type is the dynamic configuration type, the engine dynamic configuration information class is generated as the target configuration class. Next, the business configuration process of each initial configuration YAML file is determined according to the business logic, and the corresponding relationship between the initial configuration YAML file and the target configuration class is determined based on the business configuration process. After determining the corresponding relationship between the initial configuration YAML file and the target configuration class, the content of the target configuration class is filled according to the configuration items in the initial configuration YAML file and the configuration parameters corresponding to the configuration items. The filling process consists of two parts. The first part uses the configuration items to fill the field names and field types of the target configuration class. The second part generates the attribute values ​​corresponding to the field names according to the configuration parameters. After the filling is completed, the attribute rules corresponding to the configuration parameters are obtained, and the configuration parameters are checked based on the attribute rules. When all attribute values ​​are checked, the target configuration class is instantiated to obtain the configuration class instance, the configuration class instance is serialized, the configuration file parsing results are obtained, and the configuration file parsing results are persistently stored.

[0132] The parsing process of the embodiment of the present application eliminates the need to directly operate dictionaries or lists by accessing the properties or methods of objects, reduces the degree of hard coding required for normal parsing, and reduces potential errors caused by directly operating the data structure of the initial configuration YAML file. It can also adapt to complex nested structures. When processing complex nested structures, object-oriented processing can more clearly express the relationship between data. Through the intelligent game engine configuration file parsing method of the embodiment of the present application, the reading efficiency of the initial configuration YAML file can be improved, making the configuration process in the intelligent game engine configuration and application scenarios more convenient and efficient.

[0133] Reference Figure 7 , Figure 7 Schematic diagram of the application process of the intelligent game engine configuration file parsing method provided in the embodiment of the present application. Figure 7The learning process of the intelligent game engine can be managed through the intelligent game engine development platform. The development platform can manage the intelligent game engines of different development teams. You only need to upload the initial configuration YAML file of the intelligent game engine to the platform. After that, the intelligent game engine development platform will parse these uploaded initial configuration YAML files in the background, obtain the configuration file parsing results, and store them persistently. When visual operations are required, read the configuration file parsing results and deserialize them into configuration class instances, and then display the configuration class instances in Figure 7 On the interface of the development platform shown.

[0134] As can be seen from the above, the embodiment of the present application has an intuitive data access process. After the initial configuration YAML file is classified, the final configuration file parsing result can be directly accessed and operated in an object-oriented manner. This method not only improves the code readability and maintainability of the intelligent game engine, but also makes the data structure of the initial configuration YAML file more intuitive and easy for developers to understand.

[0135] The technical solution provided by the embodiment of the present application is to obtain at least one initial configuration YAML file of the intelligent game engine, extract at least one configuration item and the configuration parameters of each configuration item from the initial configuration YAML file, generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file, generate the field name of the target configuration class according to the configuration item, generate the attribute value corresponding to the field name according to the configuration parameter, obtain the attribute rule corresponding to the configuration parameter, perform parameter verification on the configuration parameter based on the attribute rule, and when all the attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result. The embodiment of the present application converts the initial configuration YAML file into the form of a class instance, and describes the configuration related information as a class object through the process of dynamic parsing and dynamic verification. Different from the related art, the conversion and parsing process of JSON or XML involves more string operations and data structure conversions, which leads to these processes being usually more complicated and computationally intensive. In this embodiment, the data in the initial configuration YAML file is directly mapped to the attributes of the class object, thereby avoiding parsing each level one by one, and improving the processing speed and efficiency of configuration related data.

[0136] The embodiment of the present application also provides a smart game engine configuration file parsing device, which can implement the above-mentioned smart game engine configuration file parsing method, referring to Figure 8 , the device comprises:

[0137] Configuration data acquisition module 810: used to obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file.

[0138] Target configuration class generation module 820: used to generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file.

[0139] Attribute value filling module 830: used to generate the field name and field type of the target configuration class according to the configuration item, and generate the attribute value corresponding to the field name according to the configuration parameter.

[0140] Instantiation module 840: used to obtain the attribute rules corresponding to the configuration parameters, perform parameter verification on the configuration parameters based on the attribute rules, and when all attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result.

[0141] The specific implementation of the intelligent game engine configuration file parsing device of this embodiment is basically the same as the specific implementation of the intelligent game engine configuration file parsing method described above, and will not be repeated here.

[0142] The present application also provides an electronic device, including:

[0143] at least one memory;

[0144] at least one processor;

[0145] at least one program;

[0146] The program is stored in the memory, and the processor executes the at least one program to implement the intelligent gaming engine configuration file parsing method implemented in the present application. The electronic device can be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.

[0147] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0148] The processor 801 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0149] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the intelligent game engine configuration file parsing method of the embodiment of this application;

[0150] Input / output interface 803, used to implement information input and output;

[0151] Communication interface 804, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and

[0152] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);

[0153] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .

[0154] An embodiment of the present application also provides a storage medium, which is a storage medium that stores a computer program. When the computer program is executed by a processor, the above-mentioned intelligent game engine configuration file parsing method is implemented.

[0155] As a non-transitory storage medium, the memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0156] The intelligent game engine configuration file parsing method, device, equipment and storage medium proposed in the embodiment of the present application obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and the configuration parameters of each configuration item from the initial configuration YAML file, generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file, generate the field name of the target configuration class according to the configuration item, generate the attribute value corresponding to the field name according to the configuration parameter, obtain the attribute rule corresponding to the configuration parameter, perform parameter verification on the configuration parameter based on the attribute rule, and when all the attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result. The embodiment of the present application converts the initial configuration YAML file into the form of a class instance, and describes the configuration related information as a class object through the process of dynamic parsing and dynamic verification. Different from the conversion and parsing process of JSON or XML in the related art, which involves more string operations and data structure conversions, these processes are usually more complicated and have a large amount of calculation. In this embodiment, the data in the initial configuration YAML file is directly mapped to the attributes of the class object, thereby avoiding parsing each level one by one, and improving the processing speed and efficiency of configuration related data.

[0157] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0158] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0159] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0160] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0161] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0162] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0163] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0164] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store programs.

[0167] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for parsing a configuration file of an intelligent gaming engine, characterized in that: include: Obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file; Generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file; Generate a field name and field type of the target configuration class according to the configuration item, and generate an attribute value corresponding to the field name according to the configuration parameter; The attribute rules corresponding to the configuration parameters are obtained, and the configuration parameters are verified based on the attribute rules. When all attribute values ​​are verified, the target configuration class is instantiated to obtain the configuration file parsing result.

2. The intelligent game engine configuration file parsing method according to claim 1, characterized in that: The generating at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file includes: Obtaining the configuration type of the configuration item of the at least one initial configuration YAML file; Generate the target configuration class corresponding to all the configuration types; The business configuration process of each of the initial configuration YAML files is determined according to the business logic, and the corresponding relationship between the initial configuration YAML file and the target configuration class is determined based on the business configuration process.

3. The intelligent game engine configuration file parsing method according to claim 2, characterized in that: The generating the target configuration class corresponding to all the configuration types includes: When the configuration type is a meta-information configuration type, the engine meta-information configuration class is generated as the target configuration class; when the configuration type is a static configuration type, the engine static configuration information class is generated as the target configuration class; when the configuration type is a dynamic configuration type, the engine dynamic configuration information class is generated as the target configuration class.

4. The intelligent game engine configuration file parsing method according to claim 3, characterized in that: When the target configuration class is the engine dynamic configuration information class, generating the attribute value corresponding to the field name according to the configuration parameter includes: Determine at least one configuration step from the configuration parameters, and obtain configuration information in the configuration step for passing to the next configuration step, wherein the configuration information is used to indicate an execution action of the next configuration step; The configuration information of the configuration step is written into the attribute value corresponding to the field name.

5. The intelligent game engine configuration file parsing method according to claim 1, characterized in that: The acquiring the attribute rule corresponding to the configuration parameter and performing parameter verification on the configuration parameter based on the attribute rule includes: Based on the business logic, obtain the attribute rule corresponding to the configuration parameter from the initial configuration YAML file, and obtain the type constraint, value range constraint and / or candidate value constraint from the attribute rule; The parameter type of the configuration parameter is checked according to the type constraint, and / or at least one of the default value, maximum value and minimum value of the configuration parameter is checked based on the value range constraint, and / or the candidate value of the configuration parameter is checked based on the candidate value constraint.

6. The intelligent game engine configuration file parsing method according to claim 1, characterized in that: The instantiation of the target configuration class to obtain the configuration file parsing result includes: Performing transactional operations on the target configuration class; When the result of the transactional operation indicates that all are successfully executed, the configuration file parsing result is obtained according to the target configuration class, and when the result of the transaction indicates that all are rolled back, a parsing error conclusion is generated.

7. The intelligent game engine configuration file parsing method according to claim 1, characterized in that: The obtaining the configuration file parsing result according to the target configuration class includes: Instantiate the target configuration class to obtain a configuration class instance, serialize the configuration class instance to obtain the configuration file parsing result; The parsing result of the configuration file is persistently stored.

8. An intelligent game engine configuration file parsing device, characterized in that: include: Configuration data acquisition module: used to obtain at least one initial configuration YAML file of the intelligent game engine, and extract at least one configuration item and configuration parameters of each configuration item from the initial configuration YAML file; Target configuration class generation module: used to generate at least one target configuration class according to the business logic and the configuration type of the configuration item in the initial configuration YAML file; Attribute value filling module: used to generate the field name and field type of the target configuration class according to the configuration item, and generate the attribute value corresponding to the field name according to the configuration parameter; Instantiation module: used to obtain the attribute rules corresponding to the configuration parameters, perform parameter verification on the configuration parameters based on the attribute rules, and when all attribute values ​​are verified, instantiate the target configuration class to obtain the configuration file parsing result.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the intelligent game engine configuration file parsing method according to any one of claims 1 to 7 when executing the computer program.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the intelligent gaming engine configuration file parsing method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Chip verification method, device and system

    CN120030961A