CN103440285B - Large-scale mobile phone games system and database update method thereof - Google Patents

Large-scale mobile phone games system and database update method thereof Download PDF

Info

Publication number
CN103440285B
CN103440285B CN201310353724.XA CN201310353724A CN103440285B CN 103440285 B CN103440285 B CN 103440285B CN 201310353724 A CN201310353724 A CN 201310353724A CN 103440285 B CN103440285 B CN 103440285B
Authority
CN
China
Prior art keywords
data
class
module
sql statement
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310353724.XA
Other languages
Chinese (zh)
Other versions
CN103440285A (en
Inventor
柴魁元
阮江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING LOCOJOY TECHNOLOGY Co Ltd
Original Assignee
BEIJING LOCOJOY TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING LOCOJOY TECHNOLOGY Co Ltd filed Critical BEIJING LOCOJOY TECHNOLOGY Co Ltd
Priority to CN201310353724.XA priority Critical patent/CN103440285B/en
Publication of CN103440285A publication Critical patent/CN103440285A/en
Application granted granted Critical
Publication of CN103440285B publication Critical patent/CN103440285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of large-scale mobile phone games system and database update method thereof, described method includes: after game server software module starts, for each data class for mobile phone games, generate should data class there is the tables of data of identical class name with this data class;After game server software module receives the solicited message that game mobile client software module sends, it is resolved, according to analysis result and business demand, related data is operated accordingly, change accordingly including to the data of data class;The class name of data class, in calling database operating modules, during with the api routine of the corresponding database manipulation type that shifts gears of the data of data class, is passed to api routine by game server software module;Api routine, according to incoming class name, carries out the operation of described database manipulation type to the tables of data with this class name.The method makes large-scale mobile phone games be more convenient for developing, and reduces the development of games cycle.

Description

Large-scale mobile phone games system and database update method thereof
Technical field
The present invention relates to database field, particularly relate to a kind of large-scale mobile phone games system and database thereof more New method.
Background technology
Mobile phone games refer to the Games Software running on mobile phone.It is used at present writing the journey that mobile phone games are most Sequence language is Java language, sees J2ME(Java Platform, Micro Edition);Next to that C language.With The development of science and technology, the function of present mobile phone gets more and more, the most from strength to strength.And mobile phone games are the most far away It not that what " Tetris " in our impression, " Snake " etc picture is simple and crude, simple in rule Game, and then developed into match in excellence or beauty with handheld device, there is answering of the strongest recreational and interactivity Miscellaneous form;Such as equal to the large-scale mobile phone games " generation master " of computer game, " 10 years swords ".
Large-scale mobile phone games are usually online game, and it is with internet as transmission medium, with operation of playing Game server and user's handheld device (mobile terminal) that business provides are processing terminal, mobile to play Client software is the game on line of information interactive window.Realize the system of large-scale mobile phone games, the most large-scale Mobile phone games system, as it is shown in figure 1, include: be provided with the mobile terminal of game mobile client software 101, the game server 102 of network side, and the game number being connected with game server 102 it are arranged at According to storehouse 103.
After game mobile client software on mobile terminal 101 starts, according to user in the mistake playing game The operational order sent in journey sends corresponding solicited message to game server 102;Wherein, mobile whole End can be mobile phone, panel computer.
The game server software of corresponding game mobile client software is installed on game server 102, In order to the solicited message that game server 102 is received, after resolving, according to analysis result and industry Business demand, operates accordingly.
Such as, game server software receives the solicited message of customer upgrade equipment, and customer upgrade fills Standby business demand is: first deduct the monetary data of user, is then lifted out the attribute of the equipment of user; Whether have, after checking the attribute of the equipment promoting user afterwards, the achievement that can complete;Use if it has, update The achievement information at family.
Therefore, the operation carried out is needed to include according to the business demand of customer upgrade equipment: more new game number According to the monetary data of the user in storehouse 103, the subscriber's installation data updated in game database 103, Determining when having the achievement that can complete, the user updated in game database 103 achieves data.
Complete above-mentioned operation, then need the programming personnel of game in advance according to these business demands, incite somebody to action Perform the database update statement of these operations, i.e. sql(structured query language, structuring Query language) statement is programmed in game server software.It is to say, in game server software by In the code that programming personnel writes, include to solicited message resolve code, according to business demand to phase Close data and carry out the business logic codes of corresponding operating;And after carrying out corresponding operating, according to right in operation The sql statement code that the demand of database update is write.
Such as, the monetary data of above-mentioned user, subscriber's installation data, user achieve data and are stored in trip In tables of data A of play database 103;So need to complete associative operation by following sql statement:
The sql statement of the monetary data of the user in more new data table A;
The sql statement of the subscriber's installation data in more new data table A;
User in more new data table A achieves the sql statement of data;
It was found by the inventors of the present invention that programming personnel is during writing game server software, according to industry After business demand carries out corresponding operating to related data, further according to this operation of the Operations Analyst carried out to database Update demand, and write corresponding sql statement need take a substantial amount of time;This makes to use existing The cycle that the database update method of technology carries out large-scale mobile phone games exploitation is longer;Therefore, it is necessary to carry For a kind of database update method, can develop greatly with more convenient programming personnel based on this database update method Type mobile phone games, thus reduce the development of games cycle.
Summary of the invention
The defect existed for above-mentioned prior art, the invention provides a kind of large-scale mobile phone games system and Database update method so that large-scale mobile phone games based on this database update method are more convenient for developing, To reduce the development of games cycle.
According to an aspect of the invention, it is provided the database update side of a kind of large-scale mobile phone games system Method, including:
After the game server software module being installed on game server starts, for for mobile phone games Predefined each data class, generates should data class have the number of identical class name with this data class According to table;
The game mobile client being installed on mobile terminal is received soft in described game server software module After the solicited message that part module sends, the solicited message received is resolved;And according to analysis result and Related data is operated by business demand accordingly, and described operation includes the data of data class are carried out phase Should change;
Afterwards, described game server software module is in calling database operating modules, with described data During the api routine of the corresponding database manipulation type that shifts gears of the data of class, by the class of described data class Name is passed to described api routine;
Described api routine, according to incoming class name, carries out described database behaviour to the tables of data with this class name Make the operation of type.
Wherein, the shifting gears particularly as follows: increase new data in described data class of the data of described data class; And, it is specially data with the corresponding database manipulation type that shifts gears of the data of described data class and inserts Type;Or
Shifting gears particularly as follows: delete data from described data class of the data of described data class;And, It is specially data with the corresponding database manipulation type that shifts gears of the data of described data class and deletes type; Or
The data of described data class shift gears particularly as follows: the data revised in described data class;And, It is specially data modification type with the corresponding database manipulation type that shifts gears of the data of described data class.
It is preferred that described for for the predefined each data class of mobile phone games, generate should data Class also has the tables of data of identical class name with this data class, specifically includes:
For for the predefined each data class of mobile phone games, create one to should the data of data class Table: this tables of data is identical with the title of this data class, and each attribute defined in this data class maps respectively For each field in this tables of data.
It is preferred that described for for the predefined each data class of mobile phone games, generate should data Class also has the tables of data of identical class name with this data class, also includes:
For for the predefined each data class of mobile phone games, determining the label of each attribute of this data class;
For each attribute of this data class, arrange should the tables of data of data class according to the label of this attribute In, to should the label of field of attribute.
It is preferred that described api routine is according to incoming class name, the tables of data with this class name is carried out described The operation of database manipulation type, specifically includes:
Described api routine, according to incoming class name, obtains the data of the data class with this class name, and tool There is the tables of data of this class name;And according to obtain data, generate described database manipulation type, to described After tables of data carries out the sql statement operated, the sql statement according to generating carries out database manipulation.
It is preferred that in described generation described database manipulation type, sql that described tables of data is operated After statement, also include:
Described api routine is by the sql subquery cache of generation to subquery cache processing module;
The sql statement of caching in this module, every setting the time period, is carried out excellent by described subquery cache processing module After change, carry out database manipulation according to the sql statement after optimizing;
Wherein, described the method that is optimized of sql statement of caching in this module is included:
If described subquery cache processing module is determined for same tables of data, this module is cached with many numbers According to the sql statement of amendment type, then the sql statement that the most finally be stored in is retained, by other sql statement from This module is deleted;
If described subquery cache processing module is determined for same tables of data, this module is cached with and formerly deposits The data that enter insert the sql statement of type, and after the data that are stored in delete the sql statement of type;And institute State the data relating to update in the sql statement of data insertion type, with the sql that described data delete type The data relating to deletion action in statement are identical, then sql statement and data that described data are inserted type are deleted The sql statement of type is deleted from this module.
According to another aspect of the present invention, additionally provide a kind of large-scale mobile phone games system, including:
The game mobile client software module being installed on mobile terminal, after receiving the operational order of user, To the corresponding solicited message of game server;
The database operating modules being installed on game server, it includes multitype database action type Api routine;
The game server software module being installed on game server, for for mobile phone games after its startup Predefined each data class, generates should data class have the number of identical class name with this data class According to table;And after receiving described solicited message, the solicited message received is resolved;And according to solution Related data is operated by analysis result and business demand accordingly, and described operation includes data class Data change accordingly;Afterwards, in calling described database operating modules, with described data class During the api routine of the corresponding database manipulation type that shifts gears of data, the class name of described data class is passed Enter to described api routine;The tables of data with this class name, according to incoming class name, is entered by described api routine The operation of the described database manipulation type of row.
Further, described large-scale mobile phone games system, also include: subquery cache processing module;And
Api routine in described database operating modules, specifically for according to incoming class name, obtains and has this The data of the data class of class name, and there is the tables of data of this class name;And according to the data obtained, generate institute After sql statement that state database manipulation type, that described tables of data is operated, the sql statement that will generate It is cached in described subquery cache processing module;
The sql statement of caching in this module, every setting the time period, is carried out excellent by described subquery cache processing module After change, carry out database manipulation according to the sql statement after optimizing.
Further, described large-scale mobile phone games system, also include: statement logger module;
Described api routine is additionally operable to recorded in described statement logger module the sql statement of generation;With And
At least two before current time is set the sql language in the time period by described statement logger module Sentence retains;And after described subquery cache processing module breaks down, recovers, will this module be remembered The sql statement of record is written in described subquery cache processing module.
Further, described large-scale mobile phone games system, also include: data cache module;And
Described game server software module be additionally operable to described according to analysis result and business demand to relevant During data operate accordingly, from described data cache module, read the number carried out required for described operation According to;And after operating accordingly, the data buffer storage obtained after carrying out described operation delays to described data In storing module.
In technical solution of the present invention, large-scale mobile phone games system can be for pre-defining for mobile phone games Each data class, generate should the tables of data of data class;And the related data in data class occurs After change, by performing corresponding database manipulation based on this data class, realize the renewal of database. Thus, related data, during writing game server software, is entered by programming personnel according to business demand Row corresponding operating, after the data in data class relevant in operation are changed, need not be further according to carrying out This operation of Operations Analyst the demand of database update is write corresponding sql statement, such programming personnel On the code of the service logic aspect that more energy can be placed on exploitation game, and need not be bottom Calling of database and expend too much energy so that programming personnel is more convenient for developing large-scale mobile phone games, subtracts The little development of games cycle.
Further, being also provided with in the large-scale mobile phone games system of the present invention can be to the sql statement generated The statement logger module being optimized, which reduces transmission and the execution of database update statement, Improve the efficiency of database update;And, being also provided with in the large-scale mobile phone games system of the present invention can With the statement logger module that the sql statement generated in certain period of time is retained, delay at statement Deposit after processing module breaks down, recovers, still can ensure that the related data being changed can safety Store in database, thus ensure that the security of data.
Accompanying drawing explanation
Fig. 1 is the Organization Chart of the large-scale mobile phone games system of prior art;
Fig. 2 is a kind of internal structure block diagram of the large-scale mobile phone games system of the embodiment of the present invention;
Fig. 3 is the flow chart of the database update method of the large-scale mobile phone games system of the embodiment of the present invention;
Fig. 4 is the another kind of internal structure block diagram of the large-scale mobile phone games system of the embodiment of the present invention.
Detailed description of the invention
Below with reference to accompanying drawing, technical scheme is carried out clear, complete description, it is clear that Described embodiment is only a part of embodiment of the present invention rather than whole embodiments.Base Embodiment in the present invention, those of ordinary skill in the art are not making the premise of creative work All other embodiments obtained by lower, broadly fall into the scope that the present invention is protected.
The term such as " module " used in this application, " system " is intended to include the entity relevant to computer, example Such as, but not limited to, hardware, firmware, combination thereof, software or executory software.Such as, module can To be, it is not limited to: on processor run process, processor, object, executable program, hold Thread, program and/or the computer of row.For example, application program calculating equipment run and this calculating Equipment can be module.One or more modules may be located in an executory process and/or thread, One module can also be on a computer and/or be distributed between two or more multiple stage computer.
It was found by the inventors of the present invention that in the development process of large-scale mobile phone games, programming personnel generally uses Object-oriented language carries out programming;Object oriented language (Object-Oriented Language) is one Plant the programming language using object as base program structural units, refer to that the design for describing is with object For core, and to as if the basis of program time of running;Object oriented language provides class, succession Deng composition;One class is used to describe the common structure of all objects belonging to this class.
Generally including two kinds in a large-scale mobile game, a kind service-oriented is referred to as service class, One kind data-oriented is referred to as data class;In large-scale mobile game, if the related data in data class There occurs and change the operation that so may need to relate to that database is updated.
So, if the present inventor is it is considered that after related data in data class changes, perform Corresponding database manipulation based on this data class;Thus programming personnel is writing game server software process In, according to business demand, related data is carried out corresponding operating, to the data in data class relevant in operation After being changed, need not further according to this operation of the Operations Analyst carried out to the demand of database update (such as, Analyze and need which field in which tables of data is carried out which type of operation), write corresponding sql language Sentence, and it is the most permissible to be carried out corresponding database manipulation based on this data class.So, programming people On the code of the service logic aspect that more energy can be placed on exploitation game by member, and need not be bottom Calling of database and expend too much energy;Make programming personnel be more convenient for developing large-scale mobile phone games, reduce Development of games cycle.
Describe technical scheme below in conjunction with the accompanying drawings in detail.
Based on above-mentioned analysis and thinking, the system that large-scale mobile phone games can be realized of the present invention, the most large-scale Mobile phone games system, internal structure block diagram is as in figure 2 it is shown, include: the game being installed on mobile terminal moves Dynamic client software module 201, the game server software module 202 being installed on game server, and Database operating modules 203 based on data class.
The game mobile client software module 201 being installed on mobile terminal can be mobile with existing game Client software is identical, after receiving the operational order of user, to the corresponding solicited message of game server; And after receiving the information that game server returns, carry out the display of corresponding game picture.
The game server software module 202 being installed on game server is then soft with existing game server Part is different: pre-defined each data class for mobile phone games in game server software module 202, and Generate the tables of data of corresponding each data class;Receiving asking of game mobile client software module 201 transmission After seeking information, the solicited message received is resolved, according to analysis result and business demand to dependency number After operating accordingly, the API in database operating modules 203 based on data class can be called (Application Programming Interface, application programming interfaces) program, the api routine pair called Tables of data in database carries out data insertion, the operation deleted, revise;Wherein, database and game garment Business device is connected.
Database operating modules 203 based on data class includes the api routine of multitype database action type; Such as:
Database manipulation type is the api routine that data insert type: int Save(TModel tModel);
Database manipulation type is the api routine that data delete type: int Delete(TModel tModel);
Database manipulation type is the api routine of data modification type: int Update(TModel tModel); Wherein, be the parameter of incoming api routine in bracket, i.e. the class name of data class.
The flow process of database update method based on above-mentioned large-scale mobile phone games system, as it is shown on figure 3, bag Include following steps:
After S301: game server software module 202 starts, for predefined often for mobile phone games Individual data class, generates should data class have the tables of data of identical class name with this data class.
Specifically, for for the predefined each data class of mobile phone games, create one to should data The tables of data of class: this tables of data is identical with the title of this data class, and each attribute defined in this data class The each field being each mapped in this tables of data;Further, it is also possible to for pre-defining for mobile phone games Each data class, determine the label of each attribute of this data class;For each attribute of this data class, root Arrange should be in the tables of data of data class according to the label of this attribute, to should the label of field of attribute;Tool Body process it may be that game server software module 202 process initiation after, for predefined data Class generates relevant metadata by reflection;Afterwards, when performing to build table order, the unit of corresponding each data class Data, generate the statement of the tables of data creating corresponding each data class respectively;Such as, the establishment " user " of generation The statement of tables of data is as follows:
CREATE TABLE User(
' UserId ' VARCHAR(30) NOT NULL DEFAULT ' ',
' UserName ' VARCHAR(50) DEFAULT NULL,
‘Gold’INT(11)DEFAULT NULL,
PRIMARY KEY(‘UserId’)
)
Wherein, the field in the table of establishment include " UserId " (ID), " UserName " (user name), " Gold " (gold coin);Additionally include the label of field " UserId ", i.e. major key label (Primarykey).
It is true that after step S301 terminates, if game mobile client software module 201 receives user Operational order, send corresponding solicited message to game server software module 202, the most large-scale mobile phone is swum Play system performs following step according to the solicited message of user and completes the renewal of database:
S302: receive game mobile client software module 201 in game server software module 202 After the solicited message sent, the solicited message received is resolved;And according to analysis result and business demand Operating related data accordingly, described operation includes changing the data of data class accordingly.
Such as, if game server software module 202 receives game mobile client software module 201 Send solicited message, and to receive solicited message resolve after, the analysis result obtained is user Upgrade equipment, then first the monetary data in monetary data class is carried out by game server software module 202 Change (deducting a part of currency), then be changed (promoting to the equipment data in equipment data class The attribute of the equipment of user);If after the equipment data in equipment data class change, user has can be complete The achievement become, then be changed (updating the achievement information of user) to the achievement data in achievement data class.
S303: game server software module 202 is in calling database operating modules 203, with described During the api routine of the corresponding database manipulation type that shifts gears of the data of data class, by described data class Class name be passed to this api routine.
Specifically, according to analysis result and business demand, the data of data class are entered in above-mentioned steps S302 Row is corresponding change after, programming personnel can follow-up carry out as described in this step S303 call database manipulation mould The api routine operation of block 203:
In the process, if related data is carried out by above-mentioned steps S302 according to analysis result and business demand In corresponding operation, to the shifting gears of data of data class it is: in described data class, increase new data, The database manipulation type of the api routine then called in this step S303 is the change of the data with this data class Mode corresponding database manipulation type, i.e. data insert type;
If related data is operated accordingly by above-mentioned steps S302 according to analysis result and business demand In, to the shifting gears of data of data class it is: from described data class, delete data, then this step S303 In the database manipulation type of api routine called be the corresponding number that shifts gears of the data with this data class According to storehouse action type, i.e. data delete type;
If related data is operated accordingly by above-mentioned steps S302 according to analysis result and business demand In, to the shifting gears of data of data class it is: revise the data in described data class, then this step S303 In the database manipulation type of api routine called be the corresponding number that shifts gears of the data with this data class According to storehouse action type, i.e. data modification type.
After changing due to the related data in data class, programming personnel only needs to know related data Shift gears, call the api routine of database operating modules, it is no longer necessary to enter according to related data This operation of Operations Analyst of row the demand to database update, also need not write corresponding sql language according to this operation Sentence, so, programming personnel need not expend too much energy for the calling of database of bottom;Make to program people Member is more convenient for developing large-scale mobile phone games, reduces the development of games cycle.
S304: this api routine, according to incoming class name, carries out described data to the tables of data with this class name The operation of storehouse action type.
Specifically, this api routine, according to incoming class name, obtains the data of the data class with this class name, And there is the tables of data of this class name;And according to obtain data, generate described database manipulation type, After the sql statement operating described tables of data, the sql statement according to generating carries out database manipulation.
Such as, if the class entitled monetary data class being passed to this api routine, described database manipulation type is Data modification type, then monetary data table is modified by this api routine, specifically can be to monetary data table In currency fields modify.
As a kind of more excellent embodiment, present invention also offers a kind of large-scale mobile phone games system, internal Structured flowchart as shown in Figure 4, including: the game mobile client software module 401 that is installed on mobile terminal, The game server software module 402 being installed on game server, database operating modules based on data class 403, and subquery cache processing module 404.
Game mobile client software module 401 and the merit of above-mentioned game mobile client software module 201 Can be identical;The function phase of game server software module 402 and above-mentioned game server software module 202 With, here is omitted.
Database operating modules 403 based on data class includes the api routine of multitype database action type; During the game server software module 402 api routine in calling database operating modules 403, by data After the class name of class is passed to this api routine, this api routine, according to incoming class name, obtains and has this class name The data of data class, and there is the tables of data of this class name;And according to the data obtained, generate described number According to storehouse action type, sql statement that described tables of data is operated, and the sql subquery cache that will generate In subquery cache processing module 404.
The sql statement of caching in this module, every setting the time period, is carried out excellent by subquery cache processing module 404 After change, carry out database manipulation according to the sql statement after optimizing;Wherein, subquery cache processing module 404 will In this module, the sql statement of caching is optimized and specifically may include that
If subquery cache processing module 404 is determined for same tables of data, this module is cached with many numbers According to the sql statement of amendment type, then the sql statement that the most finally be stored in is retained, by other sql statement from This module is deleted;If subquery cache processing module 404 is determined for same tables of data, slow in this module Have the data that are formerly stored in and insert the sql statement of type, and after the data that are stored in delete the sql of type Statement;And data insert in the sql statement of type and relate to the data of update, with the sql that data delete type The data relating to deletion action in statement are identical, then sql statement and data that data are inserted type delete type Sql statement delete from this module.
Such as, if user has carried out the operation repeatedly revising monetary data, then API meeting in setting the time period The a plurality of sql subquery cache of currency amendment operation that carries out monetary data table generated is to subquery cache module In 404;Subquery cache module 404 only retains be finally stored in and monetary data table carries out currency amendment behaviour The sql statement made, and carry out database manipulation according only to this sql statement;
For another example, after user obtains an equipment, in setting the time period, again this equipment is sold, then API Can be generated one the sql statement that equipment tables of data is carried out this equipment update, and one to dress Standby tables of data carries out the sql subquery cache of this equipment deletion action in subquery cache module 404;Subquery cache Two sql statements are deleted by module 404, do not carry out database manipulation;So, database is decreased more The transmission of new statement and execution, improve the efficiency of database update;And, user carries out database update Operation the most frequent, the raising of the efficiency of database update is the most obvious.
Further, large-scale mobile phone games system as shown in Figure 4 may also include that statement logger module 405.
Correspondingly, the sql statement of generation also can be recorded language by the api routine in database operating modules 403 In sentence logger module 405.
At least two before current time is set the sql language in the time period by statement logger module 405 Sentence retains;And after subquery cache processing module 404 breaks down, recovers, will this module be remembered The sql statement of record is written in subquery cache processing module 404.So, in subquery cache processing module 404 After breaking down, recovering, still can ensure that the related data being changed can be safely stored into database In, it is ensured that the security of data.
Large-scale mobile phone games system as shown in Figure 2, Figure 4 shows, may also include that data cache module;
Correspondingly, game server software module 202/ game server software module 402 is additionally operable in basis During related data is operated by analysis result and business demand accordingly, read from data cache module Carry out the data required for described operation;And after operating accordingly, will obtain after carrying out described operation Data buffer storage in data cache module.
In technical solution of the present invention, large-scale mobile phone games system can be for pre-defining for mobile phone games Each data class, generate should the tables of data of data class;And the related data in data class occurs After change, operated by the associated databases performing the tables of data corresponding to this data class, realize data The renewal in storehouse.Thus, programming personnel is during writing game server software, according to business demand pair Related data carries out corresponding operating, after the data in data class relevant in operation are changed, and need not Further according to this operation of the Operations Analyst the carried out demand to database update, without right according to analyze The demand of database update writes corresponding sql statement, and more energy can be put by such programming personnel On the code of the service logic aspect of exploitation game, and need not expend for the calling of database of bottom Too much energy so that programming personnel is more convenient for developing large-scale mobile phone games, reduces the development of games cycle.
Further, being also provided with in the large-scale mobile phone games system of the present invention can be to the sql statement generated The statement logger module being optimized, which reduces transmission and the execution of database update statement, Improve the efficiency of database update;And, being also provided with in the large-scale mobile phone games system of the present invention can With the statement logger module that the sql statement generated in certain period of time is retained, delay at statement Deposit after processing module breaks down, recovers, still can ensure that the related data being changed can safety Store in database, thus ensure that the security of data.
The above is only the preferred embodiment of the present invention, it is noted that general for the art For logical technical staff, under the premise without departing from the principles of the invention, it is also possible to make some improvement and profit Decorations, these improvements and modifications also should be regarded as protection scope of the present invention.

Claims (8)

1. the database update method of one kind large-scale mobile phone games system, it is characterised in that including:
After the game server software module being installed on game server starts, for for mobile phone games Predefined each data class, generates should data class have the number of identical class name with this data class According to table;
The game mobile client being installed on mobile terminal is received soft in described game server software module After the solicited message that part module sends, the solicited message received is resolved;And according to analysis result and Related data is operated by business demand accordingly, and described operation includes the data of data class are carried out phase Should change;
Afterwards, described game server software module is in calling database operating modules, with described data During the api routine of the corresponding database manipulation type that shifts gears of the data of class, by the class of described data class Name is passed to described api routine;
Described api routine, according to incoming class name, carries out described database behaviour to the tables of data with this class name Make the operation of type, specifically include: described api routine, according to incoming class name, obtains and has this class name The data of data class, and there is the tables of data of this class name;And according to the data obtained, generate described data After storehouse action type, the sql statement that operates described tables of data, the sql statement according to generating is carried out Database manipulation;And, described api routine is by the sql subquery cache of generation to subquery cache processing module; Described subquery cache processing module is every setting the time period, after in this module, the sql statement of caching is optimized, Database manipulation is carried out according to the sql statement after optimizing.
2. the method for claim 1, it is characterised in that shifting gears of the data of described data class Particularly as follows: described data class increases new data;And, with shifting gears of the data of described data class Corresponding database manipulation type is specially data and inserts type;Or
Shifting gears particularly as follows: delete data from described data class of the data of described data class;And, It is specially data with the corresponding database manipulation type that shifts gears of the data of described data class and deletes type; Or
The data of described data class shift gears particularly as follows: the data revised in described data class;And, It is specially data modification type with the corresponding database manipulation type that shifts gears of the data of described data class.
3. method as claimed in claim 2, it is characterised in that described for fixed in advance for mobile phone games Each data class of justice, generate to should data class there is the tables of data of identical class name with this data class, Specifically include:
For for the predefined each data class of mobile phone games, create one to should the data of data class Table: this tables of data is identical with the title of this data class, and each attribute defined in this data class maps respectively For each field in this tables of data.
4. method as claimed in claim 3, it is characterised in that described for fixed in advance for mobile phone games Each data class of justice, generate to should data class there is the tables of data of identical class name with this data class, Also include:
For for the predefined each data class of mobile phone games, determining the label of each attribute of this data class;
For each attribute of this data class, arrange should the tables of data of data class according to the label of this attribute In, to should the label of field of attribute.
5. method as claimed in claim 4, it is characterised in that described by the sql language of caching in this module The method that sentence is optimized includes:
If described subquery cache processing module is determined for same tables of data, this module is cached with many numbers According to the sql statement of amendment type, then the sql statement that the most finally be stored in is retained, by other sql statement from This module is deleted;
If described subquery cache processing module is determined for same tables of data, this module is cached with and formerly deposits The data that enter insert the sql statement of type, and after the data that are stored in delete the sql statement of type;And institute State the data relating to update in the sql statement of data insertion type, with the sql that described data delete type The data relating to deletion action in statement are identical, then sql statement and data that described data are inserted type are deleted The sql statement of type is deleted from this module.
6. one kind large-scale mobile phone games system, it is characterised in that including:
The game mobile client software module being installed on mobile terminal, after receiving the operational order of user, To the corresponding solicited message of game server;
The database operating modules being installed on game server, it includes multitype database action type Api routine;
The game server software module being installed on game server, for for mobile phone games after its startup Predefined each data class, generates should data class have the number of identical class name with this data class According to table;And after receiving described solicited message, the solicited message received is resolved;And according to solution Related data is operated by analysis result and business demand accordingly, and described operation includes data class Data change accordingly;Afterwards, in calling described database operating modules, with described data class During the api routine of the corresponding database manipulation type that shifts gears of data, the class name of described data class is passed Enter to described api routine;The tables of data with this class name, according to incoming class name, is entered by described api routine The operation of the described database manipulation type of row;
Described system also includes: subquery cache processing module;And
Api routine in described database operating modules, specifically for according to incoming class name, obtains and has this The data of the data class of class name, and there is the tables of data of this class name;And according to the data obtained, generate institute After sql statement that state database manipulation type, that described tables of data is operated, the sql statement that will generate It is cached in described subquery cache processing module;
The sql statement of caching in this module, every setting the time period, is carried out excellent by described subquery cache processing module After change, carry out database manipulation according to the sql statement after optimizing.
7. system as claimed in claim 6, it is characterised in that also include: statement logger module;
Described api routine is additionally operable to recorded in described statement logger module the sql statement of generation;With And
At least two before current time is set the sql language in the time period by described statement logger module Sentence retains;And after described subquery cache processing module breaks down, recovers, will this module be remembered The sql statement of record is written in described subquery cache processing module.
System the most as claimed in claims 6 or 7, it is characterised in that also include: data cache module; And
Described game server software module be additionally operable to described according to analysis result and business demand to relevant During data operate accordingly, from described data cache module, read the number carried out required for described operation According to;And after operating accordingly, the data buffer storage obtained after carrying out described operation delays to described data In storing module.
CN201310353724.XA 2013-08-14 2013-08-14 Large-scale mobile phone games system and database update method thereof Active CN103440285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310353724.XA CN103440285B (en) 2013-08-14 2013-08-14 Large-scale mobile phone games system and database update method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310353724.XA CN103440285B (en) 2013-08-14 2013-08-14 Large-scale mobile phone games system and database update method thereof

Publications (2)

Publication Number Publication Date
CN103440285A CN103440285A (en) 2013-12-11
CN103440285B true CN103440285B (en) 2016-09-07

Family

ID=49693977

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310353724.XA Active CN103440285B (en) 2013-08-14 2013-08-14 Large-scale mobile phone games system and database update method thereof

Country Status (1)

Country Link
CN (1) CN103440285B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927168B (en) * 2014-04-02 2017-10-27 北京中交兴路车联网科技有限公司 A kind of method and device of object-oriented data model persistence
CN104601562B (en) * 2015-01-04 2017-12-22 福建天晴数码有限公司 The exchange method and system of game server and database
CN105045789A (en) * 2015-02-15 2015-11-11 北京乐动卓越信息技术有限公司 Game server database buffer memory method and system
CN105056529B (en) * 2015-08-13 2018-11-09 北京乐动卓越科技有限公司 A kind of the management system and management method of player's data
CN107729579B (en) * 2017-11-29 2021-04-09 武汉斗鱼网络科技有限公司 Database separation design method and device
CN108647283A (en) * 2018-05-04 2018-10-12 武汉灵动在线科技有限公司 A kind of configuration of game data is quick to be generated and analytic method
CN111352918B (en) * 2018-12-21 2023-05-23 卓望数码技术(深圳)有限公司 Terminal database data migration method and system
CN109933573B (en) * 2019-01-30 2021-06-01 北京融链科技有限公司 Database service updating method, device and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7249140B1 (en) * 2002-05-31 2007-07-24 Ncr Corp. Restartable scalable database system updates with user defined rules
CN102033948A (en) * 2010-12-22 2011-04-27 中国农业银行股份有限公司 Method and device for updating data
CN102609488A (en) * 2012-01-20 2012-07-25 北京星网锐捷网络技术有限公司 Client, data query method of client, server and data query system
CN102741843A (en) * 2011-03-22 2012-10-17 青岛海信传媒网络技术有限公司 Method and apparatus for reading data from database
CN103020193A (en) * 2012-12-03 2013-04-03 北京奇虎科技有限公司 Method and equipment for processing database operation request
US8473519B1 (en) * 2008-02-25 2013-06-25 Cisco Technology, Inc. Unified communication audit tool

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8739118B2 (en) * 2010-04-08 2014-05-27 Microsoft Corporation Pragmatic mapping specification, compilation and validation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7249140B1 (en) * 2002-05-31 2007-07-24 Ncr Corp. Restartable scalable database system updates with user defined rules
US8473519B1 (en) * 2008-02-25 2013-06-25 Cisco Technology, Inc. Unified communication audit tool
CN102033948A (en) * 2010-12-22 2011-04-27 中国农业银行股份有限公司 Method and device for updating data
CN102741843A (en) * 2011-03-22 2012-10-17 青岛海信传媒网络技术有限公司 Method and apparatus for reading data from database
CN102609488A (en) * 2012-01-20 2012-07-25 北京星网锐捷网络技术有限公司 Client, data query method of client, server and data query system
CN103020193A (en) * 2012-12-03 2013-04-03 北京奇虎科技有限公司 Method and equipment for processing database operation request

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DAO(一);坏小子;《http://blog.sina.com.cn/s/blog_6fd9615d01010b0h.html》;20120217;第2页第13行到第2页第19行 *

Also Published As

Publication number Publication date
CN103440285A (en) 2013-12-11

Similar Documents

Publication Publication Date Title
CN103440285B (en) Large-scale mobile phone games system and database update method thereof
CN107402992B (en) Distributed NewSQL database system and full-text retrieval establishing method
EP2874077B1 (en) Stateless database cache
CN107038222A (en) Database caches implementation method and its system
US8881127B2 (en) Systems and methods to automatically generate classes from API source code
CN106104596A (en) Display is for the cooperation icon of the state that cooperates
CN101246495A (en) Method for constructing query scheme and executing data query and statistics
CN108319661A (en) A kind of structured storage method and device of spare part information
CN101794315A (en) Object relationship mapping model with fixed database schema
CN110737682A (en) cache operation method, device, storage medium and electronic equipment
CN104317957B (en) A kind of open platform of report form processing, system and report processing method
CN102054217A (en) Entity morphing in metamodel-based tools
CN110109958A (en) Method for caching and processing, device, equipment and computer readable storage medium
US20050166115A1 (en) Method for performing software stress test
CN112506892A (en) Index traceability management system based on metadata technology
CN101013426B (en) Information management apparatus and method
CN111159040A (en) Test data generation method, device, equipment and storage medium
US20110264487A1 (en) Embedding Planning Components In Transactional Applications
US20040064804A1 (en) Generation of partitioned enterprise application using a high-level specification
CN110209744A (en) Relevant database and its operating method and device based on alliance's chain
CN110532225A (en) Storage engines switching method, device, electronic equipment and medium
CN110222032A (en) A kind of generalised event model based on software data analysis
CN110083596A (en) A kind of method of data history tracking and the tracking of data change histories
CN110531964A (en) The intelligent developed method of software personalisation
CN107533559A (en) Data structure, the model for filling data structure and the method being programmed using data structure to processing unit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant