Resource verification method and device, electronic equipment and storage medium
The automatic loading and verification of resource tables through the resource table verification program solves the problem that resource verification methods in the existing technology cannot perform cross-table union and version comparison, improves verification efficiency and accuracy, and reduces labor costs.
Patent Information
- Application Number
- CN202310345323.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-01
AI Technical Summary
Existing resource verification methods can only achieve simple single-table verification, and cannot perform joint verification across multiple resource tables. They also require manual intervention, which increases costs, and cannot compare and verify resource tables between different versions.
Through the resource table verification program, the function interface of the cross-platform multi-language data representation component is obtained, the resource table is automatically loaded and verified, the matching verification rules are executed, the verification results are obtained, and the verification results are processed visually and sent to the terminal interface.
It improves the efficiency and accuracy of resource verification, reduces resource coupling, supports flexible adjustment of verification rules, realizes cross-table association and version comparison verification, and reduces labor costs.
Smart Images

Figure CN118733146A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to resource verification technology, and in particular to a resource verification method, device, electronic equipment and storage medium. Background Art
[0002] In related technologies, when performing resource verification, resource verification is often achieved by relying on built-in functions such as data validation, annotations, and scripts in Excel tables. When configuring the resource table, some simple verifications are performed on the current table content, such as duplicate IDs, data range restrictions, and conditional judgments. This method can only meet simple resource verification requirements. If complex resource verification is performed, manual intervention is required, which will greatly increase the cost of source verification. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a resource verification method, device, electronic device and storage medium, which can obtain the function interface of the cross-platform multi-language data representation component through a resource table verification program, and then use the resource table verification program to automatically verify the resource table to obtain accurate resource verification results, which not only improves the efficiency and accuracy of resource verification, but also the resource table verification program can reduce resource coupling in the verification process. In addition, the verification rules can be flexibly adjusted according to different game requirements.
[0004] The technical solution of the embodiment of the present invention is achieved as follows:
[0005] An embodiment of the present invention provides a resource verification method, the method comprising:
[0006] Trigger the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component;
[0007] Using the resource table verification program, all resource tables to be verified are loaded through the function interface of the cross-platform multi-language data representation component;
[0008] Get the validation rules corresponding to each resource table;
[0009] Loop through all resource tables to be checked, execute the check rules matching the resource tables, and obtain the check results of the resource tables;
[0010] The verification result of the resource table is visualized, and the verification result of the resource table after the visualization is sent to a display interface of the terminal.
[0011] The embodiment of the present invention further provides a resource verification device, including:
[0012] The information transmission module is used to trigger the resource table verification program and obtain the function interface of the cross-platform multi-language data representation component;
[0013] An information processing module, used to utilize the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component;
[0014] The information processing module is used to obtain the verification rules corresponding to each resource table;
[0015] The information processing module is used to loop through all resource tables to be checked, execute the check rules matching the resource tables, and obtain the check results of the resource tables;
[0016] The information processing module is used to visualize the verification result of the resource table and send the visualized verification result of the resource table to the display interface of the terminal.
[0017] In the above scheme,
[0018] The information processing module is used to trigger the C program framework in the resource table verification program;
[0019] The information processing module is used to load and execute the script file in the resource table verification program through the C program framework to obtain the function interface of the cross-platform multi-language data representation component.
[0020] In the above scheme,
[0021] The information processing module is used to use the resource table verification program to serialize the contents of the original resource table and the protocol file through the function interface of the cross-platform multi-language data representation component to obtain all resource tables to be verified;
[0022] The information processing module is used to load all the resource tables to be verified into a readable medium through the function interface of the cross-platform multi-language data representation component.
[0023] In the above scheme,
[0024] The information processing module is used to read the verification rules corresponding to each resource table and the universal function matching the script file through the script file when loading and executing the script file in the resource table verification program.
[0025] In the above scheme,
[0026] The information processing module is used to execute at least one of the following on the general verification rules in the script file in the resource table verification program when the resource table of the target program changes:
[0027] Add custom validation rules, delete the general validation rules, and replace the general validation rules with the custom validation rules.
[0028] In the above scheme,
[0029] The information processing module is used to loop through all resource tables to be checked, and when the resource table is not checked, execute the check rule matching the resource table to obtain the check result of the resource table, wherein the check rule matching the resource table includes at least one of the following:
[0030] Custom validation rules, enumeration validation rules, uniqueness validation rules, and range validation rules.
[0031] In the above scheme,
[0032] The information processing module is used to determine the verification rules that match the different field information of the resource table respectively;
[0033] The information processing module is used to verify the field type, field enumeration and field range of the resource table respectively through verification rules respectively matched with different field information of the resource table.
[0034] In the above scheme,
[0035] The information processing module is used to determine matching templates that respectively match different field information of the resource table;
[0036] The information processing module is used to determine the verification rules that match the different field information of the resource table respectively through the matching template;
[0037] The information processing module is used to verify the accuracy of the resource table based on verification rules that respectively match different field information of the resource table.
[0038] In the above scheme,
[0039] The information processing module is used to adjust the resource table to the cache result set when the matching templates that respectively match the different field information of the resource table cannot be determined;
[0040] The information processing module is used to adjust the resource table to the cache result set when it is determined that the accuracy of the resource table is inaccurate based on the verification rules respectively matched with different field information of the resource table.
[0041] An embodiment of the present invention further provides an electronic device, characterized in that the electronic device comprises:
[0042] A memory for storing executable instructions;
[0043] The processor is used to implement the preceding resource verification method when running the executable instructions stored in the memory.
[0044] An embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, wherein the executable instructions implement the preceding resource verification method when executed by a processor.
[0045] The embodiments of the present invention have the following beneficial effects:
[0046] 1) The embodiment of the present invention obtains the function interface of the cross-platform multi-language data representation component by triggering the resource table verification program; uses the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component; obtains the verification rules corresponding to each resource table; loops through all resource tables to be verified, executes the verification rules matching the resource tables, and obtains the verification results of the resource tables; visualizes the verification results of the resource tables, thereby automatically verifying the resource tables and obtaining accurate resource verification results, which not only improves the efficiency and accuracy of resource verification, but also the resource table verification program can reduce resource coupling in the verification process. In addition, the verification rules can be flexibly adjusted according to different game requirements.
[0047] 2) By sending the verification result of the resource table after visualization to the display interface of the terminal, the user can intuitively and accurately know the verification result of the resource table, and adjust the resource table or verification rules in time to meet the usage requirements of different game products. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram of a usage scenario of the resource verification method provided in an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0050] Figure 3 An optional flow chart of a resource verification method provided in an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of the structure of a resource table verification program in an embodiment of the present invention;
[0052] Figure 5 A schematic diagram is added for the verification rules in the embodiment of the present invention;
[0053] Figure 6 This is a schematic diagram of the resource verification effect in an embodiment of the present invention;
[0054] Figure 7 An optional schematic diagram of a flow chart of a resource verification method provided in an embodiment of the present invention;
[0055] Figure 8 Schematic diagram of element exposure in an embodiment of the present invention;
[0056] Fig. 9 Schematic diagram of the process of setting the burying point parameters in an embodiment of the present invention;
[0057] Fig.10 A schematic diagram of the process of setting the interface interaction code file for synchronous tracking in an embodiment of the present invention;
[0058] Fig.11 This is a schematic diagram of the effect of the buried point processing in an embodiment of the present invention;
[0059] Fig.12 The figure is a schematic diagram of the resource table synchronization pipeline process in an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0061] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0062] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0063] 1) API: The full name is Application Programming Interface, which can be translated into application program interface. It is a set of predefined functions or agreements for connecting different components of a software system. The purpose is to provide application programs and developers with the ability to access a set of routines based on certain software or hardware without having to access the original code or understand the details of the internal working mechanism.
[0064] 2) SDK: The full name is Software Development Kit, which can be translated into software development kit. It is a collection of development tools for building application software for specific software packages, software frameworks, hardware platforms, operating systems, etc. In a broad sense, it includes a collection of related documents, examples and tools to assist in the development of a certain type of software.
[0065] 3) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.
[0066] 4) Mini Program is a program developed based on a front-end language (such as JavaScript) to implement services in a Hyper Text Markup Language (HTML) page. It is downloaded by a client (such as a browser or any client with a built-in browser core) via a network (such as the Internet) and interpreted and executed in the client's browser environment, saving the steps of installation in the client. For example, mini programs for various services such as ticket purchase and ride code can be downloaded and run in a social network client.
[0067] 5) Components are functional modules of the mini-program’s view, also known as front-end components, such as buttons, titles, tables, sidebars, content, and footers on the page. Components include modular codes for easy reuse in different pages of the mini-program.
[0068] 6) Running environment: an engine for interpreting and executing codes in different development languages. For example, for the running environment of mini-programs, it can be JavaScript Core on the iOS platform or X5 JS Core on the Android platform.
[0069] 7) Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. It is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0070] 8) Resource table: A table used in a program to configure some modifiable data to flexibly adjust the program's performance or functions.
[0071] 9)ResCheck: A resource table check program based on Lua script.
[0072] 10) TDR: TSF4G Data Represention, a cross-platform multi-language data representation component, is mainly used for data-based serialization and deserialization (supports binary and XML text modes) and ORM data storage. The DR data representation component is released in the form of a program library and a TDR tool. TDR-API is essentially a set of algorithms independent of the data structure. The functions of the commonly used APIs involve network encoding and decoding, XML data input and output, data visualization, object-relational mapping, and data sorting. The TDR tool implements conversion between various metadata formats, and can generate C / C++ data structure definition header files based on metadata descriptions in XML format. The TDR tool can also generate code to implement specified functions. Currently, it supports the generation of code in three languages: C++\AS3\C#. The supported functions include network encoding and decoding, XML data input and output, and data visualization.
[0073] 11) Protocol, the data format of the game database referred to in the embodiments of the present application. The 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.
[0074] Before introducing the resource verification method provided by the present application, the processing procedure of resource verification in the related technology is first explained. The current mainstream resource verification methods include: 1) mainly through the built-in data verification, annotation, script and other functions of the Excel table, some simple verification is performed on the current table content when the resource table is configured, such as duplicate ID, data range restriction, conditional judgment, etc. The defects of this solution are: only simple single-table verification rules can be implemented, and joint verification across multiple resource tables cannot be performed; only the content of the current modification can be verified, and resource tables between different versions cannot be compared and verified; rule developers need to master some Excel skills, which increases the labor cost of resource verification.
[0075] 2) Develop a corresponding resource table configuration web page, add various rule verification logic codes to the web page, and then verify the resource table through these rules when configuring resources. The defects of this solution are: it is necessary to add a whole set of web resource table configuration functions, which increases a lot of development costs; it requires continuous investment in professional web development, which increases a lot of maintenance costs; the new rules need to be communicated with web developers, which increases a lot of understanding and communication costs, and increases the labor cost of resource verification.
[0076] In order to overcome the above defects, the present application provides a resource verification method, device, electronic device and storage medium, which can obtain the function interface of the cross-platform multi-language data representation component through the resource table verification program, and then use the resource table verification program to automatically verify the resource table to obtain accurate resource verification results, which not only improves the efficiency and accuracy of resource verification, but also the resource table verification program can reduce resource coupling during the verification process. In addition, according to different game requirements, the verification rules can be flexibly adjusted. Figure 1 A schematic diagram of a usage scenario of the resource verification method provided in an embodiment of the present invention, see Figure 1 , the terminal (including the terminal 10-1 and the terminal 10-2) is provided with a corresponding client capable of executing different functions, wherein the client is the terminal (including the terminal 10-1 and the terminal 10-2) obtaining different game programs from the corresponding server 200 through the network 300 using different business processes, the terminal is connected to the server 200 through the network 300, the network 300 may be a wide area network or a local area network, or a combination of the two, using a wireless link to achieve data transmission, wherein the types of game programs obtained by the terminal (including the terminal 10-1 and the terminal 10-2) from the corresponding server 200 through the network 300 are not the same, for example: the terminal (including the terminal 10-1 and the terminal 10-2) can obtain web games from the corresponding server 200 through the network 300, and can also obtain game programs of terminal games and mobile games from the corresponding server 200 through the network 300. Different types of web pages may be stored in the server 200. In some embodiments of the present invention, the different types of web pages stored in the server 200 may be written in software codes of different programming languages, and the code objects may be different types of code entities. For example, in a software code written in C language, a code object can be a function. In a software code written in JAVA language, a code object can be a class, and in an iOS OC language, a code object can be a segment of target code. In a software code written in C++ language, a code object can be a class or a function. In this application, the compilation environment of different types of web pages is no longer distinguished.
[0077] 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 resource 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 resource table is obtained through the application program interface, and the target data is displayed on the interactive interface.
[0078] The game database is used to store data corresponding to game items through resource tables.
[0079] The structure of the electronic device of the embodiment of the present invention is described in detail below. The electronic device can be implemented in various forms, such as a dedicated terminal with a resource verification function, such as a gateway, or a server with a resource verification function, such as the aforementioned Figure 1 Server 200 in. Figure 2 The schematic diagram of the structure of the electronic device provided by the embodiment of the present invention can be understood as follows: Figure 2 Only an exemplary structure of the server is shown, not all structures, and can be implemented as needed. Figure 2 Partial or complete structure shown.
[0080] The server provided in the embodiment of the present invention includes: at least one processor 201, a memory 202, a user interface 203 and at least one network interface 204. The various components in the electronic device 20 are coupled together through a bus system 205. It can be understood that the bus system 205 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 205 is not used in the following examples. Figure 2 Various buses are labeled as bus system 205 .
[0081] The user interface 203 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.
[0082] It is understood that the memory 202 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. The memory 202 in the embodiment of the present invention can store data to support the operation of the terminal (such as 10-1). Examples of these data include: any computer program for operating on the terminal (such as 10-1), such as an operating system and an application. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application can include various applications.
[0083] In some embodiments, the resource verification device provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the resource verification device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the resource verification method provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.
[0084] As an example of a resource verification device provided in an embodiment of the present invention being implemented by a combination of software and hardware, the resource verification device provided in an embodiment of the present invention can be directly embodied as a combination of software modules executed by a processor 201. The software module can be located in a storage medium, and the storage medium is located in a memory 202. The processor 201 reads the executable instructions included in the software module in the memory 202, and completes the resource verification method provided in an embodiment of the present invention in combination with necessary hardware (for example, including a processor 201 and other components connected to a bus 205).
[0085] As an example, the processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0086] As an example of hardware implementation of the resource verification device provided in an embodiment of the present invention, the device provided in an embodiment of the present invention can be directly executed by a processor 201 in the form of a hardware decoding processor, for example, one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components to implement the resource verification method provided in an embodiment of the present invention.
[0087] The memory 202 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 20. Examples of such data include: any executable instructions for operating on the electronic device 20, such as executable instructions, and the program implementing the resource verification method of the embodiment of the present invention can be included in the executable instructions.
[0088] In other embodiments, the resource verification device provided by the embodiment of the present invention can be implemented in software. Figure 2 The resource verification device 2020 stored in the memory 202 is shown, which can be software in the form of a program and a plug-in, and includes a series of modules. As an example of a program stored in the memory 202, a resource verification device 2020 can be included. The resource verification device 2020 includes the following software modules: an information transmission module 2081 and an information processing module 2082. When the software modules in the resource verification device 2020 are read into the RAM by the processor 201 and executed, the resource verification method provided by the embodiment of the present invention will be implemented. The functions of each software module in the resource verification device 2020 are introduced below:
[0089] The information transmission module 2081 is used to trigger the resource table verification program and obtain the function interface of the cross-platform multi-language data representation component;
[0090] The information processing module 2082 is used to use the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component;
[0091] Information processing module 2082, used to obtain the verification rules corresponding to each resource table;
[0092] The information processing module 2082 is used to loop through all resource tables to be checked, execute the check rules matching the resource tables, and obtain the check results of the resource tables;
[0093] The information processing module 2082 is used to visualize the verification result of the resource table and send the visualized verification result of the resource table to the display interface of the terminal.
[0094] In the above scheme,
[0095] Information processing module 2082, used to trigger the C program framework in the resource table verification program;
[0096] The information processing module 2082 is used to load and execute the script file in the resource table verification program through the C program framework to obtain the function interface of the cross-platform multi-language data representation component.
[0097] In the above scheme,
[0098] The information processing module 2082 is used to use the resource table verification program to serialize the contents of the original resource table and the protocol file through the function interface of the cross-platform multi-language data representation component to obtain all resource tables to be verified;
[0099] The information processing module 2082 is used to load all resource tables to be verified into a readable medium through the function interface of the cross-platform multi-language data representation component.
[0100] In the above scheme,
[0101] The information processing module 2082 is used to read the verification rules corresponding to each resource table and the general function matching the script file through the script file when loading and executing the script file in the resource table verification program.
[0102] In the above scheme,
[0103] The information processing module 2082 is used to execute at least one of the following on the general verification rules in the script file in the resource table verification program when the resource table of the target program changes:
[0104] Add custom validation rules, delete common validation rules, and replace common validation rules with custom validation rules.
[0105] In the above scheme,
[0106] The information processing module 2082 is used to loop through all resource tables to be checked. When a resource table has not been checked, the check rule matching the resource table is executed to obtain a check result of the resource table, wherein the check rule matching the resource table includes at least one of the following:
[0107] Custom validation rules, enumeration validation rules, uniqueness validation rules, and range validation rules.
[0108] In the above scheme,
[0109] Information processing module 2082, used to determine the verification rules that match the different field information of the resource table respectively;
[0110] The information processing module 2082 is used to verify the field type, field enumeration and field range of the resource table respectively through verification rules that match different field information of the resource table respectively.
[0111] In the above scheme,
[0112] The information processing module 2082 is used to determine the matching templates that match the different field information of the resource table respectively;
[0113] The information processing module 2082 is used to determine the verification rules that match the different field information of the resource table respectively through the matching template;
[0114] The information processing module 2082 is used to verify the accuracy of the resource table based on the verification rules that match the different field information of the resource table.
[0115] In the above scheme,
[0116] The information processing module 2082 is used to adjust the resource table to the cache result set when the matching templates that match the different field information of the resource table cannot be determined;
[0117] The information processing module 2082 is used to adjust the resource table to the cache result set when the accuracy of the resource table is determined to be inaccurate based on the verification rules respectively matched with different field information of the resource table.
[0118] An embodiment of the present invention further provides an electronic device, characterized in that the electronic device includes:
[0119] A memory for storing executable instructions;
[0120] The processor is used to implement a preceding resource verification method when running executable instructions stored in a memory.
[0121] The embodiment of the present invention further provides a computer-readable storage medium storing executable instructions, which implement the preceding resource verification method when executed by a processor.
[0122] according to Figure 2The electronic device shown, in one aspect of the present application, the present application also provides a computer program product or a computer program, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the different embodiments and combinations of embodiments provided in various optional implementations of the above-mentioned resource verification method.
[0123] The server in the embodiment of the present invention may 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, and big data and artificial intelligence platforms. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0124] Combination Figure 2 The electronic device 20 shown illustrates a resource verification method provided by an embodiment of the present invention, see Figure 3 , Figure 3 An optional flow chart of the resource verification method provided in the embodiment of the present invention is provided. It can be understood that: Figure 3 The steps shown can be performed by various servers running resource verification devices, such as a game server or a game server cluster with resource verification function. Figure 3 The steps shown are explained.
[0125] Step 301: The resource verification device triggers the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component.
[0126] Step 302: The resource verification device uses the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component.
[0127] Among them, reference Figure 4 , Figure 4 This is a schematic diagram of the structure of the resource table verification program in the embodiment of the present invention. The TDR part interface is encapsulated by C language for Lua script to call, so that the resource table content to be verified is loaded into a readable storage medium (such as memory) in the Lua script, so that the Lua script can execute the verification logic. Figure 4 As shown, the structure of the resource table verification program in the embodiment of the present invention includes three parts: 1) C program framework 2) TDR interface 3) Lua script framework, which are introduced below respectively:
[0128] 1. C program framework: The main entry point of the resource verification program in this application, which loads and executes the code of the Lua script framework and provides encapsulated functions for the Lua script framework to call, mainly including TDR reading resource table, TDR reading macro definitions in protocol files, and log output.
[0129] 2. TDR: TSF4G Data Represention, a cross-platform multi-language data representation component, is mainly used for data serialization and deserialization (supports binary mode and XML text mode) and ORM data storage. DR data representation components are released in the form of program libraries and TDR tools.
[0130] 3. Lua script framework: The Lua script file that will be executed after the C program framework is started, including reading all resource tables, loading random script verification rules, and general processing functions that may be used in the script.
[0131] Combination Figure 4 The resource table verification program structure shown in the figure, in some embodiments of the present invention, triggering the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component can be implemented in the following ways:
[0132] Trigger the C program framework in the resource table verification program; through the C program framework, load and execute the script file in the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component. Among them, the script file in the resource table verification program is Figure 4 The lua script file shown in the resource table check program is written in standard C language and is open in source code form. It is designed to be embedded in the application program, thereby providing flexible extension and customization functions for the application program. In the process of loading and executing the script file in the resource table check program, the script file has the following beneficial technical effects: Lightweight: It is written in standard C language and is open in source code form. After compilation, it is only more than 100K and can be easily embedded in other programs. Extensible: Lua provides very easy-to-use extension interfaces and mechanisms: these functions are provided by the host language (usually C or C++), and Lua can use them as if they were built-in functions. Support procedure-oriented programming and functional programming; automatic memory management; only one general type of table is provided, which can be used to implement arrays, hash tables, collections, and objects; language built-in pattern matching; closures; functions can also be regarded as values; provide multi-threading support (cooperative processes, not threads supported by the operating system); through closures and tables, it is very convenient to support some key mechanisms required for object-oriented programming, such as data abstraction, virtual functions, inheritance and overloading.
[0133] In some embodiments of the present invention, using a resource table verification program, all resource tables to be verified are loaded through the function interface of the cross-platform multi-language data representation component, which can be implemented in the following manner:
[0134] Using the resource table verification program, the contents of the original resource table and the protocol file are serialized through the function interface of the cross-platform multi-language data representation component to obtain all resource tables to be verified;
[0135] Through the function interface of the cross-platform multi-language data representation component, all resource tables to be verified are loaded into a readable medium. For example, after accessing a new game project, the protocol file of the new game project is received through the interactive interface, and the user imports the protocol file of the new game project through the control 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 resource table in the new game project. The resource representation 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 section of related data collection of a business module, such as a user table and a prop table; and the protocol file is used to define the table structure of the resource table and the data protocol supported by the resource table. The table structure includes three parts: the table name, the fields in the table, and the records of the table; among them, a collection of multiple field values of the same object is called a record; the field describes a certain feature of the specified object. Since the same game may have resource tables of different formats or versions, the game resource "props" may also exist in different resource tables. Therefore, by loading all resource tables into memory through the Lua script, cross-table association data verification can be easily performed. At the same time, multiple versions of resource table data can be loaded into the script memory at the same time for comparison and verification, further improving the accuracy of resource verification.
[0136] Step 303: The resource verification device obtains the verification rules corresponding to each resource table.
[0137] refer to Figure 5 , Figure 5 A schematic diagram is added for the verification rules in the embodiment of the present invention. In some embodiments of the present invention, obtaining the verification rules corresponding to each resource table can be implemented in the following manner:
[0138] When the script file in the resource table verification program is loaded and executed, the verification rules corresponding to each resource table and the general functions matching the script file are read through the script file. Among them, since different game programs have different requirements when performing resource verification, the verification rules obtained are also different. The verification rules included in the lua script file can be conventional verification rules, such as: custom verification rules, enumeration verification rules, uniqueness verification rules, range verification rules, or specific custom verification rules for a certain game program, such as: remaining funds verification, equipment authority verification, game character level verification. In order to increase the versatility of the resource verification method provided in the present application, when the resource table of the target program changes, at least one of the following is executed on the general verification rules in the script file in the resource table verification program: adding custom verification rules, deleting general verification rules, and replacing general verification rules with custom verification rules. As a result, the resource table verification program can reduce resource coupling in the verification process. In addition, the verification rules can be flexibly adjusted according to different game requirements. Such as Figure 5 As shown in the figure, when the "lottery" function is added to the game program, the verification rules are added as follows: the resource table that needs to be verified is named "lottery"; Line 626: It is necessary to verify that the "ID" field in the resource table is unique in the entire resource table and cannot be repeated; Line 627: It is necessary to verify that the "Type" field in the resource table can only be "FREE" or "MONEY"; Line 628: It is necessary to verify that the value range of the "Times" field in the resource table can only be 1-10; Line 629: It is necessary to verify that the "ItemID" field in the resource table exists in the "ID" field of the resource table "item"; Line 630: Some additional verification is required for the resource table, and the lottery_custom function defined in the lua script is executed for each row of data in the resource table.
[0139] Through the processing of step 301 to step 303, all resource tables to be verified are loaded, and after the verification rules corresponding to each resource table are obtained, resource verification can continue through step 304 to step 305.
[0140] Step 304: the resource verification device traverses all resource tables to be verified in a loop, executes verification rules matching the resource tables, and obtains verification results of the resource tables.
[0141] In some embodiments of the present invention, looping through all resource tables to be checked, executing the check rules matching the resource tables, and obtaining the check results of the resource tables can be achieved in the following ways:
[0142] Loop through all resource tables to be verified. When the resource table is not verified, execute the verification rules that match the resource table to obtain the verification result of the resource table, wherein the verification rules that match the resource table include at least one of the following: custom verification rules, enumeration verification rules, uniqueness verification rules, and range verification rules. Custom verification: verification rules that cannot be satisfied by the pre-set simple verification rules, or verification rules that are relatively special in the resource table itself, requiring the user to write a lua check function by himself. For example, props of the self-selected treasure box type can only be configured for manual use. Enumeration verification: pre-set common rules, used for a certain field in the resource table can only be an enumeration value, such as the use type in the prop table can only be automatic use or manual use. Range verification: pre-set common rules, used for the range limit of a certain field in the resource table, such as the level of the game player can only be between 1-40. Existence verification: pre-set common rules, used for a certain field in the resource table needs to exist in a field in another table, such as the props contained in the goods on the shelves in the mall must be configured in the prop table. Uniqueness check: pre-set common rules, used to ensure that a field in a resource table is unique across the entire resource table, such as the ID primary key of a resource table, which needs to be unique across the entire resource table.
[0143] Step 305: The resource verification device visualizes the verification result of the resource table, and sends the visualized verification result of the resource table to the display interface of the terminal.
[0144] refer to Figure 6 , Figure 6 This is a schematic diagram of the resource verification effect in an embodiment of the present invention. Figure 6 Schematic diagram of the effect, taking the resource verification of adding the red envelope function as an example, users can Figure 6 Clearly know: Resource table Disguise configuration, fixed quantity 28; Resource table Disguise configuration, single-select check is normal, current upper limit 100, current quantity 50; [Exchange table] [Daily purchase limit] check is successful, total number of daily purchase limit counter: 50, configured quantity: 6, resource table name: Exchange_1;
[0145] [Exchange table] [Weekly purchase limit] Check succeeded, weekly purchase limit counter total: 30, configured quantity: 1, resource table name: Exchange_1. [Exchange table] [Daily purchase limit] Check succeeded, daily purchase limit counter total: 50, configured quantity: 6, resource table name: Exchange_2. [Exchange table] [Weekly purchase limit] Check succeeded, weekly purchase limit counter total: 30, configured quantity: 0, resource table name: Exchange_2. [Exchange table] [Monthly purchase limit] Check succeeded, monthly purchase limit counter total: 20, configured quantity: 0, resource table name: Exchange_2. [Exchange table] [Yearly purchase limit] Check succeeded, yearly purchase limit counter total: 50, configured quantity: 0, resource table name: Exchange_2. [Exchange table] [Permanent purchase limit] Check succeeded, permanent purchase limit counter total: 50, configured quantity: 12, resource table name: Exchange_2.
[0146] In some embodiments of the present invention, due to the complex resource table of mobile games, each field can be configured with different verification rules. Due to different development requirements in different game products, when verifying the resource table, the pulled data resources are wrong, which makes the resource table wrong. Therefore, the resource table needs to be adjusted. If the verification rule is wrong, the verification rule needs to be adjusted. At this time, caching the resource table can allow developers to intervene in time and improve the flexibility of resource verification. Figure 7 , Figure 7 An optional flow chart of the resource verification method provided in the embodiment of the present invention is provided. It can be understood that: Figure 7 The steps shown can be executed by various servers running the service process detection device, for example, a dedicated terminal, server or server cluster with a service process detection function. Figure 7 The steps shown are explained.
[0147] Step 701: Determine the verification rules that match the different field information of the resource table respectively.
[0148] Step 702: Verify the field type, field enumeration, and field range of the resource table respectively through verification rules that match different field information of the resource table.
[0149] Step 703: Determine matching templates that respectively match different field information of the resource table.
[0150] Among them, reference Figure 8 , Figure 8An optional process structure diagram of the resource verification method provided in an embodiment of the present invention, wherein the accuracy verification process needs to iterate the sub-process reporting set, and match the template reporting with the matching rules for each actual report. The matching rules can establish uniqueness using several matching fields in the template reporting, and can establish a unique association between the template reporting and the actual reporting based on the splicing of these matching fields.
[0151] Step 704: Determine the matching rules that match the different field information of the resource table respectively through the matching template.
[0152] Step 705: Verify the accuracy of the resource table based on the matching rules that match the different field information of the resource table.
[0153] In some embodiments of the present invention, when the matching templates that respectively match the different field information of the resource table cannot be determined, the resource table saved in the process reporting set is adjusted to the cache result set; when the accuracy of the resource table is determined to be inaccurate based on the matching rules that respectively match the different field information of the resource table, the resource table saved in the process reporting set is adjusted to the cache result set.
[0154] Among them, if for a certain actual report, the template report set by the matching rule is not found in the template report corresponding to the sub-process in the database, it can be considered that the report has not been reported. After all report verifications are completed, the template report results that are not matched to the actual report are stored in the cache result set. When the template report matches the corresponding actual report, the fields in the non-matching rules matched by the actual report are compared with the corresponding fields of the template report. If they are consistent / compliant with the rules, the report is deemed to have passed. Otherwise, the results of the failed comparison are stored in the cache result set. After the resource table is adjusted to the cache result set, the operation and maintenance personnel can access the resource table in time to correct it, or adjust the verification rules, add custom verification rules, delete general verification rules, and replace general verification rules with custom verification rules to meet the usage requirements of different game programs.
[0155] The database may be a cloud server or a cloud server cluster. The embodiments of the present application may be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data calculation, storage, processing, and sharing. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business model applications. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites, so cloud technology needs to be supported by cloud computing.
[0156] It should be noted that cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called the "cloud". From the user's point of view, the resources in the "cloud" can be infinitely expanded, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a basic capability provider for cloud computing, a cloud computing resource pool platform will be established, referred to as a cloud platform, generally referred to as Infrastructure as a Service (IaaS), and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (which can be virtualized machines, including operating systems), storage devices and network devices.
[0157] Combined with the previous sequence Figure 1 As shown, the resource verification method provided in the embodiment of the present invention can be implemented by corresponding cloud devices, for example: the terminal (including the terminal 10-1 and the terminal 10-2) is connected to the server 200 located in the cloud through the network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two. It is worth noting that the server 200 can be a physical device or a virtualized device.
[0158] The resource verification method provided by this application is further described below in combination with different implementation scenarios. With the explosive growth of game data, traditional relational databases are increasingly unable to meet the requirements of high concurrent reading and writing, efficient storage and access of massive data, high scalability and high availability. NoSQL databases have developed very rapidly due to their advantages such as simple expansion and fast reading and writing. Fig. 9 , Fig. 9 This is a schematic diagram of the database architecture in this application. The database table is stored in the 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. Due to the fragmentation of game time, there are many interactions between players, the amount of data is large, and both full-area and full-server and zone-based servers are very common. The game is developing and changing rapidly, and there are many operational activities. The data storage layer has high requirements for low latency. Therefore, the read requests, write requests, and delete requests in the database are not only large in number, but also instantaneous. Therefore, it is necessary not only to reduce memory fragmentation and memory overhead, but also to ensure the security and accuracy of data without occupying the hardware overhead of the database, thereby reducing the user's usage cost. Fig. 9In the structure shown, a TcaplusDB record consists of a line of strings. Each field supports nested types, with a maximum of 32 levels of nesting. The maximum size of a single record is 10MB, and commonly used object files can be serialized into binary files for storage. Fig. 9 When the capacity of the source storage node in the database architecture shown is insufficient, the server needs to be expanded to migrate the game data stored in the source storage node to a new server. At this time, the new server can be the destination storage node.
[0159] exist Fig. 9 In the game database shown in the figure, add the item "lottery" to the target game program, see Fig.10 , Fig.10 The process diagram of the resource verification method provided in this application specifically includes the following steps:
[0160] Step 1001: Start the executable file program compiled by C language.
[0161] in, Fig.11 A schematic diagram of the front-end display effect of a lottery item is provided for an embodiment of the present invention, wherein during the game, lottery is a means of attracting users with good effects and has been widely used in various electronic games. For example, users can obtain virtual props, virtual resources, etc. required in the game through lottery activities in the game. At present, in some technologies, a roulette wheel is usually used to realize lottery and obtain virtual prizes. For example, by throwing a virtual dice to get points, a virtual prize corresponding to the landing point of the thrown dice on the roulette wheel can be obtained.
[0162] Step 1002: Load the Lua script, register the encapsulated functions such as resource loading and log output in the main logic of the program, read the Lua script file and execute it.
[0163] Fig.12 This is a schematic diagram of the resource table synchronization pipeline process in an embodiment of the present invention. After submitting the lottery prop resource table, the synchronization pipeline will be executed regularly, and the resource verification tool will be called to verify the submitted resources. If the verification is successful, the resource table will be automatically submitted to the server project directory. If the verification fails, it will not be synchronized.
[0164] Among them, the resource table that needs to be verified is named "lottery"; Line 626: It is necessary to verify that the "ID" field in the resource table is unique in the entire resource table and cannot be repeated; Line 627: It is necessary to verify that the "Type" field in the resource table can only be "FREE" or "MONEY"; Line 628: It is necessary to verify that the value range of the "Times" field in the resource table can only be 1-10; Line 629: It is necessary to verify that the "ItemID" field in the resource table exists in the "ID" field of the resource table "item"; Line 630: Some additional checks are required on the resource table, and the lottery_custom function defined in the lua script is executed for each row of data in the resource table.
[0165] Step 1003: Load the resource table. In the Lua script, call the TDR function interface encapsulated in the C program to load the resource table of the lottery props into the memory.
[0166] Step 1004: Loop through the lottery prop resource table in the memory, execute the corresponding verification rules registered in each resource table in the lua script rule file, and output verification information.
[0167] The present invention has the following beneficial technical effects:
[0168] 1) The embodiment of the present invention triggers the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component; uses the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component; obtains the verification rules corresponding to each resource table; loops through all resource tables to be verified, executes the verification rules that match the resource table, and obtains the verification results of the resource table; visualizes the verification results of the resource table, thereby automatically verifying the resource table and obtaining accurate resource verification results, which not only improves the efficiency and accuracy of resource verification, but also the resource table verification program can reduce resource coupling during the verification process. In addition, the verification rules can be flexibly adjusted according to different game requirements. At the same time, the resource table verification program can realize cross-table related data verification and simultaneous verification of resource tables of different versions, thereby improving the efficiency of resource verification.
[0169] 2) By sending the verification results of the visualized resource table to the display interface of the terminal, the user can intuitively and accurately know the verification results of the resource table, and adjust the resource table or verification rules in time to meet the usage requirements of different game products.
[0170] 3) Since different game programs have different resource verification requirements, it is possible to determine verification rules that match the different field information of the resource table. Through the verification rules that match the different field information of the resource table, the field type, field enumeration and field range of the resource table are verified respectively to meet the needs of different game programs.
[0171] 4) Due to different development requirements in different game products, when verifying the resource table, the pulled data resources are wrong, causing the resource table to be wrong. At this time, the resource table needs to be adjusted. If the verification rules are wrong, the verification rules need to be adjusted. At this time, caching the resource table can allow developers to intervene in time and improve the flexibility of resource verification.
[0172] The above are only embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A resource verification method, It is characterized in that The method comprises: Trigger the resource table verification program to obtain the function interface of the cross-platform multi-language data representation component; Using the resource table verification program, all resource tables to be verified are loaded through the function interface of the cross-platform multi-language data representation component; Get the validation rules corresponding to each resource table; Loop through all resource tables to be checked, execute the check rules matching the resource tables, and obtain the check results of the resource tables; The verification result of the resource table is visualized, and the verification result of the resource table after the visualization is sent to a display interface of the terminal.
2. The method according to claim 1, It is characterized in that The triggering resource table verification program obtains the function interface of the cross-platform multi-language data representation component, including: Trigger the C program framework in the resource table verification program; The script file in the resource table verification program is loaded and executed through the C program framework to obtain the function interface of the cross-platform multi-language data representation component.
3. The method according to claim 1, It is characterized in that The resource table verification program is used to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component, including: Utilizing the resource table verification program, serializing the contents of the original resource table and the protocol file through the function interface of the cross-platform multi-language data representation component to obtain all resource tables to be verified; All resource tables to be verified are loaded into a readable medium through the function interface of the cross-platform multi-language data representation component.
4. The method according to claim 2, It is characterized in that The obtaining of the verification rules corresponding to each resource table includes: When the script file in the resource table verification program is loaded and executed, the verification rule corresponding to each resource table and the general function matching the script file are read through the script file.
5. The method according to claim 4, It is characterized in that The method further comprises: When the resource table of the target program changes, at least one of the following is performed on the general verification rules in the script file in the resource table verification program: Add custom validation rules, delete the general validation rules, and replace the general validation rules with the custom validation rules.
6. The method according to claim 1, It is characterized in that The loop traverses all resource tables to be checked, executes the check rules matching the resource tables, and obtains the check results of the resource tables, including: Loop through all resource tables to be checked, and when the resource table is not checked, execute the check rule matching the resource table to obtain the check result of the resource table, wherein the check rule matching the resource table includes at least one of the following: Custom validation rules, enumeration validation rules, uniqueness validation rules, and range validation rules.
7. The method according to claim 6, It is characterized in that The method further comprises: Determine verification rules that match different field information of the resource table respectively; The field type, field enumeration and field range of the resource table are verified respectively by verification rules respectively matching different field information of the resource table.
8. The method according to claim 6, It is characterized in that The method further comprises: Determine matching templates that match different field information of the resource table respectively; Determining, through the matching template, verification rules that match different field information of the resource table respectively; The accuracy of the resource table is verified based on the verification rules respectively matched with the different field information of the resource table.
9. The method according to claim 8, It is characterized in that The method further comprises: When the matching templates respectively matching the different field information of the resource table cannot be determined, adjusting the resource table to the cache result set; When the accuracy of the resource table is determined to be inaccurate based on the verification rules respectively matched with different field information of the resource table, the resource table is adjusted to the cache result set.
10. A resource verification device, It is characterized in that The device comprises: The information transmission module is used to trigger the resource table verification program and obtain the function interface of the cross-platform multi-language data representation component; An information processing module, used to utilize the resource table verification program to load all resource tables to be verified through the function interface of the cross-platform multi-language data representation component; The information processing module is used to obtain the verification rules corresponding to each resource table; The information processing module is used to loop through all resource tables to be checked, execute the check rules matching the resource tables, and obtain the check results of the resource tables; The information processing module is used to visualize the verification result of the resource table and send the visualized verification result of the resource table to the display interface of the terminal.
11. An electronic device, It is characterized in that The electronic device comprises: A memory for storing executable instructions; A processor, configured to implement the resource verification method according to any one of claims 1 to 9 when running the executable instructions stored in the memory.
12. A computer program product comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the resource verification method described in any one of claims 1 to 9 is implemented.
13. A computer-readable storage medium storing executable instructions, It is characterized in that When the executable instructions are executed by the processor, the resource verification method described in any one of claims 1 to 9 is implemented.
