CN110020319A - View switching method and apparatus - Google Patents

View switching method and apparatus Download PDF

Info

Publication number
CN110020319A
CN110020319A CN201711462154.2A CN201711462154A CN110020319A CN 110020319 A CN110020319 A CN 110020319A CN 201711462154 A CN201711462154 A CN 201711462154A CN 110020319 A CN110020319 A CN 110020319A
Authority
CN
China
Prior art keywords
view
request
html data
url
module
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
Application number
CN201711462154.2A
Other languages
Chinese (zh)
Inventor
罗劲松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711462154.2A priority Critical patent/CN110020319A/en
Publication of CN110020319A publication Critical patent/CN110020319A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of view switching method and apparatus, are related to field of computer technology.Wherein, this method comprises: receiving view switching request;The view switching request includes: the URL for requesting view and the mark of new region to be brushed;Corresponding html data is obtained from cache object according to the URL of the request view;In the case where the corresponding html data is not sky, the corresponding html data is filled to new region to be brushed according to the mark of the new region to be brushed.By above step, it is able to solve the problem that switching efficiency is low between webpage multiple view, promotes page response speed and user experience when view switching.

Description

View switching method and apparatus
Technical field
The present invention relates to field of computer technology more particularly to a kind of view switching method and apparatus.
Background technique
With the arrival in Web2.0 (second-generation internet) epoch, the prevailing of Web rich client is caused.In the rich visitor of Web In the end of family, a page may be made of many views, carried out dynamic using the form of Local hydrodynamic unit between each view and cut It changes.
In the prior art, there are following two view handoff techniques.Prior art one: it is cut needing to carry out view When changing, each view directly is obtained from network service end, and the view that will acquire is presented in the end PC or the mobile terminal browsing of user On device.Prior art two: multiple views are stored in HTML (hypertext markup language) label of the container class such as DIV in advance It is interior, when needing to carry out view switching, by the DOM (Document Object Model, the document object that operate this container class Model) object carry out view display and hide.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery: in prior art side In case one, since each view requires to obtain from network service end, lead to network bandwidth and server process resource expense mistake Greatly;In addition, cause page response slack-off since network service end processing request and transmitted data on network need elapsed time, And then influence user experience.In technical solution two, since multiple views to be stored in the html tag of the container class such as DIV in advance In, the page DOM node for resulting in the need for management is excessive, and then the slack-off problem of page response occurs, and is likely to occur HTML mark The problem of ID attribute of label repeats.
Summary of the invention
In view of this, the present invention provides a kind of view switching method and apparatus, it is able to solve between webpage multiple view and switches The problem of low efficiency, promotes page response speed and user experience when view switching.In addition, the present invention also can effectively solve now There is the problem of ID attribute of html tag existing for technical solution repeats.
To achieve the above object, according to an aspect of the invention, there is provided a kind of view switching method.
View switching method of the invention includes: to receive view switching request;The view switching request includes: request view The mark of the URL of figure and new region to be brushed;Corresponding HTML is obtained from cache object according to the URL of the request view Data;It, will be described corresponding according to the mark of the new region to be brushed in the case where the corresponding html data is not sky Html data is filled to new region to be brushed.
Optionally, the method also includes: in the case where the corresponding html data is empty, according to request view The URL of figure sends the request for obtaining html data to server-side;After the html data for receiving server-side return, returned described The html data returned is cached into the cache object, and according to the mark of the new region to be brushed by the HTML number of the return According to filling to new region to be brushed.
Optionally, the view switching request further include: the parameter for whether needing to update for indicating request view;It is described Method further include: executing the step for obtaining corresponding html data from cache object according to the URL for requesting view Before rapid, confirmation the value of the parameter is the value for indicating request view and not needing to update.
Optionally, the method also includes: the value of the parameter be indicate request view need update value when, according to The URL of the request view sends the request for obtaining html data to server-side.
Optionally, the cache object includes: JSON object;The html data by the return is cached to described slow Depositing the step in object includes: to calculate the cryptographic Hash of the URL of the request view;By the cryptographic Hash of the URL of the request view As key name, using the html data of the return as key assignments, and the key-value pair being made of the key name and the key assignments is delayed It deposits into the JSON object.
To achieve the above object, according to another aspect of the present invention, a kind of view switching device is provided.
View switching device of the invention includes: receiving module, for receiving view switching request;The view switching is asked Ask includes: the URL of request view and the mark of new region to be brushed;Module is obtained, for the URL according to the request view Corresponding html data is obtained from cache object;Module is filled, for not being empty situation in the corresponding html data Under, the corresponding html data is filled to new region to be brushed according to the mark of the new region to be brushed.
Optionally, described device further include: sending module is used in the case where the corresponding html data is empty, The request for obtaining html data is sent to server-side according to the URL of the request view;Cache module, for receiving service After holding the html data returned, the html data of the return is cached into the cache object;The filling module, is also used In after the html data for receiving server-side return, according to the mark of the new region to be brushed by the html data of the return It fills to new region to be brushed.
Optionally, the view switching request further include: the parameter for whether needing to update for indicating request view;It is described Device further include: confirmation module, for executing the URL according to the request view from cache object in the acquisition module Before the middle operation for obtaining corresponding html data, confirmation the value of the parameter is the value for indicating request view and not needing to update.
Optionally, the sending module is also used to when the value of the parameter is the value for indicating that view is requested to need to update, The request for obtaining html data is sent to server-side according to the URL of the request view.
Optionally, the cache object includes: JSON object;The cache module caches the html data of the return It extremely include: the cryptographic Hash that the cache module calculates the URL of the request view in the cache object;The cache module will The cryptographic Hash of the URL of the request view is as key name, using the html data of the return as key assignments, and will be by the key name The key-value pair constituted with the key assignments is cached into the JSON object.
To achieve the above object, according to a further aspect of the invention, a kind of terminal is provided.
Terminal of the invention, comprising: one or more processors;And storage device, for storing one or more journeys Sequence;When one or more of programs are executed by one or more of processors, so that one or more of processors are real Existing view switching method of the invention.
To achieve the above object, according to a further aspect of the invention, a kind of computer-readable medium is provided.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor Existing view switching method of the invention.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that includes request view by receiving URL, new region to be brushed mark view switching request, according to it is described request view URL correspondence is obtained from cache object Html data, and in the case where the corresponding html data is not sky, by the corresponding html data fill to Refresh region is able to solve the problem that switching efficiency is low between webpage multiple view, promotes page response speed when view switching And user experience, user's flowing of access is saved, user's access cost is reduced.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of view switching method according to an embodiment of the invention;
Fig. 2 is the key step schematic diagram of view switching method according to another embodiment of the present invention;
Fig. 3 is the main modular schematic diagram of view switching device according to an embodiment of the invention;
Fig. 4 is the main modular schematic diagram of view switching device according to another embodiment of the present invention;
Fig. 5 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the terminal device of the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
It should be pointed out that in the absence of conflict, the feature in embodiment and embodiment in the present invention can be with It is combined with each other.
Fig. 1 is the schematic diagram of the key step of view switching method according to an embodiment of the invention.As shown in Figure 1, The view switching method of the embodiment of the present invention includes:
Step S101, view switching request is received.Wherein, the view switching request includes: to request the unified money of view The mark (ID) of source finger URL (URL) and new region to be brushed.
Illustratively, it when opening the original list of some Web application on terminal browser as user, can be arranged by clicking " checking " button of certain record issues view switching request on the table page.Terminal is listening to the click thing for checking button It, can be by calling JS a kind of (JavaScript, high-level programming language) library method to execute step S101 to step S103's when part Process.In addition, in the specific implementation, user can also be by clicking some hyperlink or other page-tag objects on the page Issue view switching request.
Step S102, corresponding html data is obtained from cache object according to the URL of the request view.
Wherein, the corresponding html data can be regarded as HTML code needed for browser generates the request view. Illustratively, the cache object includes JSON (JavaScript Object Notation) object or array object. JSON object is one of JS data structure object, and the form based on key-value pair (Key-Value) stores.When the caching When object is JSON object, step S102 includes: the cryptographic Hash for calculating the URL of the request view, and is regarded according to the request The cryptographic Hash of the URL of figure inquires JSON object, to obtain html data corresponding with the request cryptographic Hash of URL of view.
Step S103, in the case where the corresponding html data is not sky, according to the mark of the new region to be brushed The corresponding html data is filled to new region to be brushed.
In embodiments of the present invention, it by receiving view switching request, is obtained from cache object according to the URL of request view Corresponding html data is taken, and in the case where the corresponding html data is not sky, the corresponding html data is filled out It is charged to new region to be brushed, is able to solve the problem that switching efficiency is low between webpage multiple view, page when promoting view switching is rung Answer speed and user experience.Meanwhile by obtaining corresponding html data from local cache object, user's visit can be saved It asks flow, reduces user's access cost.
Fig. 2 is the key step schematic diagram of view switching method according to another embodiment of the present invention.As shown in Fig. 2, this The view switching method of inventive embodiments includes:
Step S201, view switching request is received.Wherein, the view switching request include: request view URL, to The mark of refresh region and the parameter for whether needing to update for indicating request view.
Illustratively, it when opening the original list of some Web application on terminal browser as user, can be arranged by clicking " checking " button of certain record issues view switching request on the table page.Terminal is listening to the click thing for checking button It, can be by calling a kind of JS (JavaScript, high-level programming language) library method to execute process shown in Fig. 2 when part.In addition, having Body implement when, user can also by click the page on some hyperlink or other page-tag objects issue view switching ask It asks.
Further, before step S201, the method for the embodiment of the present invention, which may also include that, is cut in advance for the view on the page It changes operation object (such as button, hyperlink or other page-tag objects) and configures corresponding view switching request parameter value. For example, its view switching request parameter value can be configured that request if request view (view after switching) needs to update The parameter value that the URL of view, the mark of new region to be brushed, expression request view need to update;If requesting view without updating, Its view switching request parameter value can be configured that the URL of request view, the mark of new region to be brushed, indicate request view not The parameter value for needing to update.By the above personalized configuration, the flexibility and applicability of view switching method can be improved.
Further, it after step S201, if the value of the parameter is the value for indicating request view and not needing to update, holds Row step S202;If the value of the parameter is the value for indicating request view and needing to update, S204 is thened follow the steps.For example, working as institute When the value for stating parameter is " false ", indicate that request view does not need to update, and then execute step S202;Work as the value of the parameter When for " true ", indicate that request view needs to update, and then execute step S204.
In embodiments of the present invention, it according to the difference of the parameter value for indicating that view is requested whether to need to update, executes The step of html data needed for requesting view is generated from caching object acquisition browser, or execute to obtain from server-side and browse The step of html data needed for device generates request view, can not only improve page response speed when view switching, and It can be improved the flexibility and applicability of view switching method.
Step S202, corresponding html data is obtained from cache object according to the URL of the request view.
Wherein, the corresponding html data can be regarded as HTML code needed for browser generates the request view. Illustratively, the cache object is JSON (JavaScript Object Notation) object.JSON object is in JS A kind of data structure object, the form based on key-value pair (Key-Value) store.In this example, step S202 includes: meter The cryptographic Hash of the URL of the request view is calculated, and JSON object is inquired according to the cryptographic Hash of the URL of the request view, to obtain Take html data corresponding with the request cryptographic Hash of URL of view.
Further, in the case where the html data obtained according to step S202 is not sky, step S203 is executed;In basis In the case that the html data that step S202 is obtained is empty, step S204 is executed.
In embodiments of the present invention, the html data of the request view obtained using JSON target cache from server-side, is deposited It takes convenient and access efficiency high, can further promote page response speed and user experience when view switching.In addition, using JSON object carries out caching access and is easily achieved.
Step S203, the corresponding html data is filled to new district to be brushed according to the mark of the new region to be brushed Domain.
Step S204, the request for obtaining html data is sent to server-side according to the URL of the request view.
In embodiments of the present invention, after step s 204, step S205 is first carried out, then executes step S206.Another In a little embodiments, step S206 can also be first carried out after step s 204, then execute step S205.
Step S205, after the html data for receiving server-side return, the html data of the return is cached to institute It states in cache object.
Illustratively, when the cache object is JSON object, step S205 includes: to calculate the request view The cryptographic Hash of URL;Using the cryptographic Hash of the URL of the request view as key name (Key), using the html data of the return as Key assignments (Value), and the key-value pair being made of the key name and the key assignments is cached into the JSON object.In the present invention In embodiment, cached by the html data for returning to server-side into cache object, rather than by the HTML number of multiple views According to the html tag for depositing in container class, it can effectively solve the problem that the ID attribute of html tag present in prior art repeats The problem of.
Step S206, the html data of the return is filled to new district to be brushed according to the mark of the new region to be brushed Domain.
For example, there are three view display areas on webpage, area identification is respectively 11,12,13, if in view switching request Area identification to be refreshed be " 11 ", then the html data of the return is filled to the region for being identified as " 11 ", with to user View after showing switching.
In embodiments of the present invention, the problem that switching efficiency is low between webpage multiple view is able to solve by above step, Promote the page response speed and user experience when view switching.Meanwhile it is corresponding by being obtained from local cache object Html data can save user's flowing of access, reduce user's access cost.In addition, by using JSON target cache from clothes The html data for the request view that business end obtains, not only access is convenient, but also access efficiency height, can further promote multiple view Page response speed and user experience when switching.In addition, being cached by the html data for returning to server-side to cache object In, it can effectively solve the problem that the problem of ID attribute of html tag present in prior art repeats.
Fig. 3 is the main modular schematic diagram of view switching device according to an embodiment of the invention.As shown in figure 3, this The view switching device 300 of inventive embodiments includes: receiving module 301, obtains module 302, filling module 303.
Receiving module 301, for receiving view switching request.Wherein, the view switching request includes: request view The mark (ID) of uniform resource locator (URL) and new region to be brushed.
Illustratively, it when opening the original list of some Web application on terminal browser as user, can be arranged by clicking " checking " button of certain record issues view switching request on the table page.In addition, in the specific implementation, user can also pass through a little Some hyperlink or other page-tag objects hit on the page issue view switching request.
Module 302 is obtained, for obtaining corresponding html data from cache object according to the URL of the request view.
Wherein, the corresponding html data can be regarded as HTML code needed for browser generates the request view. Illustratively, the cache object includes JSON (JavaScript Object Notation) object or array object. JSON object is one of JS data structure object, and the form based on key-value pair (Key-Value) stores.
When the cache object is JSON object, module 302 is obtained according to the URL of the request view from cache object It is middle to obtain the cryptographic Hash that corresponding html data includes: the URL of the calculating request view, and according to the request view The cryptographic Hash of URL inquires JSON object, to obtain html data corresponding with the request cryptographic Hash of URL of view.
Module 303 is filled, in the case where the corresponding html data is not sky, according to the new region to be brushed Mark the corresponding html data is filled to new region to be brushed.
In embodiments of the present invention, view switching request is received by receiving module, by obtaining module from cache object Middle acquisition html data corresponding with the URL of view is requested, and in the case where the corresponding html data is not sky, pass through Filling module fills the corresponding html data to new region to be brushed, and it is low to be able to solve switching efficiency between webpage multiple view The problem of, promote the page response speed and user experience when view switching.Meanwhile by being obtained from local cache object Corresponding html data can save user's flowing of access, reduce user's access cost.
Fig. 4 is the main modular schematic diagram of view switching device according to another embodiment of the present invention.As shown in figure 4, this The view switching device 400 of inventive embodiments includes: receiving module 401, confirmation module 402, obtains module 403, sending module 404, module 405, cache module 406 are filled.
Receiving module 401, for receiving view switching request.Wherein, the view switching request includes: request view URL, the mark of new region to be brushed and the parameter for whether needing to update for indicating request view.
Illustratively, it when opening the original list of some Web application on terminal browser as user, can be arranged by clicking " checking " button of certain record issues view switching request on the table page.In addition, in the specific implementation, user can also pass through a little Some hyperlink or other page-tag objects hit on the page issue view switching request.
Confirmation module 402, for calling when confirming the value of the parameter is to indicate that request view does not need the value updated It obtains module 403 and executes the operation for obtaining corresponding html data from cache object according to the URL of the request view;Confirmation Module 402 is also used to call sending module 404 when confirming the value of the parameter is the value for indicating that view is requested to need to update Execute the operation for sending according to the URL of the request view to server-side and obtaining the request of html data.
For example, indicating request when the value of the parameter for indicating that view is requested whether to need to update is " false " View does not need to update, and then acquisition module 403 is called to obtain html data from cache object;When described for indicating request When the value for the parameter whether view needs to update is " true ", indicate that request view needs to update, and then call sending module 404 The request for obtaining html data is sent to server-side.
In embodiments of the present invention, pass through the modules such as setting confirmation module 402, acquisition module 403, sending module 404, energy It is enough that html data is directly obtained from cache object in the case where requesting view without updating, it needs to update in request view In the case of directly obtain html data from server-side, page response speed when view switching can not only be improved, and can Improve the flexibility and applicability of view switching device.
Module 403 is obtained, for confirming that the value of the parameter is to indicate that request view does not need to update in confirmation module 402 Value when, according to it is described request view URL corresponding html data is obtained from cache object.
Wherein, the corresponding html data can be regarded as HTML code needed for browser generates the request view. Illustratively, the cache object is JSON (JavaScript Object Notation) object.JSON object is in JS A kind of data structure object, the form based on key-value pair (Key-Value) store.In this example, 403 basis of module is obtained It includes: to obtain module 403 to calculate the request view that the URL of the request view obtains corresponding html data from cache object The cryptographic Hash of the URL of figure, and JSON object is inquired according to the cryptographic Hash of the URL of the request view, to obtain and the request The corresponding html data of the cryptographic Hash of the URL of view.
In embodiments of the present invention, the html data obtained using JSON target cache from server-side, not only access is convenient, And access efficiency is high, can further promote page response speed and user experience when view switching.In addition, using JSON Object carries out caching access and is easily achieved.
Further, in embodiments of the present invention, when the corresponding html data that acquisition module 403 is obtained from cache object When for sky, sending module 404 is called to execute the request for sending according to the URL of the request view to server-side and obtaining html data Operation.When the corresponding html data that acquisition module 403 is obtained from cache object is not sky, filling module 405 is called Execution fills the corresponding html data to the operation of new region to be brushed according to the mark of the new region to be brushed.
Sending module 404, for confirming that the value of the parameter indicates that request view needs update in confirmation module 402 In the case where value, or in the case where it is empty for obtaining the corresponding html data that module 403 obtains, according to the request view URL to server-side send obtain html data request.
Module 405 is filled, in the case that the corresponding html data for obtaining in acquisition module 403 is not sky, or In the case where receiving the html data of server-side return, according to the mark of the new region to be brushed by the HTML of the return Data are filled to new region to be brushed.
For example, there are three view display areas on webpage, area identification is respectively 11,12,13, if in view switching request Area identification to be refreshed be " 11 ", then fill the html data that module 405 will be obtained from cache object, or from server-side The html data of acquisition is filled to the region for being identified as " 11 ", to show the view after switching to user.
Cache module 406, for receive server-side return html data in the case where, by the HTML of the return Data buffer storage is into the cache object.
Illustratively, when the cache object is JSON object, cache module 406 delays the html data of the return Deposit to the cache object include: cache module 406 calculate it is described request view URL cryptographic Hash;Cache module 406 is by institute It states and requests the cryptographic Hash of the URL of view as key name (Key), using the html data of the return as key assignments (Value), and will It is cached by the key-value pair that the key name and the key assignments are constituted into the JSON object.In embodiments of the present invention, by slow Storing module caches the html data that server-side returns into cache object, rather than the html data of multiple views is deposited in The html tag of container class can effectively solve the problem that the problem of ID attribute of html tag present in prior art repeats.
The device of the embodiment of the present invention is able to solve the problem that switching efficiency is low between webpage multiple view, promotes view switching When page response speed and user experience.In addition, in the case where confirmation request view is without updating, it is straight by obtaining module It connects and obtains corresponding html data from local cache object, user's flowing of access can be saved, reduce user's access cost. In addition, the html data of the request view obtained by using JSON target cache from server-side, not only access is convenient, Er Qiecun Take it is high-efficient, can further be promoted multiple view switching when page response speed and user experience.In addition, passing through cache module The html data that server-side returns is cached into cache object, can effectively solve the problem that HTML present in prior art is marked The problem of ID attribute of label repeats.
Fig. 5 is shown can be using the view switching method of the embodiment of the present invention or the exemplary system of view switching device Framework 500.
As shown in figure 5, system architecture 500 may include terminal device 501,502,503, network 504 and server 505. Network 504 between terminal device 501,502,503 and server 505 to provide the medium of communication link.Network 504 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 501,502,503 and be interacted by network 504 with server 505, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 501,502,503 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 501,502,503 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 505 can be to provide the server of various services, such as terminal device 501,502,503 is issued The request for obtaining html data needed for browser generates request view provides the network server supported.Network server can be with The request received is carried out the processing such as to analyze, and html data needed for browser generation request view is fed back into terminal Equipment.
It should be noted that view switching method provided by the embodiment of the present invention is generally executed by terminal device, accordingly Ground, view switching device are generally positioned in terminal device.
It should be understood that the number of terminal device, network and server in Fig. 5 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 6 shows the structural representation for being suitable for the computer system 600 for the terminal device for being used to realize the embodiment of the present invention Figure.Computer system shown in Fig. 6 is only an example, should not function to the embodiment of the present invention and use scope bring and appoint What is limited.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and Execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data. CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always Line 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 609, and/or from can Medium 611 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 601, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet It includes receiving module, obtain module, filling module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, receiving module is also described as " receiving the module of view switching request ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes It obtains the equipment and executes following below scheme: receiving view switching request;The view switching request include: request view URL and The mark of new region to be brushed;Corresponding html data is obtained from cache object according to the URL of the request view;Described right In the case that the html data answered not is sky, according to the mark of the new region to be brushed by the corresponding html data fill to New region to be brushed.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of view switching method, which is characterized in that the described method includes:
Receive view switching request;The view switching request includes: the URL for requesting view and the mark of new region to be brushed;
Corresponding html data is obtained from cache object according to the URL of the request view;
It, will be described corresponding according to the mark of the new region to be brushed in the case where the corresponding html data is not sky Html data is filled to new region to be brushed.
2. the method according to claim 1, wherein the method also includes:
In the case where the corresponding html data is empty, is sent and obtained to server-side according to the URL of the request view The request of html data;
After the html data for receiving server-side return, the html data of the return is cached into the cache object, And the html data of the return is filled to new region to be brushed according to the mark of the new region to be brushed.
3. according to the method described in claim 2, it is characterized in that, the view switching request further include: for indicating request The parameter whether view needs to update;
The method also includes: corresponding HTML is obtained from cache object executing the URL according to the request view Before the step of data, confirmation the value of the parameter is the value for indicating request view and not needing to update.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
When the value of the parameter, which is, indicates value that request view needs to update, according to the URL of the request view to server-side Send the request for obtaining html data.
5. according to the method described in claim 2, it is characterized in that, the cache object includes: JSON object;
The step that the html data by the return is cached into the cache object includes: to calculate the request view The cryptographic Hash of URL;Using the cryptographic Hash of the URL of the request view as key name, using the html data of the return as key assignments, And the key-value pair being made of the key name and the key assignments is cached into the JSON object.
6. a kind of view switching device, which is characterized in that described device includes:
Receiving module, for receiving view switching request;The view switching request includes: to request the URL of view and to be brushed The mark of new region;
Module is obtained, for obtaining corresponding html data from cache object according to the URL of the request view;
Module is filled, in the case where the corresponding html data is not sky, according to the mark of the new region to be brushed The corresponding html data is filled to new region to be brushed.
7. device according to claim 6, which is characterized in that described device further include:
Sending module, in the case where the corresponding html data is empty, according to the URL of the request view to service End sends the request for obtaining html data;
Cache module, for after the html data for receiving server-side return, the html data of the return to be cached to institute It states in cache object;
The filling module is also used to after the html data for receiving server-side return, according to the mark of the new region to be brushed Knowledge fills the html data of the return to new region to be brushed.
8. device according to claim 7, which is characterized in that the view switching request further include: for indicating request The parameter whether view needs to update;
Described device further include: confirmation module, for it is described acquisition module execute it is described according to it is described request view URL from Before the operation for obtaining corresponding html data in cache object, confirmation the value of the parameter is to indicate that request view does not need more New value.
9. device according to claim 8, which is characterized in that the sending module, be also used to be in the value of the parameter When indicating the value that request view needs to update, is sent according to the URL of the request view to server-side and obtain asking for html data It asks.
10. device according to claim 7, which is characterized in that the cache object includes: JSON object;
It includes: that the cache module calculates that the cache module, which caches the html data of the return into the cache object, The cryptographic Hash of the URL of the request view;The cache module, will using the cryptographic Hash of the URL of the request view as key name The html data of the return is cached as key assignments, and by the key-value pair being made of the key name and the key assignments to the JSON In object.
11. a kind of terminal characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1 to 5 is realized when row.
CN201711462154.2A 2017-12-28 2017-12-28 View switching method and apparatus Pending CN110020319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711462154.2A CN110020319A (en) 2017-12-28 2017-12-28 View switching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711462154.2A CN110020319A (en) 2017-12-28 2017-12-28 View switching method and apparatus

