CN107025260A - Realize method, device and the electronic equipment of Web offline storages - Google Patents

Realize method, device and the electronic equipment of Web offline storages Download PDF

Info

Publication number
CN107025260A
CN107025260A CN201611225337.8A CN201611225337A CN107025260A CN 107025260 A CN107025260 A CN 107025260A CN 201611225337 A CN201611225337 A CN 201611225337A CN 107025260 A CN107025260 A CN 107025260A
Authority
CN
China
Prior art keywords
driving
interface
storage
particular memory
storage driving
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
CN201611225337.8A
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co 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 CN201611225337.8A priority Critical patent/CN107025260A/en
Publication of CN107025260A publication Critical patent/CN107025260A/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
    • 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

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)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present application provides a kind of method for realizing Web offline storages, device and electronic equipment, and this method includes:First interface object is initialized on startup;Judge whether the first interface object after initialization is designated particular memory driving;If particular memory driving is designated, after particular memory driving is initialized, the native interface that the particular memory is driven is mapped to first interface;If not specified particular memory driving, according to current browser environment, optimal storage driving is selected from default storage driving set, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven is mapped to the first interface;When needing to carry out Web offline storages, the first interface is called to be handled.The embodiment of the present application, which realizes both specify according to user, determines offline storage mode, can also be the adaptively selected offline storage mode of user in the case of the not specified offline storage mode of user.

Description

Realize method, device and the electronic equipment of Web offline storages
Technical field
The application is related to computer network communication technology field, more particularly, to a kind of method for realizing Web offline storages, Device and electronic equipment.
Background technology
Web application be it is a kind of can be by the application program of web access, i.e. web application is made with browser For the application program of client.For the service provider of web application, it no longer needs individually to write for client It is available for the application program of user installation.In use, user can directly pass through browser access Web Application Server.Current Web Application program typically supports Web offline storage functions.So-called Web offline storages, i.e., under Web environment, to what is obtained online Data (applied such as Web request data, response data) carry out browser end backup, in order to subsequently can be when needed (such as off-line state) is used.
Under Web environment, different offline storage modes has different characteristics, such as cookie capacity is small, easily expired, Compatibility is good;LocalStorage can only store character string, and speed is slow, but compatibility is good;The asynchronous storage speeds of IndexedDB It hurry up, and support large data sets, but only partial view device support etc. at present.In addition, every kind of offline storage mode is suffered from not again Same interface (API, Application Programming Interface), therefore, the service for web application is carried For business, different offline storage modes are selected under different browser environments and be adapted to different interfaces, it is necessary to compared with High development cost.To solve the problem, Mozilla foundations have issued one and have been directed to simplifying off-line data in Web applications The JavaScript storehouses of storage, i.e. LocalForage.As the offline storage mode under a kind of new Web environment, LocalForage has unified connecing for several conventional offline storage mode (LocalStorage, IndexedDB and WebSQL) Mouthful, and can according to current browser environment, from several conventional offline storage modes Adaptive matching go out one it is preferred Offline storage mode.
However, for the service provider of web application, needing to specify offline storage side according to actual needs sometimes Formula, and if using above-mentioned LocalForage Adaptive matching mode, then can not independently be selected, can only passively receive The offline storage mode of LocalForage selections.
The content of the invention
The purpose of the embodiment of the present application is a kind of method for realizing Web offline storages of offer, device and electronic equipment, with Realize both can according to user specify determine offline storage mode, can also the not specified offline storage mode of user situation Under, it is the adaptively selected offline storage mode of user.
To reach above-mentioned purpose, on the one hand, the embodiment of the present application provides a kind of method for realizing Web offline storages, bag Include following steps:
First interface object is initialized on startup;
Judge whether the first interface object after initialization is designated particular memory driving;
If particular memory driving is designated, after particular memory driving is initialized, the particular memory is driven Native interface be mapped to first interface;
If not specified particular memory driving, according to current browser environment, is selected from default storage driving set Optimal storage driving is selected, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven maps Into the first interface;
When needing to carry out Web offline storages, the first interface is called to be handled.
On the other hand, the embodiment of the present application additionally provides a kind of device for realizing Web offline storages, including:
Object initialization module, for initializing first interface object according to default building method on startup;
Driving confirms module, for judging whether the first interface object after initialization is designated particular memory driving;
First package module,, will after particular memory driving is initialized for when particular memory driving is designated The native interface of the particular memory driving is mapped to first interface;
Second package module, for when not specified particular memory drives, according to current browser environment, being deposited from default Selection optimal storage driving in storage driving set, and after the optimal storage driving is initialized, the optimal storage is driven Native interface be mapped to the first interface;
Interface interchange module, for when needing to carry out Web offline storages, calling the first interface to be handled.
Another further aspect, the embodiment of the present application additionally provides a kind of electronic equipment, including:
Processor;
Memory for storing executable instruction;
Wherein, the processor is configured as:
First interface object is initialized according to default building method on startup;
Judge whether the first interface object after initialization is designated particular memory driving;
If particular memory driving is designated, after particular memory driving is initialized, the particular memory is driven Native interface be mapped to first interface;
If not specified particular memory driving, according to current browser environment, is selected from default storage driving set Optimal storage driving is selected, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven maps Into the first interface;
When needing to carry out Web offline storages, the first interface is called to be handled.
The technical scheme provided from above the embodiment of the present application, the embodiment of the present application is in initialization first interface object Afterwards, first judge whether the first interface object after initialization is designated particular memory driving;If particular memory is designated Driving, then after particular memory driving is initialized, first interface is mapped to by the native interface that particular memory drives;If not Particular memory driving is specified, then according to current browser environment, optimal storage driving is selected from default storage driving set, And after the optimal storage driving is initialized, the native interface that optimal storage drives is mapped to first interface;When need into During row Web offline storages, first interface is called to be handled.Therefore, the embodiment of the present application is realized can both refer to according to user Surely determine offline storage mode, can also in the case of the not specified offline storage mode of user, be user it is adaptively selected from Line storage mode, so as to improve Consumer's Experience.
Brief description of the drawings
, below will be to embodiment or existing in order to illustrate more clearly of the embodiment of the present application or technical scheme of the prior art There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments described in application, for those of ordinary skill in the art, are not paying the premise of creative labor Under, other accompanying drawings can also be obtained according to these accompanying drawings.In the accompanying drawings:
Fig. 1 is the flow chart for the method that the embodiment of the application one realizes Web offline storages;
Fig. 2 is the acquisition schematic diagram of Storage class libraries in the embodiment of the application one;
Fig. 3 is the structured flowchart for the device that the embodiment of the application one realizes Web offline storages;
Fig. 4 is the structured flowchart of the electronic equipment of the embodiment of the application one.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, it is real below in conjunction with the application The accompanying drawing in example is applied, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described implementation Example only some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, this area is common The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to the application protection Scope.
With reference to shown in Fig. 1, the method for realizing Web offline storages of the embodiment of the present application comprises the following steps:
S101, on startup initialization first interface object.
In the embodiment of the present application, described starts the startup that can be applied for Web.Described Web applications can be chat Room (chat room), forum (forum), BBS(Bulletin Board System) (BBS, Bulletin Board System), WebQQ, Web Mailbox, Web mapping softwares or Web game etc..
In the application one embodiment, described startup for example can be the User logs in Web applications of Web applications, example As WebQQ user logs in WebQQ by browser.In one embodiment of the application, described startup can also be WebQQ User opens Web applications by browser, for example, the homepage of Web applications is opened by browser.
In the embodiment of the present application, the initialization first interface object is the process that first interface object assigns initial value. In embodiments herein, the first interface object is according to the construction stated in third party's class libraries by Web application providers What method was created, the first interface object can call first interface, to realize the operation of Web offline storages correlation.Wherein, it is right For a class, typically all definition has building method, to complete the initialization of object;Can be certainly when class instantiates an object It is dynamic to call building method.Third party's class libraries is the reusable type set of an object-oriented, and these types for example can be with Including interface and realize class.In the application one embodiment, such as one Storage class libraries can include following interface and Realize class:
Storage.get () // be used to obtain particular memory record according to key (key assignments)
Storage.set//be used to set particular memory to record
Storage.remove//be used to remove stored record according to key
Storage.clear//be used to remove all stored records
Storage.has is used to judge whether that particular memory is recorded according to key, returns to true/false
Storage.forEach is used for all stored records in searching loop driving, and performs certain specific readjustment letter successively Number (incoming through parameter)
In the embodiment of the present application, third party's class libraries can be obtained from third-party server, such as shown in Fig. 2, and third party is opening Distribute into after storage class libraries, can be deposited on the server of one's own side, so that user (is generally the service of Web applications here Provider) use.In the other embodiment of the application, third party can also be developed the class libraries completed and deposit in and be entrusted by it On the other side Entrust Server of support.
S102, judge initialization after first interface object whether be designated particular memory driving.
In the application one embodiment, parameter can be specified according to the pressure of the first interface object after initialization (forcibly parameters), judges whether the first interface object after initialization is designated particular memory driving.For example when When forcibly parameters are true, then illustrate that first interface object is forced to specify the driving of some particular memory.It is corresponding, when When forcibly parameters are false, then illustrate that first interface object is not forced to specify any storage driving.It the above is only citing Illustrate, in the application other embodiment, also judge by other means.
For the service provider that Web is applied, the purpose for specifying the driving of some particular memory is forced to be, sometimes by force Making the storage driving specified may be more preferable than the effect of automatic adaptation, such as when storing small lot data, forcing to specify makes It is substantially more efficient than the indexedDB of automatic adaptation with localStorage.Therefore, when the Web service providers applied wish Hope that the embodiment of the present application is provided for facility when independently selecting storage driving according to actual demand.Therefore, with The example that localForage directly returns to an automatic adaptation pattern is different, and the embodiment of the present application realizes the initialization of example The Web service providers of application are given, the service provider applied by Web builds example by new instructions, this is just many examples Structure provide may.Particularly when a web application is excessively complicated, there are a variety of different data types and storage demand, Different adaptation patterns is used for different data, multiple different examples directly can be constructed by new instructions.
In the application one embodiment, the storage that the particular memory is driven in default storage driving set is driven It is dynamic.It is corresponding, if the particular memory driving were designated, and current browser environment would not support the particular memory to drive It is dynamic, then according to current browser environment, from the remaining storage driving of storage driving set, selection optimal storage driving. Wherein, the storage driving in the storage driving set can for example include:IndexedDB drives and LocalStorage drives It is dynamic.
If S103a, particular memory driving is designated, after particular memory driving is initialized, specific deposited described The native interface of storage driving is mapped to first interface.
In the embodiment of the present application, the first interface can be the unified interface for the otherness for shielding different storage drivings Or general-purpose interface, the first interface can be provided in the way of asynchronous chain type access key-value pair (key/value) external interface tune With.
When confirming that first interface object is forced to specify the driving of some particular memory (such as LocalStorage), Particular memory driving can directly be initialized.Initialize the particular memory driving after, it is described by particular memory drive it is primary Interface mappings can specifically include into first interface:
By predefined empty first interface, first interface of the native interface driven with the particular memory by encapsulation Carry out unified interface mapping.In one exemplary embodiment of the application, native interface, which is mapped to first interface process, to be The process of first interface encapsulation is carried out using the Promise patterns of asynchronism callback.Below, to " native interface encapsulation " and " unification Interface mappings " are illustrated respectively.Described " native interface encapsulation " is understood that:Such as to the encapsulation of set interfaces, During using localStorage as storage driving, directly invoking its setItem interface just can be with;And using indexedDB as , it is necessary to first open an affairs during storage driving, create after a table object, recall put interfaces, encapsulation work is exactly to pack Above-mentioned work.By taking set interfaces as an example, described " unified interface mapping " is exactly by the both above set interfaces for driving and encapsulating Predefined unified interface is all uniformly mapped to, so when calling unified interface, what is actually called is exactly behind The set interfaces that localStorage and inndexedDB was encapsulated, such interface docking operation is exactly unified interface mapping.
If S103b, not specified particular memory drive, according to current browser environment, from default storage driving collection Optimal storage driving is selected in conjunction, and after optimal storage driving is initialized, primary connect what the optimal storage drove Mouth is mapped to the first interface.
In the embodiment of the present application, the current browser environment, i.e., the essential information of currently used browser is for example browsed Device title and version, which storage driving etc. supported.Wherein, current browser environment can be by calling current browser itself to carry The API of confession is realized.
It is described according to current browser environment in the application one embodiment, selected from default storage driving set Optimal storage driving is selected, can be included:
Whether detection current browser environment supports the first storage driving in the storage driving set;If supporting institute The first storage driving is stated, then it is optimal driving to confirm first storage driving;
If not supporting first storage driving, whether detection current browser environment supports the storage driving collection The second storage driving in conjunction;
If supporting second storage driving, it is optimal driving to confirm first storage driving;
If not supporting second storage driving, mistake of dishing out.
Wherein, first storage driving can include IndexedDB drivings, and second storage driving can include LocalStorage drives.Due to clearly having discarded WebSQL drivings in HTML5 specifications, although currently may some browsers WebSQL drivings also are being supported, but in edition upgrading of the future with browser, the branch driven to WebSQL may be abandoned at any time Hold, it is possible to some offline storage data based on WebSQL drivings can be caused unavailable.And the embodiment of the present application is discarded The support driven to WebSQL, and it is comprehensive use LocalStorage and IndexedDB, this can substantially meet main flow and browse Numeral in offline storage demand (such as shown in table 1 below) under device, table 1 is supported minimum browser version, and can be with Simplify the code of Web applications.
Table 1
Driving Chorme Firefox(Gecko) IE Opera Safari(webkit)
LocalStorage 4 3.5 8 10.5 4
IndexedDB 23、24(webkit) 10、16(moz) 10 15 7.1
S104, when need carry out Web offline storages when, call the first interface to be handled.
Specific which data are done with how offline storage is operated, the service provider that can be applied by Web applies according to web Particular demands do programmed instruction preset, these programmed instruction are typically JS (JavaScript) script.For final use For family (using the user that web is applied by browser), when the interaction shape of progress web applications is, loaded by browser And above-mentioned JS scripts are performed, operated with doing corresponding storage according to the instruction of default offline storage.
Although procedures described above flow includes the multiple operations occurred with particular order, it should however be appreciated that understand, These processes can include more or less operations, and these operations can sequentially be performed or performed parallel (such as using parallel Processor or multi-thread environment).
With reference to shown in Fig. 3, the device for realizing Web offline storages of the embodiment of the present application, including:
Object initialization module 31, for initializing first interface object according to default building method on startup;
Driving confirms module 32, is driven for judging whether the first interface object after initialization is designated particular memory It is dynamic;
First package module 33, for when particular memory driving is designated, after particular memory driving is initialized, The native interface that the particular memory is driven is mapped to first interface;
Second package module 34, for when not specified particular memory drives, according to current browser environment, from default Optimal storage driving is selected in storage driving set, and after the optimal storage driving is initialized, the optimal storage is driven Dynamic native interface is mapped to the first interface;
Interface interchange module 35, for when needing to carry out Web offline storages, calling the first interface to be handled.
The device for realizing Web offline storages of the embodiment of the present application is corresponding with above-mentioned embodiment illustrated in fig. 1, therefore, relevant In the detailed description of the device for realizing Web offline storages of the embodiment of the present application, above-mentioned embodiment illustrated in fig. 1 is referred to, herein Repeat no more.
Fig. 4 shows the structured flowchart of the electronic equipment of the embodiment of the application.It refer to shown in Fig. 4, in hardware layer Face, the electronic equipment includes processor, internal bus, network interface, internal memory and nonvolatile memory, and bag is also possible to certainly Include the hardware required for other business.It is right into internal memory that processor reads corresponding computer program from nonvolatile memory After run, formed on logic level and realize the devices of Web offline storages.Certainly, in addition to software realization mode, the application It is not precluded from other implementations, such as the mode of logical device or software and hardware combining etc., that is to say, that following processing stream The executive agent of journey is not limited to each logic unit or hardware or logical device.Wherein, the processor by with It is set to:
First interface object is initialized according to default building method on startup;
Judge whether the first interface object after initialization is designated particular memory driving;
If particular memory driving is designated, after particular memory driving is initialized, the particular memory is driven Native interface be mapped to first interface;
If not specified particular memory driving, according to current browser environment, is selected from default storage driving set Optimal storage driving is selected, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven maps Into the first interface;
When needing to carry out Web offline storages, the first interface is called to be handled.
The electronic equipment of the embodiment of the present application is corresponding with above-mentioned embodiment illustrated in fig. 1, therefore, is related to the embodiment of the present application Electronic equipment detailed description, refer to above-mentioned embodiment illustrated in fig. 1, will not be repeated here.
In the 1990s, for a technology improvement can clearly distinguish be on hardware improvement (for example, Improvement to circuit structures such as diode, transistor, switches) or software on improvement (for the improvement of method flow).So And, with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit. Designer nearly all obtains corresponding hardware circuit by the way that improved method flow is programmed into hardware circuit.Cause This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, PLD (Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate Array, FPGA)) it is exactly such a integrated circuit, its logic function is determined by user to device programming.By designer Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, without asking chip maker to design and make Special IC chip.Moreover, nowadays, substitution manually makes IC chip, and this programming is also used instead mostly " patrols Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development, And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language (Hardware Description Language, HDL), and HDL is also not only a kind of, but have many kinds, such as ABEL (Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL (Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also should This understands, it is only necessary to slightly programming in logic and be programmed into method flow in integrated circuit with above-mentioned several hardware description languages, The hardware circuit for realizing the logical method flow can be just readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing Device and storage can by the computer of the computer readable program code (such as software or firmware) of (micro-) computing device Read medium, gate, switch, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller includes but is not limited to following microcontroller Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that except with Pure computer readable program code mode is realized beyond controller, can be made completely by the way that method and step is carried out into programming in logic Obtain controller and come real in the form of gate, switch, application specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. Existing identical function.Therefore this controller is considered a kind of hardware component, and various for realizing to including in it The device of function can also be considered as the structure in hardware component.Or even, can be by for realizing that the device of various functions is regarded For that not only can be the software module of implementation method but also can be the structure in hardware component.
Device, module or unit that above-described embodiment is illustrated, can specifically be realized, Huo Zheyou by computer chip or entity Product with certain function is realized.It is a kind of typically to realize that equipment is computer.Specifically, computer for example can be individual People's computer, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media player, navigation Any equipment in equipment, electronic mail equipment, game console, tablet PC, wearable device or these equipment Combination.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented The function of each unit can be realized in same or multiple softwares and/or hardware during application.
The present invention be with reference to method according to embodiments of the present invention, device and computer program product flow chart and/or Block diagram is described.It should be understood that can by each flow in computer program instructions implementation process figure and/or block diagram and/or Square frame and the flow in flow chart and/or block diagram and/or the combination of square frame.These computer program instructions can be provided to arrive All-purpose computer, special-purpose computer, the processor of Embedded Processor or other programmable data processing devices are to produce one Machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for realizing in stream The device for the function of being specified in one flow of journey figure or multiple flows and/or one square frame of block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net Network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus Or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, calculate according to herein Machine computer-readable recording medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability Comprising so that process, method, commodity or equipment including a series of key elements are not only including those key elements, but also wrap Include other key elements being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described Also there is other identical element in process, method, commodity or the equipment of element.
It will be understood by those skilled in the art that embodiments herein can be provided as method, device or computer program product. Therefore, the application can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Form.Deposited moreover, the application can use to can use in one or more computers for wherein including computer usable program code The shape for the computer program product that storage media is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The application can be described in the general context of computer executable instructions, such as program Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these DCEs, by Remote processing devices connected by communication network perform task.In a distributed computing environment, program module can be with Positioned at including in the local and remote computer-readable storage medium including storage device.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment Divide mutually referring to what each embodiment was stressed is the difference with other embodiment.It is real especially for system Apply for example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
Embodiments herein is the foregoing is only, the application is not limited to.For those skilled in the art For, the application can have various modifications and variations.It is all any modifications made within spirit herein and principle, equivalent Replace, improve etc., it should be included within the scope of claims hereof.

Claims (10)

1. a kind of method for realizing Web offline storages, it is characterised in that comprise the following steps:
First interface object is initialized on startup;
Judge whether the first interface object after initialization is designated particular memory driving;
If particular memory driving is designated, after particular memory driving is initialized, the original that the particular memory is driven Interface mappings are given birth into first interface;
If not specified particular memory driving, according to current browser environment, is selected most from default storage driving set Excellent storage driving, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven is mapped to institute State first interface;
When needing to carry out Web offline storages, the first interface is called to be handled.
2. the method according to claim 1 for realizing Web offline storages, it is characterised in that after the judgement initialization Whether first interface object is designated particular memory driving, including:
According to the pressure of the first interface object after initialization specify parameter, judge initialize after first interface object whether by Specify particular memory driving.
3. the method according to claim 1 or 2 for realizing Web offline storages, it is characterised in that the particular memory driving For the storage driving in default storage driving set;
It is corresponding, if the particular memory driving were designated, and current browser environment would not support the particular memory to drive It is dynamic, then according to current browser environment, from the remaining storage driving of storage driving set, selection optimal storage driving.
4. the method according to claim 3 for realizing Web offline storages, it is characterised in that in the storage driving set Storage driving include:IndexedDB drives and LocalStorage drivings.
5. the method according to claim 1 for realizing Web offline storages, it is characterised in that described according to current browser Environment, selects optimal storage driving from default storage driving set, including:
Whether detection current browser environment supports the first storage driving in the storage driving set;
If supporting first storage driving, it is optimal driving to confirm first storage driving;
If not supporting first storage driving, whether detection current browser environment is supported in the storage driving set The second storage driving;
If supporting second storage driving, it is optimal driving to confirm first storage driving;
If not supporting second storage driving, mistake of dishing out.
6. the method according to claim 5 for realizing Web offline storages, it is characterised in that the first storage driving bag IndexedDB drivings are included, second storage driving drives including LocalStorage.
7. the method according to claim 1 for realizing Web offline storages, it is characterised in that the first interface is with asynchronous The mode of chain type access key-value pair provides external interface and called.
8. the method according to claim 1 for realizing Web offline storages, it is characterised in that the first interface object is Created by Web application providers according to the building method stated in third party's class libraries.
9. a kind of device for realizing Web offline storages, it is characterised in that including:
Object initialization module, for initializing first interface object according to default building method on startup;
Driving confirms module, for judging whether the first interface object after initialization is designated particular memory driving;
First package module,, will be described after particular memory driving is initialized for when particular memory driving is designated The native interface of particular memory driving is mapped to first interface;
Second package module, for when not specified particular memory drives, according to current browser environment, being driven from default storage Selection optimal storage driving in dynamic set, and after the optimal storage driving is initialized, the original that the optimal storage is driven Interface mappings are given birth into the first interface;
Interface interchange module, for when needing to carry out Web offline storages, calling the first interface to be handled.
10. a kind of electronic equipment, it is characterised in that including:
Processor;
Memory for storing executable instruction;
Wherein, the processor is configured as:
First interface object is initialized according to default building method on startup;
Judge whether the first interface object after initialization is designated particular memory driving;
If particular memory driving is designated, after particular memory driving is initialized, the original that the particular memory is driven Interface mappings are given birth into first interface;
If not specified particular memory driving, according to current browser environment, is selected most from default storage driving set Excellent storage driving, and after the optimal storage driving is initialized, the native interface that the optimal storage is driven is mapped to institute State first interface;
When needing to carry out Web offline storages, the first interface is called to be handled.
CN201611225337.8A 2016-12-27 2016-12-27 Realize method, device and the electronic equipment of Web offline storages Pending CN107025260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611225337.8A CN107025260A (en) 2016-12-27 2016-12-27 Realize method, device and the electronic equipment of Web offline storages

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611225337.8A CN107025260A (en) 2016-12-27 2016-12-27 Realize method, device and the electronic equipment of Web offline storages

Publications (1)

Publication Number Publication Date
CN107025260A true CN107025260A (en) 2017-08-08

Family

ID=59525454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611225337.8A Pending CN107025260A (en) 2016-12-27 2016-12-27 Realize method, device and the electronic equipment of Web offline storages

Country Status (1)

Country Link
CN (1) CN107025260A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815433A (en) * 2019-01-11 2019-05-28 平安科技(深圳)有限公司 Method and device, storage medium and electronic equipment is locally stored in browser
CN112612546A (en) * 2020-12-24 2021-04-06 广州虎牙科技有限公司 Page loading method and device, electronic equipment and storage medium
WO2021082859A1 (en) * 2019-10-28 2021-05-06 深圳前海微众银行股份有限公司 Data processing method, and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013060927A1 (en) * 2011-10-25 2013-05-02 Nokia Corporation Method and apparatus for providing offline binary data in a web environment
CN104156233A (en) * 2014-07-21 2014-11-19 小米科技有限责任公司 Method, device and terminal for updating light applications in offline manner
CN104657358A (en) * 2013-11-15 2015-05-27 腾讯科技(深圳)有限公司 Method and system for caching webpage program offline

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013060927A1 (en) * 2011-10-25 2013-05-02 Nokia Corporation Method and apparatus for providing offline binary data in a web environment
CN104657358A (en) * 2013-11-15 2015-05-27 腾讯科技(深圳)有限公司 Method and system for caching webpage program offline
CN104156233A (en) * 2014-07-21 2014-11-19 小米科技有限责任公司 Method, device and terminal for updating light applications in offline manner

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
佚名: ""localForage官方文档"", 《LOCALFORAGE官方文档》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815433A (en) * 2019-01-11 2019-05-28 平安科技(深圳)有限公司 Method and device, storage medium and electronic equipment is locally stored in browser
WO2021082859A1 (en) * 2019-10-28 2021-05-06 深圳前海微众银行股份有限公司 Data processing method, and device
CN112612546A (en) * 2020-12-24 2021-04-06 广州虎牙科技有限公司 Page loading method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106970822A (en) A kind of container creation method and device
CN107391526A (en) A kind of data processing method and equipment based on block chain
CN108549562A (en) A kind of method and device of image load
CN111885082B (en) Web application package processing method, device and equipment
WO2020052337A1 (en) Information processing method and apparatus, storage medium, and electronic device
US11720515B2 (en) Article, device, and techniques for serverless stack for streaming message processing
CN108282518A (en) A kind of customer terminal webpage generation method and device
CN107092475A (en) The call method and device of a kind of interactive controls
CN108345511A (en) A kind of application data verification method, device and electronic equipment
CN107025260A (en) Realize method, device and the electronic equipment of Web offline storages
WO2017079422A1 (en) Spreadsheet arrays
CN109725989A (en) A kind of method and device of task execution
CN109241026A (en) The method, apparatus and system of data management
CN111651219A (en) Method and equipment for managing multi-module project configuration file
CN107102950A (en) A kind of applied program testing method and device
CN109814863A (en) A kind of processing method, device, computer equipment and computer storage medium for requesting returned data
CN107301220B (en) Method, device and equipment for data driving view and storage medium
CN107678805A (en) The call method and device of a kind of application programming interfaces
CN110046052B (en) Service calling method and device
CN106557343A (en) Systematic function application and the method and device of loading resource
CN111324347B (en) Component construction method, device and system, page generation method, device and medium
TWI756549B (en) Data processing method, apparatus and equipment
US20180225333A1 (en) Data write/import performance in a database through distributed memory
CN107749916A (en) The method and device that a kind of mobile phone ROM high in the clouds real-time customization is downloaded
CN116016227A (en) Micro-service system arrangement visualization method, device and medium based on Docker compound

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

Effective date of registration: 20201016

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201016

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: Greater Cayman, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20170808

RJ01 Rejection of invention patent application after publication