`

Evernote 同步机制分析

 
阅读更多

SyncService

SyncNotification

SyncProgressFragment

 

参考http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc297053055

 

1、EDAM(Evernote Data Access and Management) 协议

 

  • 数据模型(data model)由 service 管理
  • 远程处理(remote procedures)从 service 返回和提交修改数据
  • 通过 Thrift service 定义语言来描述数据模型和远程处理,支持所有流行语言
2、远程处理(remote procedures)
  • UserStore service 用户认证
  • NoteStore service 用于数据变更

3、数据模型



每个核心的 NoteStore 数据元都有一个GUID(Globally unique identifier),在创建时生成,不能修改,被API参考调用。

每个数据对象都有一个 USN(updateSequenceNumber),用于发生修改服务的时候。每次发生变更提交时会创建一个USN。USN 是用户名下唯一且单调递增变量,方便客户端判断同步。

 

  • User - 用户账户,用户名密码邮箱、个人属性、偏好
  • Accounting - 账务,服务级别:如上传次数/空间限制(uploadLimit)。
  • Notebook - 笔记本,每个用户账户可以有多个 notebook,note 需要存放在 notebook 中。有默认的 notebook - 不能删除最后一个 notebook。
  • Note - 超文本文档,ENML(Evernote Markup Language)格式,内嵌资源(images, ink, audio, PDF, etc.),图片以内嵌二进制文件
  • NoteAttributes - 系统定义的属性,如creation time, size, origin,用于搜索和过滤;
  • Resource -  资源文件,二进制数据块。类似于电子邮件的附件,每个资源可能有一组描述其定义的属性 ResourceAttributes.
  • SavedSearch -  保存搜索条件

资源内部使用MD5关联资源,如

<en-media type=”image/jpeg” hash=”9e107d9d372bb6826bd81d3542a419d6”/>

 

4、UserStore Service

 

固定访问: https://www.evernote.com/edam/user

 

UserStore Service API
远程方法 简介
checkVersion 发送客户端版本号给服务,并获取兼容响应。
authenticate 发送用户名和密码给服务,并获取成功的令牌信息。
refreshAuthentication 发送一个将要到期的令牌给服务,并获取一个新的令牌。
getUser 根据令牌返回一个用户。
getPublicUserInfo 返回一个用户的公开信息。
getPreminmInfo 返回一个用户免费/高级账号状态。

 

5、OAuth 认证

 

 

6、NoteStore Service

 

 

固定访问: https://www.evernote.com/edam/note/

 


远程方法

简介

listNotebooks

Returns a list of all of the Notebooks in the account.

getNotebook

Retrieves the state of a single Notebook.

getDefaultNotebook

Retrieves the Notebook that should receive new Notes which do not specify a destination.

createNotebook

Makes a new Notebook in the account.

updateNotebook

Changes an existing Notebook.

expungeNotebook

Permanently removes an existing Notebook. Notes within the notebook are moved to the current default Notebook and moved into the trash.

 

 

 

listTags

Returns a list of all of the Tags in the account.

listTagsByNotebook

Returns a list of all of the Tags that are applied to at least one note within a specified notebook.

getTag

Retrieves the state of a single Tag.

createTag

Makes a new Tag in the account.

updateTag

Changes an existing Tag.

untagAll

Removes a Tag from any Notes.

expungeTag

Permanently removes an existing Tag.

 

 

 

listSearches

Returns a list of all of the SavedSearches in the account.

getSearch

Retrieves the state of a single SavedSearch.

createSearch

Makes a new SavedSearch in the account.

updateSearch

Changes an existing SavedSearch.

expungeSearch

Permanently removes an existing SavedSearch.

 

 

 

findNotes

Performs a search of the Notes in the User’s account based on a configurable filter, returning a paginated subset.

findNotesMetadata

Performs a search of the Notes in the User’s account based on a configurable filter, returning a paginated, configurable subset of metadata for matching notes.

findNoteCounts

Performs a search based on a configurable filter, returning the number of Notes that would match this filter for each Notebook and Tag.

getNote

Retrieves the state of a single Note.

getNoteContent

Retrieves just the ENML hypertext content of a Note.

getNoteSearchText

Returns the plain text contents of a single note.

getNoteTagNames

Retrieves the names of the Tags for a single Note.

createNote

Makes a new Note in an existing Notebook.

updateNote

Changes the content or metadata of a single existing Note.

deleteNote

Moves a single existing Note to the trash.

expungeNote

Permanently removes an existing Note. In most cases, third party applications that wish to remove a Note should use deleteNote instead of expungeNote.

expungeNotes

Permanently removes a set of existing Notes.

expungeInactiveNotes

Permanently removes all of the notes that are currently not active (i.e. notes in the “Trash”)

copyNote

 

listNoteVersions

Retrieves a list of the prior versions of a particular note that are saved within the service.

getNoteVersion

Retrieves a previous version of a Note after it has been updated within the service (for premium Users only).

 

 

getNoteApplicationData

Retrieves the full applicationData map for a given note.

getNoteApplicationDataEntry

Retrieves a single entry in the applicationData map for a given note.

setNoteApplicationDataEntry

Create or update a single entry in the applicationData map for a given note.

unsetNoteApplicationDataEntry

Remove a single entry from the applicationData map for a given note.

 

 

 

getResource

Retrieves the state of a single Note attachment, optionally with its binary contents.

updateResource

Updates the metadata for a single Resource.  (Not its binary contents.)

getResourceData

Retrieves the binary contents of a single Resource.

getResourceByHash

Retrieves one of the resources from a Note, via the MD5 checksum of its contents, not its GUID.

getResourceRecognition

Returns the XML recognition index file for a single Resource, which can be used to find words in the image.

getResourceAlternateData

Retrieves the binary contents of the Resource’s alternate data file.

getResourceAttributes

Returns the set of attributes for the Resource.

getResourceSearchText

Returns the plain text contents of a single Resource.

 

 

 

getResourceApplicationData

Retrieves the full applicationData map for a given resource.

getResourceApplicationDataEntry

Retrieves a single entry in the applicationData map for a given resource.

setResourceApplicationDataEntry

Create or update a single entry in the applicationData map for a given resource.

unsetResourceApplicationDataEntry

Remove a single entry from the applicationData map for a given resource.

 

 

getPublicNotebook

Gets the information for one published Notebook from a user’s account, via its public URI.

createSharedNotebook

Make a new SharedNotebook object.

listSharedNotebooks

Returns a list of all of the SharedNotebooks in an account.

expungeSharedNotebooks

Permanently removes a set of existing SharedNotebooks.

createLinkedNotebook

Makes a new LinkedNotebook object.

updateLinkedNotebook

Changes an existing LinkedNotebook.

listLinkedNotebooks

Returns a list of all LinkedNotebooks in an account.

expungeLinkedNotebook

Permanently removes an existing LinkedNotebook.

authenticateToSharedNotebook

Returns an authentication token that can be used to access the contents of a notebook shared from someone else’s account.

getSharedNotebookByAuth

Get extended information about a notebook shared from someone else’s account.

sendMessageToSharedNotebookMembers

Send an email to some or all of the addresses that a notebook has already been shared with. The message will include a link to the shared notebook.

 

 

 

getSyncState

Light-weight call for caching clients to “ping” the service to see whether the account has changed.

getSyncChunk

Core routine for full, synchronizing clients to retrieve the set of changes in an account since the last checkpoint. If you are developing a new application consider using getFilteredSyncChunkinstead of getSyncChunk.

getFilteredSyncChunk

Similar to getSyncChunk, but allows clients to specify the set of data elements that they would like returned to reduce network traffic and sync time.

getLinkedNotebookSyncState

Light-weight call for caching clients to “ping” the service to see whether shared notebooks linked from other accounts have changed.

getLinkedNotebookSyncChunk

Core routine for full, synchronizing clients to retrieve the set of changes in shared notebooks linked from other accounts since the last checkpoint.

 

 

 

 

 

  • 大小: 21.9 KB
分享到:
评论
1 楼 weixiangkun 2012-03-19  
不知道有没有SyncService的代码,可以分享给我吗?我的邮箱7512278@qq.com

相关推荐

    PinboardEvernoteSync-源码.rar

    《Pinboard与Evernote同步源码解析》 在数字化时代,信息管理变得至关重要,而Pinboard和Evernote作为两款优秀的笔记应用,各自拥有强大的功能。然而,在日常使用中,用户可能需要将两者的数据进行同步,以实现信息...

    evernote-clone:试图克隆Evernote

    在"evernote-clone"中,可以找到关于如何集成用户认证机制的代码。 2. 数据存储和同步: Meteor 支持MongoDB数据库,因此开发者需要理解如何设计数据模型,以及如何实现数据的增删改查和实时同步。 3. UI/UX 设计...

    evernote_to_trello_exporter:将Evernote笔记导出到trello卡

    这为那些使用Evernote进行笔记管理和想要同步到Trello进行项目管理的人提供了一个便捷的解决方案。 【描述分析】 描述中提到的 "evernote_to_trello_exporter" 提供了将Evernote笔记迁移至Trello的功能。"更多相关...

    evernix:基于Evernote的个人信息维护者

    1. 自动同步:Evernix可能会提供定期或实时的Evernote账户同步功能,确保信息的最新状态。 2. 信息整理:可能有更高级的分类、标签和过滤机制,方便用户根据个人需求定制信息视图。 3. 快速检索:可能增强Evernote的...

    国内外知识管理软件比较(精).doc

    - 扩展性强:提供插件机制和统一的存储、同步机制,可作为轻量级wiki或SharePoint使用。 3. Kmpro: Kmpro是深蓝海域公司的知识管理平台,专为国内企业设计,具有以下特点: - B/S架构:便于企业内部知识的快速分析...

    2021最新手账系列-林袱弊府靛固聪_俏农.pdf

    2. 数据同步与备份:用户在多个设备上或在不同时间使用同一设备编辑手账时,软件会提供数据同步机制,保证数据的一致性和完整性。 3. 移动应用开发技术:用于开发手机和平板电脑等移动设备上的手账应用,运用的编程...

    国内外知识管理软件比较精参考.pdf

    本文将深入分析国内外几款知名的知识管理软件,探讨它们的功能特性及适用场景,为用户选择合适的软件提供参考。 国内的知识管理软件以适应中国用户习惯和网络环境为特色,同时提供了多种功能以满足个人和企业的需求...

    android学习笔记(三、便签demo改进)

    此外,我们还可以引入云同步机制,让用户在不同设备间无缝切换。 接下来,我们要考虑的是功能增强。例如,增加搜索功能,让用户快速找到特定的便签;添加分类管理,将便签按类别划分,方便组织;或者实现时间轴视图...

    课堂笔记和笔记软件.rar

    3. 代码型笔记软件:如Jupyter Notebook、Typora,适合编程、数据分析、科学计算等场景,支持Markdown语言和实时预览。 4. 协作型笔记软件:如Google Keep、TiddlyWiki,允许多人共享和协作编辑笔记。 三、选择笔记...

    notegem2016(解压密码:1)

    3. **笔记应用**:NoteGem2016可能是一款类似于Evernote的笔记应用程序,允许用户创建、组织和存储各种类型的信息,如文字、图片、链接等。它可能还支持搜索功能,方便用户快速找到所需内容。 4. **数据加密**:...

    Vue技术栈实现的云笔记项目,印象笔记的功能基本都实现.zip

    该项目基于Vue技术栈实现了一个云笔记应用,名为“vue-evernote-master”,其设计灵感和功能特点借鉴了知名的云笔记服务——印象笔记。Vue.js作为前端框架,提供了强大的组件化开发能力,使得项目的结构清晰,代码...

    FinancialfreeAcadmic-Zapier-app

    首先,我们要理解Zapier的基本运作机制。Zapier由“触发器”和“动作”组成。触发器是事件的起点,比如当一个新的电子邮件到达Gmail账户时,或者在Google表格中添加新行。一旦触发器被激活,Zapier会执行一系列预设...

Global site tag (gtag.js) - Google Analytics