CN106886465A - A kind of data capture method and device - Google Patents

A kind of data capture method and device Download PDF

Info

Publication number
CN106886465A
CN106886465A CN201510944900.6A CN201510944900A CN106886465A CN 106886465 A CN106886465 A CN 106886465A CN 201510944900 A CN201510944900 A CN 201510944900A CN 106886465 A CN106886465 A CN 106886465A
Authority
CN
China
Prior art keywords
mode
data
specific field
mode information
setting
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.)
Granted
Application number
CN201510944900.6A
Other languages
Chinese (zh)
Other versions
CN106886465B (en
Inventor
王凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cainiao Smart Logistics Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510944900.6A priority Critical patent/CN106886465B/en
Publication of CN106886465A publication Critical patent/CN106886465A/en
Application granted granted Critical
Publication of CN106886465B publication Critical patent/CN106886465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of data capture method of disclosure, for solving because the demand for data acquiring mode is inconsistent, and may cause the less efficient problem of the data acquisition of front end during joint debugging.Method includes:Front end receiver data acquisition is instructed;In response to the instruction, it is determined that the mode information for pre-setting;According to the default mapping relations of mode information and corresponding data acquiring mode, it is determined that the data acquiring mode that the mode information for pre-setting is mapped;Using the data acquiring mode determined, data are obtained.The application is also disclosed a kind of data acquisition facility.

Description

A kind of data capture method and device
Technical field
The application is related to field of computer technology, more particularly to a kind of data capture method and device.
Background technology
Software development, can be divided into including front end exploitation and rear end exploitation.
Wherein, front end, refers to the functional module for realizing front-end functionality.Front-end functionality mentioned here, Can specifically include but the structure of boundary is not realized, the apparent visual performance and the friendship of interface aspect at interface At least one in mutually realizing.Front end is developed, and is primarily referred to as front end developer and front end is developed.
Rear end, refers to the functional module for realizing back-end function.Back-end function mentioned here, specifically may be used To include but is not limited to some functional realieys etc. at interface, such as, and the business processing logic triggered by interface Realize, just belong to back-end function.Rear end is developed, and is primarily referred to as rear end developer and rear end is developed.
At present, in software development process, front and back ends developer regard actual demand, it is possible to need into The joint debugging of row front and back end.When joint debugging is carried out, to realize some functions of front end, it may occur that data interaction, By carrying out data interaction, front end can get the data required for realizing its function.
In actual development, because front and back ends are inconsistent for the demand of data acquiring mode, for example, writing Enter to the data acquiring mode in the JS codes of front end and realize logic, the data that may be desirably employed with rear end Acquisition modes are mismatched.Now, in order to ensure the smooth acquisition of data, it is necessary to front-end person who is to JS codes In data acquiring mode realize logic Modification.
However, using change JS codes in data acquiring mode realize logic by the way of, can exist effect The low problem of rate, and then reduce the data acquisition efficiency of front end during joint debugging.
The content of the invention
The embodiment of the present application provides a kind of data capture method, for solving due to for data acquiring mode Demand is inconsistent, and may cause the less efficient problem of the data acquisition of front end during joint debugging.
The embodiment of the present application also provides a kind of data acquisition facility, for solving due to for data acquiring mode Demand it is inconsistent, and the less efficient problem of the data acquisition of front end during joint debugging may be caused.
The embodiment of the present application uses following technical proposals:
A kind of data capture method, including:
Front end receiver data acquisition is instructed;
In response to the instruction, it is determined that the mode information for pre-setting;
According to the default mapping relations of mode information and corresponding data acquiring mode, it is determined that described pre-set The data acquiring mode that is mapped of mode information;
Using the data acquiring mode determined, data are obtained.
A kind of data acquisition facility, is applied to front end, including:
Instruction reception unit, for receiving data acquisition instruction;
Information determination unit, for the instruction received in response to instruction reception unit, it is determined that pre-setting Mode information;
Mode determining unit, for being closed with the default mapping of corresponding data acquiring mode according to mode information System, determines the data acquiring mode that the mode information that information determination unit determines is mapped;
Data capture unit, for the data acquiring mode that employing mode determining unit is determined, obtains data.
Above-mentioned at least one technical scheme that the embodiment of the present application is used can reach following beneficial effect:
Due to that can support to be characterized by pre-setting mode information which kind of data acquisition side used Formula, even if so that front and back ends developer is inconsistent for the demand of data acquiring mode, it is also possible to simple Ground reaches the purpose of change data acquisition modes by changing which information, and without front end, developer repaiies Change the data acquiring mode in JS codes realizes logic.So that in terms of existing technologies, Ke Yiti The data acquisition efficiency of front end during joint debugging high.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes of the application Point, the schematic description and description of the application is used to explain the application, does not constitute to the application not Work as restriction.In the accompanying drawings:
A kind of data capture method that Fig. 1 is provided for the embodiment of the present application realizes schematic flow sheet;
Fig. 2 a are the schematic diagram that " adaptation layer " is added in the data acquisition logic of the mode based on VM;
A kind of data capture method that Fig. 2 b are provided for the embodiment of the present application application flow in practice is illustrated Figure;
Fig. 2 c are the mode represented to the data that front end obtains when BUI controls " to utilize Select exhibitions Show " when, the logical schematic that the adaptation layer in the embodiment of the present application is realized;
Fig. 2 d are the mode represented to the data that front end obtains when BUI controls " to utilize menu bar Menu shows " when, the logical schematic that the adaptation layer in the embodiment of the present application is realized;
Fig. 2 e are the mode represented to the data that front end obtains when BUI controls for " using form Table During displaying ", the logical schematic that the adaptation layer in the embodiment of the present application is realized;
The data capture method that Fig. 3 is provided for the embodiment of the present application another application flow in practice is illustrated Figure;
A kind of concrete structure schematic diagram of data acquisition facility that Fig. 4 is provided for the embodiment of the present application.
Specific embodiment
It is specifically real below in conjunction with the application to make the purpose, technical scheme and advantage of the application clearer Apply example and corresponding accompanying drawing is clearly and completely described to technical scheme.Obviously, it is described Embodiment is only some embodiments of the present application, rather than whole embodiments.Based on the implementation in the application Example, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made Example, belongs to the scope of the application protection.
Below in conjunction with accompanying drawing, the technical scheme that each embodiment of the application is provided is described in detail.
Embodiment 1
In order to solve because the demand for data acquiring mode is inconsistent, and before may causing during joint debugging The less efficient problem of the data acquisition at end, the embodiment of the present application 1 provides a kind of data capture method.The party Method implements flow chart as shown in figure 1, comprising the following steps:
Step 11, the instruction of front end receiver data acquisition;
Front end refers to the functional module for realizing front-end functionality.Front-end functionality mentioned here, specifically can be with The including but not limited to structure at interface realizes that the apparent visual performance at interface and the interaction of interface aspect are realized In at least one.The Webpage that such as user can be seen by PC ends interface, is exactly one kind of front end, When user browses webpage, the information in webpage clicking, such as word during the data such as picture, can trigger number Instructed according to obtaining.
During front and back ends joint debugging, front end developer can also by other means, such as forward end It is input into the mode of the code for triggering data acquisition instruction so that front end receiver refers to the data acquisition Order.
Step 12, in response to performing the data acquisition instruction that step 11 is received, it is determined that the side for pre-setting Formula information;
Specifically, instructed in response to the data acquisition, front end is often called and runnable interface (such as webpage) JS files in source file.Wherein, source file described herein refers to refer to by the source code at the interface Constitute, the JS files being made up of JS codes can be typically included in source file.
In the embodiment of the present application, can be, but not limited to use two ways, it is determined that the mode information for pre-setting. Wherein, first way can include:Front end instructs in response to data acquisition, and searching data obtains instruction institute In the JS files for calling specific field (be mutually to be distinguished with other fields described hereinafter, the specific field Can be described as the first specific field);Front end is according to lookup result, it is determined that the mode information for pre-setting.
Such as, it is not empty shape by the first specific field if lookup result is to find the first specific field State, is defined as the mode information for pre-setting;If lookup result is not to find the first specific field, It is then empty state by the first specific field, is defined as the mode information for pre-setting.
Involved data acquiring mode, including but not limited to following two in the embodiment of the present application:
1st, the tune based on remote procedure call protocol (Remote Procedure Call Protocol, RPC) Use mode.
The realization principle of which is:Front end by the back-end send RPC ask, and obtain rear end according to The data of RPC request feedbacks.
Such as, front end can use Ajax (Asynchronous JavaScript And XML, AJAX) Technology, sends the RPC for obtaining data and asks to the back-end, so as to obtain rear end be asked according to the RPC The data of feedback.
2nd, the mode based on Velocity templates (Velocity Module, VM)
The realization principle of which is:The template engine that front end passes through VM, and corresponding template instruction, Java objects are directly accessed, so as to obtain the data being written in java objects.
At present, in front end is developed, JavaScript (abbreviation JS) is a kind of literal translation formula script, is It is widely used in the script of front end exploitation, can be used to add interbehavior in front end page.At some In correlation technique, front end developer can realize that logic is compiled by by one of above-mentioned data acquiring mode It is JS codes, and is arranged in the JS files of front end, front end can be caused by running the JS codes, Realize obtaining data using corresponding data acquiring mode.
In the embodiment of the present application, rear end developer expectation front end use can known by front end developer Data acquiring mode after, to the first specific field in the data acquisition JS files that are called of instruction (be such as set to empty or be not sky) is configured, the purpose for pre-setting mode information is reached.Specifically, When rear end developer expects the data acquiring mode that uses of front end for the method for calling based on RPC, can Sky is set to by first specific field;And developer expect the data acquiring mode that uses of front end for During mode based on VM, it is not sky that can be set to first specific field.Or, when rear end is opened When hair personnel expect the data acquiring mode that uses of front end for the method for calling based on RPC, can by this One specific field is set to not be sky;And developer expect the data acquiring mode that uses of front end for based on During the mode of VM, first specific field can be set to sky.For specifically setting for the first specific field Mode is put, can be depending on actual conditions, the embodiment of the present application is not construed as limiting to this.
The first specific field described in the embodiment of the present application, such as can be queryUri fields.
The second way is introduced further below.
The second way can include:Front end instructs in response to data acquisition, it is determined that the on off state for setting; According to result is determined, it is determined that the mode information for pre-setting.
Specifically, when it is determined that result is in opening for switch, switch is in opening, really It is set to the mode information for pre-setting;When it is determined that result is closed for switch, at switch In closed mode, it is defined as the mode information for pre-setting.
In the embodiment of the present application, can be opened by front end using certain configuration item of certain JS file as " switch " Hair personnel are configured to the value of the configuration item, reach the purpose for pre-setting mode information.Such as, this is matched somebody with somebody If the value for putting item is set to 0, represent that switch is in opening;If the value is set to 1, then it represents that switch It is closed.Specifically, front end developer can be know rear end developer expect front end adopt After data acquiring mode, the value to the configuration item is configured.Such as, when rear end developer expects When the data acquiring mode that front end uses is for the method for calling based on RPC, the value of the configuration item can be set It is set to 0;And when developer expects the data acquiring mode that uses of front end for the mode based on VM, can 1 is set to by the value of the configuration item.Or, when rear end developer expects that the data that front end uses are obtained When the mode of taking is the method for calling based on RPC, the value of the configuration item can be set to 1;And in exploit person When the data acquiring mode that member's expectation front end uses is for the mode based on VM, the value of the configuration item can be set It is set to 0.For the specific set-up mode of the first specific field, can be depending on actual conditions, the application reality Example is applied to be not construed as limiting this.
Step 13, according to the default mapping relations of mode information and corresponding data acquiring mode, it is determined that described The data acquiring mode that the mode information for pre-setting is mapped;
Such as, continue to continue to use the example of first way and the second way above, the difference for pre-setting Mode information can be with as shown in the table with the mapping relations of corresponding data acquiring mode.Wherein, table 1 is the A kind of corresponding mapping relations of mode, table 2 is the corresponding mapping relations of the second way.
Table 1:
The mode information for pre-setting Data acquiring mode
First specific field is not empty state Method of calling based on RPC
First specific field is empty state Mode based on VM
Table 2:
The mode information for pre-setting Data acquiring mode
Switch is in opening Method of calling based on RPC
Switch is closed Mode based on VM
Step 14, using the data acquiring mode determined, obtains data.
Continue to continue to use the example of first way and the second way above, however, it is determined that the data acquisition side for going out Formula is the method for calling based on RPC, then can be by way of rear end sends RPC requests, after acquisition Hold the data according to RPC request feedbacks.
The scheme of data is obtained due to the method for calling based on RPC, has been comparative maturity in the prior art Technology, the embodiment of the present application is repeated no more to the process that implements of which.
It should be noted that if it is determined that data acquiring mode be the mode based on VM, then can pass through The template engine of VM, and corresponding template instruction, directly access java objects, so as to be written to Data in java objects.
In the embodiment of the present application, in order to allow users to intuitively know by performing step 14, in step After 14 are finished, methods described can also include step:Data to getting represent.
Specifically, in the embodiment of the present application, embedded user interface (Build In User can be used Interface, BUI) control, the data to getting represent.
It should be noted that when using RPC method of calling obtain data when, due to can send In RPC requests, (which such as can be combobox, menu bar or form to carry data display mode Etc. the mode that can be realized by BUI) information, it is hereby achieved that rear end is fed back, form and the data The data of exhibition method matching, so that the data obtained using which, directly can be carried out by BUI controls Displaying.
And for the mode based on VM, according to the mode based on VM for providing in the prior art, Its obtain data form, often do not support to be directly shown by BUI controls, but support using than More primary mode is shown.
In the embodiment of the present application, it is contemplated that by the way of BUI control exposure data, data are often caused Represent more directly perceived and attractive in appearance, therefore, the data-generating process by the way of based on VM can be used Following sub-steps are realized, to enable that the data for getting are supported directly to be shown by BUI controls.
Sub-step I:(specific field is called the second designated word to specific field in front end lookup VM afterwards Section), if finding, perform sub-step II;Otherwise, then sub-step III is performed;
Sub-step II:Obtain the data in the second specific field;
If it should be noted that the second specific field can be found, being included in second specific field The data corresponding to data acquisition instruction that data, as front end receiver are arrived.The data can be opened by rear end Hair personnel are set in advance in second specific field.Specifically, rear end developer is setting the second finger When determining the data in field, the data supported directly by BUI control exposures can be set, so that front end uses Data in second specific field that mode based on VM gets, directly can be come by BUI controls Displaying.
In the embodiment of the present application, the second described specific field can refer to the combobox (Select) in VM Property value, the menu bar (Menu) of specific field (title of the field such as can be data-item) in element The property value of specific field (title of the field such as can be data) in object, form (Table) unit The property value of specific field (title of the field such as can be date-item) in element.
Above-mentioned various second specific fields, are the fields relevant with predetermined data display mode.Therefore, In the embodiment of the present application, the second specific field in VM is searched in front end, can specifically include:
Front end determines the mark of the second specific field according to predetermined data display mode;
In VM, the second specific field corresponding to the mark of the second specific field is searched.
Specifically, when data display mode is for " using Select displayings ", the mark of the second specific field It is the mark of specific field in Select elements.So as to front end obtains the data in the second specific field, including: Front end obtains the property value of specific field in Select elements.
Similarly, when data display mode is for " using menu bar Menu displayings ", the second specific field The mark for being designated specific field in Menu objects.So as to front end obtains the data in the second specific field, Including:Obtain the property value of specific field in Menu objects.
Similarly, when data display mode is for " using form Table displayings ", the second specific field It is designated the mark of specific field in Table objects.Front end obtains the data in the second specific field, including: Obtain the property value of specific field in Table objects.
Sub-step III:Crawl HTML (Hyper Text Markup Language, HTML) The data of element.
In the embodiment of the present application, the data of HTML element are captured, such as can be specifically by by document Object model (Document Object Model, DOM) is come what is realized.Usually, HTML is changed Certain content of the page, it is necessary to which acquisition is entered to all elements in html page (i.e. HTML element) The entrance that row is accessed.This entrance, is added, moves, changes or removes together with to HTML element Method and attribute, all obtained by DOM.Due to obtaining HTML element by DOM Data, be that the embodiment of the present application is no longer repeated in a kind of prior art of comparative maturity.The application In embodiment, the data of the HTML element obtained by DOM typically can directly by BUI controls It is shown.
The method provided using the embodiment of the present application, due to that can support, by pre-setting mode information, to come Which kind of data acquiring mode is characterized use, even if so that front and back ends developer is for data acquisition side The demand of formula is inconsistent, it is also possible to simply by changing which information, reach change data acquisition modes Purpose, realize logic without the data acquiring mode in front end developer modification JS codes.So as to In terms of existing technologies, the data acquisition efficiency of front end during joint debugging can be improved.
Embodiment 2
In embodiment 2, mainly introduce the embodiment of the present application 1 offer data capture method in practice one Plant application flow.
In embodiment 2, it is contemplated that the data that are got to front end using BUI controls are shown, can be with User is allowed intuitively to know the particular content of the data for getting, therefore data in the mode based on VM are obtained Take in logic, add " adaptation layer " as shown in Figure 2 a.Wherein, the effect of " adaptation layer " is somebody's turn to do, it is main It is so that front end is based on the data that the mode of VM is obtained, can directly supports to be carried out using BUI controls Displaying.
Below in conjunction with Fig. 2 b, each step that the application flow of the offer of embodiment 2 is included specifically is introduced.
Step 21, the instruction of front end receiver data acquisition;
Step 22, front end in response to the instruction, in searching the called JS codes of the instruction QueryUri fields, and judge whether the queryUri fields are empty, if not empty, then step 23 is performed, If it is empty, then step 24 is performed;
Wherein, described queryUri fields, for representing Asynchronous Request address.If the field is sky, Illustrate to be not based on calling for RPC in the absence of Asynchronous Request address, that is, the data acquiring mode for using Mode, but the mode based on VM;Conversely, then illustrating that the data acquiring mode for using is based on RPC Method of calling.
Step 23, front end sends the RPC requests for acquisition request data to the back-end, and is being properly received After data to rear end in response to RPC request feedbacks, flow terminates;
Step 24, front end determine will using, the data to obtaining represent by the way of (can be according to adopting With BUI controls determine which), and second specific field is determined according to which, and then determination is It is no that the second specific field can be found in VM;If finding, step 25 is performed, otherwise, held Row step 26;
Step 25, front end obtains the data in the second specific field, and using BUI controls to getting Data are shown, and flow terminates;
It should be noted that when the mode that BUI controls are represented to the data for obtaining is " to utilize Select During displaying ", the second specific field is specific field in Select elements.So as to front end obtains the second designated word Data in section, including:Front end obtains the property value of specific field in Select elements.
Similarly, when the mode is for " using menu bar Menu displayings ", the mark of the second specific field It is the mark of specific field in Menu objects to know.So as to front end obtains the data in the second specific field, bag Include:Obtain the property value of specific field in Menu objects.
Similarly, when the mode is for " using form Table displayings ", the mark of the second specific field It is the mark of specific field in Table objects.Front end obtains the data in the second specific field, including:Obtain Take the property value of specific field in Table objects.
Step 26, by DOM, obtains the data of HTML element, and using BUI controls to obtaining To data be shown, flow terminates.
It should be noted that step 22~step 26, can be realized by adaptation layer as shown in Figure 2 a Logic.Specifically, when the mode that BUI controls are represented to the data that front end obtains is " utilization Select shows " when, the logic that adaptation layer is realized is as shown in Figure 2 c.
Similarly, when the mode that BUI controls are represented to the data that front end obtains is " to utilize menu bar Menu shows " when, the logic that adaptation layer is realized is as shown in Figure 2 d.
Similarly, when the mode that BUI controls are represented to the data that front end obtains is " using form Table During displaying ", the logic that adaptation layer is realized is as shown in Figure 2 e.
Be packaged by the logic that the above-mentioned flow that embodiment 2 is described is included, can obtain unification, Method for obtaining data (the method can such as be named as getData).Based on the method, front end is opened Hair personnel, can be directly by calling the party without being concerned about what kind of data acquiring mode front end uses again Method obtains and demonstrating data, it is to avoid because front and back ends developer is for data acquiring mode in joint debugging Demand it is inconsistent so that produce code Change cost.
Embodiment 3
In embodiment 3, data capture method in practice another of the offer of the embodiment of the present application 1 is mainly introduced A kind of application flow.
Below in conjunction with Fig. 3, each step that the application flow of the offer of embodiment 3 is included specifically is introduced.
Step 31, the instruction of front end receiver data acquisition;
Step 32, front end instructs in response to data acquisition, calls packaged RPC components;
It should be noted that in the RPC components, being packaged with the configuration item for realization switch, being based on The method of calling of RPC realizes logic, and patrols for getting required rendering when data are shown Volume.
Step 33, front end judge configuration item encapsulate in the component, for realizing switch value whether be 1;If 1, it is determined that switch is in opening, so as to perform step 34;Otherwise, it is determined that switch It is closed, so as to perform step 35;
Step 34, the realization that the method for calling based on RPC encapsulated in the RPC components is run in front end is patrolled Collect and the Rendering logic, realize obtaining data by way of sending RPC and asking and carrying out data Displaying, flow terminates;
Step 35, front end obtains data and shows by the way of based on VM, and flow terminates.
The above-mentioned flow provided by embodiment 3, front end developer is only needed to the configuration in the component The value of item is modified, you can realize the change to data acquiring mode, it is not necessary to again as prior art Logic is modified to be realized to data acquiring mode in JS codes, thus can avoid in joint debugging due to Front and back ends developer is inconsistent for the demand of data acquiring mode, so that the code Change cost for producing.
Embodiment 4
To solve because the demand for data acquiring mode is inconsistent, and front end during joint debugging may be caused The less efficient problem of data acquisition, for the identical inventive concept of embodiment~embodiment 3, this Shen Please embodiment 4 a kind of data acquisition facility is provided.The device can be exactly a kind of front end, or front end Comprising a kind of functional module.
Specifically, the structural representation of the device is as shown in figure 4, including following functional unit:
Instruction reception unit 41, for receiving data acquisition instruction;
Information determination unit 42, the data acquisition for being received in response to instruction reception unit 41 is instructed, really Surely the mode information for pre-setting;
Mode determining unit 43, for being closed with the default mapping of corresponding data acquiring mode according to mode information System's (claiming the mapping relations afterwards), determines the data that the mode information that information determination unit 42 determines is mapped Acquisition modes;
Data capture unit 44, for the data acquiring mode that employing mode determining unit 43 is determined, obtains Access evidence.
In one embodiment, if data acquisition instruction is to call the instruction of JS codes, can be with Using adaptation pattern, it is determined that the mode information for pre-setting.Specifically, information determination unit 42 can Instructed with response to the data acquisition, searching data obtains the first finger in the called JS codes of instruction Determine field;And according to lookup result, it is determined that the mode information for pre-setting.
Such as, if information determination unit 42 finds the first specific field, it is not by the first specific field Empty state, is defined as the mode information for pre-setting;If not finding the first specific field, will First specific field is empty state, is defined as the mode information for pre-setting.
Or, in one embodiment, switching mode can be used, it is determined that the mode for pre-setting Information.Specifically, information determination unit 42 can be used for being instructed in response to the data acquisition, it is determined that setting The state of the switch put;And according to result is determined, it is determined that the mode information for pre-setting.
Such as, be in for switch when the switch is determined in opening by information determination unit 42 Opening, is defined as the mode information for pre-setting;Determine it is described switch be closed When, switch is closed, it is defined as the mode information for pre-setting.
When using adaptation pattern, mode determining unit 43, can be used for working as by the first specific field is not sky State, be defined as it is described pre-set mode information when, according to the mapping relations, determine that information is true Order unit 42 determine mode information MAP data acquiring mode, be based on RPC method of calling (or Mode based on VM);When being empty state by the first specific field, it is defined as the side for pre-setting During formula information, according to the mapping relations, the mode information MAP that information determination unit 42 determines is determined Data acquiring mode, is the mode (or the method for calling based on RPC) based on VM.
When using switching mode, mode determining unit 43, can be used for working as will switch in opening, During the mode information pre-set described in being defined as, according to the mapping relations, the data of the mapping are determined Acquisition modes are the method for calling (or the mode based on VM) based on RPC;Shape is closed when switch is in State, be defined as it is described pre-set mode information when, according to the mapping relations, determine the mapping Data acquiring mode is the mode (or the method for calling based on RPC) based on VM.
Adaptation pattern or switching mode, data capture unit 44 is either used to may be incorporated for:Work as root According to the mapping relations, when the data acquiring mode for determining the mapping is the mode based on VM, search The second specific field in VM template instructions;If finding the second specific field, the second designated word is obtained Data in section;If not finding the second specific field, the data of HTML element are captured.
Adaptation pattern or switching mode, data capture unit 44 is either used to may be incorporated for:According to Predetermined data display mode, determines the mark of the second specific field;In VM, the second designated word is searched The second specific field corresponding to the mark of section.
In one embodiment, data capture unit 44 determines according to predetermined data display mode The mode of the mark of two specific fields can include:
When the data display mode is when showing using combobox Select, to obtain Select elements Data-item property values;
When the data display mode is the data of acquisition Menu objects when being shown using menu bar Menu Value;
When the data display mode is the data-item of acquisition Table objects when being shown using form Table Property value.
In one embodiment, data capture unit 44 can be used for:If not finding the second designated word Section, then capture the data of DOM element in html page.
In one embodiment, the data for getting intuitively are checked for the ease of user, the application is implemented The device that example is provided can also include:
Display unit, for utilizing BUI components, is presented the data that data capture unit 44 is obtained.
The scheme provided using the embodiment of the present application, due to that can support, by pre-setting mode information, to come Which kind of data acquiring mode is characterized use, even if so that front and back ends developer is for data acquisition side The demand of formula is inconsistent, it is also possible to simply by changing which information, reach change data acquisition modes Purpose, realize logic without the data acquiring mode in front end developer modification JS codes.So as to In terms of existing technologies, the data acquisition efficiency of front end during joint debugging can be improved.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or meter Calculation machine program product.Therefore, the present invention can be using complete hardware embodiment, complete software embodiment or knot Close the form of the embodiment in terms of software and hardware.And, the present invention can be used and wherein wrapped at one or more Containing computer usable program code computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) on implement computer program product form.
The present invention is produced with reference to method according to embodiments of the present invention, equipment (system) and computer program The flow chart and/or block diagram of product is described.It should be understood that can by computer program instructions realize flow chart and / or block diagram in each flow and/or the flow in square frame and flow chart and/or block diagram and/ Or the combination of square frame.These computer program instructions to all-purpose computer, special-purpose computer, insertion can be provided The processor of formula processor or other programmable data processing devices is producing a machine so that by calculating The instruction of the computing device of machine or other programmable data processing devices is produced for realizing in flow chart one The device of the function of being specified in individual flow or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or the treatment of other programmable datas to set In the standby computer-readable memory for working in a specific way so that storage is in the computer-readable memory Instruction produce include the manufacture of command device, the command device realization in one flow of flow chart or multiple The function of being specified in one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices, made Obtain and series of operation steps is performed on computer or other programmable devices to produce computer implemented place Reason, so as to the instruction performed on computer or other programmable devices is provided for realizing in flow chart one The step of function of being specified in flow or multiple one square frame of flow and/or block diagram or multiple square frames.
Embodiments herein is the foregoing is only, the application is not limited to.For this area skill For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle Any modification, equivalent substitution and improvements of work etc., within the scope of should be included in claims hereof.

Claims (24)

1. a kind of data capture method, it is characterised in that including:
Front end receiver data acquisition is instructed;
In response to the instruction, it is determined that the mode information for pre-setting;
According to the default mapping relations of mode information and corresponding data acquiring mode, it is determined that described pre-set The data acquiring mode that is mapped of mode information;
Using the data acquiring mode determined, data are obtained.
2. the method for claim 1, it is characterised in that the data acquisition instruction is to call JS The instruction of code;Then
In response to the instruction, it is determined that the mode information for pre-setting, including:
The first specific field in the called JS codes of the instruction is searched in response to the instruction in front end;
According to lookup result, it is determined that the mode information for pre-setting.
3. method as claimed in claim 2, it is characterised in that according to lookup result, it is determined that setting in advance The mode information put, including:
It is not empty state by the first specific field if finding first specific field, is defined as institute State the mode information for pre-setting;
It is empty state by the first specific field if not finding first specific field, is defined as institute State the mode information for pre-setting.
4. method as claimed in claim 3, it is characterised in that according to the mapping relations, determine institute The data acquiring mode that the mode information for pre-setting is mapped is stated, including:
When being not empty state by the first specific field, be defined as it is described pre-set mode information when, root According to the mapping relations, the data acquiring mode for determining the mapping is based on remote procedure call protocol RPC Method of calling;When being empty state by the first specific field, it is defined as the mode information for pre-setting When, according to the mapping relations, the data acquiring mode for determining the mapping is the mode based on VM;Or,
When being not empty state by the first specific field, be defined as it is described pre-set mode information when, root According to the mapping relations, the data acquiring mode for determining the mapping is the mode based on VM;When by first Specific field is empty state, be defined as it is described pre-set mode information when, according to the mapping relations, The data acquiring mode for determining the mapping is the method for calling based on remote procedure call protocol RPC.
5. the method for claim 1, it is characterised in that in response to the instruction, it is determined that in advance The mode information of setting, including:
Front end is in response to the instruction, it is determined that the state of the switch for setting;
According to result is determined, it is determined that the mode information for pre-setting.
6. method as claimed in claim 5, it is characterised in that according to result is determined, it is determined that setting in advance The mode information put, including:
When the switch is determined in opening, switch is in opening, be defined as described pre- The mode information for first setting;
When determining that the switch is closed, switch is closed, be defined as described pre- The mode information for first setting.
7. method as claimed in claim 6, it is characterised in that according to the mapping relations, determine institute The data acquiring mode that the mode information for pre-setting is mapped is stated, including:
When switch is in into opening, be defined as it is described pre-set mode information when, reflected according to described Relation is penetrated, the data acquiring mode for determining the mapping is the method for calling based on RPC;At by switch In closed mode, be defined as it is described pre-set mode information when, according to the mapping relations, determine institute The data acquiring mode for stating mapping is the mode based on VM;Or,
When switch is in into opening, be defined as it is described pre-set mode information when, reflected according to described Relation is penetrated, the data acquiring mode for determining the mapping is the mode based on VM;Closed when switch is in State, be defined as it is described pre-set mode information when, according to the mapping relations, determine the mapping Data acquiring mode be the method for calling based on RPC.
8. the method as described in any claim of claim 1~7, it is characterised in that when according to the mapping Relation, when the data acquiring mode for determining the mapping is the mode based on VM, using the data determined Acquisition modes, obtain data, including:
Search the second specific field in VM template instructions in front end;
If finding the second specific field, the data in the second specific field are obtained;
If not finding the second specific field, the data of HTML HTML element are captured.
9. method as claimed in claim 8, it is characterised in that what front end was searched in VM second specifies Field, including:
Front end determines the mark of the second specific field according to predetermined data display mode;
In VM, the second specific field corresponding to the mark of the second specific field is searched.
10. method as claimed in claim 9, it is characterised in that:
When the data display mode is that when being shown using combobox, front end obtains the number in the second specific field According to, including:Obtain the property value of specific field in Select elements;
When the data display mode is that when being shown using menu bar Menu, front end obtains the second specific field In data, including:Obtain the property value of specific field in Menu objects;
When the data display mode is that when being shown using form Table, front end is obtained in the second specific field Data, including:Obtain specified field attribute value in Table objects.
11. methods as claimed in claim 8, it is characterised in that crawl HTML HTML The data of element, including:
By DOM Document Object Model DOM, the data of HTML element are captured.
12. method as described in claim 1~7,9~11 any claims, it is characterised in that methods described Also include:
Using the user interface BUI components of browser, the data for obtaining are presented.
13. a kind of data acquisition facilities, it is characterised in that be applied to front end, described device includes:
Instruction reception unit, for receiving data acquisition instruction;
Information determination unit, for the instruction received in response to instruction reception unit, it is determined that pre-setting Mode information;
Mode determining unit, for being closed with the default mapping of corresponding data acquiring mode according to mode information System, determines the data acquiring mode that the mode information that information determination unit determines is mapped;
Data capture unit, for the data acquiring mode that employing mode determining unit is determined, obtains data.
14. devices as claimed in claim 13, it is characterised in that the data acquisition instruction is to call The instruction of JS codes;Then
Information determination unit, is used for:In response to the instruction, the called JS codes of the instruction are searched In the first specific field;According to lookup result, it is determined that the mode information for pre-setting.
15. devices as claimed in claim 14, it is characterised in that:
Information determination unit, if for finding first specific field, not being by the first specific field Empty state, is defined as the mode information for pre-setting;If not finding first specific field, It is then empty state by the first specific field, is defined as the mode information for pre-setting.
16. devices as claimed in claim 15, it is characterised in that mode determining unit, are used for:
When being not empty state by the first specific field, be defined as it is described pre-set mode information when, root According to the mapping relations, the data acquiring mode for determining the mapping is based on remote procedure call protocol RPC Method of calling;When being empty state by the first specific field, it is defined as the mode information for pre-setting When, according to the mapping relations, the data acquiring mode for determining the mapping is the mode based on VM;Or,
When being not empty state by the first specific field, be defined as it is described pre-set mode information when, root According to the mapping relations, the data acquiring mode for determining the mapping is the mode based on VM;When by first Specific field is empty state, be defined as it is described pre-set mode information when, according to the mapping relations, The data acquiring mode for determining the mapping is the method for calling based on remote procedure call protocol RPC.
17. devices as claimed in claim 13, it is characterised in that information determination unit, are used for:
In response to the instruction, it is determined that the state of the switch for setting;According to result is determined, it is determined that pre-setting Mode information.
18. devices as claimed in claim 17, it is characterised in that information determination unit, are used for:
When the switch is determined in opening, switch is in opening, be defined as described pre- The mode information for first setting;When determining that the switch is closed, switch is closed, It is defined as the mode information for pre-setting.
19. devices as claimed in claim 18, it is characterised in that mode determining unit, are used for:
When switch is in into opening, be defined as it is described pre-set mode information when, reflected according to described Relation is penetrated, the data acquiring mode for determining the mapping is the method for calling based on RPC;At by switch In closed mode, be defined as it is described pre-set mode information when, according to the mapping relations, determine institute The data acquiring mode for stating mapping is the mode based on VM;Or,
When switch is in into opening, be defined as it is described pre-set mode information when, reflected according to described Relation is penetrated, the data acquiring mode for determining the mapping is the mode based on VM;Closed when switch is in State, be defined as it is described pre-set mode information when, according to the mapping relations, determine the mapping Data acquiring mode be the method for calling based on RPC.
20. device as described in claim 13~19, it is characterised in that data capture unit, is used for:
When according to the mapping relations, the data acquiring mode for determining the mapping is the mode based on VM When, search the second specific field in VM template instructions;
If finding the second specific field, the data in the second specific field are obtained;
If not finding the second specific field, the data of HTML HTML element are captured.
21. devices as claimed in claim 20, it is characterised in that data capture unit, are used for:
According to predetermined data display mode, the mark of the second specific field is determined;
In VM, the second specific field corresponding to the mark of the second specific field is searched.
22. devices as claimed in claim 21, it is characterised in that data capture unit, are used for:
When the data display mode is that when being shown using combobox, front end obtains the number in the second specific field According to, including:Obtain the property value of specific field in Select elements;
When the data display mode is that when being shown using menu bar Menu, front end obtains the second specific field In data, including:Obtain the property value of specific field in Menu objects;
When the data display mode is that when being shown using form Table, front end is obtained in the second specific field Data, including:Obtain specified field attribute value in Table objects.
23. devices as claimed in claim 20, it is characterised in that data capture unit, are used for:
If not finding the second specific field, by DOM Document Object Model DOM, HTML element is captured Data.
24. device as described in claim 13~19,21~23 any claims, it is characterised in that described Device also includes:
Display unit, for the user interface BUI components using browser, is presented data capture unit and obtains Data.
CN201510944900.6A 2015-12-16 2015-12-16 Data acquisition method and device Active CN106886465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510944900.6A CN106886465B (en) 2015-12-16 2015-12-16 Data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510944900.6A CN106886465B (en) 2015-12-16 2015-12-16 Data acquisition method and device

