CN109814863A - A kind of processing method, device, computer equipment and computer storage medium for requesting returned data - Google Patents
A kind of processing method, device, computer equipment and computer storage medium for requesting returned data Download PDFInfo
- Publication number
- CN109814863A CN109814863A CN201811536327.5A CN201811536327A CN109814863A CN 109814863 A CN109814863 A CN 109814863A CN 201811536327 A CN201811536327 A CN 201811536327A CN 109814863 A CN109814863 A CN 109814863A
- Authority
- CN
- China
- Prior art keywords
- control
- data
- returned data
- returned
- marking variable
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 21
- 241001269238 Data Species 0.000 claims abstract description 28
- 238000000034 method Methods 0.000 claims abstract description 28
- 238000003780 insertion Methods 0.000 claims abstract description 24
- 230000037431 insertion Effects 0.000 claims abstract description 24
- 238000013507 mapping Methods 0.000 claims abstract description 18
- 238000012545 processing Methods 0.000 claims abstract description 16
- 230000006870 function Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 claims description 8
- 238000005538 encapsulation Methods 0.000 description 8
- 230000004044 response Effects 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000012216 screening Methods 0.000 description 5
- 230000003068 static effect Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000012163 sequencing technique Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000009941 weaving Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of processing method, device, computer equipment and computer storage mediums for requesting returned data, are related to data processing field, the write efficiency of returned data can be improved.The described method includes: obtaining the corresponding returned data of network request by transferring Asynchronous Programming interface;The marking variable carried according to the returned data is stored the returned data in the form of array into the data class encapsulated in advance in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained, definition there are the mapping relations in marking variable and interface between control in the data class encapsulated in advance;When receiving returned data insertion instruction, all returned datas batch in the database of each control is embedded in corresponding each control respectively.
Description
Technical field
The present invention relates to technical field of data processing, more particularly to a kind of processing method for requesting returned data, device,
Computer equipment and computer storage medium.
Background technique
During Internet application and development, network data request is essential.When server is successfully received client
After holding the request of data sent, background program can be handled request of data, generated returned data packet by interface and be sent to
Client, further client carries out returned data packet to be parsed into required data format, and is shown in application interface.
In practical applications, application interface is equivalent to a screen, is formed by multiple control combinations, receives in client
After returned data packet, the data in returned data packet can be handled, and different controls is written into the data that processing obtains
In.
However, in the process of processing, data required for different controls are different to data in returned data packet
, the data of position insertion required for removing screening control in returned data packet one by one according to control in interface are needed, then
Corresponding data are embedded into different controls, so that each control write-in task requires to rely on a control write-in times
The completion of business can just execute, and the Logic of Tasks nesting is cumbersome, cause to request the efficiency of returned data write-in lower.
Summary of the invention
In view of this, the present invention provides a kind of processing method, device, computer equipment and calculating for requesting returned data
Machine storage medium, main purpose are to solve the problems, such as to request returned data write efficiency lower at present.
According to the present invention on one side, a kind of processing method for requesting returned data is provided, this method comprises:
The corresponding returned data of network request is obtained by transferring Asynchronous Programming interface;
The marking variable carried according to the returned data stores the returned data in the form of array to preparatory envelope
In the data class of dress in the database of control corresponding with the marking variable, the corresponding returned data of each control, institute are obtained
State the mapping relations for defining and having in marking variable and interface between control in the data class encapsulated in advance;
When receiving returned data insertion instruction, respectively by all returned datas in the database of each control
Batch is embedded in corresponding each control.
Further, described to include: by transferring the corresponding returned data of Asynchronous Programming interface acquisition network request
By transferring Asynchronous Programming interface conjunctionn network request, whether network request event is received in monitoring server;
If server receives network request event, pre-registered interface function is called to intercept network request corresponding
Returned data.
Further, the corresponding returned data of the network request is that server needs to be written respectively according to topology file generation
Data in a control, the topology file record has the control information being laid out in page framework, described asynchronous by transferring
Before programming interface obtains the corresponding returned data of network request, the method also includes:
According to the control information being laid out in the page framework, marking variable corresponding with control information is pre-defined;
The marking variable corresponding with control information is encapsulated into data class each control according to default binding rule
On.
Further, the marking variable carried according to the returned data is by the returned data in the form of array
In the database that control corresponding with the marking variable is stored into the data class encapsulated in advance, it is corresponding to obtain each control
Returned data includes:
It is searched from the data class encapsulated in advance and the marking variable according to the marking variable that the returned data carries
In the database of corresponding control;
The returned data is stored in the form of array into data class and the variable mark according to the mapping relations
In the database for knowing corresponding each control, the corresponding returned data of each control is obtained.
Further, described when receiving returned data insertion instruction, respectively by the database of each control
In all returned datas batch be embedded in corresponding each control before, the method also includes:
The attribute information for parsing each control in the pre-stored data class determines that the data of each control show class
Type;
Judge whether the data display type of the returned data meets the data of control corresponding with the marking variable
Display type.
Further, it is described respectively by the database of each control all returned datas batch be embedded in it is corresponding
Include: in each control
If the data that the data display type of the returned data meets control corresponding with the marking variable are shown
All returned datas batch in the database of each control is then embedded in corresponding each control respectively by type
In;
If the data that the data display type of the returned data does not meet control corresponding with the marking variable are aobvious
Show type, is then shown in the data that the data display type of the returned data is converted to control corresponding with the marking variable
After showing type, all returned datas batch in the database of each control is embedded in corresponding each control respectively
In part.
Further, described when receiving returned data insertion instruction, respectively by the database of each control
In all returned datas batch be embedded in corresponding each control after, the method also includes:
When listening to the display trigger event of preset control in the page, the corresponding return number of the preset control is transferred
According to, and the corresponding returned data of the preset control is shown in the page.
According to the present invention on the other hand, a kind of processing unit for requesting returned data is provided, which includes:
Acquiring unit, for obtaining the corresponding returned data of network request by transferring Asynchronous Programming interface;
Storage unit, the marking variable for being carried according to the returned data is by the returned data in the form of array
In the database that control corresponding with the marking variable is stored into the data class encapsulated in advance, it is corresponding to obtain each control
Returned data, definition has the mapping relations in marking variable and interface between control in the data class encapsulated in advance;
Embedded unit, for when receive returned data insertion instruction when, respectively will be in the database of each control
All returned datas batch be embedded in corresponding each control.
Further, the acquiring unit includes:
Module is monitored, for whether being received in monitoring server by transferring Asynchronous Programming interface conjunctionn network request
Network request event;
Calling module calls pre-registered interface function to intercept if receiving network request event for server
The corresponding returned data of network request.
Further, the corresponding returned data of the network request is that server needs to be written respectively according to topology file generation
Data in a control, the topology file record have the control information being laid out in page framework, described device further include:
Definition unit, for it is described by transfer Asynchronous Programming interface obtain the corresponding returned data of network request it
Before, according to the control information being laid out in the page framework, pre-define marking variable corresponding with control information;
Encapsulation unit, for encapsulating the marking variable corresponding with control information to data according to default binding rule
In class on each control.
Further, the storage unit includes:
Searching module, the marking variable for being carried according to the returned data searched from the data class encapsulated in advance with
In the database of the corresponding control of the marking variable;
Memory module, for storing the returned data into data class in the form of array according to the mapping relations
In the database of each control corresponding with the marking variable, the corresponding returned data of each control is obtained.
Further, described device further include:
Determination unit, for it is described when receive returned data insertion instruction when, respectively by the number of each control
Before being embedded in corresponding each control according to all returned datas batch in library, the pre-stored data class is parsed
In each control attribute information, determine the data display type of each control;
Judging unit, for judging it is corresponding with the marking variable whether the data display type of the returned data meets
Control data display type.
Further, the embedded unit, if met specifically for the data display type of the returned data and institute
The data display type of the corresponding control of marking variable is stated, then respectively by all return numbers in the database of each control
According to being embedded in corresponding each control in batches;
The embedded unit, if the data display type for being specifically also used to the returned data is not met and the variable
The data display type of corresponding control is identified, then is converted to and the variable by the data display type of the returned data
After the data display type for identifying corresponding control, respectively by all returned datas in the database of each control batch
Amount is embedded in corresponding each control.
Further, described device further include:
Display unit, for it is described when receive returned data insertion instruction when, respectively by the number of each control
After being embedded in corresponding each control according to all returned datas batch in library, when listening to preset control in the page
When showing trigger event, the corresponding returned data of the preset control is transferred, and shows that the preset control is corresponding in the page
Returned data.
Another aspect according to the present invention provides a kind of storage equipment, is stored thereon with computer program, described program
The processing method of above-mentioned request returned data is realized when being executed by processor.
Another aspect according to the present invention provides a kind of processing unit for requesting returned data, including storage equipment, place
The computer program managing device and storage on a storage device and can running on a processor, when the processor executes described program
Realize the processing method of above-mentioned request returned data.
By above-mentioned technical proposal, a kind of processing method and processing device for requesting returned data provided by the invention passes through tune
Asynchronous Programming interface is taken to obtain the corresponding returned data of network request, it, can since Asynchronous Programming interface is equivalent to response type programming
Very easily to express static or dynamic data flow, the marking variable that is further carried according to returned data is by returned data
In the database for storing into the data class encapsulated in advance control corresponding with the marking variable in the form of array, obtain each
The corresponding returned data of a control, and then when receiving returned data insertion instruction, it respectively will be in the database of each control
All returned datas batch be embedded in corresponding each control.With the return that screening control needs to be embedded in one by one in the prior art
Data, so that the processing method for the request returned data that returned data is written one by one in control is compared, the present invention is by transferring
Asynchronous Programming interface combines mapping relations defined in the data class encapsulated in advance, and request returned data batch is written to the page
Each control in so that reducing the nesting of the Logic of Tasks without interdepending between data write-in task, improve request and return
The write efficiency of data.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of processing method flow diagram for requesting returned data provided in an embodiment of the present invention;
Fig. 2 shows the processing method flow diagrams of another request returned data provided in an embodiment of the present invention;
Fig. 3 shows a kind of structural schematic diagram of processing unit for requesting returned data provided in an embodiment of the present invention;
Fig. 4 shows the apparatus structure schematic diagram of the processing of another request returned data provided in an embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
The embodiment of the invention provides a kind of processing method for requesting returned data, may be implemented that returned data batch will be requested
The purpose being written in each control of the page is measured, as shown in Figure 1, this method comprises:
101, the corresponding returned data of network request is obtained by transferring Asynchronous Programming interface.
Wherein, Asynchronous Programming is equivalent to response type and weaves into, and a kind of programming paradigm of Data Flow Oriented and change propagation passes through
Static or dynamic data flow can easily be expressed in weaving into language by transferring Asynchronous Programming interface.
Network request is the critically important part of client, is equivalent to the warp that user accesses a page, opens a website
It crosses, common network request has synchronous GET, synchronous POST, asynchronous GET, asynchronous POST etc., and visitor may be implemented by network request
Data interaction between family end and server, data exchange process between the server of specific client end can be with are as follows: client is logical
The request for initiating specific data to service is crossed, may include order and the request message of URI etc. in the request, server returns to knot
Fruit data, the result data include the response message etc. of result, further by client parsing result data after, then by number of results
According to being shown on interface.
For the embodiment of the present invention, during acquisition network request corresponding returned data, Asynchronous Programming interface meeting
Observed person's object and observer's object are created, observed person's object sends the prison of monitoring network request by subscribing in order
Control event gives observer's object, and observer's object, which receives monitor event in sequence and executes, obtains the corresponding return of network request
The movement of data.
It should be noted that the corresponding returned data of network request is that server is returned according to the network request that client is sent
The data that client is shown are back to, since heterogeneous networks request corresponding requests parameter and request data type may not be identical,
And when server generates returned data, in order to facilitate data transmission, returned data can be uniformly encapsulated in a data
Bao Zhong, so that the data format and data type of returned data are not consistent with practical, the embodiment of the present invention is getting network
After requesting corresponding returned data, the corresponding returned data of network request can be handled, by the data of returned data
Format and data type are restored to data format format and data type before encapsulation.
102, the returned data is stored in the form of array to pre- according to the marking variable that the returned data carries
In the data class first encapsulated in the database of control corresponding with the marking variable, the corresponding return number of each control is obtained
According to.
In practical applications, client can carry the layout text of request page when sending network request to server
Part, record has a control information being laid out in page framework in the topology file, such as position of each control and each control it
Between association etc. so that server can generate returned data corresponding with control by different controls in page framework, for example, controlling
Part A corresponding account logs in, control B corresponds to login password, and control C correspondence forgets Password etc., here without limiting.
Wherein, definition has the mapping relations in marking variable and interface between control in the data class encapsulated in advance, such as
Control A corresponds to marking variable 001, and control B corresponds to marking variable 002 etc., and the control in interface can be chart control, table
Control, report controls etc., herein without limiting, control here can have the attribute of oneself, by assigning some letters of control
Different control functions can be realized in single and visible method, such as assigns the function of closing webpage after button control triggering, or
Person assigns the function of label control input text, herein without limiting.
For the embodiment of the present invention, can be found and variable mark entrained by returned data according to the data class encapsulated in advance
Sensible corresponding control, which is the control that returned data should be written, further by returned data in the form of array
In the database for storing into the data class encapsulated in advance space corresponding with marking variable, so that it is corresponding to obtain each control
Returned data.
103, when receiving returned data insertion instruction, respectively by all returns in the database of each control
Batch data is embedded in corresponding each control.
It is understood that after client gets the corresponding returned data of network request, due to control each in interface
The write-in content of part is not identical, it will usually in the database by each control corresponding returned data caching, in order to from number
The returned data that should be written according to each control is searched in library, and after the insertion instruction for receiving returned data, number will be returned
According to being embedded into corresponding control.
For the embodiment of the present invention, specifically all returned datas batch in the database of each control is being embedded in respectively
During corresponding each control, each control may be comprising in relation to the page info in interface, such as page mark in the page
Inscribe, illustrate information and URL etc., in order to facilitate the insertion of returned data, meeting pre-structured describes the bibliographic structure of website, the catalogue
Definition has various common attributes, such as page title, page URL in structure, each in the page after construction complete bibliographic structure
Control can read the bibliographic structure of website automatically, and then convenient for returned data batch to be embedded in corresponding control.
The processing method of request returned data provided in an embodiment of the present invention obtains network by transferring Asynchronous Programming interface
Request corresponding returned data, since Asynchronous Programming interface is equivalent to response type programming, can very easily express it is static or
Dynamic data flow is further stored returned data in the form of array to preparatory according to the marking variable that returned data carries
In the data class of encapsulation in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained,
And then when receiving returned data insertion instruction, all returned datas batch in the database of each control is embedded in respectively
In corresponding each control.With screening control needs the returned data that is embedded in one by one in the prior art, thus by returned data by
The processing method of request returned data in a write-in control is compared, and the present invention combines envelope in advance by transferring Asynchronous Programming interface
Request returned data batch is written in each control of the page, so that data by mapping relations defined in the data class of dress
Without interdepending between write-in task, the nesting of the Logic of Tasks is reduced, the write efficiency of request returned data is improved.
The embodiment of the invention provides the processing methods of another request returned data, may be implemented that returned data will be requested
Batch is written to the purpose in each control of the page, as shown in Fig. 2, this method comprises:
201, according to the control information being laid out in the page framework, variable mark corresponding with control information is pre-defined
Know.
Client, can be by the control information being laid out in page framework to be laid out during sending network request to server
The form of file is sent to server, in order to which server can generate network request pair according to the control information in topology file
The returned data answered.
Wherein, page framework is usually a upper mo(u)ld bottom half style, and upper part is menu, and lower part is the interior of multiple Shipping Options Pages
Hold region, menu provides by other plug-in units, and when clicking menu content area show other plug-in registrations forms or
Person's user control.The control information of page framework layout may include in the page positional relationship of each control in interface and
The time sequencing etc. that control is shown, here without limiting.
For the embodiment of the present invention, since each control of page framework layout corresponds to different returned datas, for side
It is returned to the batch write-in of data, marking variable corresponding with control information can be pre-defined, by each control well in advance
Label, the marking variable are equivalent to the label of control, thus when receiving returned data, without searching each control one by one
The corresponding returned data of part.
202, the marking variable corresponding with control information is encapsulated into data class according to default binding rule each
On control.
Wherein, presetting binding rule can be to encapsulate the corresponding marking variable of control information according to the location information of control
The corresponding marking variable of control information is tied to each control by the sequence on each control into data class, such as from left to right
The corresponding marking variable of control information is tied on each control by the sequence on part, or from top to bottom, can also for according to
The corresponding marking variable of control information is encapsulated each control into data class by the time sequencing that control is shown, such as when generation
Between successive sequence the corresponding marking variable of control information is tied on each control, here without limiting.
203, by transferring Asynchronous Programming interface conjunctionn network request, network request thing whether is received in monitoring server
Part.
Interface callback mechanism is found everywhere in Android, especially in terms of interface event processing, Asynchronous Programming is equivalent to one
Kind programming model is capable of providing unified Asynchronous Programming interface encapsulation come the data flow of the observable operated, has higher
Response speed.
For the embodiment of the present invention, a monitoring can be specifically registered on network request object by Asynchronous Programming interface
Device, the monitor are associated with network request, for monitoring in server whether network request event occurs.
If 204, server receives network request event, pre-registered interface function is called to intercept network request pair
The returned data answered.
For the embodiment of the present invention, if server receives network request event, server can be according to network request thing
Part generates request returned data, which is that server needs to be written in each control according to topology file generation
Data call pre-registered interface library functions to intercept network for the ease of returned data batch to be written in each control
Corresponding return function is requested, by pre-processing to returned data, to improve the writing speed of returned data.
It should be noted that above-mentioned interface library functions are with the function for intercepting network request function, here to interface
Library function, here can also be also using same other functions etc. with network interceptor request function without limiting.
205, it is searched from the data class encapsulated in advance and the variable according to the marking variable that the returned data carries
In the database for identifying corresponding control.
Since server is believed so returned data is carried with control according to the returned data of page layout file generated
Corresponding marking variable is ceased, can further be searched from the data class encapsulated in advance according to the marking variable that returned data carries
To control corresponding with marking variable.
Wherein, definition has the mapping relations in marking variable and interface between control, interface in the data class encapsulated in advance
In each control be corresponding with respective returned data, returned data here can be the shapes such as the address url, label and picture
Formula, here without limiting.
206, the returned data is stored in the form of array into data class and the change according to the mapping relations
Amount identifies in the database of corresponding each control, obtains the corresponding returned data of each control.
For the embodiment of the present invention, definition has reflecting between control in marking variable and interface in the data class that encapsulates in advance
Relationship is penetrated, the database of control corresponding with marking variable entrained by returned data can be determined by mapping relations, due to each
The returned data of a control is not identical, and then returned data is stored in the form of array into data class and marking variable pair
In the database for the control answered, so that each control can obtain the corresponding returned data of the control in array.
The embodiment of the present invention can find the corresponding returned data of each control in interface by data class, without by
It is a to search the corresponding returned data of each control, so that the batch of returned data be facilitated to be written, improve the write-in speed of returned data
Degree.
207, the attribute information for parsing each control in the pre-stored data class determines that the data of each control are aobvious
Show type.
Due to being stored with the corresponding returned data of each control in pre-stored data class, and the data of each control are aobvious
Show that type is different, such as the corresponding data display type of control A is picture, the corresponding data display type of control B is day
Phase determines that the data of each control show class here by parsing the attribute information of each control in pre-stored data class
Type, that is, only after the data display type of returned data meets the data display type of control, the control is corresponding to be returned
Returning data just can accurately be embedded into control.
For the embodiment of the present invention, the attribute information of control can have multiple, such as Name attribute, Text attribute, Width
Attribute, Value attribute etc. are belonged to since attribute can determine different data display types, such as Input by Text
Property can determine the data display type of the control, such as order button control, can determine the control by Value attribute
Data display type, here to the attribute information for the data display type for determining control without limiting.
208, judge whether the data display type of the returned data meets control corresponding with the marking variable
Data display type.
After server generates the corresponding returned data of network request, for the ease of the transmission of returned data, usual situation
The data display type of lower returned data is not data display type required for control, so that returned data can not be accurately embedded in
Into control, so needing to judge that the data display type of returned data is after determining the data display type of each control
The no data display type for meeting control corresponding with marking variable, so that returned data is accurately embedded into each control.
If the data display type of 209a, the returned data meets the data of control corresponding with the marking variable
All returned datas batch in the database of each control is then embedded in corresponding each control respectively by display type
In part.
For the embodiment of the present invention, if the data display type of returned data meets control corresponding with marking variable
Data display type illustrates directly be embedded in returned data without the conversion for displaying data returned data type
Into control.
If it is corresponding with step 209a have step 209b, the data display type of the returned data is not met and institute
The data display type of the corresponding control of marking variable is stated, then is converted to and institute by the data display type of the returned data
After the data display type for stating the corresponding control of marking variable, respectively by all returns in the database of each control
Batch data is embedded in corresponding each control.
For the embodiment of the present invention, if the data display type of returned data does not meet control corresponding with marking variable
Data display type, illustrate the conversion for needing to display data returned data type, can just be embedded in returned data
Into control.Specifically conversion function function can be received by the way that different types of operator is arranged, call conversion function function pair
Returned data displays data the conversion of type, so that data display type needed for returned data adaptation control, such as
String data display type is converted into image data display type, here without limiting.
210, when listening to the display trigger event of preset control in the page, the corresponding return of the preset control is transferred
Data, and the corresponding returned data of the preset control is shown in the page.
For the embodiment of the present invention, user can click button in the page or into the page during accession page
The page operations, either which kind of page operation such as text are inputted, the object of the page operation is some control in the page, so
In listening to the page when display trigger event of preset control, illustrate page operation of the preset control there are user, further
The corresponding returned data of preset control is transferred from the data class encapsulated in advance, and is shown that preset control is corresponding in the page and returned
Return data.
The processing method of request returned data provided in an embodiment of the present invention obtains network by transferring Asynchronous Programming interface
Request corresponding returned data, since Asynchronous Programming interface is equivalent to response type programming, can very easily express it is static or
Dynamic data flow is further stored returned data in the form of array to preparatory according to the marking variable that returned data carries
In the data class of encapsulation in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained,
And then when receiving returned data insertion instruction, all returned datas batch in the database of each control is embedded in respectively
In corresponding each control.With screening control needs the returned data that is embedded in one by one in the prior art, thus by returned data by
The processing method of request returned data in a write-in control is compared, and the present invention combines envelope in advance by transferring Asynchronous Programming interface
Request returned data batch is written in each control of the page, so that data by mapping relations defined in the data class of dress
Without interdepending between write-in task, the nesting of the Logic of Tasks is reduced, the write efficiency of request returned data is improved.
Further, the specific implementation as Fig. 1 the method, the embodiment of the invention provides a kind of request returned datas
Processing unit, as shown in figure 3, described device includes: acquiring unit 31, storage unit 32, embedded unit 33.
Acquiring unit 31 can be used for obtaining the corresponding returned data of network request by transferring Asynchronous Programming interface;
Storage unit 32, the marking variable that can be used for being carried according to the returned data is by the returned data with array
Form store into the data class encapsulated in advance in the database of control corresponding with the marking variable, obtain each control
Corresponding returned data, definition has the mapping in marking variable and interface between control to close in the data class encapsulated in advance
System;
Embedded unit 33 can be used for when receiving returned data insertion instruction, respectively by the number of each control
It is embedded in corresponding each control according to all returned datas batch in library.
The processing unit of request returned data provided in an embodiment of the present invention obtains network by transferring Asynchronous Programming interface
Request corresponding returned data, since Asynchronous Programming interface is equivalent to response type programming, can very easily express it is static or
Dynamic data flow is further stored returned data in the form of array to preparatory according to the marking variable that returned data carries
In the data class of encapsulation in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained,
And then when receiving returned data insertion instruction, all returned datas batch in the database of each control is embedded in respectively
In corresponding each control.With screening control needs the returned data that is embedded in one by one in the prior art, thus by returned data by
The processing method of request returned data in a write-in control is compared, and the present invention combines envelope in advance by transferring Asynchronous Programming interface
Request returned data batch is written in each control of the page, so that data by mapping relations defined in the data class of dress
Without interdepending between write-in task, the nesting of the Logic of Tasks is reduced, the write efficiency of request returned data is improved.
In specific application scenarios, as shown in figure 4, the corresponding returned data of the network request is server according to cloth
Office file generates the data needed to be written in each control, and the topology file record has the control letter being laid out in page framework
Breath, described device further include:
Definition unit 34 can be used for obtaining the corresponding return number of network request by transferring Asynchronous Programming interface described
According to before, according to the control information being laid out in the page framework, marking variable corresponding with control information is pre-defined;
Encapsulation unit 35, can be used for will the marking variable encapsulation corresponding with control information according to default binding rule
Into data class on each control;
Determination unit 36 can be used for described when receiving returned data insertion instruction, respectively by each control
Before all returned datas batch in the database of part is embedded in corresponding each control, parse described pre-stored
The attribute information of each control in data class determines the data display type of each control;
Judging unit 37, can be used for judging whether the data display type of the returned data meets and the variable mark
Know the data display type of corresponding control;
The embedded unit 33, if the data display type that specifically can be used for the returned data meets and the change
Amount identifies the data display type of corresponding control, then respectively by all returned datas in the database of each control batch
Amount is embedded in corresponding each control;
The embedded unit 33, if the data display type that specifically can be also used for the returned data is not met and institute
The data display type of the corresponding control of marking variable is stated, then is converted to and institute by the data display type of the returned data
After the data display type for stating the corresponding control of marking variable, respectively by all returns in the database of each control
Batch data is embedded in corresponding each control.
Display unit 38 can be used for described when receiving returned data insertion instruction, respectively by each control
After all returned datas batch in the database of part is embedded in corresponding each control, preset when listening in the page
When the display trigger event of control, the returned data of the preset control insertion is transferred, and shows the default control in the page
The returned data of part insertion.
Further, the acquiring unit 31 includes:
Monitor module 311, can be used for by transferring Asynchronous Programming interface conjunctionn network request, in monitoring server whether
Receive network request event;
Calling module 312 calls pre-registered interface letter if can be used for server receives network request event
Number intercepts the corresponding returned data of network request.
Further, the storage unit 32 includes:
Searching module 321, the marking variable that can be used for being carried according to the returned data is from the data class encapsulated in advance
In the middle database for searching control corresponding with the marking variable;
Memory module 322, can be used for according to the mapping relations by the returned data stored in the form of array to
In data class in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained.
It should be noted that each functional unit involved by a kind of processing unit for requesting returned data provided in this embodiment
Other it is corresponding describe, can be with reference to the corresponding description in Fig. 1 and Fig. 2, details are not described herein.
It is deposited thereon based on above-mentioned method as depicted in figs. 1 and 2 correspondingly, the present embodiment additionally provides a kind of storage medium
Computer program is contained, which realizes the processing of above-mentioned request returned data as depicted in figs. 1 and 2 when being executed by processor
Method.
Based on this understanding, the technical solution of the application can be embodied in the form of software products, which produces
Product can store in a non-volatile memory medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions
With so that computer equipment (can be personal computer, server or the network equipment an etc.) execution the application is each
Method described in implement scene.
Based on above-mentioned method as shown in Figure 1 and Figure 2 and Fig. 3, virtual bench embodiment shown in Fig. 4, in order to realize
Above-mentioned purpose, the embodiment of the present application also provides a kind of computer equipments, are specifically as follows personal computer, server, network
Equipment etc., the entity device include storage medium and processor;Storage medium, for storing computer program;Processor is used for
Computer program is executed to realize the processing method of above-mentioned request returned data as depicted in figs. 1 and 2.
Optionally, which can also include user interface, network interface, camera, radio frequency (Radio
Frequency, RF) circuit, sensor, voicefrequency circuit, WI-FI module etc..User interface may include display screen
(Display), input unit such as keyboard (Keyboard) etc., optional user interface can also connect including USB interface, card reader
Mouthful etc..Network interface optionally may include standard wireline interface and wireless interface (such as blue tooth interface, WI-FI interface).
It will be understood by those skilled in the art that the entity device structure of the processing of request returned data provided in this embodiment
The restriction to the entity device is not constituted, may include more or fewer components, perhaps combines certain components or difference
Component layout.
It can also include operating system, network communication module in storage medium.Operating system is that the above-mentioned computer of management is set
The program of standby hardware and software resource, supports the operation of message handling program and other softwares and/or program.Network communication mould
Block leads to for realizing the communication between each component in storage medium inside, and between other hardware and softwares in the entity device
Letter.
Through the above description of the embodiments, those skilled in the art can be understood that the application can borrow
It helps software that the mode of necessary general hardware platform is added to realize, hardware realization can also be passed through.Pass through the skill of application the application
Art scheme is reflected defined in the data class encapsulated in advance compared with currently available technology by transferring Asynchronous Programming interface and combining
Relationship is penetrated, request returned data batch is written in each control of the page, so that without mutual between data write-in task
It relies on, reduces the nesting of the Logic of Tasks, improve the write efficiency of request returned data.
It will be appreciated by those skilled in the art that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, module in attached drawing or
Process is not necessarily implemented necessary to the application.It will be appreciated by those skilled in the art that the mould in device in implement scene
Block can according to implement scene describe be distributed in the device of implement scene, can also carry out corresponding change be located at be different from
In one or more devices of this implement scene.The module of above-mentioned implement scene can be merged into a module, can also be into one
Step splits into multiple submodule.
Above-mentioned the application serial number is for illustration only, does not represent the superiority and inferiority of implement scene.Disclosed above is only the application
Several specific implementation scenes, still, the application is not limited to this, and the changes that any person skilled in the art can think of is all
The protection scope of the application should be fallen into.
Claims (10)
1. a kind of processing method for requesting returned data characterized by comprising
The corresponding returned data of network request is obtained by transferring Asynchronous Programming interface;
The marking variable carried according to the returned data stores in the form of array the returned data to encapsulating in advance
In data class in the database of control corresponding with the marking variable, the corresponding returned data of each control is obtained, it is described pre-
Definition has the mapping relations in marking variable and interface between control in the data class first encapsulated;
When receiving returned data insertion instruction, respectively by all returned datas batch in the database of each control
It is embedded in corresponding each control.
2. the method according to claim 1, wherein described obtain network request by transferring Asynchronous Programming interface
Corresponding returned data includes:
By transferring Asynchronous Programming interface conjunctionn network request, whether network request event is received in monitoring server;
If server receives network request event, pre-registered interface function is called to intercept the corresponding return of network request
Data.
3. the method according to claim 1, wherein the corresponding returned data of the network request is server root
The data needed to be written in each control are generated according to topology file, the topology file record has the control being laid out in page framework
Information, it is described obtain the corresponding returned data of network request by transferring Asynchronous Programming interface before, the method also includes:
According to the control information being laid out in the page framework, marking variable corresponding with control information is pre-defined;
The marking variable corresponding with control information is encapsulated into data class on each control according to default binding rule.
4. the method according to claim 1, wherein the marking variable carried according to the returned data will
The returned data stores in the form of array into the data class encapsulated in advance the number of control corresponding with the marking variable
Include: according to the corresponding returned data of each control in library, is obtained
It is searched from the data class encapsulated in advance according to the marking variable that the returned data carries corresponding with the marking variable
Control database in;
The returned data is stored in the form of array into data class and the marking variable pair according to the mapping relations
In the database for each control answered, the corresponding returned data of each control is obtained.
5. the method according to claim 1, wherein dividing described when receiving returned data insertion instruction
It is described before all returned datas batch in the database of each control is not embedded in corresponding each control
Method further include:
The attribute information for parsing each control in the pre-stored data class determines the data display type of each control;
Judge whether the data display type of the returned data meets the data of control corresponding with the marking variable and show
Type.
6. according to the method described in claim 5, it is characterized in that, described respectively by the institute in the database of each control
There is returned data batch to be embedded in corresponding each control and include:
If the data display type of the returned data meets the data display type of control corresponding with the marking variable,
Then all returned datas batch in the database of each control is embedded in corresponding each control respectively;
If the data that the data display type of the returned data does not meet control corresponding with the marking variable show class
Type then shows class in the data that the data display type of the returned data is converted to control corresponding with the marking variable
After type, all returned datas batch in the database of each control is embedded in corresponding each control respectively
In.
7. method according to claim 1 to 6, which is characterized in that returned data insertion ought be received described
When instruction, all returned datas batch in the database of each control is embedded in corresponding each control respectively
Later, the method also includes:
When listening to the display trigger event of preset control in the page, the corresponding returned data of the preset control is transferred, and
The corresponding returned data of the preset control is shown in the page.
8. a kind of processing unit for requesting returned data characterized by comprising
Acquiring unit, for obtaining the corresponding returned data of network request by transferring Asynchronous Programming interface;
Storage unit, the marking variable for being carried according to the returned data store the returned data in the form of array
Into the data class encapsulated in advance in the database of control corresponding with the marking variable, the corresponding return of each control is obtained
Data, definition has the mapping relations in marking variable and interface between control in the data class encapsulated in advance;
Embedded unit, for when receive returned data insertion instruction when, respectively by the institute in the database of each control
There is returned data batch to be embedded in corresponding each control.
9. a kind of computer equipment, including memory and processor, it is stored with computer program in the memory, feature exists
In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer storage medium, is stored thereon with computer program, which is characterized in that the computer program is located
The step of reason device realizes method described in any one of claims 1 to 7 when executing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811536327.5A CN109814863A (en) | 2018-12-14 | 2018-12-14 | A kind of processing method, device, computer equipment and computer storage medium for requesting returned data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811536327.5A CN109814863A (en) | 2018-12-14 | 2018-12-14 | A kind of processing method, device, computer equipment and computer storage medium for requesting returned data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109814863A true CN109814863A (en) | 2019-05-28 |
Family
ID=66601991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811536327.5A Pending CN109814863A (en) | 2018-12-14 | 2018-12-14 | A kind of processing method, device, computer equipment and computer storage medium for requesting returned data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109814863A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457089A (en) * | 2019-07-05 | 2019-11-15 | 中国平安人寿保险股份有限公司 | Collecting method, device, computer readable storage medium and computer equipment |
CN110569025A (en) * | 2019-08-26 | 2019-12-13 | 珠海格力电器股份有限公司 | Variable processing method and device, readable storage medium and electronic equipment |
CN111679826A (en) * | 2020-04-27 | 2020-09-18 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for previewing webpage editing content in real time and storage medium |
CN111714874A (en) * | 2020-06-18 | 2020-09-29 | 网易(杭州)网络有限公司 | Control state switching method and device and electronic equipment |
CN111885038A (en) * | 2020-07-16 | 2020-11-03 | 深圳思凯微电子有限公司 | Data packaging method, device and system and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101364236A (en) * | 2008-09-18 | 2009-02-11 | 中兴通讯股份有限公司 | Data processing apparatus and processing method of WEB page |
CN104866383A (en) * | 2015-05-29 | 2015-08-26 | 北京金山安全软件有限公司 | Interface calling method and device and terminal |
CN107832217A (en) * | 2017-11-09 | 2018-03-23 | 政采云有限公司 | A kind of automated testing method and device |
CN108038212A (en) * | 2017-12-20 | 2018-05-15 | 江苏国泰新点软件有限公司 | A kind of data interactive method, device, system, equipment and storage medium |
-
2018
- 2018-12-14 CN CN201811536327.5A patent/CN109814863A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101364236A (en) * | 2008-09-18 | 2009-02-11 | 中兴通讯股份有限公司 | Data processing apparatus and processing method of WEB page |
CN104866383A (en) * | 2015-05-29 | 2015-08-26 | 北京金山安全软件有限公司 | Interface calling method and device and terminal |
CN107832217A (en) * | 2017-11-09 | 2018-03-23 | 政采云有限公司 | A kind of automated testing method and device |
CN108038212A (en) * | 2017-12-20 | 2018-05-15 | 江苏国泰新点软件有限公司 | A kind of data interactive method, device, system, equipment and storage medium |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457089A (en) * | 2019-07-05 | 2019-11-15 | 中国平安人寿保险股份有限公司 | Collecting method, device, computer readable storage medium and computer equipment |
CN110457089B (en) * | 2019-07-05 | 2023-09-26 | 中国平安人寿保险股份有限公司 | Data acquisition method, data acquisition device, computer readable storage medium and computer equipment |
CN110569025A (en) * | 2019-08-26 | 2019-12-13 | 珠海格力电器股份有限公司 | Variable processing method and device, readable storage medium and electronic equipment |
CN110569025B (en) * | 2019-08-26 | 2020-09-22 | 珠海格力电器股份有限公司 | Variable processing method and device, readable storage medium and electronic equipment |
CN111679826A (en) * | 2020-04-27 | 2020-09-18 | 平安国际智慧城市科技股份有限公司 | Method, device and equipment for previewing webpage editing content in real time and storage medium |
CN111679826B (en) * | 2020-04-27 | 2024-04-05 | 深圳赛安特技术服务有限公司 | Method, device, equipment and storage medium for previewing webpage editing content in real time |
CN111714874A (en) * | 2020-06-18 | 2020-09-29 | 网易(杭州)网络有限公司 | Control state switching method and device and electronic equipment |
CN111885038A (en) * | 2020-07-16 | 2020-11-03 | 深圳思凯微电子有限公司 | Data packaging method, device and system and computer readable storage medium |
CN111885038B (en) * | 2020-07-16 | 2022-06-10 | 深圳思凯微电子有限公司 | Data packaging method, device and system and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11595477B2 (en) | Cloud storage methods and systems | |
CN109814863A (en) | A kind of processing method, device, computer equipment and computer storage medium for requesting returned data | |
CN104866383B (en) | Interface calling method and device and terminal | |
CN111104635B (en) | Method and device for generating form webpage | |
CN106569783B (en) | Method and device for executing task script | |
CN109062563B (en) | Method and device for generating page | |
KR20170104500A (en) | Network features Virtualization management and orchestration methods, devices and programs | |
CN110908712A (en) | Data processing method and equipment for cross-platform mobile terminal | |
US10019293B2 (en) | Enhanced command selection in a networked computing environment | |
US12093966B2 (en) | Customer service representative dashboard with micro-applications | |
CN113703785B (en) | Component-based platform deployment method, device, equipment and storage medium | |
US9350738B2 (en) | Template representation of security resources | |
US8838799B2 (en) | Command management in a networked computing environment | |
CN109729121B (en) | Cloud storage system and method for realizing custom data processing in cloud storage system | |
CN110213105A (en) | It is a kind of cross-platform micro- using creation method | |
CN115237481A (en) | Method, device and equipment for driving external equipment and storage medium | |
JP2014123360A (en) | Tag classification system and method for virtual machine | |
US10324692B2 (en) | Integration for next-generation applications | |
CN110362305A (en) | A kind of form component state switching method and device | |
CN114675982A (en) | General method and system for acquiring data of service integration system | |
CN111158998A (en) | Display method and device of buried point data | |
CN113726855B (en) | Service aggregation method, device, electronic equipment and computer-readable storage medium | |
CN114237871A (en) | Arranging method and device of cloud resources, computer equipment and storage medium | |
CN113704664A (en) | Method and device for generating routing address for accessing page | |
US20240202053A1 (en) | Performing api services using zone-based topics within a pub/sub messaging infrastructure |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |