Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of protection of the invention.
The embodiment of the invention discloses a kind of data manipulation method and device, the query script searching target categorical data at least one memory space is encapsulated as public data query function, when needing to inquire about target categorical data corresponding to some classification logotype, target categorical data can be inquired to needing the classification logotype to target categorical data incoming in public data query function, inquiry velocity is fast, and query steps is simple, reduces the cost of labor of exploitation.
Referring to Fig. 1, Fig. 1 is the flow chart of a kind of data manipulation method disclosed in the embodiment of the present invention.As it is shown in figure 1, the method may comprise steps of.
S100, reception are for obtaining the operational order of target categorical data, and described operational order includes the classification logotype of described target categorical data;
In the embodiment of the present invention, data are when at least one memory space stores, it is sub-category storage, the data of each classification have a classification logotype, when user needs to obtain target categorical data, then enter the operating instructions, this operational order carries the classification logotype of the target categorical data needing acquisition.It should be noted that operational order can be the program code inputted, carrying the classification logotype of target categorical data in this program code, further, this program code can also carry the storage mark of at least one memory space needing inquiry.
S101, call public data query function inquires about whether there is the described target categorical data that described classification logotype is corresponding at least one memory space;
In the embodiment of the present invention, when receiving the operational order obtaining target categorical data, namely call the public data query function encapsulated in advance inquires about whether there is the target categorical data that category mark is corresponding at least one memory space.Public data query function can be tool-class code, and the normal data that this tool-class code comprises definition adds add interface and digital independent get interface.It should be noted that at least one memory space can include buffer memory, data base etc..
Public data query function can include the subfunction for inquiring about target categorical data in the buffer, optionally, public data query function could be included for inquiring about the subfunction of target categorical data in data base, when calling data query function, it is necessary to input the classification logotype of target categorical data to data query function and need the storage mark of at least one memory space inquired about every time.
S102, if there is described target categorical data at least one memory space described, then obtains described target categorical data.
In the embodiment of the present invention, inquired by public data query function and at least one memory space exists target categorical data, then obtain this target categorical data, concrete, at least one memory space can include buffer memory, it is also possible to includes data base, therefore, can be obtain target categorical data in the buffer, it is also possible to be acquisition target categorical data in data base.Optionally, the digital independent get interface that the mode of acquisition target categorical data can be through in public data query function from buffer memory or data base is read out.
In the embodiment of the present invention, receive the operational order for obtaining target categorical data, this operational order includes the classification logotype of target categorical data, call public data query function inquires about whether store the target categorical data that category mark is corresponding at least one memory space, if there is this target categorical data, then obtain this target categorical data.Pass through the present embodiment, the query script searching target categorical data at least one memory space is encapsulated as public data query function, when needing to inquire about target categorical data corresponding to some classification logotype, target categorical data can be inquired to needing the classification logotype to target categorical data incoming in public data query function, inquiry velocity is fast, and query steps is simple, reduces the cost of labor of exploitation.
Refer to the flow chart that Fig. 2, Fig. 2 are the disclosed another kind of data manipulation methods of the embodiment of the present invention.As in figure 2 it is shown, the method may comprise steps of.
S200, reception are for obtaining the operational order of target categorical data, and described operational order includes the classification logotype of described target categorical data;
Embodiment of the present invention step S200, refer to the embodiment step S100 of Fig. 1, does not repeat them here.
S201, call described public data query function inquires about at least one buffer memory described that at least one cashing indication described is corresponding whether there is the described target categorical data that described classification logotype is corresponding respectively;
In the embodiment of the present invention, at least one memory space includes at least one buffer memory, operational order includes the cashing indication of at least one buffer memory, call public data query function at least one buffer memory is inquired about, public data query function can be the public bag encapsulated in advance, and this public bag can be tool-class code.When every time inquiring about target categorical data in buffer memory, it is thus only necessary to the classification logotype of the cashing indication of the incoming buffer memory needing inquiry and target categorical data in this public data query function.
If S202 at least one buffer memory described exists described target categorical data, then from the buffer memory preserving described target categorical data, obtain described target categorical data.
In the embodiment of the present invention, if at least one buffer memory inquired about includes this target categorical data, then from the buffer memory preserving target categorical data, obtain this target categorical data.The buffer memory quantity needing inquiry can only one of which, can also have multiple, when the quantity of buffer memory has multiple, from buffer memory, target categorical data is then searched successively according to predefined order, such as, if buffer memory is memcached and jvm, then can first search from access speed faster jvm buffer memory, if finding, then from jvm buffer memory, obtain target categorical data;If not finding this target categorical data, then searching from memcached buffer memory, if memcached buffer memory exists, then from memcached buffer memory, obtaining target categorical data, this target categorical data is write in jvm buffer memory simultaneously.
Optionally, public data query function includes digital independent interface, the mode obtaining described target categorical data from the buffer memory preserving described target categorical data may is that the described digital independent interface calling in described public data query function, reads described target categorical data from the buffer memory preserving described target categorical data;
Concrete, pre-defined normal data reads get interface, and public data query function includes this get interface, when needs obtain target categorical data from buffer memory, call the digital independent get interface in public data query function, target categorical data can be obtained from buffer memory.
S203, if being absent from described target categorical data at least one buffer memory described, calls described public data query function inquires about in the data base that described Database Identification is corresponding whether there is the described target categorical data that described classification logotype is corresponding;
In the embodiment of the present invention, at least one memory space not only includes at least one buffer memory, also includes data base, not only includes the cashing indication of at least one buffer memory in operational order, also includes wide area information server mark.Public data query function includes the subfunction for inquiring about data in the buffer and for inquiring about the subfunction of data in data base.Call public data query function at least one buffer memory, do not inquire target categorical data, call in the data base that public data query function inquiry Database Identification is corresponding whether there is the target categorical data that category mark is corresponding.
If the described data base of S204 exists described target categorical data, then from described data base, obtain described target categorical data;
Optionally, public data query function includes digital independent interface, the mode obtaining described target categorical data from described data base may is that the described digital independent interface calling in described public data query function, reads described target categorical data from described data base.
Concrete, pre-defined normal data reads get interface, and public data query function includes this get interface, when needs obtain target categorical data from data base, call the digital independent get interface in public data query function, from data base, obtain this target categorical data.
S205, stores described target categorical data at least one buffer memory described.
In the embodiment of the present invention, from buffer memory, directly obtain target categorical data for the ease of next time, therefore when inquiring target categorical data in data base, target categorical data is stored at least one buffer memory.
Optionally, public data query function also includes data and adds interface, the concrete mode stored by described target categorical data at least one buffer memory described may is that the described data called in described public data query function add interface, and described target categorical data is added at least one buffer memory described.
Concrete, pre-defined normal data adds add interface, public data query function includes this add interface, when target categorical data is stored at least one buffer memory by needs, call the data in public data query function and add add interface, add target categorical data at least one buffer memory.
In the embodiment of the present invention, receive the operational order for obtaining target categorical data, this operational order includes the classification logotype of target categorical data, call public data query function inquires about whether store the target categorical data that category mark is corresponding at least one memory space, if there is this target categorical data, then obtain this target categorical data.Pass through the present embodiment, the query script searching target categorical data at least one memory space is encapsulated as public data query function, when needing to inquire about target categorical data corresponding to some classification logotype, target categorical data can be inquired to needing the classification logotype to target categorical data incoming in public data query function, inquiry velocity is fast, and query steps is simple, reduces the cost of labor of exploitation.
Referring to Fig. 3, Fig. 3 is the structure chart of a kind of data operation device disclosed in the embodiment of the present invention, as it is shown on figure 3, this data operation device includes:
Receiving unit 100, for receiving the operational order for obtaining target categorical data, described operational order includes the classification logotype of described target categorical data;
In the embodiment of the present invention, data are when at least one memory space stores, it is sub-category storage, the data of each classification have a classification logotype, when user needs to obtain target categorical data, then enter the operating instructions, receive unit 100 and receive this operational order, this operational order carries the classification logotype of the target categorical data needing acquisition.It should be noted that operational order can be the program code inputted, carrying the classification logotype of target categorical data in this program code, further, this program code can also carry the storage mark of at least one memory space needing inquiry.
Call unit 101, for calling public data query function inquires about whether there is the described target categorical data that described classification logotype is corresponding at least one memory space;
In the embodiment of the present invention, when receiving the operational order obtaining target categorical data, namely call unit 101 calls the public data query function encapsulated in advance inquires about whether there is the target categorical data that category mark is corresponding at least one memory space.Public data query function can be tool-class code, and the normal data that this tool-class code comprises definition adds add interface and digital independent get interface.It should be noted that at least one memory space can include buffer memory, data base etc..
Public data query function can include the subfunction for inquiring about target categorical data in the buffer, optionally, public data query function could be included for inquiring about the subfunction of target categorical data in data base, when calling data query function, it is necessary to input the classification logotype of target categorical data to data query function and need the storage mark of at least one memory space inquired about every time.
Acquiring unit 102, if there is described target categorical data at least one memory space described, obtains described target categorical data.
In the embodiment of the present invention, inquired by public data query function and at least one memory space exists target categorical data, acquiring unit 102 then obtains this target categorical data, concrete, at least one memory space can include buffer memory, it is also possible to includes data base, therefore, can be obtain target categorical data in the buffer, it is also possible to be acquisition target categorical data in data base.Optionally, the digital independent get interface that the mode of acquisition target categorical data can be through in public data query function from buffer memory or data base is read out.
Further alternative, described data operation device can also include memory element 103:
Described memory element 103, for storing described target categorical data at least one buffer memory described.
In the embodiment of the present invention, directly obtaining target categorical data from buffer memory for the ease of next time, therefore when inquiring target categorical data in data base, target categorical data is stored at least one buffer memory by memory element 103.
Optionally, public data query function also includes data and adds interface, the concrete mode that described target categorical data is stored at least one buffer memory described by memory element 103 may is that the described data that memory element 103 is called in described public data query function add interface, and described target categorical data is added at least one buffer memory described.
Concrete, pre-defined normal data adds add interface, public data query function includes this add interface, when target categorical data is stored at least one buffer memory by needs, memory element 103 is called the data in public data query function and is added add interface, adds target categorical data at least one buffer memory.
In the embodiment of the present invention, receive the operational order for obtaining target categorical data, this operational order includes the classification logotype of target categorical data, call public data query function inquires about whether store the target categorical data that category mark is corresponding at least one memory space, if there is this target categorical data, then obtain this target categorical data.Pass through the present embodiment, the query script searching target categorical data at least one memory space is encapsulated as public data query function, when needing to inquire about target categorical data corresponding to some classification logotype, target categorical data can be inquired to needing the classification logotype to target categorical data incoming in public data query function, inquiry velocity is fast, and query steps is simple, reduces the cost of labor of exploitation.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment can be by the hardware that program carrys out instruction relevant and completes, this program can be stored in a computer-readable recording medium, storage medium may include that flash disk, read only memory (Read-OnlyMemory, ROM), random access device (RandomAccessMemory, RAM), disk or CD etc..
Above client terminal playing control method a kind of disclosed in the embodiment of the present invention and client are described in detail, principles of the invention and embodiment are set forth by specific case used herein, and the explanation of above example is only intended to help to understand method and the core concept thereof of the present invention;Simultaneously for one of ordinary skill in the art, according to the thought of the present invention, all will change in specific embodiments and applications, in sum, this specification content should not be construed as limitation of the present invention.