Publications (2)

Publication Number Publication Date
CN106886465A true CN106886465A (en) 2017-06-23
CN106886465B CN106886465B (en) 2021-06-15

Family

ID=59176178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510944900.6A Active CN106886465B (en) 2015-12-16 2015-12-16 Data acquisition method and device

Country Status (1)

Country Link
CN (1) CN106886465B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889272A (en) * 2019-11-29 2020-03-17 中国银行股份有限公司 Data processing method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193125A (en) * 2006-11-20 2008-06-04 华为技术有限公司 A method and device for local device configuration management of user
WO2011158478A1 (en) * 2010-06-17 2011-12-22 日本電気株式会社 Data processing system and data processing method
CN102347895A (en) * 2011-06-21 2012-02-08 杭州华三通信技术有限公司 Method and equipment for transmitting monitoring data
CN102938839A (en) * 2012-11-13 2013-02-20 浙江宇视科技有限公司 Monitoring front-end equipment and encoding server
CN103577599A (en) * 2013-11-15 2014-02-12 北京邮电大学 Method and device for storing local data through mobile terminal
CN104579695A (en) * 2013-10-23 2015-04-29 杭州华三通信技术有限公司 Data forwarding device and method
CN105138312A (en) * 2014-06-05 2015-12-09 阿里巴巴集团控股有限公司 Table generation method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193125A (en) * 2006-11-20 2008-06-04 华为技术有限公司 A method and device for local device configuration management of user
WO2011158478A1 (en) * 2010-06-17 2011-12-22 日本電気株式会社 Data processing system and data processing method
CN102347895A (en) * 2011-06-21 2012-02-08 杭州华三通信技术有限公司 Method and equipment for transmitting monitoring data
CN102938839A (en) * 2012-11-13 2013-02-20 浙江宇视科技有限公司 Monitoring front-end equipment and encoding server
CN104579695A (en) * 2013-10-23 2015-04-29 杭州华三通信技术有限公司 Data forwarding device and method
CN103577599A (en) * 2013-11-15 2014-02-12 北京邮电大学 Method and device for storing local data through mobile terminal
CN105138312A (en) * 2014-06-05 2015-12-09 阿里巴巴集团控股有限公司 Table generation method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889272A (en) * 2019-11-29 2020-03-17 中国银行股份有限公司 Data processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106886465B (en) 2021-06-15

