A data processing method, device, equipment, storage medium and product
By displaying the interactive interface in the game database, receiving protocol files and compiling and generating dynamic link library files, it solves the problem of low data acquisition and construction efficiency in the game database, and achieves visual display and efficient testing of data.
Patent Information
- Application Number
- CN202210007957.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-04
AI Technical Summary
In the existing technology, the process of obtaining and constructing game database data requires developers to manually provide GM commands, which is labor-intensive, time-consuming, and inefficient.
Receive the protocol file of the new game project by displaying the interactive interface, compile and generate the code file, compile the application program interface of the game database into a dynamic link library file, call the dynamic link library file to access the application program interface, obtain and display the target data in the database table , to achieve data visualization.
It greatly improves the testing efficiency, enables test students to easily perform data construction, including query, modification and deletion operations, and simplifies the management and testing process of game database data.
Smart Images

Figure CN114356341B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data processing method, a data processing device, an electronic device, a computer-readable storage medium, and a computer product. Background Art
[0002] The game manager (GM) is the person in charge of hosting the game or supervising the player's behavior and maintaining the game environment. The game data is stored in the game database. When the game needs to be tested, the data needs to be obtained from the game database and constructed. In related technologies, this is achieved by developers providing GM commands, which consumes manpower and time. Summary of the invention
[0003] In order to solve the above technical problems, the embodiments of the present application provide a data processing method, an information processing device, an electronic device, a computer-readable storage medium and a computer program product, which display the data of the corresponding database table, realize data visualization in the game database, and then testers can easily construct data, greatly improving the testing efficiency.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, comprising: displaying an interactive interface, and when a new game project is accessed, receiving a protocol file of the new game project through the interactive interface, the protocol file being used to define a database table in the new game project, and the database table being stored in a game database; compiling the protocol file to generate a code file written in a preset programming language; compiling an application program interface of the game database into a dynamic link library file according to the code file; when an edit request for data in the database table is received through the interactive interface, calling the dynamic link library file to access the application program interface, and obtaining target data in the database table corresponding to the edit request through the application program interface, and displaying the target data on the interactive interface.
[0006] According to one aspect of an embodiment of the present application, a data processing device is provided, comprising: a display module for displaying an interactive interface; a receiving module for receiving a protocol file of a new game project when a new game project is accessed, the protocol file being used to define a database table in the new game project, the database table being stored in a game database; a file compilation module for compiling the protocol file to generate a code file written in a preset programming language; an interface compilation module for compiling an application program interface of the game database into a dynamic link library file according to the code file; a calling module for calling the dynamic link library file to access the application program interface when an editing request for data in the database table is received through the interactive interface, and obtaining target data in the database table corresponding to the editing request through the application program interface; the display module is also used to display the target data on the interactive interface.
[0007] In one embodiment of the present application, the data processing device also includes an establishment module, which is used to establish a mapping relationship between the new game project and the database table when the database table of the new game project has the same table name as the database table of other game projects and the table structure of the database table is different, and store the mapping relationship in the game database.
[0008] In one embodiment of the present application, the calling module includes an analysis unit and an assignment unit; the analysis unit is used to analyze the request data carried by the editing request according to the table structure of the database table to obtain the field type of the request data; the assignment unit is used to traverse the field values in the database table if the field type of the request data is a large file field in a non-serialized structured data format in a cross-platform multi-language data representation protocol, and use the field value corresponding to the request data as the target data.
[0009] In one embodiment of the present application, the mapping relationship also includes a protocol path of the protocol file, and the assignment unit is also used to determine the protocol file corresponding to the large file field in the serialized structure data format according to the protocol path of the mapping relationship in the database if the field type of the request data is a large file field in a serialized structure data format in a cross-platform multi-language data representation protocol, parse the request data according to the protocol file, obtain the correspondence between the field name and the field value corresponding to the request data, determine the field value corresponding to the field name in the database table according to the correspondence, and use the field value as the target data.
[0010] In one embodiment of the present application, the file compilation module is further used to replace the table name of the database table according to the mapping relationship to generate a new protocol file; compile the new protocol file to generate a code file written in a preset programming language.
[0011] In one embodiment of the present application, the interface compilation module is further used to add the code file to the game database so that the application interface of the game database calls the code file; encapsulates the application interface after calling the code file to obtain a target interface; and compiles the target interface into the dynamic link library file.
[0012] In one embodiment of the present application, the display module is further used to perform a serialization operation on the target data to obtain binary data; after performing a deserialization operation on the binary data, the data is visually displayed on the interactive interface.
[0013] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the data processing method as described above.
[0014] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the data processing method as described above.
[0015] According to one aspect of an embodiment of the present application, a computer program product is provided, including computer instructions, which implement the data processing method as described above when executed by a processor.
[0016] In the technical solution provided in the embodiments of the present application, an interactive interface is displayed, and a protocol file of a new game project is received through the interactive interface. The protocol file is compiled to generate a code file, and then the application program interface of the game database is compiled into a dynamic link library file through the code file, so that the dynamic link library file can be called, the application program interface can be accessed, and the data in the game database can be obtained and then output and displayed on the interactive interface, that is, the data of the corresponding database table is displayed, so as to realize data visualization in the game database, so that test students can conveniently construct data, which is convenient and greatly improves the testing efficiency.
[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0019] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0020] Figure 2 is a flow chart of a data processing method shown in an exemplary embodiment of the present application;
[0021] Figure 3 yes Figure 2 A schematic diagram of the flow of step S120 in the illustrated embodiment;
[0022] Figure 4 yes Figure 2 A schematic flow chart of step S130 in the illustrated embodiment;
[0023] Figure 5 for Figure 2 A schematic diagram of a process of acquiring target data in step S140 in the illustrated embodiment;
[0024] Figure 6 yes Figure 2 A schematic diagram of another process of acquiring target data in step S140 in the illustrated embodiment;
[0025] Figure 7 yes Figure 2 A schematic diagram of a flow chart of displaying target data on an interactive interface in step S140 in the illustrated embodiment;
[0026] Figure 8 is a schematic diagram of project access configuration shown in an exemplary embodiment of the present application;
[0027] Fig. 9 is a schematic diagram of an interface for protocol importing shown in an exemplary embodiment of the present application;
[0028] Fig.10 is a flow chart of a data processing method shown in another exemplary embodiment of the present application;
[0029] Fig.11 It is an overall framework diagram of a data processing method provided by an exemplary embodiment of the present application;
[0030] Fig.12 It is a schematic diagram of an interface of data in a database table for visual display shown in an exemplary embodiment of the present application;
[0031] Fig.13 is a schematic diagram of a process of obtaining target data shown in another exemplary embodiment of the present application;
[0032] Fig.14 It is a flowchart of compiling tcaplus.so shown in an exemplary embodiment of the present application;
[0033] Fig.15 is a schematic diagram of a data processing device shown in an exemplary embodiment of the present application;
[0034] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0035] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0037] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0038] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0039] Here, the abbreviations and key term definitions related to this application are introduced:
[0040] Protocol, the data format of the game database referred to in the embodiment of the present application. Network protocol refers to a set of rules, standards or agreements established for data exchange in a computer network. Protocol is a term used to describe the rules for exchanging information between processes. In a computer network, two entities that communicate with each other are in different geographical locations. The two processes on them communicate with each other and need to coordinate their actions by exchanging information to achieve synchronization. The exchange of information must be carried out in accordance with pre-agreed rules.
[0041] Pb, Protocol Buffer, is an open source protocol format developed by Google.
[0042] TDR:TSF4G Data Represention, a protocol format developed by Tencent Games.
[0043] Tcaplus: Game database is a distributed NoSQL data storage service designed by Tencent specifically for games.
[0044] See also Figure 1 , Figure 1 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a terminal 10 and a game database 20, and the terminal 10 and the game database 20 communicate with each other via a wired or wireless network.
[0045] Among them, a visual editing tool is running on the terminal 10, and the visual editing tool is used to display an interactive interface. When a new game project is connected, the protocol file of the new game project is received through the interactive interface, and the protocol file is compiled to generate a code file written in a preset programming language; according to the code file, the application program interface of the game database is compiled into a dynamic link library file, and when an editing request for data in the database table is received through the interactive interface, the dynamic link library file is called to access the application program interface, and the target data corresponding to the editing request in the database table is obtained through the application program interface, and the target data is displayed on the interactive interface.
[0046] The game database is used to store data corresponding to game items through database tables.
[0047] Among them, the visual editing tool can be a test application, website or platform, running on the terminal 10, and the terminal 10 can be an electronic device such as a smart phone, a tablet, a laptop, a computer, an intelligent voice interaction device, a smart home appliance, a car terminal, etc.; the game database 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, 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, CDN (Content Delivery Network) and big data and artificial intelligence platforms, and no restrictions are imposed here.
[0048] like Figure 2 As shown, Figure 2 is a flowchart of a data processing method according to an exemplary embodiment. The method can be applied to Figure 1 The implementation environment shown in Figure 1 The terminal in the embodiment environment shown is specifically executed. The data processing method may include steps S110 to S140, which are described in detail as follows:
[0049] S110, displaying an interactive interface. When a new game project is connected, a protocol file of the new game project is received through the interactive interface. The protocol file is used to define a database table in the new game project. The database table is stored in a game database.
[0050] In one embodiment of the present application, the interactive interface is a channel for information exchange between people and computers. Users input information and perform operations to the computer through the interactive interface, and the computer provides information to the user through the interactive interface for reading, analysis and judgment. After the interactive interface is displayed, when a new game project is accessed, the protocol file of the new game project is received through the interactive interface; wherein, the new game project refers to the game, accessing the new game project refers to adding relevant information of the new game project, and accessing the new game project can be accessed through the interactive interface, such as adding the server name of the new game project on the interactive interface, the access ID of the cluster in the game database, the table group ID, the access address, etc.; wherein, the cluster is the basic management unit of the game database, which is responsible for providing independent data storage services for the business; the table group is the logical isolation scheme of the game database, which represents a data partition that can isolate different tables; the table group ID is required when connecting to the database; accessing the new game project can also be the game server sending the relevant content of the new game project to the terminal, and then the terminal receives the relevant content and obtains the information of the new game project.
[0051] After accessing a new game project, the protocol file of the new game project is received through the interactive interface. For example, the user imports the protocol file of the new game project through the controls on the interactive interface, and then the client terminal receives the protocol file of the new game project. The protocol file is used to define the database table in the new game project. The database represents that the table is an object used to store data in the database. It is a collection of structured data, and from the perspective of the game business, a table can be responsible for a related data set of a business module, such as a user table and a prop table. The protocol file is used to define the table structure of the database table and the data protocol supported by the database table. The table structure includes three parts: table name, fields in the table, and records in the table. Among them, a collection of multiple field values of the same object is called a record. A field describes a certain feature of a specified object.
[0052] In one embodiment of the present application, the database table is stored in a game database. Optionally, the game database includes TcaplusDB. The data storage protocols supported by the database table in TcaplusDB include the tdr protocol and the Protocol Buffers (pb) protocol.
[0053] S120: Compile the protocol file to generate a code file written in a preset programming language.
[0054] In one embodiment of the present application, the protocol file is compiled to generate a code file written in a commonly used programming language, wherein the preset compilation language corresponds to the data protocol format of the protocol file; specifically, the protocol file can be compiled into a code file written in languages such as c / c++, py, etc. according to the official tools corresponding to the protocol file, wherein the official tools corresponding to the protocol file are pre-stored in the terminal.
[0055] For example, when the protocol file is a tdr protocol file, it is compiled into a code file written in C language through the relevant interface provided by TcaplusDB; when the protocol file is a pb protocol file, it is compiled into a code file written in py language through the compilation tool provided by protobuf.
[0056] S130, compile the application program interface of the game database into a dynamic link library file according to the code file.
[0057] In one embodiment of the present application, a dynamic link library file is a non-executable binary program file that allows programs to share code and other resources necessary to perform special tasks, and is used to provide code, data or functions to the program, so that the program can open, enable, query, disable and close the driver according to the instructions in the dynamic link library file; therefore, the API interface of the game database is compiled into a dynamic link library file according to the code file, so that the program corresponding to the subsequent visualization tool can call the instructions in the dynamic link library file to access the API interface of the game database.
[0058] S140. When an edit request for data in a database table is received through the interactive interface, the dynamic link library file is called to access the application program interface, and target data corresponding to the edit request in the database table is obtained through the application program interface, and the target data is displayed on the interactive interface.
[0059] In one embodiment of the present application, an editing request is received through an interactive interface, and the editing request is used to request data in a database table in the new game project. The terminal will call a dynamic link library file and access an API (Application Programming Interface). Through the API interface, the target data in the database table corresponding to the editing request can be accessed.
[0060] It is understandable that the game database includes multiple database tables. When a user triggers an editing request through an operation, the editing request carries the identifier of the database table. For example, a specific database table is selected on the interactive interface, and then the terminal determines which database table the editing request is for based on the identifier of the specific database table.
[0061] The editing request includes but is not limited to querying, modifying or deleting data in the database table. For example, when the editing request is to query data a, the target data corresponding to data a in the database table, such as the value of data a, is obtained through the API interface, and the value of data a is displayed on the interactive interface. When the editing request is to delete data b, data b is first deleted through the API interface, and then the data in the database table after deleting data b is displayed as the target data on the interactive interface. When the editing request is to modify data c, data c is modified through the API interface, and then the modified data c is displayed as the target data on the interactive interface.
[0062] In this embodiment, editing requests can be received through the interactive interface, dynamic link library files can be called, and application programming interfaces can be accessed to manipulate data in the database table. Users can easily construct data in the database table, such as query, modify, and delete data. Complex scene simulations of game projects can also be performed by manipulating data in the database table, which is simple and clear.
[0063] It is understandable that the table names of database tables in different game projects may be the same, but the table structures are different. In order to distinguish different database tables and facilitate subsequent acquisition of the correct database table, in one embodiment of the present application, it is necessary to establish a correspondence between the game project and the database table; therefore, before compiling the protocol file to generate a code file written in a preset programming language, the method further includes:
[0064] When the database table of the new game project has the same table name as the database tables of other game projects, and the table structures of the database tables are different, a mapping relationship between the new game project and the database table is established, and the mapping relationship is stored in the game database.
[0065] In an embodiment of the present application, the database table of the new game project is compared with the data tables of other game projects that have been connected to determine whether the database table of the new game project has the same table name as the other game projects, and whether the table structures of the database tables are different; for example, the new game project A has a user database table userinfo, and the B game also has a user database table userinfo, but because the A game is different from the B game, the corresponding table structures are also different, so a mapping relationship between A and A's user database table, and a mapping relationship between B and B's user database table can be established.
[0066] Optionally, a mapping relationship between a new game project and a database table can be established according to preset rules, such as setting an identifier for the database table and establishing a mapping relationship between the ID of the new game project and the identifier of the database table, such as project ID-userinfo; of course, new game projects and database tables can also be established according to other rules, as long as the database table corresponding to the new game project can be found through the established mapping relationship.
[0067] The established mapping relationship is stored in the game database, and then when the game database is accessed, the corresponding database table can be found based on the mapping relationship; in another embodiment of the present application, the mapping relationship can also be stored in the terminal.
[0068] In one embodiment of the present application, Figure 3 As shown, Figure 3 yes Figure 2 The flowchart of step S120 in the illustrated embodiment includes:
[0069] S121. Replace the table name of the database table according to the mapping relationship to generate a new protocol file.
[0070] In one embodiment of the present application, after establishing a mapping relationship between a new game project and a database table, the database table corresponding to the new game project can be determined based on the mapping relationship. In order to quickly access the database table of the new game project in the future, the table name of the database table can be replaced according to the mapping relationship. For example, the ID of the game project is added to the table name of the database table, for example, the database table name of game A is replaced with A_userinfo. Since the protocol file defines the table structure of the database table, after the database table name is replaced, the protocol file also changes, and a new protocol file can be obtained.
[0071] S122. Compile the new protocol file to generate a code file written in a preset programming language.
[0072] Compile the new protocol file, specifically convert the new protocol file into a code file written in a preset programming language through the corresponding official tool of the protocol file.
[0073] It can be understood that the difference between the new protocol file and the old protocol file lies in the table name of the database table, so the new protocol file can be converted into a code file according to the data protocol format of the old protocol file, for example, compiled into a code file written in py language through the compilation tool provided by protobuf.
[0074] Optionally, code files include source files (.c) and header files (.h).
[0075] In one embodiment of the present application, Figure 4 As shown, Figure 4 yes Figure 2 The flowchart of step S130 in the illustrated embodiment includes:
[0076] S131. Add the code file to the game database so that the application program interface of the game database calls the code file.
[0077] It should be understood that after the code file is generated, the code file is added to the game database so that the API interface of the game database can call the code file. For example, when the API interface of the game database calls the code file, the corresponding database table can be determined.
[0078] S132, encapsulate the application program interface after calling the code file to obtain a target interface.
[0079] After the API interface of the game database calls the code file, the API interface is encapsulated, that is, the API interface of the game database is encapsulated in combination with the code file to obtain a target interface.
[0080] Optionally, the target interface is obtained by encapsulating the application interface of the calling code file through a code generator; for example, through SWIG (Simplified Wrapper and Interface Generator). SWIG is essentially a code generator that generates wrapper codes (wrappercode) for C / C++ programs in other languages. These wrapper codes will use the CAPI provided by each language to expose the content of the C / C++ program to the corresponding language.
[0081] Optionally, a code generator is pre-stored in the terminal. The code generator is only for a single project. When a new game project is connected and the protocol file is uploaded, it will be renamed and the description file of the code generator will be updated for all game projects, that is, the description file will be regenerated. The description file is mainly a swig configuration file, which is mainly the configuration of the c++ interface that can be exposed to the terminal call; updating the description file can be to introduce the project protocol file to generate a .h header file.
[0082] S133, compile the target interface into a dynamic link library file.
[0083] In one embodiment of the present application, after encapsulating the target interface, the target interface is compiled into a dynamic link library file through an automated construction tool, for example, scons (scons is an open source, automated construction tool coded in Python) is used to construct and generate the dynamic link library file.
[0084] like Figure 5 As shown, Figure 5 for Figure 2 The flowchart of obtaining target data in step S140 in the illustrated embodiment, obtaining target data corresponding to the edit request in the database table through the application program interface, includes:
[0085] S141. Analyze the request data carried by the edit request according to the table structure of the database table to obtain the field type of the request data.
[0086] In one embodiment of the present application, the editing request carries request data, which is used to represent the request content that the user wants to request. For example, when the editing request is to query the value of data A, the request data is data A; when the editing request is to delete data B, the request data is data B.
[0087] As mentioned above, the table structure of a database table includes the table name, fields in the table, and records in the table; since different database tables support different data protocols, the field types of fields in different database tables are different, and the request data is for the data in the database table. Therefore, in one embodiment of the present application, when an edit request is received, it is necessary to analyze the request data carried by the edit request according to the table structure of the database table to obtain the field type of the request data, that is, to determine whether the request data of the request corresponds to the data in the database table, and when the request data corresponds to a certain database table, determine which method to use to determine the target data of the request data according to the field type of the request data.
[0088] Optionally, after analyzing the request data carried in the edit request, a serialization operation is performed on the request data to process the request data into continuous binary stream data to comply with the data format in the database table.
[0089] S142. If the field type of the requested data is a large file field in a non-serialized structured data format in a cross-platform multi-language data representation protocol, traverse the field values in the database table and use the field value corresponding to the requested data as the target data.
[0090] As mentioned above, the data protocols supported by the database table include the tdr protocol, the pb protocol, and the protobuf blob field included in the tdr protocol; if the field type of the requested data is a non-protobuf blob field in the tdr protocol, the fields in the database table are directly traversed, and the field corresponding to the requested data is used as the target data; for example, if the editing request is to query data A, and the field type of data A is a non-protobuf blob field in the tdr protocol, the field values in the database table are directly traversed. If the field corresponding to data A is obtained through the traversal, and the field is x, x is used as the target data.
[0091] For another example, if the edit request is to modify data B, and the field type of data B is a non-protobuf blob field in the tdr protocol, the fields in the database table are directly traversed. When the field value corresponding to data B is obtained, the value y of the field corresponding to the current data B is modified to value z, and the value z of the modified field is used as the target data.
[0092] In one embodiment of the present application, a mapping relationship between a new game project and a database table is stored in the database table, and the mapping relationship also includes a protocol path of a protocol file corresponding to the new game project, such as Figure 6 As shown, Figure 6 for Figure 2 Another flow chart of obtaining target data in step S140 in the illustrated embodiment includes:
[0093] S143. If the field type of the requested data is a large file field in a serialized structure data format in a cross-platform multi-language data representation protocol, determine a protocol file corresponding to the large file field in the serialized structure data format according to the protocol path of the mapping relationship in the database.
[0094] It should be noted that the protocol file for the new game project is a TDR protocol that includes a nested PB protocol. When the mapping relationship between the new game project and the database table is stored in the game database, the mapping relationship also includes the protocol path of the TDR protocol. The TDR protocol nests the PB protocol, so the field type in the database table may be the protobufblob field in the TDR protocol.
[0095] In one embodiment of the present application, if the field type of the requested data is the protobuf blob field in the tdr protocol, the mapping relationship between the new game project and the database table is pulled from the game database, and then the pb protocol file nested in the tdr protocol corresponding to the protobuf blob field is found according to the protocol path of the tdr protocol of the mapping relationship.
[0096] S144. Parse the request data according to the protocol file to obtain the correspondence between the field name and the field value corresponding to the request data, determine the field value corresponding to the field name in the database table according to the correspondence, and use the field value as the target data.
[0097] After finding the pb protocol file, the pb protocol file is introduced to parse the request data to obtain the corresponding relationship between the field name and field value of the request data. For example, if the request data is A data, the corresponding relationship between the field name a and the field value a' of A data is obtained, and then the field value a' corresponding to the field name a can be determined in the database table according to the corresponding relationship, and the field value a' is used as the target data.
[0098] It should be noted that, in one embodiment of the present application, in order to ensure that the target data displayed on the interactive interface is more accurate, such as Figure 7 As shown, Figure 7 yes Figure 2 The schematic flow chart of displaying the target data on the interactive interface in step S140 in the illustrated embodiment includes:
[0099] S145, performing a serialization operation on the target data to obtain binary data;
[0100] S146. After deserializing the binary data, the data is visualized on the interactive interface.
[0101] It is understandable that after the terminal obtains the target data in the background, it needs to transfer the target data to the interactive interface for display. Specifically, the target data needs to be serialized to process the target data into continuous binary stream data for transmission; then the binary data needs to be deserialized to parse the binary data stream into data corresponding to the protocol file according to the definition of the database table, and then displayed visually on the interactive interface.
[0102] For ease of understanding, in one embodiment of the present application, a data processing method is described using a specific example, wherein the game database is tcaplusDB; Figure 8 As shown, Figure 8 A schematic diagram of project access configuration is shown for an exemplary embodiment of the present application. A new game project is accessed through an interactive interface, and the server name of the new game project, the access ID of the cluster (TargetAppld), the table group ID (Targetzoneld), and the access address (Targeturl) are added; Fig. 9 As shown, Fig. 9 This is a schematic diagram of the interface for protocol importing shown as an exemplary embodiment of the present application, i.e., receiving the protocol file of the new game project imported by the user through the interactive interface. For the protocol containing the protobuf blob field in the TDR protocol, i.e., the TDR nested pb format, it is necessary to upload the pb file first.
[0103] like Fig.10 Shown and Fig.11 As shown, Fig.10 An interactive flow chart of a data processing method provided in an embodiment of the present application, Fig.11 An overall framework diagram of a data processing method provided in an embodiment of the present application; the data processing method is executed by a data visualization editing platform running on a terminal, the data visualization editing platform is written in Python (computer programming language), and the method includes:
[0104] S1001. Upload the protocol file on the data visualization editing platform, which supports both TDR protocol and PB protocol files.
[0105] Through Fig. 9 The interactive interface shown uploads the protocol file, which includes the TDR protocol and / or the PB protocol file;
[0106] S1002. After receiving the protocol file, the data visualization editing platform compiles the tdr and pb protocol files by itself and automatically identifies the library table;
[0107] After receiving the protocol file, it is mainly compiled into a C file through the relevant interface provided by tcaplus, and the pb protocol is compiled into a py file through the compilation tool provided by protobuf; automatic identification of library tables refers to identifying the database tables and their structures in the protocol files.
[0108] Among them, the structure of the database table is saved in the form of a protocol file; the TDR or PB protocol has a fixed structure (protocol rules), but is stored in different formats. By identifying the library table, the protocol rules can be understood, and then they can be parsed one by one in the future.
[0109] S1003. The data visualization editing platform recompiles tcaplus.so according to the compiled protocol and the identified library table.
[0110] After compiling to obtain C files and Py files, the API interface of TCAplus is further encapsulated in combination with the compiled C files or Py files, and converted into C / C++ interfaces for Python calls through SWIG. Then, Scons compiles tcaplus.so according to the corresponding configuration files.
[0111] like Fig.11 As shown, the above steps S1001-S1003 correspond to Fig.11 As shown on the left side, the swig description file, tcaplus interface encapsulation, and tcaplus-api are the development interfaces used by the data visualization editing platform; the swig description file describes the swig configuration file, which is mainly the configuration of the c++ interface that can be exposed to python calls; Tcplus encapsulation refers to further compilation through scons on the basis of the original tcaplus-api, providing a more convenient and quick tcaplus.so for use; tcaplus-api is the API interface of tcaplus.
[0112] S1004. The data visualization editing platform calls tcaplus-api according to the request to return relevant data;
[0113] When receiving a query / modify / delete request, Python calls tcaplus.so to access the API interface and obtain the relevant data corresponding to the request.
[0114] S1005. The relevant data is visualized on the data visualization editing platform through serialization and deserialization.
[0115] like Fig.11 As shown, the above steps S1004-S1005 correspond to Fig.11In the right part shown, when the user needs to request data from the database table, he directly selects the relevant environment and database table name on the data visualization editing platform. The environment is private to the project and generally refers to the server environment in the game. The game backend is deployed in different servers, and the relevant user data is different. The data visualization editing platform receives the query / modify / delete request and calls the self-compiled tcaplus.so, serializes the request data corresponding to the request, and determines the target data corresponding to the request data from the tcaplus database. The target data is displayed on the interactive interface of the data visualization editing platform after serialization and deserialization.
[0116] like Fig.12 As shown, Fig.12 This is a schematic diagram of an interface for visually displaying data in a database table as shown in an exemplary embodiment of the present application. The database table for which the data is to be displayed is determined through environment selection and library table selection. The data in the selected database table is queried, modified or deleted through the "Query Data", "Modify Data" and "Delete Data" controls. Finally, the data in the database table can be displayed in the display area corresponding to the "Library Table Data", thereby enabling users to modify, query and delete the visually displayed data.
[0117] It is understandable that the data visualization editing platform can store the user's operation records so that the next time the user requests data from the same database table, the target data can be directly retrieved and displayed based on the records.
[0118] It should be noted that the uploaded protocol file can be a protocol containing a protobuf blob field in the tdr protocol, that is, the field in the database table is a mixed pb-encoded field in the tdr structure. In order to dynamically parse the mixed pb-encoded field in the tdr structure, such as Fig.13 As shown, Fig.13 FIG. 4 is a flow chart of obtaining target data shown in another exemplary embodiment of the present application; the process of obtaining target data is described below.
[0119] First, after uploading the protocol file, design the corresponding rules of the library table according to different projects, establish the mapping relationship between the project and the library table, and save it in the database DB.
[0120] When a user queries data in a database table, the background of the data visualization editing platform parses the query request data according to the table type of the database table.
[0121] When the query request data is for a non-protobuf blob field in the TDR protocol, directly traverse the data in the database table and assign the query request data to obtain the target data.
[0122] When the query request data is for the protobuf blob field in the tdr protocol, the mapping relationship is pulled from the database DB. The mapping relationship is not only the project-library table, but also includes the protocol path. According to the protocol path of the mapping relationship, the corresponding pb protocol file is found, and the pb file is dynamically introduced for parsing to obtain the corresponding field name and field value corresponding to the request data. According to the corresponding relationship, the field value is determined from the database table as the target data.
[0123] It should be noted that the table names of database tables in different projects are the same, but the table structures of database tables are different. In order to be compatible with the situation where the table names in different projects are the same but the structures are different. Fig.14 As shown, Fig.14 It is a flowchart of compiling tcaplus.so shown in another exemplary embodiment of the present application; how to compile tcaplus.so is specifically described below.
[0124] like Fig.14 As shown, first, according to the uploaded protocol file, such as the TDR protocol, the TDR protocol is saved in XML format, and the table name is replaced according to the negotiated rules (such as mapping relationship) to generate a new XML file; recompile the XML file and convert it into a C file or a PY file, for example, compile XML to generate the corresponding C++ code (.c and .h code files), update the SWIG description file, and prepare for the subsequent compilation to obtain tcaplus.so.
[0125] The C++ code generated by the library table file is dynamically injected into the tcaplus compilation module provided by tsf4g, and scons is called to rebuild and generate a new tcaplus.so; that is, the XML library table is self-compiled into corresponding .c and .h files, and the tcaplus API interface is further encapsulated in combination with the compiled .c and .h files, and the C / C++ interface for Python to call is converted through swig, and then scons compiles and generates tcaplus.so according to the corresponding configuration file.
[0126] The data visualization editing platform is written in Python, and Python can directly call tcaplus.so. However, in order to simplify the interaction between C / C++ and other scripting languages, the new so file is compiled through swig to generate the corresponding py file for the data visualization editing platform to call, that is, swig is used to simplify the c / c++ interaction between python and tcaplus.
[0127] The game mainly uses TCAPlus for data storage. The data protocols are mainly TDR, PB and the TDR protocol that contains the protobuf blob field type. There is no convenient visualization tool for TCAPlus data editing (including query, modification and deletion) for the TDR protocol, especially the TDR protocol that contains the protobuf blob field.
[0128] In order to solve the above problems. The data processing method provided in this embodiment automatically parses the protocol, automatically identifies the protocol field type, automatically compiles the TDR protocol, and the PB protocol, and finally automatically compiles it into the corresponding SO library. A visual operation interface is also provided. When the user selects the relevant environment and library table name, and operates the DB database, such as querying, modifying, deleting, etc., the data of the DB database can be obtained by calling the SO library, accessing the API to obtain the TCAplus data, and performing serialization and deserialization operations, and outputting the page displayed to the data visualization editing platform. The data of the corresponding library table will be displayed, and then the test students can conveniently perform data construction, including but not limited to game character related data modification construction, game record matching data construction, etc., which greatly improves the test efficiency. Test students can also conveniently simulate complex scenarios, such as matching algorithm matching mechanism scenario simulation, protocol automation testing, etc., which is convenient and greatly improves the test efficiency.
[0129] The device embodiment of the present application is introduced, which can be used to execute the data processing method in the above embodiment of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above embodiment of the data processing method of the present application.
[0130] The present application embodiment provides a data processing device, such as Fig.15 As shown, it includes a display module 1510, a receiving module 1520, a file compilation module 1530, an interface compilation module 1540 and a calling module 1550;
[0131] A display module 1510 is used to display an interactive interface;
[0132] A receiving module 1520 is used to receive a protocol file of the new game project when a new game project is accessed, where the protocol file is used to define a database table in the new game project, and the database table is stored in the game database;
[0133] A file compiling module 1530, for compiling the protocol file to generate a code file written in a preset programming language;
[0134] The interface compiling module 1540 is used to compile the application program interface of the game database into a dynamic link library file according to the code file;
[0135] The calling module 1550 is used to call the dynamic link library file to access the application program interface when receiving an editing request for data in the database table through the interactive interface, and obtain the target data corresponding to the editing request in the database table through the application program interface;
[0136] The display module 1510 is also used to display the target data on the interactive interface.
[0137] In one embodiment of the present application, based on the aforementioned scheme, the data processing device also includes an establishment module, which is used to establish a mapping relationship between the new game project and the database table when the database table of the new game project has the same table name as the database table of other game projects and the table structure of the database table is different, and store the mapping relationship in the game database.
[0138] In one embodiment of the present application, based on the aforementioned scheme, the calling module 1550 includes an analysis unit and an assignment unit; the analysis unit is used to analyze the request data carried by the editing request according to the table structure of the database table to obtain the field type of the request data; the assignment unit is used to traverse the field values in the database table if the field type of the request data is a large file field in a non-serialized structured data format in a cross-platform multi-language data representation protocol, and use the field value corresponding to the request data as the target data.
[0139] In one embodiment of the present application, based on the aforementioned scheme, the mapping relationship also includes a protocol path of the protocol file, and the assignment unit is also used to determine the protocol file corresponding to the large file field in the serialized structure data format according to the protocol path of the mapping relationship in the database if the field type of the requested data is a large file field in the serialized structure data format in the cross-platform multi-language data representation protocol, parse the request data according to the protocol file, obtain the correspondence between the field name and the field value corresponding to the request data, determine the field value corresponding to the field name in the database table according to the correspondence, and use the field value as the target data.
[0140] In one embodiment of the present application, based on the aforementioned solution, the file compilation module 1530 is further used to replace the table name of the database table according to the mapping relationship to generate a new protocol file; compile the new protocol file to generate a code file written in a preset programming language.
[0141] In one embodiment of the present application, based on the aforementioned scheme, the interface compilation module 1540 is further used to add the code file to the game database so that the application interface of the game database calls the code file; encapsulates the application interface after calling the code file to obtain the target interface; and compiles the target interface into a dynamic link library file.
[0142] In one embodiment of the present application, based on the above-mentioned solution, the display module 1510 is further used to perform a serialization operation on the target data to obtain binary data; after the binary data is deserialized, it is visually displayed on the interactive interface.
[0143] The data processing device provided in this embodiment displays an interactive interface, and receives a protocol file of a new game project through the interactive interface, compiles the protocol file to generate a code file, and then compiles the application program interface of the game database into a dynamic link library file through the code file, so that the dynamic link library file can be called to access the application program interface, and the data in the game database can be obtained and then output and displayed on the interactive interface, thereby realizing data visualization in the game database and displaying the data of the corresponding database table, so that testers can conveniently construct data, such as modifying and constructing game character-related data, constructing game record matching data, and constructing simulated account data in batches during stress testing, thereby greatly improving test efficiency.
[0144] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0145] An embodiment of the present application also provides an electronic device, including one or more processors, and a storage device, wherein the storage device is used to store one or more programs, and when one or more of the programs are executed by one or more processors, the electronic device implements the steps of the data processing method as described above, including: displaying an interactive interface, and when a new game project is connected, receiving a protocol file of the new game project through the interactive interface, the protocol file is used to define a database table in the new game project, and the database table is stored in a game database; compiling the protocol file to generate a code file written in a preset programming language; compiling an application program interface of the game database into a dynamic link library file according to the code file; when an editing request for data in the database table is received through the interactive interface, calling the dynamic link library file to access the application program interface, and obtaining target data in the database table corresponding to the editing request through the application program interface, and displaying the target data on the interactive interface.
[0146] Through the electronic device provided in the embodiment of the present application, when a new project is accessed, it is only necessary to upload the corresponding protocol file to query, add, delete and other operations on the data in the database table of the game database, which is convenient and greatly improves the testing efficiency.
[0147] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0148] It should be noted that Fig.16 The computer system 1600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0149] like Fig.16 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1602 or the program loaded from the storage part 1608 to the random access memory (RAM) 1603, such as executing the method described in the above embodiment. In RAM 1603, various programs and data required for system operation are also stored. CPU 1601, ROM 1602 and RAM 1603 are connected to each other through bus 1604. Input / output (I / O) interface 1605 is also connected to bus 1604.
[0150] The following components are connected to the I / O interface 1605: an input section 1606 including a keyboard, a mouse, etc.; an output section 1607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the I / O interface 1605 as needed. A removable medium 1611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1610 as needed so that a computer program read therefrom is installed into the storage section 1608 as needed.
[0151] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1609, and / or installed from a removable medium 1611. When the computer program is executed by a central processing unit (CPU) 1601, various functions defined in the system of the present application are executed.
[0152] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0153] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0155] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0156] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in each of the above embodiments.
[0157] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0158] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0159] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0160] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A data processing method, characterized in that: include: Displaying an interactive interface, when a new game project is accessed, receiving a protocol file of the new game project through the interactive interface, wherein the protocol file is used to define a database table in the new game project, and the database table is stored in a game database; Compiling the protocol file to generate a code file written in a preset programming language; Adding the code file to the game database so that the application program interface of the game database calls the code file; Encapsulating the application program interface after calling the code file to obtain a target interface; compiling the target interface into a dynamic link library file; When an editing request for the data in the database table is received through the interactive interface, the dynamic link library file is called to access the application program interface, and the target data in the database table corresponding to the editing request is obtained through the application program interface, and the target data is displayed on the interactive interface.
2. The method according to claim 1, characterized in that Before compiling the protocol file to generate a code file written in a preset programming language, the method further includes: When the database table of the new game item has the same table name as the database table of other game items, but the table structures of the database tables are different, a mapping relationship between the new game item and the database table is established, and the mapping relationship is stored in the game database.
3. The method according to claim 2, characterized in that The acquiring, through the application program interface, target data in the database table corresponding to the editing request comprises: Analyze the request data carried by the edit request according to the table structure of the database table to obtain the field type of the request data; If the field type of the request data is a large file field in a non-serialized structured data format in a cross-platform multi-language data representation protocol, the field values in the database table are traversed, and the field value corresponding to the request data is used as the target data.
4. The method according to claim 3, characterized in that The mapping relationship also includes a protocol path of the protocol file, and the method further includes: If the field type of the request data is a large file field in a serialized structure data format in a cross-platform multi-language data representation protocol, determining a protocol file corresponding to the large file field in the serialized structure data format according to a protocol path of a mapping relationship in the database; The request data is parsed according to the protocol file to obtain the correspondence between the field name and the field value corresponding to the request data, and the field value corresponding to the field name is determined in the database table according to the correspondence, and the field value is used as the target data.
5. The method according to claim 2, characterized in that: The compiling of the protocol file to generate a code file written in a preset programming language includes: The table name of the database table is replaced according to the mapping relationship to generate a new protocol file; The new protocol file is compiled to generate a code file written in a preset programming language.
6. The method according to any one of claims 1 to 5, characterized in that: The displaying the target data on the interactive interface comprises: Performing a serialization operation on the target data to obtain binary data; After the binary data is deserialized, it is visually displayed on the interactive interface.
7. A data processing device, characterized in that: include: Display module, used to display the interactive interface; A receiving module, used for receiving a protocol file of a new game project when a new game project is accessed, wherein the protocol file is used for defining a database table in the new game project, and the database table is stored in a game database; A file compiling module, used for compiling the protocol file to generate a code file written in a preset programming language; An interface compilation module, used for adding the code file to the game database so that the application program interface of the game database calls the code file; Encapsulating the application program interface after calling the code file to obtain a target interface; compiling the target interface into a dynamic link library file; A calling module, configured to, when receiving an edit request for the data in the database table through the interactive interface, call the dynamic link library file to access the application program interface, and obtain target data in the database table corresponding to the edit request through the application program interface; The display module is also used to display the target data on the interactive interface.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
