A kind of data processing method and device
Technical field
The present embodiments relate to field of computer technology more particularly to a kind of data processing method and devices.
Background technology
Currently, server-side can describe a things in the form of object.Each object have oneself attribute and
Method body.In general, multiple objects that server-side is created are stored in distributed data base.For example, in electric business
In the warehousing system that this server-side of platform is disposed:Each warehouse can be considered as an object, can there is warehouse number, storehouse
The attributes such as library name, address, quantity in stock;Each commodity can also be considered as an object, can there is goods number, commodity
Whether title unit price, quantity, is the attributes such as promotional item.
To meet user's particular demands or business processing needs, often there is terminal reading or update server-side is created
Object part attribute application scenarios.But in the prior art, the processing tune for process object that server-side provides
All it is using whole attributes of object as processing unit with interface.For example, being stored with object A in server-side, which has
100 attributes, although terminal only wants to preceding 10 attributes of reading object A, based on the processing tune provided in prior art
With interface, the read requests that terminal is initiated to server-side still need to carry 100 attributes of object A.This request method makes
In follow-up reading or update distributed data base during corresponding data, the transmission consuming of data flow is larger, can increase
Server-side is added to bear the response for reading or updating request.
Invention content
A kind of data processing method of offer of the embodiment of the present invention and device, to mitigate server-side to reading or updating request
Response burden, reduces spent expense.
On the one hand, an embodiment of the present invention provides a kind of data processing method, this method includes:
Receive the original processing request of the terminal attribute set to target object transmitted after triggering setting demand;
It is asked, is determined to the target object and the matched attribute set of setting demand according to the original processing
New processing request;
Respond the new processing request.
On the other hand, the embodiment of the present invention additionally provides a kind of data processing equipment, which includes:
Original processing request reception unit, it is transmitted to target object after triggering setting demand for receiving terminal
Attribute set original processing request;
New processing request determination unit is determined for being asked according to the original processing to the target object and institute
State the new processing request of the matched attribute set of setting demand;
New processing request-response unit, for responding the new processing request.
It is transmitted to target object under setting demand to receive terminal for technical solution provided in an embodiment of the present invention
After the original processing request of attribute set, relevant response is not carried out directly against the original processing request, but first according to original
Begin to handle the new processing request with the matched attribute set of setting demand for asking to determine to target object, to be responded.
Due to the request data for response be only target object all properties set in the part attribute that matches with setting demand
Corresponding request data, so during subsequent response can be made to ask, the transmission consuming of data flow is smaller, so as to
Mitigate response burden of the server-side to processing request, reduces spent expense, and do not influence at the business under setting demand
Reason.
Description of the drawings
Fig. 1 is a kind of flow diagram for data processing method that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow diagram of data processing method provided by Embodiment 2 of the present invention;
Fig. 3 is a kind of structural schematic diagram for data processing equipment that the embodiment of the present invention three provides.
Specific implementation mode
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limitation of the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing described as flow chart or method.Although operations (or step) are described as the processing of sequence by flow chart,
Many of which operation can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of operations can be pacified again
Row.The processing can be terminated when its operations are completed, it is also possible to the additional step being not included in attached drawing.Institute
It states processing and can correspond to method, function, regulation, subroutine, subprogram etc..
Embodiment one
Fig. 1 is a kind of flow diagram for data processing method that the embodiment of the present invention one provides.It is provided in this embodiment
Scheme is applicable to the network architecture being made of terminal and server-side.Wherein, server-side can be used to terminal and provide data
The physical equipment or system of service are handled, such as server-side can be the distributed system being made of multiple servers, these clothes
Business device is combined provides data processing service for terminal jointly;Terminal can be such as smart mobile phone, tablet computer, notes
The physical equipments such as this computer or desktop computer.The data processing method can be executed by data processing equipment, described device
By software and or hardware realization, it is built in server-side.Referring to Fig. 1, data processing method provided in this embodiment specifically includes
Following operation.
S110, the original processing for receiving the terminal attribute set to target object transmitted after triggering setting demand
Request.
S120, it is asked according to original processing, determines the new place with the setting matched attribute set of demand to target object
Reason request.
S130, the response new processing request.
Wherein, target object is the object stored in server-side, which includes multiple attributes.For example, it takes
Business end is used to the platform that terminal provides shopping at network service, then the object that the server-side is stored may include:(it belongs in warehouse
Property can have warehouse number, warehouse title, address, quantity in stock etc.), (its attribute can have goods number, trade name to commodity
, unit price, quantity, whether be referred to as promotional item etc.).
In the prior art, no matter under which kind of setting demand, the processing request to object in server-side is that terminal is based on
What fixed common process calling interface was initiated, the parameter to be configured in the interface is typically object itself, namely needs pair
Whole attributes of object are configured.Even if under certain setting demands, it is only necessary to the part attribute in object is handled,
Such as need to only read commodity whether be promotional item this attribute, the read requests initiated in the prior art be also be directed to quotient
Whole attributes of this object of product, only the value of certain attributes therein is sky.But it is carried in being asked due to processing
Largely some attributes unrelated with current demand, so can make server-side in response handles request process, data flow
Transmission consuming is larger, and can also influence other processing of processing request pair some attributes unrelated with current demand.
In view of this, the present embodiment provides a solution, it is transmitted to mesh under setting demand to receive terminal
After the original processing request for marking the attribute set of object, relevant response is not carried out directly against the original processing request, but
First determine that the new processing to target object with the matched attribute set of setting demand is asked according to original processing request, with into
Row response.Due to the request data for response be only target object all properties set in the portion that matches with setting demand
Request data corresponding to adhering to separately property, so during subsequent response can be made to ask, the transmission consuming of data flow is smaller, from
And response burden of the server-side to processing request can be mitigated, spent expense is reduced, and do not influence under setting demand
Business processing.
As a kind of specific implementation mode of the present embodiment, it is transmitted to mesh after triggering setting demand to receive terminal
The original processing request of the attribute set of object is marked, including:Terminal is received after triggering setting demand based on to target object
Common process calling interface, the first attribute set to target object of transmission original processing request, the first attribute set
The set formed for all properties of target object;
Correspondingly, being asked according to original processing, determine to the new with the setting matched attribute set of demand of target object
Processing request, including:Original processing request is parsed, therefrom to filter out the pending attribute set phase with target object
The processing request data of pass, wherein pending attribute set is target object and the setting matched attribute set of demand;According to
Filter result generates new processing request.In the present embodiment, can which of pre-set target object attribute set be with
The matched attribute set of setting demand.
Illustratively, new processing request is generated according to filter result, including:A new data are created according to filter result
Connection object DTO (Data Transfer Object), the wherein attribute set of DTO are the pending property set of target object
It closes;Obtain be pre-created under setting demand to the personalisation process calling interface of target object, and by the personalisation process
The value of the parameter of calling interface is configured to value compatible with the DTO created, to generate new processing request.The new processing of response is asked
It asks, including:Based on the personalisation process calling interface after configuration operates, calling personalisation process component responds, newly processing is asked
It asks.
Based on the above-mentioned technical proposal, it will be recognized by one of ordinary skill in the art that terminal can also be directly based upon to target pair
The personalisation process calling interface of elephant initiates the processing with the setting matched attribute set of demand to target object to server-side
Request.As another specific implementation mode of the present embodiment, it is transmitted to mesh after triggering setting demand to receive terminal
The original processing request of the attribute set of object is marked, including:Terminal is received based on being pre-created under setting demand to target
The personalisation process calling interface of object, the original processing request of the second attribute set to target object of transmission;
It is asked according to original processing, determines the new processing with the matched attribute set of setting demand to target object
Request, including:Original processing is asked, as the new processing with the matched attribute set of setting demand to target object
Request;
The new processing request of response, including:Personalisation process component responds are called newly to handle request.
In embodiments of the present invention, processing request is read requests or update request.
Embodiment two
Fig. 2 is a kind of flow chart of data processing method provided by Embodiment 2 of the present invention.The present embodiment is in above-mentioned each reality
On the basis of applying example, a preferred embodiment is provided.Referring to Fig. 2, this method specifically includes following operation.
1. first, by the client in terminal after triggering setting demand, based on the common process tune to target object
With interface, the method 1 (being realized by first assembly 1) on remote call service end, to initiate the to target object to server-side
The original processing of one attribute set is asked.Wherein, the first attribute set is the set of all properties composition of target object.It is public
Processing calling interface in parameter be:The parameter of all properties of target object.It, can be by the ginseng in interface in called side body of laws
Several values pass to server-side.
Server-side, also i.e. will be in these parameters if do not handled the request after receiving original processing request
The useless parameter in part be filtered, can cause subsequently during respond request to corresponding to these parameters value carry out sequence
Occurs energy consumption phenomenon when rowization.For this purpose, server-side comes from client initiation using first assembly 1 to handle in the present embodiment
Original processing request.
2. configuring first assembly 1 in server-side after obtaining original processing request, which is parsed, with from
In filter out with the relevant processing request data of the pending attribute set of target object, wherein pending attribute set be target
Object with setting the matched attribute set of demand;A new data transmission object DTO is created according to filter result;It obtains pre-
First create under setting demand to the personalisation process calling interface of target object, by the parameter of personalisation process calling interface
Value be configured to value compatible with DTO, to generate new processing request;Then, it is connect based on the personalization after configuration operates
Mouthful, the method 2 (being realized by the second component 2) in server-side is called, to be initiated to server-side to target object and setting demand
The new processing of matched attribute set is asked.Wherein the attribute set of DTO is the pending attribute set of target object.
For example, client passes to coding, title, address and the affiliated city for including warehouse in the parameter of first assembly 1
City's code, and actually pertained only under setting demand to the coding in warehouse and the processing of affiliated city codes.At this time, it is necessary to
First assembly 1 completes the transfer process from target object to DTO.By conversion operation, first assembly 1, which can create one, only to be had
There is the DTO of the two attributes of coding and city codes, and the parameter value being adapted to therewith is passed into the second component 2.
3. the second component 2 configured in server-side is used as personalisation process component, after obtaining newly handling request, response
The new processing is asked, and the handling result that response obtains is returned to the client in terminal.
For example, the second component 2 find first assembly 1 pass over and contain only warehouse coding and city codes the two belong to
Property the compatible parameter values of DTO after, can specific process content is responded according to the parameter value, such as inquiry or more
Newly.At this time, it is not necessarily to be concerned about other property contents of target object during realizing that request responds, these contents are first
It is had been filtered out in component 1, and has been replaced this object of DTO.
4. certainly, be different from it is above-mentioned 1.-scheme that 3. provides, the client in terminal can also be according to setting demand encapsulation
DTO, based on being pre-created under setting demand to the personalisation process calling interface of target object, on remote call service end
The second component 2, the processing of target object and setting demand matched attribute set is asked with being sent to server-side.Second
Component 2 responds processing request, and the handling result that response obtains is returned to the client in terminal.
In the present embodiment, the relevant place of all properties set in being asked processing according to setting demand with target object
Reason data are filtered and encapsulate again, reduce many times to parse the request, avoid in follow-up reading or update point
In cloth database during corresponding data redundant data loss.It is flat to have ensured that server-side is in always by establishment DTO
In steady data exchange process, network is better adapted to.Even if attribute set is changed, DTO needs are modified, remotely
The calling interface of object can still continue to have.And scheme provided in this embodiment is applicable to following application scenarios:Clothes
Business end is non-distributed systems, needs to avoid accessing a large amount of thin scales of component object to call and client is avoided to depend on
Tool volume representation inside component object.
Embodiment three
Fig. 3 is a kind of structural schematic diagram for data processing equipment that the embodiment of the present invention three provides.Referring to Fig. 3, the data
The concrete structure of processing unit is as follows:
Original processing request reception unit 310, it is transmitted to target after triggering setting demand for receiving terminal
The original processing of the attribute set of object is asked;
New processing request determination unit 320, for being asked according to the original processing, it is determining to the target object with
The new processing of the matched attribute set of setting demand is asked;
New processing request-response unit 330, for responding the new processing request.
As a kind of specific implementation mode of the present embodiment, the original processing request reception unit 310 is specifically used for:
Terminal is received after triggering setting demand based on the common process calling interface to the target object, transmission
Original processing request to the first attribute set of target object, first attribute set are all categories of the target object
Property composition set;
Determination unit 320 is asked in the new processing, including:
Subelement 3201 is filtered, for being parsed to the original processing request, therefrom to filter out and the target
The relevant processing request data of pending attribute set of object, wherein the pending attribute set is the target object
With the matched attribute set of setting demand;
Subelement 3202 is generated, for generating new processing request according to filter result.
Illustratively, the generation subelement 3202, is specifically used for:
A new data transmission object DTO is created according to filter result, wherein the attribute set of the DTO is the mesh
Mark the pending attribute set of object;
Obtain be pre-created under setting demand to the personalisation process calling interface of the target object, and will be described
The value of the parameter of personalisation process calling interface is configured to value compatible with the DTO, to generate new processing request;
The new processing request-response unit 330 is specifically used for based on the personalisation process after configuration operates
Calling interface calls newly processing request described in personalisation process component responds.
As another specific implementation mode of the present embodiment, the original processing request reception unit 310 is specific to use
In:
Terminal is received based on being pre-created under setting demand to the personalisation process calling interface of the target object,
The original processing request of the second attribute set to target object sent;
Determination unit 320 is asked in the new processing, is specifically used for:
The original processing asked, as to the target object and the matched attribute set of setting demand
New processing request;
The new processing request-response unit 330, is specifically used for:It calls newly to handle described in personalisation process component responds and ask
It asks.
Based on the above technical solution, the processing request is read requests or update request.
The said goods can perform the method that any embodiment of the present invention is provided, and have the corresponding function module of execution method
And advantageous effect.
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.