WO2017028707A1 - 一种通知消息管理方法和装置 - Google Patents
一种通知消息管理方法和装置 Download PDFInfo
- Publication number
- WO2017028707A1 WO2017028707A1 PCT/CN2016/094116 CN2016094116W WO2017028707A1 WO 2017028707 A1 WO2017028707 A1 WO 2017028707A1 CN 2016094116 W CN2016094116 W CN 2016094116W WO 2017028707 A1 WO2017028707 A1 WO 2017028707A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- notification message
- browser
- local cache
- request
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Definitions
- the present application relates to the field of communications technologies, and in particular, to a notification message management method and apparatus.
- the browser When the browser receives the notification message, it must be uniformly distributed to each page and promptly presented to the user. If the processing is not good, it will appear. For example, multiple same notification messages are repeatedly popped up, or some pages cannot receive the notification message correctly for display, which causes user misunderstanding and dissatisfaction.
- a cookie can be used to implement a notification message management mechanism of a browser.
- the specific steps are as follows:
- the object of the present invention is to provide a notification message management method, which can solve the problem that when a cookie is used to manage a notification message, each tab page keeps polling to check whether a new message appears in the cookie, and the page is changed. Rendering slows down.
- the embodiment of the present application further provides a notification message management apparatus for ensuring implementation and application of the foregoing method.
- a notification message management method including:
- the requesting page is specified in a page that has been registered to the browser's local cache, including:
- the first page in the open page that is registered to the browser's local cache is designated as the request page.
- the method further includes:
- the notification message in the browser local cache is deleted.
- the application also discloses a notification message management method, including:
- the notification message is requested by the request page to be obtained by the server and stored in the browsing In the local cache.
- the method further includes:
- the notification message is displayed in a floating window when in an active state.
- the method further includes:
- the notification message is requested from the server as the request page
- the requested notification message is stored in the browser local cache.
- the application also discloses a notification message management apparatus, including:
- a specified unit configured to specify a request page in a page that has been registered to the browser's local cache
- a message receiving unit configured to receive a notification message sent by the request page, where the notification message is requested by the request page to the server;
- the triggering unit is configured to send trigger information to the browser's page to trigger the browser page to obtain the notification message.
- the specifying unit is configured to designate, in the page that is in the open state, the first page registered to the browser local cache as the request page.
- the device further includes:
- the clearing unit is configured to delete the notification message in the browser local cache when the page of the browser is processed according to the notification message.
- the application also discloses a notification message management apparatus, including:
- a determining unit configured to determine whether a specified request page exists in a page registered to a browser local cache
- a message obtaining unit configured to: when the determining unit determines that the specified request page exists, obtain a notification message in the browser local cache when receiving the trigger information sent by the browser local cache The notification message is requested by the request page to be obtained by the server and stored in the browser local cache.
- the device further includes:
- the prompting unit is configured to display the notification message in a floating window manner when in an active state.
- the device further includes:
- a requesting unit configured to request a notification message from the server as the request page when the determining unit determines that the specified request page does not exist in the page registered to the browser local cache;
- a storage unit configured to store the requested notification message in the browser local cache.
- the embodiments of the present application include the following advantages:
- the embodiment of the present application obtains a notification message by interacting with the server by specifying a request page in the browser page, thereby avoiding frequent interaction between each page and the server, reducing the pressure of the server, and simultaneously receiving the notification message.
- Uniform storage and actively trigger the browser page to obtain the notification message, avoiding the browser page continuously polling to see if a new notification message appears, thereby reducing the processing pressure of the page, reducing the page change, rendering Slow down situation.
- FIG. 1 is a flow chart showing the steps of an embodiment of a notification message management method of the present application
- FIG. 2 is a flow chart of steps of another embodiment of a notification message management method of the present application.
- FIG. 3 is a flow chart of steps of another embodiment of a notification message management method of the present application.
- FIG. 4 is a structural block diagram of an embodiment of a notification message management apparatus of the present application.
- FIG. 5 is a structural block diagram of another embodiment of a notification message management apparatus of the present application.
- FIG. 6 is a structural block diagram of another embodiment of a notification message management apparatus of the present application.
- FIG. 7 is a structural block diagram of another embodiment of a notification message management apparatus of the present application.
- FIG. 1 a flow chart of steps of an embodiment of a notification message management method of the present application is shown, which may specifically include the following steps:
- Step 101 Specify a request page in a page that has been registered to the browser's local cache.
- the device for managing the notification message may be a browser local cache (LocalStorage), or may be a module built in the browser local cache.
- the device first specifies a request page in a plurality of pages registered to the LocalStorage. After the designation, the request page interacts with the server to request a notification message, and the other pages do not request a notification message from the server.
- the device can pre-approve the first page registered to the LocalStorage as a request page.
- the page When the page is registered to the LocalStorage, it can check whether the request page already exists in the LocalStorage. If not, the default page is the specified request page, and then the registration is performed. After LocalStorage, according to the trigger condition, or actively request a notification message from the server; if there is a request page, the page can be registered. In addition, if the page is the currently displayed page, that is, the page that is active, the device can mark the page, for example, set the page as focus.
- the device When the page in the browser is closed, the device will delete the information in the localStorage. If the currently closed page is active, the focus information in the localStorage will also be cleared.
- the closed page is the specified request page, the device can specify that the second registered incoming page becomes the request page, by the request The page makes a request with the server to get the notification.
- the device can designate the first page in the open state to be registered to the browser's local cache as the request page.
- the device may also specify a certain page in the browser as the request page according to other rules, and is not limited to the above manner.
- Step 102 Receive a notification message sent by the request page, where the notification message is requested by the request page to be obtained by the server.
- the specified request page may request a notification message to the server in real time or periodically. After the request page requests to obtain the notification message, the notification message is sent to the device, and the device stores the received notification message in the LocalStorage.
- Step 103 Send a trigger message to a browser page to trigger a browser page to obtain a notification message.
- the device After receiving the notification message, the device sends trigger information to each page of the browser, where the trigger information may directly include the notification message, so that each page of the browser can obtain the notification message after receiving the trigger information;
- the trigger information may also be used to notify the browser that each page receives a new notification message in the LocalStorage, and does not include the notification message.
- each page After receiving the trigger information, each page may obtain a notification message in the LocalStorage.
- the embodiment of the present application obtains a notification message by interacting with the server by specifying a request page in the browser page, thereby avoiding frequent interaction between each page and the server, reducing the pressure of the server, and simultaneously receiving the notification message.
- Uniform storage and actively trigger the browser page to obtain the notification message, avoiding the browser page continuously polling to see if a new notification message appears, thereby reducing the processing pressure of the page, reducing the page change, rendering Slow down situation.
- the method may further include:
- Step 201 When the page of the browser is processed according to the notification message, the notification message in the browser local cache is deleted.
- each page of the browser may separately send a feedback message to the device to notify the device that the processing has been completed, and the device knows each page.
- the notification message stored in LocalStorage can be deleted to release the memory.
- the method may include the following steps:
- Step 301 Determine whether a specified request page exists in a page that has been registered to the browser local cache.
- This embodiment describes the page of the browser as the execution subject.
- the browser page is registered to the LocalStorage, it is first determined whether the specified request page exists in the page that has been registered to the browser's local cache. If not, the process proceeds to step 302. If yes, step 305 is performed.
- Step 302 requesting a notification message from the server as a request page.
- the browser page may, after completing the registration, manage the device according to the reservation rule of the notification message, and default to the first registration to the LocalStorage. Page and set itself to the request page.
- This page can be used as a request page to request notification messages to the server in real time or periodically.
- step 303 and step 304 can be performed simultaneously.
- step 303 the requested notification message is stored in the browser local cache.
- the request page sends the obtained notification message to the notification message management device.
- the device After receiving the notification message, the device stores the notification message in the browser's LocalStorage on the one hand, and sends a trigger message on the other hand to facilitate the browser.
- the other pages get the notification message from LocalStorage.
- Step 304 Display the notification message in a floating window mode when in the active state.
- the page may also display the notification message in a floating window manner to prompt the user.
- Step 305 When receiving the trigger information sent by the browser local cache, obtain a notification message in the browser local cache, where the notification message is requested by the request page and stored in the browser local cache.
- the page determines that the specified request page exists in the page registered to the browser local cache, the page does not actively request the notification message from the server, but receives the trigger information sent by the browser LocalStorage, in the browser LocalStorage Get the notification message in .
- the notification message is stored in the localStorage of the browser by the specified request page according to the foregoing steps 302-303.
- step 304 is further performed.
- FIG. 4 a structural block diagram of an embodiment of a notification message management apparatus of the present application is shown, which may specifically include the following units:
- the specifying unit 401 is configured to specify the request page in a page that has been registered to the browser local cache.
- the message receiving unit 402 is configured to receive a notification message sent by the request page, where the notification message is requested by the request page to be obtained by the server.
- the triggering unit 403 is configured to send trigger information to the browser page to trigger the browser page to obtain the notification message.
- the device specifies a request page in the browser page by using a specified unit, and the request page interacts with the server to obtain a notification message, thereby avoiding frequent interaction between each page and the server, thereby reducing the pressure on the server, and simultaneously reducing the pressure on the server.
- the message receiving unit and the trigger unit uniformly store the notification message, and actively trigger the browser page to obtain the notification message, thereby preventing the browser page from continuously polling to see if a new notification message appears, thereby reducing the page.
- the processing pressure reduces the page change and the rendering slows down.
- the specifying unit 401 is configured to designate, in the page in the open state, the first page registered to the browser local cache as the request page.
- the apparatus may further include:
- the clearing unit 501 is configured to delete the notification message in the browser local cache when the page of the browser is processed according to the notification message.
- FIG. 6 a structural block diagram of an embodiment of a notification message management apparatus of the present application is shown, which may specifically include the following units:
- the determining unit 601 is configured to determine whether a specified request page exists in a page that has been registered to the browser local cache.
- the message obtaining unit 602 is configured to: when the determining unit determines that the specified request page exists, obtain a notification message in the browser local cache when receiving the trigger information sent by the browser local cache, The notification message is requested by the request page to be obtained by the server and stored in the browser local cache.
- the device may further include:
- the prompting unit 701 is configured to display the notification message in a floating window manner when in an active state.
- the device can also include:
- the requesting unit 702 is configured to, when the determining unit 601 determines that the specified request page does not exist in the page registered to the browser local cache, request the notification message from the server as the request page;
- the storage unit 703 is configured to store the requested notification message in the browser local cache.
- the embodiment of the present application further provides an electronic device, including a memory, a transceiver, and a processor.
- the processor and the transceiver and the memory are connected to each other through a bus; the bus may be an ISA bus, a PCI bus, or an EISA bus.
- the bus can be divided into an address bus, a data bus, a control bus, and the like.
- the memory is used to store a program, and specifically, the program may include program code, and the program code includes computer operation instructions.
- the memory may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
- the processor is used to read the program code in the memory and perform the following steps:
- a transceiver configured to receive a notification message sent by the request page, where the notification message is requested by the request page, and send a trigger information to the browser page to trigger the browser page to obtain the Notification message.
- the embodiment of the present application further provides another electronic device, including a memory and a processor.
- the processor and the memory are connected to each other through a bus; the bus may be an ISA bus, a PCI bus, or an EISA bus.
- the bus can be divided into an address bus, a data bus, a control bus, and the like.
- the memory is used to store a program, and specifically, the program may include program code, and the program code includes computer operation instructions.
- the memory may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
- the processor is used to read the program code in the memory and perform the following steps:
- the notification message is requested by the request page to be obtained by the server and stored in the browsing In the local cache.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- embodiments of the embodiments of the present application can be provided as a method, apparatus, or computer program product. Therefore, embodiments of the present application may adopt an entirely hardware embodiment, an entirely software embodiment, or a combination of soft A form of embodiment of hardware and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-persistent computer readable media, such as modulated data signals and carrier waves.
- Embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing terminal device
- Means are provided for implementing the functions specified in one or more of the flow or in one or more blocks of the flow chart.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the instruction device implements the functions specified in one or more blocks of the flowchart or in a flow or block of the flowchart.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请实施例提供了一种通知消息管理方法和装置。该通知消息管理方法包括:在已注册到浏览器本地缓存的页面中指定请求页面;接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。本申请实施例通过指定浏览器页面中的请求页面,由该请求页面与服务器进行交互来获取通知消息,避免了各页面与服务器的频繁交互,减小了服务器的压力,同时,通过对通知消息的统一存放,并主动触发浏览器页面获取该通知消息,避免了浏览器页面不停地轮询查看是否出现了新的通知消息,从而减小了页面的处理压力,减少了页面变卡,渲染变慢的情况。
Description
本申请要求2015年08月18日递交的申请号为201510509373.6、发明名称为“一种通知消息管理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,特别是涉及一种通知消息管理方法和装置。
当下web应用越来越多,越来越平台化,很多的平台应用都会使用通知消息的方式来将一些信息实时地反馈给用户,例如一些待办事宜,系统通知,状态变更等等。而浏览器通知消息的管理其实是比较复杂的,主要需解决以下几个问题:
1、要保证请求的唯一性。
当存在多个浏览器页面的时候,如何统一进行通知消息的监听,如果每个浏览器页面都去监听,就会导致浏览器会有很多的重复请求,导致服务器压力暴增,另外也会造成不同页面收到的结果不一致的情况。
2、要保证信息提醒的唯一性。
当浏览器收到通知消息后,必须要将其统一地分发给各个页面并且友好地提示给用户。如果处理不好,就会出现,例如,重复弹出多个相同的通知消息,或者有些页面无法正确收到通知消息进行展示,从而引起用户的误解和不满。
现有技术中,可以使用cookie来实现浏览器的通知消息管理机制,具体步骤为:
1、接收服务器向嵌入有网页即时通讯客户端的页面发送的通知消息,所述通知消息中包括即时通讯信息到达的标记;
2、将所述即时通讯信息到达的标记写入所述嵌入有网页即时通讯客户端的页面所属的上级域名对应的小型文件记录Cookie中;
3、根据所述Cookie中的所述标记,在所述上级域名下嵌入所述网页即时通讯客户端的其他页面上进行所述即时通讯信息到达的通知。
在实现本申请的过程中,发明人发现现有技术至少存在如下问题:
使用Cookie来管理通知消息,需要浏览器的各个tab页面,不停地轮询查看Cookie
中是否出现了新的通知消息,如果有,再做展示。这个过程会占用当前页面的资源,导致页面变卡,渲染变慢等问题。
发明内容
本申请实施例的发明目的在于提供一种通知消息管理方法,能够解决使用Cookie来管理通知消息时,各个tab页面不停地轮询查看Cookie中是否出现了新消息,而导致的页面变卡,渲染变慢的问题。
相应的,本申请实施例还提供了一种通知消息管理装置,用以保证上述方法的实现及应用。
为了解决上述问题,本申请公开了一种通知消息管理方法,包括:
在已注册到浏览器本地缓存的页面中指定请求页面;
接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;
向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
进一步,所述在已注册到浏览器本地缓存的页面中指定请求页面,包括:
将处于开启状态的页面中第一个注册到所述浏览器本地缓存的页面指定为请求页面。
进一步,所述方法还包括:
当所述浏览器的页面根据所述通知消息处理完毕时,删除所述浏览器本地缓存中的所述通知消息。
本申请还公开了一种通知消息管理方法,包括:
确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面;
若存在,则当接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
进一步,所述方法还包括:
当处于激活状态时以悬浮窗的方式显示所述通知消息。
进一步,所述方法还包括:
当确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,作为请求页面向服务器请求通知消息;
将请求到的所述通知消息存储在所述浏览器本地缓存中。
本申请还公开了一种通知消息管理装置,包括:
指定单元,被配置为在已注册到浏览器本地缓存的页面中指定请求页面;
消息接收单元,被配置为接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;
触发单元,被配置为向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
进一步,所述指定单元,被配置为将处于开启状态的页面中第一个注册到所述浏览器本地缓存的页面指定为请求页面。
进一步,所述装置还包括:
清除单元,被配置为当所述浏览器的页面根据所述通知消息处理完毕时,删除所述浏览器本地缓存中的所述通知消息。
本申请还公开了一种通知消息管理装置,包括:
确定单元,被配置为确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面;
消息获取单元,被配置为当所述确定单元确定存在所述指定的请求页面时,在接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
进一步,所述装置还包括:
提示单元,被配置为当处于激活状态时以悬浮窗的方式显示所述通知消息。
进一步,所述装置还包括:
请求单元,被配置为当所述确定单元确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,作为请求页面向服务器请求通知消息;
存储单元,被配置为将请求到的所述通知消息存储在所述浏览器本地缓存中。
与现有技术相比,本申请实施例包括以下优点:
本申请实施例通过指定浏览器页面中的请求页面,由该请求页面与服务器进行交互来获取通知消息,避免了各页面与服务器的频繁交互,减小了服务器的压力,同时,通过对通知消息的统一存放,并主动触发浏览器页面获取该通知消息,避免了浏览器页面不停地轮询查看是否出现了新的通知消息,从而减小了页面的处理压力,减少了页面变卡,渲染变慢的情况。
图1是本申请的一种通知消息管理方法实施例的步骤流程图;
图2是本申请的另一种通知消息管理方法实施例的步骤流程图;
图3是本申请的另一种通知消息管理方法实施例的步骤流程图;
图4是本申请的一种通知消息管理装置实施例的结构框图;
图5是本申请的另一种通知消息管理装置实施例的结构框图;
图6是本申请的另一种通知消息管理装置实施例的结构框图;
图7是本申请的另一种通知消息管理装置实施例的结构框图。
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。
参照图1,示出了本申请的一种通知消息管理方法实施例的步骤流程图,具体可以包括如下步骤:
步骤101,在已注册到浏览器本地缓存的页面中指定请求页面。
本实施例中,用于对通知消息进行管理的装置(以下简称该装置)可以是浏览器本地缓存(LocalStorage),也可以是内置在浏览器本地缓存中的模块。
该装置首先在注册到LocalStorage的多个页面中指定一个请求页面,在指定后,由该请求页面与服务器进行交互,请求获得通知消息,而其它页面不会向服务器请求通知消息。
该装置可以预先约定第一个注册到LocalStorage的页面为请求页面,当页面注册到LocalStorage时可以查看LocalStorage中是否已存在请求页面,若不存在,则默认本页面为指定的请求页面,进而注册到LocalStorage后,根据触发条件,或者主动向服务器请求通知消息;若存在请求页面,则该页面完成注册即可。另外,若该页面为当前展示的页面也即处于激活状态的页面,该装置可以对该页面进行标记,例如将该页面设置为focus。
当浏览器中的页面关闭时,该装置会将该页面在localStorage中得信息删除,如果当前关闭的页面是激活状态的,则localStorage中的focus信息也会被清除。当关闭的页面是指定的请求页面时,该装置可以指定第二个注册进来的页面成为请求页面,由该请求
页面与服务器进行请求,获取通知。
因此,该装置可以将处于开启状态的页面中第一个注册到浏览器本地缓存的页面指定为请求页面。
当然,该装置还可以按照其他规则指定浏览器中的某一页面为请求页面,并不局限于上述方式。
步骤102,接收请求页面发送的通知消息,该通知消息由请求页面向服务器请求获得。
该指定的请求页面会实时或定期向服务器请求通知消息,在该请求页面请求获得通知消息后,会将该通知消息发送至该装置,该装置将接收到的通知消息存储在LocalStorage中。
步骤103,向浏览器的页面发送触发信息,以触发浏览器页面获得通知消息。
该装置在接收到通知消息后,向该浏览器的各页面发送触发信息,该触发信息中可以直接包含上述通知消息,以使浏览器的各页面接收到触发信息后即可从中获知通知消息;该触发信息也可以仅用于告知浏览器各页面LocalStorage中接收到新的通知消息,而并不包含该通知消息,各页面在接收到该触发信息后可以到LocalStorage中获取通知消息。
本申请实施例通过指定浏览器页面中的请求页面,由该请求页面与服务器进行交互来获取通知消息,避免了各页面与服务器的频繁交互,减小了服务器的压力,同时,通过对通知消息的统一存放,并主动触发浏览器页面获取该通知消息,避免了浏览器页面不停地轮询查看是否出现了新的通知消息,从而减小了页面的处理压力,减少了页面变卡,渲染变慢的情况。
在另一实施例中,如图2所示,该方法还可以包括:
步骤201,当浏览器的页面根据该通知消息处理完毕时,删除浏览器本地缓存中的通知消息。
在本实施例中,当浏览器的各页面从LocalStorage中获得通知消息并根据通知消息处理完毕后,各页面可以分别向该装置发送反馈消息,告知该装置已经处理完毕,在该装置获知各页面处理完毕后,即可删除LocalStorage中存储的该通知消息,以释放内存。
参照图3,示出了本申请的另一种通知消息管理方法实施例的步骤流程图,具体可以包括如下步骤:
步骤301,确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面。
本实施例以浏览器的页面为执行主体进行说明。浏览器页面在注册到LocalStorage时首先确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面,若不存在,则执行步骤302,若存在,则执行步骤305。
步骤302,作为请求页面向服务器请求通知消息。
当确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,该浏览器页面在完成注册后,可以根据通知消息管理装置的预约规则,默认为自身是第一个注册到该LocalStorage的页面,并将自身设置为请求页面。
该页面即可作为请求页面向服务器实时或定期请求通知消息。
当该请求页面获得通知消息时,可以同时执行步骤303及步骤304。
步骤303,将请求到的通知消息存储在浏览器本地缓存中。
该请求页面将获得的通知消息发送给该通知消息管理装置,该装置在接收到通知消息后一方面将该通知消息存储在浏览器的LocalStorage中,另一方面会发出触发信息,以便于浏览器的其它页面从LocalStorage中获得该通知消息。
步骤304,当处于激活状态时以悬浮窗的方式显示该通知消息。
当该请求页面为当前展示页面时,也即处于激活状态时,该页面还可以以悬浮窗的方式显示该通知消息,以提示用户。
步骤305,当接收到浏览器本地缓存发送的触发信息时,在浏览器本地缓存中获得通知消息,该通知消息由请求页面向服务器请求获得并存储在浏览器本地缓存中。
当该页面确定已注册到浏览器本地缓存的页面中存在指定的请求页面时,该页面不会主动向服务器请求通知消息,而是在接收到浏览器LocalStorage发送的触发信息时,在浏览器LocalStorage中获得该通知消息。该通知消息由已指定的请求页面按照前述步骤302~303的方法将通知消息存储到浏览器的LocalStorage中。
当该页面获得通知消息后,若该页面为当前展示页面也即处于激活状态,则也可以进一步执行步骤304。
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请实施例并不受所描述的动作顺序的限制,因为依据本申请实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请实施例所必须的。
参照图4,示出了本申请一种通知消息管理装置实施例的结构框图,具体可以包括如下单元:
指定单元401,被配置为在已注册到浏览器本地缓存的页面中指定请求页面。
消息接收单元402,被配置为接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得。
触发单元403,被配置为向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
本申请实施例中该装置通过指定单元指定浏览器页面中的请求页面,由该请求页面与服务器进行交互来获取通知消息,避免了各页面与服务器的频繁交互,减小了服务器的压力,同时,通过消息接收单元和触发单元对通知消息的统一存放,并主动触发浏览器页面获取该通知消息,避免了浏览器页面不停地轮询查看是否出现了新的通知消息,从而减小了页面的处理压力,减少了页面变卡,渲染变慢的情况。
在另一实施例中,指定单元401,被配置为将处于开启状态的页面中第一个注册到所述浏览器本地缓存的页面指定为请求页面。
在另一实施例中,如图5所示,该装置还可以包括:
清除单元501,被配置为当所述浏览器的页面根据所述通知消息处理完毕时,删除所述浏览器本地缓存中的所述通知消息。
参照图6,示出了本申请一种通知消息管理装置实施例的结构框图,具体可以包括如下单元:
确定单元601,被配置为确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面。
消息获取单元602,被配置为当所述确定单元确定存在所述指定的请求页面时,在接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
在另一实施例中,如图7所示,该装置还可以包括:
提示单元701,被配置为当处于激活状态时以悬浮窗的方式显示所述通知消息。
该装置还可以包括:
请求单元702,被配置为当所述确定单元601确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,作为请求页面向服务器请求通知消息;
存储单元703,被配置为将请求到的所述通知消息存储在所述浏览器本地缓存中。
本申请实施例还提供了一种电子设备,包括存储器、收发器和处理器。
处理器与收发器和存储器通过总线相互连接;总线可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。
其中,存储器用于存储一段程序,具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
处理器用于读取存储器中的程序代码,执行以下步骤:
在已注册到浏览器本地缓存的页面中指定请求页面。
收发器,用于接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
本申请实施例还提供了另一种电子设备,包括存储器和处理器。
处理器与存储器通过总线相互连接;总线可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。
其中,存储器用于存储一段程序,具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。存储器可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
处理器用于读取存储器中的程序代码,执行以下步骤:
确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面;
若存在,则当接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软
件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
在一个典型的配置中,所述计算机设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非持续性的电脑可读媒体(transitory media),如调制的数据信号和载波。
本申请实施例是参照根据本申请实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。
以上对本申请所提供的一种通知消息管理方法和一种通知消息管理装置,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (12)
- 一种通知消息管理方法,其特征在于,包括:在已注册到浏览器本地缓存的页面中指定请求页面;接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
- 根据权利要求1所述的方法,其特征在于,所述在已注册到浏览器本地缓存的页面中指定请求页面,包括:将处于开启状态的页面中第一个注册到所述浏览器本地缓存的页面指定为请求页面。
- 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:当所述浏览器的页面根据所述通知消息处理完毕时,删除所述浏览器本地缓存中的所述通知消息。
- 一种通知消息管理方法,其特征在于,包括:确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面;若存在,则当接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
- 根据权利要求4所述的方法,其特征在于,所述方法还包括:当处于激活状态时以悬浮窗的方式显示所述通知消息。
- 根据权利要求4或5所述的方法,其特征在于,所述方法还包括:当确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,作为请求页面向服务器请求通知消息;将请求到的所述通知消息存储在所述浏览器本地缓存中。
- 一种通知消息管理装置,其特征在于,包括:指定单元,被配置为在已注册到浏览器本地缓存的页面中指定请求页面;消息接收单元,被配置为接收所述请求页面发送的通知消息,所述通知消息由所述请求页面向服务器请求获得;触发单元,被配置为向所述浏览器的页面发送触发信息,以触发所述浏览器页面获得所述通知消息。
- 根据权利要求7所述的装置,其特征在于,所述指定单元,被配置为将处于开启状态的页面中第一个注册到所述浏览器本地缓存的页面指定为请求页面。
- 根据权利要求7或8所述的装置,其特征在于,所述装置还包括:清除单元,被配置为当所述浏览器的页面根据所述通知消息处理完毕时,删除所述浏览器本地缓存中的所述通知消息。
- 一种通知消息管理装置,其特征在于,包括:确定单元,被配置为确定已注册到浏览器本地缓存的页面中是否存在指定的请求页面;消息获取单元,被配置为当所述确定单元确定存在所述指定的请求页面时,在接收到所述浏览器本地缓存发送的触发信息时,在所述浏览器本地缓存中获得通知消息,所述通知消息由所述请求页面向服务器请求获得并存储在所述浏览器本地缓存中。
- 根据权利要求10所述的装置,其特征在于,所述装置还包括:提示单元,被配置为当处于激活状态时以悬浮窗的方式显示所述通知消息。
- 根据权利要求10或11所述的装置,其特征在于,所述装置还包括:请求单元,被配置为当所述确定单元确定已注册到浏览器本地缓存的页面中不存在指定的请求页面时,作为请求页面向服务器请求通知消息;存储单元,被配置为将请求到的所述通知消息存储在所述浏览器本地缓存中。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510509373.6 | 2015-08-18 | ||
| CN201510509373.6A CN106470225B (zh) | 2015-08-18 | 2015-08-18 | 一种通知消息管理方法和装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017028707A1 true WO2017028707A1 (zh) | 2017-02-23 |
Family
ID=58050414
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/094116 Ceased WO2017028707A1 (zh) | 2015-08-18 | 2016-08-09 | 一种通知消息管理方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106470225B (zh) |
| WO (1) | WO2017028707A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115604254A (zh) * | 2022-12-15 | 2023-01-13 | 济南丽阳神州智能科技有限公司(Cn) | 一种断点续考处理方法及设备 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113496004B (zh) * | 2020-04-02 | 2026-02-17 | 华为云计算技术有限公司 | 一种消息发送方法及装置 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7519678B1 (en) * | 2002-11-22 | 2009-04-14 | Verizon Laboratories, Inc. | Internet messaging notification methods and systems |
| CN101477535A (zh) * | 2008-12-30 | 2009-07-08 | 华为技术有限公司 | 网页页面的显示方法、请求的处理方法、装置和系统 |
| CN103532824A (zh) * | 2012-07-06 | 2014-01-22 | 阿里巴巴集团控股有限公司 | 即时通讯消息通知的方法、浏览器及服务器 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101964810A (zh) * | 2010-08-25 | 2011-02-02 | 北京神州泰岳软件股份有限公司 | 基于浏览器的实时信息同步方法 |
| JP5760716B2 (ja) * | 2011-03-30 | 2015-08-12 | 富士通株式会社 | アプリ提供システム、アプリ提供方法、情報処理装置及び情報処理プログラム |
-
2015
- 2015-08-18 CN CN201510509373.6A patent/CN106470225B/zh active Active
-
2016
- 2016-08-09 WO PCT/CN2016/094116 patent/WO2017028707A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7519678B1 (en) * | 2002-11-22 | 2009-04-14 | Verizon Laboratories, Inc. | Internet messaging notification methods and systems |
| CN101477535A (zh) * | 2008-12-30 | 2009-07-08 | 华为技术有限公司 | 网页页面的显示方法、请求的处理方法、装置和系统 |
| CN103532824A (zh) * | 2012-07-06 | 2014-01-22 | 阿里巴巴集团控股有限公司 | 即时通讯消息通知的方法、浏览器及服务器 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115604254A (zh) * | 2022-12-15 | 2023-01-13 | 济南丽阳神州智能科技有限公司(Cn) | 一种断点续考处理方法及设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106470225A (zh) | 2017-03-01 |
| CN106470225B (zh) | 2019-07-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10764350B2 (en) | Setting first-party cookies by redirection | |
| WO2020063846A1 (zh) | 一种用于呈现寄宿程序的更新信息的方法与设备 | |
| WO2017101701A1 (zh) | 一种任务状态的查询方法和装置 | |
| CN106294365A (zh) | 一种单页web应用的页面数据处理方法及设备 | |
| JP6404816B2 (ja) | ウェブページアクセス要求に対する応答の方法および装置 | |
| CN106656920B (zh) | Http服务的处理方法、装置、存储介质及处理器 | |
| CN107526751A (zh) | 网页的加载方法、客户端、网页服务器及可编程设备 | |
| TW201807560A (zh) | 界面展示方法及裝置 | |
| CN103532824B (zh) | 即时通讯消息通知的方法、浏览器及服务器 | |
| CN104462571A (zh) | 进行网页加载的方法、装置和浏览器客户端 | |
| CN105867984B (zh) | 在网页中显示任务状态的方法、装置、客户端和移动设备 | |
| CN111666518A (zh) | 一种doi显示方法及装置 | |
| CN114528517B (zh) | 一种视图处理方法、装置、电子设备及计算机可读介质 | |
| CN111865687A (zh) | 一种业务数据更新方法及设备 | |
| US20190303870A1 (en) | Service for receiving obsolete web page copies | |
| WO2012028033A1 (zh) | 消息更新的方法和装置 | |
| WO2017028707A1 (zh) | 一种通知消息管理方法和装置 | |
| CN104598554B (zh) | 网页页面加载方法及装置 | |
| CN108334322B (zh) | 一种mvc框架的数据请求方法及系统 | |
| CN106940660B (zh) | 缓存的实现的方法和装置 | |
| CN106919595B (zh) | 一种用于Cookie映射的方法、装置及电子设备 | |
| US20160127496A1 (en) | Method and system of content caching and transmission | |
| CN108287737A (zh) | Service Worker启动方法、装置及电子设备 | |
| CN113781154A (zh) | 一种信息回滚方法、系统、电子设备及存储介质 | |
| JP6248185B2 (ja) | 最近の関連するコンテンツをユーザーに示すアクティビティのインターネットでアクセス可能なデータストレージビュー |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16836571 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16836571 Country of ref document: EP Kind code of ref document: A1 |