Publications (1)

Publication Number Publication Date
CN110020319A true CN110020319A (en) 2019-07-16

Family

ID=67187107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711462154.2A Pending CN110020319A (en) 2017-12-28 2017-12-28 View switching method and apparatus

Country Status (1)

Country Link
CN (1) CN110020319A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268558A (en) * 2021-12-22 2022-04-01 建信金融科技有限责任公司 Method, device, equipment and medium for generating monitoring graph

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050257400A1 (en) * 1998-11-06 2005-11-24 Microsoft Corporation Navigating a resource browser session
CN101694618A (en) * 2009-09-01 2010-04-14 卡斯柯信号有限公司 Automatic mapping method of model layer and view layer data suitable for AJAX frame
CN102508665A (en) * 2011-11-10 2012-06-20 北京高森明晨信息科技有限公司 Method for drawing application view and device for drawing application view
CN102799421A (en) * 2011-05-25 2012-11-28 腾讯科技(深圳)有限公司 Multi-view switching system and method
US20140189073A1 (en) * 2010-08-03 2014-07-03 Facebook, Inc. Efficient Storage and Retrieval of Resources for Rendering Structured Documents
CN104216773A (en) * 2013-06-05 2014-12-17 腾讯科技(深圳)有限公司 View switching method and device
CN106528601A (en) * 2016-09-23 2017-03-22 北京五八信息技术有限公司 Method and device for dynamically configuring module
CN106776761A (en) * 2016-11-18 2017-05-31 武汉斗鱼网络科技有限公司 A kind of mobile browser renders the method and device of webpage

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050257400A1 (en) * 1998-11-06 2005-11-24 Microsoft Corporation Navigating a resource browser session
CN101694618A (en) * 2009-09-01 2010-04-14 卡斯柯信号有限公司 Automatic mapping method of model layer and view layer data suitable for AJAX frame
US20140189073A1 (en) * 2010-08-03 2014-07-03 Facebook, Inc. Efficient Storage and Retrieval of Resources for Rendering Structured Documents
CN102799421A (en) * 2011-05-25 2012-11-28 腾讯科技(深圳)有限公司 Multi-view switching system and method
CN102508665A (en) * 2011-11-10 2012-06-20 北京高森明晨信息科技有限公司 Method for drawing application view and device for drawing application view
CN104216773A (en) * 2013-06-05 2014-12-17 腾讯科技(深圳)有限公司 View switching method and device
CN106528601A (en) * 2016-09-23 2017-03-22 北京五八信息技术有限公司 Method and device for dynamically configuring module
CN106776761A (en) * 2016-11-18 2017-05-31 武汉斗鱼网络科技有限公司 A kind of mobile browser renders the method and device of webpage

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268558A (en) * 2021-12-22 2022-04-01 建信金融科技有限责任公司 Method, device, equipment and medium for generating monitoring graph
CN114268558B (en) * 2021-12-22 2023-06-06 建信金融科技有限责任公司 Method, device, equipment and medium for generating monitoring graph

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
CN106528432B (en) The construction method and device of test scene data bury a test method
CN109460513A (en) Method and apparatus for generating clicking rate prediction model
CN109062563B (en) Method and device for generating page
CN108494860B (en) WEB access system, WEB access method and device for client
CN108989362A (en) A kind for the treatment of method and apparatus of static resource
CN104572968B (en) A kind of method for updating pages and device
CN109829121B (en) Method and device for reporting click behavior data
CN110020304A (en) A kind of method and apparatus of loading page
CN107203629A (en) Page rendering method, system and device
CN109885593A (en) Method and apparatus for handling information
CN109241033A (en) The method and apparatus for creating real-time data warehouse
CN109961331A (en) Page processing method and its system, computer system and readable storage medium storing program for executing
CN109343975A (en) Method and apparatus for asynchronous communication between the page
CN110019552A (en) User pays close attention to the method and apparatus that state updates
CN109936605A (en) A kind of method and apparatus of loading interface data
CN111881392A (en) Page display method and device
CN108959642A (en) Method and apparatus for information to be written
CN110223179A (en) The data processing method of fund, device, system, medium
CN110109912A (en) A kind of identifier generation method and device
CN103051722B (en) A kind ofly determine the method whether page is held as a hostage and relevant device
CN108845864A (en) A kind of JVM rubbish recovering method and device based on spring frame
CN110020319A (en) View switching method and apparatus
CN109271238A (en) Support the task scheduling apparatus and method of a variety of programming languages
CN111222067B (en) Information generation method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190716