Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort shall fall within the protection scope of the present specification.
The embodiment of the specification provides an information updating method and device.
First, an information updating method provided in an embodiment of the present specification is described below.
It should be noted that the method provided by the embodiment of the present specification is applicable to an electronic device, and in practical application, the electronic device may include: smart phones, tablet computers, desktop/notebook computers, and the like, or desktop computers, and the like, which are not limited in this specification.
Fig. 1 is a flowchart of an information updating method according to an embodiment of the present disclosure, and referring to fig. 1, the method may include the following steps:
s102, when a trigger condition of local information updating in the electronic equipment is met, the identifier of the information displayed in the screen range of the electronic equipment is acquired.
In this embodiment, the triggering condition for updating local information in the electronic device refers to a condition that can be used to trigger the electronic device to update only the content displayed in the screen of the electronic device.
In an embodiment of the present specification, an electronic device may include: smart phones, tablet computers, desktop/notebook computers, etc., or desktop computers, etc. Each piece of information displayed in the screen range of the electronic equipment is provided with the identification of the information at the server side. The information may include: market information of securities, weather forecast information, news information, reading amount of news information, or comment amount of news information. The manner in which the electronic device displays the information may include: each piece of information is shown in a list form, or each piece of information is shown in a thumbnail form, and the like.
In this embodiment of the specification, the reading intention of the user may be recognized according to a sliding behavior performed by the user on the screen of the electronic device, and then information that the user intends to read is updated, where in an optional implementation manner, the S102 may include:
when the screen of the electronic equipment is switched from a rolling state to a rolling stop state, the identification of the information displayed in the screen range of the electronic equipment is acquired.
In this embodiment, the scroll state may include: fast scrolling, slow scrolling.
In this embodiment, any method for monitoring the scrolling of the screen in the related art may be adopted to monitor the scrolling state of the screen.
In this embodiment of the present specification, the reading intention of the user may be recognized according to a foreground and background switching behavior of the application program in the electronic device by the user, and then information that the user intends to read is updated, where in another optional implementation manner, the step S102 may include:
when an application program installed in the electronic equipment is switched from a background running state to a foreground running state, acquiring the identifier of information displayed in the screen range of the electronic equipment.
In this embodiment, the application program may include: information application, financial application, social application and other software with information providing function.
In the embodiment of the present specification, the number of pieces of information displayed within the screen range of the electronic device may be one or more, and when a plurality of pieces of information are displayed within the screen range of the electronic device, the identifiers of all pieces of information displayed within the screen range of the electronic device may be acquired; alternatively, an identifier of information in a designated area displayed in the screen range of the electronic device, that is, an identifier of a part of information displayed in the screen range of the electronic device may be acquired, for example, the designated area may be an area within the screen range of the electronic device touched by a user through a touch operation.
S104, the latest information data corresponding to the identification is requested to the server.
In the embodiment of the specification, after an identifier of information displayed in a screen range of an electronic device is acquired, the identifier is sent to a server, and corresponding latest information data is requested from the server; because the server records the identifier of each piece of information, the latest information data corresponding to the identifier and stored in the server can be searched according to the identifier of each piece of information, and the latest information data is returned to the electronic equipment.
And S106, updating the information displayed in the screen range of the electronic equipment according to the latest information data.
In the embodiment of the specification, after the latest information data returned by the server is received, the information displayed in the screen range of the electronic device is updated, that is, the graphical user UI interface of the electronic device is updated, so that the user can see the latest information at the first time.
For easy understanding, the following describes a technical solution of this specification with reference to an example diagram of an application scenario shown in fig. 2, please refer to fig. 2, where the application scenario includes: the electronic device 20 and the server 22 are connected in a communication manner, wherein the electronic device 20 is connected to the server 22 in a communication manner, and a plurality of pieces of information, that is, a first piece of information, a second piece of information, a third piece of information, a fourth piece of information, and a fifth piece of information, are displayed in the screen range 21 of the electronic device 20, it should be noted that the 5 pieces of information displayed in the screen range 21 of the electronic device 20 are merely examples, and in practical applications, the number and content of the information displayed in the screen range 21 of the electronic device 20 may be any number and content, which is not limited in the embodiments of this specification.
When a trigger condition for updating local information in the electronic device is met, for example, when a screen of the electronic device is switched from a scroll state to a scroll stop state, acquiring an identifier of all information (i.e., acquiring an identifier of a first piece of information, an identifier of a second piece of information, an identifier of a third piece of information, an identifier of a fourth piece of information, and an identifier of a fifth piece of information) in 5 pieces of information displayed in a screen range 21 of the electronic device 20, or acquiring an identifier of partial information (e.g., acquiring an identifier of the first piece of information and an identifier of the second piece of information) in 5 pieces of information displayed in the screen range 21 of the electronic device 20;
then, the electronic device 20 sends the identifier of the acquired information to the server 22, because the identifier of each piece of information and the latest information data are stored in the server 22, the server 22 can find the latest information data corresponding to the identifier from the information data locally stored in the server 22 according to the identifier sent by the electronic device 20, and return the latest information data to the electronic device 20, and after receiving the latest information data returned by the server 22, the electronic device 20 updates the information displayed in the screen range 21.
It can be seen that in the embodiment of the present specification, when the trigger condition for local information update in the electronic device is satisfied, the information "within the visual range" (within the screen range of the electronic device) of the user is updated, so that the user can see the latest information at the first time.
The embodiment can be seen in that the embodiment can update the information visible to the user in the screen range of the electronic equipment, on one hand, the timeliness of the information displayed to the user by the electronic equipment is guaranteed, on the other hand, only partial information data is requested, unnecessary data requests can be reduced, and the data traffic of the electronic equipment is saved.
Fig. 3 is a flowchart of an information updating method according to another embodiment of the present disclosure, referring to fig. 3, in a case that information displayed in a screen of an electronic device is quotation information of securities, an investment plan of a user is directly determined in consideration of real-time performance of the quotation information of the securities, in order to present the latest quotation information of the securities to the user for the first time and maximally save data traffic of the electronic device of the user, at this time, the method may include the following steps:
s302, when a trigger condition of local information updating in the electronic equipment is met, an identifier of information displayed in a screen range of the electronic equipment is acquired, wherein the information is market information of securities.
In embodiments of the present specification, the type of security may include at least one of: a stock, futures, fund, index of a security, stock index, foreign exchange, bond, or bitcoin, the identification of a security may be the code of the security, e.g., if the security is a stock, the identification of the security may be the stock code.
In the embodiment of the description, when a trigger condition for updating local information in the electronic device is met, an identifier of a security displayed in a screen range of the electronic device is acquired.
For ease of understanding, S302 is described in conjunction with the example application scenario shown in fig. 4, where the application scenario includes: the electronic device 40 and the server 42 are connected in a communication mode, the electronic device 40 is connected with the server 42 in a communication mode, an information list is displayed in a screen range 41 of the electronic device 40, the information list comprises a plurality of pieces of news information, market information of securities related to the news information is arranged below each piece of news information, for example, market information of 'next new stock' is arranged below a first piece of news information displayed in the screen range 41 of the electronic device 40, market information of 'securities', 'wide issue securities', 'national securities', 'maritime securities', 'market information' is arranged below a second piece of news information, market information of 'AlibaUS' is arranged below a third piece of news information, and market information of 'US' is arranged below a fourth piece of news information.
When the screen of the electronic device 40 is switched from the scroll state to the stop scroll state, the identifications of the securities displayed within the screen range 41 of the electronic device 40 are acquired, for example, the codes of "next new stock", "securities", "issued securities", "national securities", "haitong securities", "arbiba US", and "US" are acquired.
S304, the latest information data corresponding to the identification is requested to the server.
Following the example in S302, the codes of "next new stock", "securities", "broadcast securities", "national securities", "haitong securities", "aleiba US", and "US" are sent to the server 42 to request the latest market data of "next new stock", "securities", "broadcast securities", "national securities", "haitong securities", "aleiba US", and "US" from the server 42.
And S306, updating the market information of the securities displayed in the screen range of the electronic equipment according to the latest information data.
Following the example in S304, the server 42 finds the latest market data corresponding to the code according to the code of the security sent by the electronic device 40, and returns the latest market data to the electronic device 40, and the electronic device 40 sends the latest market data of the "next new stock", "security", "wide-issue security", "national security", "haitong security", "aleiba US", and "usa US" returned by the server 42 to the server 42, so as to request the latest market data of the "next new stock", "security", "wide-issue security", "national security", "maritime security", "haitong security", "aleiba US", and "usa" from the server 42, update the codes of the "next new stock", "security", "wide-issue security", "national security", "haitong security", "aleiba US", and "usa" in the screen range 21, and send the latest market data to the server 42, so as to request the "next new stock", the "and the" usa "to the server 42, Market information of "securities", "Cantonese securities", "national securities", "Haitong securities", "Alimba US" and "US".
It can be seen that when the user scrolls through the list of information and then stops, the quotation of the relevant stocks/funds of the information in the "visible range" of the user is updated.
The embodiment of the specification can update the market information of the securities visible to the user within the screen range of the electronic equipment through a local refreshing mechanism, on one hand, the timeliness of the information displayed to the user by the electronic equipment is ensured, on the other hand, only partial information data is requested, unnecessary data requests can be reduced, and the data flow of the electronic equipment is saved.
In order to further save the data traffic of the electronic device and improve the efficiency of real-time market updating, the embodiment of the present disclosure may first determine whether securities such as shanghai, harbour stock, U.S. stocks, futures, etc. are in the open state according to the current system time of the electronic device, and then request the latest market data of the securities in the open state from the server, in another embodiment provided by the present disclosure, the embodiment may add the following steps between S302 and S304 shown in fig. 3 on the basis of the embodiment shown in fig. 3: s308 and S310, wherein,
s308, acquiring the current system time of the electronic equipment.
And S310, judging whether the securities corresponding to the identification are in the opening state or not according to the current system time of the electronic equipment, and executing S302 if the securities corresponding to the identification are in the opening state.
In an optional implementation manner, the S310 may include: s3102, S3104 and S3106, wherein,
s3102, a securities opening time list is obtained, in which opening time ranges of a plurality of securities are recorded.
In this embodiment, a list of stock opening times may be stored in advance in the electronic device, the stock opening times, the stock closing times, and the like of the stocks may be recorded in the list of stock opening times, and the contents recorded in the list of stock opening times may be updated at irregular times. At this time, a pre-stored list of securities opening times may be obtained locally from the electronic device. In addition, the list of the stock opening times may also be directly obtained from the server, which is not limited in the embodiments of the present specification.
S3104, the opening time range of the securities corresponding to the identifier recorded in the list of opening times of securities is obtained.
S3106, determining whether the current system time is within the opening time range of the securities corresponding to the identifier, if so, executing S302.
For the acquired identifiers (for example, codes of securities) of the securities displayed in the screen range of the electronic device, in this embodiment, whether the securities displayed in the screen range of the electronic device are in an open state may be determined according to the current system time of the electronic device, and the identifiers of the securities in the open state may be screened out, for example, the identifiers of the securities in the open state are put in a list, and only the latest market data corresponding to the identifiers in the list is requested from the server. Therefore, the embodiment can be combined with the current system time of the electronic equipment to judge whether a certain security displayed in the screen range of the electronic equipment needs to be refreshed in real time, and at the moment, the extra flow can not be lost when the market information of the security is browsed at the non-opening time of holidays, so that the flow loss in most non-opening states can be avoided.
As can be seen from the above embodiments, in the embodiments, it may be determined whether securities (e.g., shanghai, hong kong, and american stocks, etc.) displayed within a screen of the electronic device are in an open state according to a current system time of the electronic device, and then latest quotation data corresponding to an identifier of the securities in the open state is requested from a server, so that repeated requests for quotation data for the securities in a non-open state are avoided, data traffic is maximally reduced, efficiency of updating quotation in real time is improved, and a large amount of traffic loss caused by one-taste real-time refreshing is also avoided.
At present, after the information is published by the server, the user will update the information to the electronic device for displaying. But later need to replace the picture, the title or even delete the piece of information for some reason, at this moment, in another embodiment provided in this specification, this embodiment can be based on the embodiment shown in fig. 3, besides updating the real-time market of the securities, when the screen of the electronic device is switched from the scrolling state to the stop scrolling, the number of comments, the title, the picture, etc. of the information displayed in the screen range of the electronic device can also be updated.
In the embodiment of the specification, the modification of the information such as article titles and pictures in the background of the server can be supported, and the information displayed in the screen range of the electronic equipment is pulled from the server and then stored in the cache of the electronic equipment. When the user starts the application program next time, the cached content can be directly displayed when the new information data is not pulled. If the title and the picture of the article are edited in the background of the server or even the article is deleted within the time, the latest title and the latest picture can be updated or the latest information can be deleted in real time by the method provided by the embodiment of the specification, so that the timeliness of the information displayed in the screen range of the electronic equipment is ensured.
In another embodiment provided in this specification, when the information displayed in the screen range of the electronic device is weather forecast information, a travel plan of a user is directly determined in consideration of real-time performance of the weather forecast information, and in order to present the weather forecast information to the user at the first time and maximally save data traffic of the electronic device of the user, the embodiment of the specification may refresh the latest weather forecast information displayed in the screen range of the electronic device and display the latest weather forecast information to the user when a trigger condition for updating local information in the electronic device is satisfied, where an identifier of the weather forecast information may be a city name.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present specification. Referring to fig. 5, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the information updating device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
when a trigger condition of local information updating in the electronic equipment is met, acquiring an identifier of information displayed in a screen range of the electronic equipment;
requesting the latest information data corresponding to the identification from a server;
and updating the information displayed in the screen range of the electronic equipment according to the latest information data.
The method executed by the information updating apparatus as disclosed in the embodiment shown in fig. 5 in this specification can be applied to a processor, or can be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method shown in fig. 1 and implement the functions of the information updating apparatus in the embodiment shown in fig. 1, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular for performing the method of:
when a trigger condition of local information updating in the electronic equipment is met, acquiring an identifier of information displayed in a screen range of the electronic equipment;
requesting the latest information data corresponding to the identification from a server;
and updating the information displayed in the screen range of the electronic equipment according to the latest information data.
Fig. 6 is a schematic structural diagram of an information updating apparatus according to an embodiment of the present specification. Referring to fig. 6, in a software implementation, the information updating apparatus 600 may include: an identification acquisition unit 601, a data request unit 602, and an information update unit 603, wherein,
an identifier obtaining unit 601, configured to obtain an identifier of information displayed within a screen of an electronic device when a trigger condition for updating local information within the electronic device is satisfied;
a data requesting unit 602, configured to request, from a server, the latest information data corresponding to the identifier acquired by the identifier acquiring unit 601;
an information updating unit 603, configured to update information displayed within the screen of the electronic device according to the latest information data requested by the data requesting unit 602.
The embodiment can be seen in that the embodiment can update the information visible to the user in the screen range of the electronic equipment, on one hand, the timeliness of the information displayed to the user by the electronic equipment is guaranteed, on the other hand, only partial information data is requested, unnecessary data requests can be reduced, and the data traffic of the electronic equipment is saved.
Optionally, as an embodiment, the identifier obtaining unit 601 includes:
the first identification obtaining subunit is used for obtaining the identification of the information displayed in the screen range of the electronic equipment when the screen of the electronic equipment is switched from the rolling state to the rolling stopping state; or,
and the second identifier acquiring subunit is used for acquiring the identifier of the information displayed in the screen range of the electronic equipment when the application program installed in the electronic equipment is switched from the background running state to the foreground running state.
Optionally, as an embodiment, the identifier obtaining unit 601 includes:
the third identification obtaining subunit is configured to obtain identifications of all information displayed within a screen range of the electronic device when a trigger condition for updating local information within the electronic device is met; or,
and the fourth identification obtaining subunit is configured to obtain an identification of the information in the specified area displayed within the screen range of the electronic device when a trigger condition for updating the local information in the electronic device is met.
Optionally, as an embodiment, the information may include: market information of securities, weather forecast information, news information, reading amount of news information, or comment amount of news information.
Optionally, as an embodiment, the information is market information of securities;
the information updating apparatus 600 further includes:
the system time acquisition unit is used for acquiring the current system time of the electronic equipment;
and the judging unit is configured to judge whether the securities corresponding to the identifier are in an open state according to the current system time acquired by the system time acquiring unit, and trigger the data requesting unit 602 to execute the operation of requesting the server for the latest information data corresponding to the identifier if the judgment result is yes.
Optionally, as an embodiment, the determining unit includes:
the system comprises a list acquisition subunit, a stock opening time list acquisition subunit and a stock opening time acquisition subunit, wherein the stock opening time list is used for acquiring a stock opening time list, and the stock opening time ranges of a plurality of stocks are recorded in the stock opening time list;
the opening time range acquiring subunit is configured to acquire an opening time range of the securities corresponding to the identifier recorded in the securities opening time list;
and the judging subunit is used for judging whether the current system time is within the opening time range of the securities corresponding to the identifier.
Optionally, as an embodiment, the list obtaining subunit includes:
the system comprises a first list acquisition subunit, a second list acquisition subunit and a third list acquisition subunit, wherein the first list acquisition subunit is used for acquiring a pre-stored security opening time list from the local of the electronic equipment; or,
and the second list acquisition subunit is used for acquiring the stock opening time list from the server.
Optionally, as an embodiment, the type of security may include at least one of: stocks, futures, funds, stock indices, foreign exchange, bonds, or bitcoin.
The information updating apparatus 600 may also execute the method of the embodiment shown in fig. 1, and implement the function of the information updating apparatus in the embodiment shown in fig. 6, which is not described herein again in this specification.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.