Similar Documents

Publication Publication Date Title
CN105354013B (en) Application interface rendering method and device
AU2012370492B2 (en) Graphical overlay related to data mining and analytics
CN106484383B (en) Page rendering method, device and equipment
US20190188060A1 (en) Enabling a web application to call at least one native function of a mobile device
US20160085520A1 (en) Application Creation Method and Apparatus
CN105354014B (en) Application interface renders methods of exhibiting and device
JP5089684B2 (en) Technology for generating service programs
CN103597469B (en) Live browser instrument in IDE
CN104424232B (en) A kind of webpage label method and apparatus
CN107766344B (en) Template rendering method and device and browser
CN107688529B (en) Component debugging method and device
CN106294372A (en) Application program page quick access method and apply its mobile terminal
US20130152010A1 (en) Multiple tab stack user interface
CN102279884A (en) Data acquiring and displaying method, system and Web server based on Web pages
EP3857399A1 (en) Personalization of content suggestions for document creation
CN105302461B (en) A kind of method and apparatus for the offer target pages in mobile application
US8769439B2 (en) Method for creation, management, and presentation of user-scoped navigation topologies for web applications
CN110263070A (en) Event report method and device
CN109684571A (en) A kind of collecting method and device, storage medium
CN110781425B (en) Display method, device and equipment of mobile terminal H5 page and storage medium
CN106156189A (en) A kind of label generating method and device, information getting method and device
CN109240664A (en) A kind of method and terminal acquiring user behavior information
US10089406B2 (en) Generating web pages with integrated content
CN110851123A (en) WebGIS power grid visualization framework construction method, system and device based on SpringMVC
CN105989075A (en) Method, device and system for displaying image by browser

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180321

Address after: Four story 847 mailbox of the capital mansion of Cayman Islands, Cayman Islands, Cayman

Applicant after: CAINIAO SMART LOGISTICS HOLDING Ltd.

Address before: Cayman Islands Grand Cayman capital building a four storey No. 847 mailbox

Applicant before: ALIBABA GROUP HOLDING Ltd.

GR01 Patent grant
GR01 Patent grant