WO2020015186A1 - Method and apparatus for real-time update of page data and electronic device - Google Patents

Method and apparatus for real-time update of page data and electronic device Download PDF

Info

Publication number
WO2020015186A1
WO2020015186A1 PCT/CN2018/108084 CN2018108084W WO2020015186A1 WO 2020015186 A1 WO2020015186 A1 WO 2020015186A1 CN 2018108084 W CN2018108084 W CN 2018108084W WO 2020015186 A1 WO2020015186 A1 WO 2020015186A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
data
new
message queue
written
Prior art date
Application number
PCT/CN2018/108084
Other languages
French (fr)
Chinese (zh)
Inventor
赖云辉
龙觉刚
孙成
叶俊锋
罗先贤
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020015186A1 publication Critical patent/WO2020015186A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Definitions

  • the present application relates to the technical field of webpage data processing. Specifically, the present application relates to a method, an apparatus, and an electronic device for updating page data in real time.
  • the Internet has been integrated into every aspect of people's lives and work. For example, in life, people are increasingly inseparable from online shopping and ordering takeaways. In order to cope with a large number of orders generated in a short period of time, various consumer electronics platforms have established business systems to facilitate timely and order information. For another example, in order to facilitate enterprise management and collaborative work, more and more enterprises use the office automation OA system to conduct enterprise internal process approval, transaction transfer, and document approval, etc., to achieve automated, paperless network office and communication the way.
  • the main menu bar will generally have options such as "My Order” and "My Task”. Click these options to get the current pending order or task.
  • Better business systems will mark the number of pending orders next to the menu item, such as "[My Order (12)]” to prompt the number of orders or tasks, but the operator still needs to manually refresh the page to obtain The number of the latest pending items.
  • This application provides a method, device, electronic device, and computer-readable storage medium for updating page data in real time, which can solve the problem that an operator needs to manually refresh the page to obtain the latest news.
  • the technical solution is as follows:
  • the present application provides a method for updating page data in real time.
  • the method includes:
  • the present application provides another method for updating page data in real time.
  • the method includes: receiving a new message generated in the background, and placing the new message in a corresponding message queue in the message middleware.
  • the new message includes the new data and The location identifier used to indicate the location to be updated in the current web page; when a preset condition is met, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current according to the new message in the message queue page.
  • the present application provides a device for updating page data in real time.
  • the device includes: a receiving module for receiving a message queue sent by a server; an extraction module for extracting a new message in the message queue, and determining according to the new message.
  • the present application provides a device for updating page data in real time.
  • the device includes a message storage module for receiving a new message generated in the background and placing the new message in a corresponding message queue in the message middleware.
  • the message includes new data and a location identifier used to indicate the location to be updated in the current webpage.
  • the message sending module is used to send the message queue in the message middleware to the front end corresponding to the message queue when the preset conditions are met. Causes the front end to update the current page based on new messages in the message queue.
  • the present application provides an electronic device including: one or more processors; a memory; and one or more application programs, wherein one or more application programs are stored in the memory and configured as Executed by one or more processors, and one or more applications are configured to perform the following operations of the method of updating page data in real time: receiving a message queue sent by a server; extracting a new message in the message queue, and according to the new The message determines the data to be written and the location identifier corresponding to the data to be written; the document object model DOM is used to determine the location to be updated corresponding to the location identifier in the current page, and the data at the location to be updated is updated to the Data to be written.
  • the present application provides an electronic device including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and are And configured to be executed by the one or more processors, and the one or more applications are configured to perform the following operations of the method for updating page data in real time: receiving a new message generated in the background, and placing the new message in The corresponding message queue in the message middleware, the new message includes new data and a location identifier used to indicate a position to be updated in the current webpage; and when a preset condition is met, the message queue in the message middleware is sent to the The front end corresponding to the message queue is described, so that the front end updates the current page according to a new message in the message queue.
  • the present application provides a computer-readable non-volatile storage medium.
  • a computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, a method for real-time updating page data is implemented. The following operations: receive a message queue sent by the server; extract a new message in the message queue, determine the data to be written and the location identifier corresponding to the data to be written according to the new message; determine the current page through the document object model DOM A position to be updated corresponding to the position identifier, and data at the position to be updated is updated to the data to be written.
  • the present application provides a computer-readable non-volatile storage medium, where the computer-readable non-volatile storage medium is used to store computer instructions, and when the computer instructions are run on the computer, the computer can execute real-time
  • the method of updating page data has the following operations: receiving a new message generated in the background, and placing the new message in a corresponding message queue in the message middleware, where the new message includes new data and is used to indicate a pending update in the current web page
  • the location identifier of the location when a preset condition is met, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
  • the data to be updated and the position of the updated data in the page are accurately obtained through orientation, and the page data is partially refreshed through the DOM, so that the operator can obtain the latest news without manually refreshing the page, avoiding Operators are delayed due to missing the latest data, while reducing the workload of operators.
  • FIG. 1 is a schematic flowchart of a method for updating page data in real time according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of another method for updating page data in real time according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a device for updating page data in real time according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of another apparatus for updating page data in real time according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
  • An embodiment of the present application provides a method for updating page data in real time. As shown in FIG. 1, the method includes steps S101 and S102.
  • Step S101 Receive a new message generated in the background, and place the new message in a corresponding message queue in the message middleware.
  • the new message includes new data and a location identifier used to indicate a location to be updated in the current webpage.
  • each new message carries a topic
  • each topic corresponds to at least one message queue
  • each message queue corresponds to a front end.
  • the server After receiving the new message generated in the background, the server stores the new message in the corresponding message queue in the message middleware according to the subject carried by the new message.
  • ActiveMQ RabbitMQ
  • Kafka Jafka
  • RocketMQ RocketMQ
  • the message middleware After the message queue is sent to the front end, the message middleware will empty the messages in the sent message queue, waiting for the server to write new messages generated in the background to the message queue.
  • the new data is data to be updated into the page.
  • the new data in this embodiment specifically refers to a type of data with a higher generation frequency, such as order data and task data.
  • the position to be updated is a position on the page where data needs to be updated, such as a cell in a table on a web page, a cell in a menu bar or task bar for displaying a to-do item.
  • Each display area on the page (such as a cell in a table) corresponds to a label in HMTL.
  • Step S102 When the preset condition is satisfied, send the message queue in the message middleware to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
  • the message queue is sent to the corresponding front end according to the theme corresponding to the message queue.
  • the front end extracts new messages from the message queue, determines the position to be updated in the current web page based on the position identifier in the new message, and uses the AJAX (Asynchronous Javascript And XML, asynchronous page dynamic refresh) technology to update the current web page.
  • the data in the position to be updated in is updated to new data to automatically update the page data.
  • AJAX is a technology used to create fast dynamic web pages.
  • AJAX enables the back-end to communicate with the server with a small amount of data to enable asynchronous updates of the web pages. This means that the entire web page can be updated without reloading the entire web page. Part of the web page is updated.
  • the display of order data on the current webpage is: the number of currently pending orders is displayed in a menu item.
  • the above method is applied to the order system.
  • the specific process is as follows: the new order data generated is sent to the server by the background, and the new message sent to the server includes: the new order data, the subject corresponding to the order data, and the location identifier, where The location identifier indicates the display position of the order data on the page.
  • the server After receiving the new message generated in the background, stores the new message in the corresponding message queue in the message middleware according to the theme carried by the new information.
  • the message queue in the message middleware is sent to the corresponding front end; after the front end obtains the new message queue, the new order data and location identifier are extracted from the new message queue, and the current location indicator indication is determined by AJAX technology
  • the position to be updated on the webpage, that is, the menu item displays a label corresponding to the number of currently pending orders. According to the number of new orders, the number of orders in the current webpage to be updated is updated to the number of new orders. Achieve automatic update of page data.
  • the method for real-time updating page data in this embodiment transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and immediately forwards the message queue to a corresponding front end, so that the front end can be updated in real time and automatically
  • Some data in the page allows the operator to get the latest news without manually refreshing the page, avoiding the operator's delay in work due to missing the latest data, and reducing the workload of the operator.
  • the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
  • Embodiment 1 This embodiment of the present application provides another possible implementation manner. On the basis of Embodiment 1, the method shown in Embodiment 2 is further included.
  • the front end will periodically send a request to the server to obtain the message queue.
  • step S102 specifically includes: when receiving a request for obtaining a message queue sent by the front end, sending a corresponding message queue to the requesting front end through a message middleware.
  • the long connection mechanism of the websocket is used to actively push the message queue from the server to the front end, so as to avoid unnecessary consumption caused by the front end continuously polling the server.
  • step S102 specifically includes: regularly sending the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
  • the time interval for sending the message queue regularly can be determined according to the frequency of generating new data in the actual service. The higher the frequency of generation, the shorter the time interval.
  • step S102 specifically includes: when the message queue changes, actively sending the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
  • the server when the server detects that a certain amount of new data in the message queue is reached, it actively sends the message queue in the message middleware to the front end corresponding to the message queue through the long connection established between the server and the front end.
  • step S102 specifically includes: buffering the message queue in the message middleware to the Redis server, and sending the message queue to the front end corresponding to the message queue through the Redis server.
  • Redis server cache the message queue in the message middleware to the Redis server, and then push the message queue to the front end through the Redis server.
  • the high availability of the Redis server is used to adapt to different data types and application scenarios.
  • the distributed nature of the Redis server reduces the probability of data loss and improves the reliability of the system.
  • this embodiment of the present application also provides a method for updating page data in real time. As shown in FIG. 2, the method includes: step S201, step S202, and step S203.
  • Step S201 Receive a message queue sent by a server.
  • step S202 a new message in the message queue is extracted, and data to be written and a location identifier corresponding to the data to be written are determined according to the new message.
  • the new message includes new data and a location identifier used to indicate a location to be updated in the current webpage. According to the new data, the data to be updated to the current page, that is, the data to be written is determined.
  • a message queue includes at least one new message.
  • Step S203 Determine the position to be updated corresponding to the position identifier in the current page through the document object model DOM, and update the data at the position to be updated to the data to be written.
  • the DOM (Document Object Model) is an application programming interface for HTML and XML.
  • the DOM maps the entire page into a file consisting of hierarchical nodes to easily obtain, modify, add, or delete elements in web pages. .
  • the method for real-time updating page data of this embodiment is applied to the front end, and cooperates with the method applied to the server side of Embodiments 1 and 2 to achieve real-time updating of the front-end page according to new data generated in the background.
  • Embodiment 1 and Embodiment 2 For explanations of related terms in this embodiment, reference may be made to related explanations in Embodiment 1 and Embodiment 2, and details are not described herein again.
  • the display of order data on the current page is to display the number of currently pending orders in a menu item.
  • the new data generated in the background can be new orders or reduced orders.
  • the specific process is: after the front end obtains a new message queue sent by the server, it extracts new order data and location identifiers from the received message queue, and according to the new addition in the message queue Orders or reduced orders and the number of orders displayed on the current page, calculate the current order number (that is, data to be written); then, the front end uses AJAX technology to determine the position to be updated in the current web page indicated by the position identifier through the DOM, That is, the menu item displays a label corresponding to the current number of orders to be processed, and updates the number of orders in the position to be updated on the current web page to data to be written to automatically update the number of orders in the menu bar of the page.
  • Some order systems not only display the order quantity, but also display specific order data, such as specific product models, product quantities, delivery periods, and so on.
  • the front end obtains a new message queue sent by the server, it extracts new order data and location identifiers from the newly received message queue, and extracts the order data from the new data as data to be written; then, it uses AJAX technology , Through the DOM to determine the position to be updated in the current web page indicated by the position identifier, that is, the label corresponding to the position where the order data is displayed on the current page, and update the number of orders in the position to be updated in the current web page to the data to be written to achieve Automatically update new or deleted order data on the page.
  • the method for real-time updating of page data in this embodiment acquires the data that needs to be updated and the position of the updated data in the page in a targeted and accurate manner, and implements partial refresh of the page data through the DOM, so that the operator can obtain the latest news without manually refreshing the page. Avoiding operator delays due to missing the latest data, while reducing operator workload.
  • the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
  • Embodiment 3 provides another possible implementation manner. On the basis of Embodiment 3, the method shown in Embodiment 4 is further included.
  • the method for real-time updating page data in this embodiment further includes the following steps: when the number of message queues received in a unit time exceeds a threshold, a plurality of consumption objects are created, and each consumption object consumes the received data in turn. message queue.
  • the consumption object is an object that processes a message queue.
  • Consumption refers to processing the message queue through the created consumption object, that is, performing the operations in steps S202 and S203.
  • a corresponding number of consumer objects are adaptively created to improve the ability of the front end to respond to a large amount of new data generated in the background.
  • the method of this embodiment further includes the following steps: obtaining a preset configuration file, and the configuration file includes a type identifier.
  • the user can set the type of data that the front-end needs to extract from the message queue through the configuration file, so that the user can quickly make adjustments according to different business needs.
  • the format of the new message sent in the background is key-value, value is new data, and key is the type identifier corresponding to the new data.
  • the new message may be a tree structure, a JSON structure, or other formats.
  • step S202 specifically includes: extracting new data corresponding to the type identifier in the configuration file from the new message in the message queue, and determining the data to be written according to the new data.
  • the obtained queue message is extracted from the success block of AJAX (the success block indicates the processing code block after AJAX successfully obtained the message), and the type in the configuration file is found from the queue message.
  • Identification just extract the value after the type identification, and then determine the data to be written according to the extracted value. Therefore, no matter whether the data provided in the background is a tree structure or a JSON structure, the data can be quickly extracted, and the user can easily set and change the type of data to be extracted according to the actual business requirements through the configuration file.
  • step S202 specifically includes: extracting an ID identifier in the new message, where the ID identifier is a unique identifier of each tag in the current page.
  • the tags are HTML tags.
  • step S203 specifically includes: querying the target tag corresponding to the ID identifier through the DOM, and updating the data in the target tag to data to be written.
  • the method further includes: sending a request for acquiring a message queue to the server periodically.
  • the time interval for sending the request can be set according to the frequency of new data in the actual service. For example, when the data is updated frequently, the front end can send a request to the server to obtain the message queue every 0.5s. After receiving the request to obtain the message queue sent by the front end, the server sends the corresponding message queue to the requesting front end through the message middleware.
  • the long connection mechanism of the websocket is used to actively push the message queue from the server to the front end, so as to avoid unnecessary consumption caused by the front end continuously polling the server.
  • step S201 specifically includes: receiving the message queue sent by the server through the long connection established with the server.
  • this embodiment provides a device for updating page data in real time.
  • the device 30 for updating page data in real time may include a message storage module 301 and a message sending module. 302.
  • the message storage module 301 is configured to receive a new message generated in the background and place the new message in a corresponding message queue in the message middleware.
  • the new message includes new data and a location identifier for indicating a location to be updated in the current webpage.
  • the message sending module 302 is configured to send the message queue in the message middleware to the front end corresponding to the message queue when the preset condition is satisfied, so that the front end updates the current page according to the new message in the message queue.
  • the device for real-time updating page data transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and forwards the message queue to the corresponding front-end in real time, so that the front-end can automatically and real-timely Update some data in the page, so that the operator can get the latest news without manually refreshing the page, avoiding the operator's delay in work due to missing the latest data, and reducing the workload of the operator.
  • the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
  • the message sending module 302 is specifically configured to regularly send the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
  • the message sending module 302 is specifically configured to actively send the message queue in the message middleware to the front end corresponding to the message queue through a long connection established with the front end when the message queue changes.
  • the message sending module 302 is configured to cache the message queue in the message middleware to the Redis server when the preset conditions are met, and send the message queue to the corresponding front end of the message queue through the Redis server, so that the front end New messages in the message queue update the current page.
  • the apparatus for updating page data in real time in this embodiment adopts the same inventive concept as the method for updating page data in real time in Embodiments 1 and 2, and can obtain the same technical effects, which will not be repeated here.
  • an embodiment of the present application provides a device for updating page data in real time.
  • the device 40 for updating page data in real time may include a receiving module 401 and an extracting module 402. And update module 403.
  • the receiving module 401 is configured to receive a message queue sent by a server.
  • the extraction module 402 is configured to extract a new message in the message queue, and determine the data to be written and a location identifier corresponding to the data to be written according to the new message.
  • the update module 403 is configured to determine a position to be updated corresponding to the position identifier in the current page through the document object model DOM, and update data at the position to be updated to data to be written.
  • the device for updating page data in real time provided in this embodiment accurately acquires the data to be updated and the position of the updated data in the page.
  • the DOM is used to partially refresh the page data, so that the operator can obtain the latest news without manually refreshing the page. , To avoid the operator's delay due to missing the latest data, while reducing the workload of the operator.
  • the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
  • the apparatus of this embodiment further includes an object creation module 404, which is configured to create multiple consumption objects when the number of message queues received in a unit time exceeds a threshold, and each consumption object consumes the received message queues in turn. .
  • an object creation module 404 which is configured to create multiple consumption objects when the number of message queues received in a unit time exceeds a threshold, and each consumption object consumes the received message queues in turn.
  • the apparatus in this embodiment further includes a configuration file obtaining module 405, configured to obtain a preset configuration file.
  • the configuration file includes a type identifier.
  • the format of the new message generated in the background is key-value, where value is the new data and key is the type identifier corresponding to the new data.
  • the extraction module 402 is specifically configured to extract new data corresponding to the type identifier in the configuration file from the new message in the message queue, and determine the data to be written according to the new data.
  • the extraction module 402 is specifically configured to: extract an ID identifier in a new message.
  • the ID identifier is a unique identifier of each tag in the current page.
  • the update module 403 is specifically configured to: query the target tag corresponding to the ID identifier through the document object model DOM; and update the data in the target tag to data to be written.
  • the receiving module 401 is specifically configured to receive a message queue sent by the server through a long connection established with the server.
  • the apparatus for updating page data in real time in this embodiment adopts the same inventive concept as the method for updating page data in real time in Embodiments 3 and 4, and can obtain the same technical effects, and details are not described herein again.
  • the electronic device 500 shown in FIG. 5 includes a processor 501 and a memory 503.
  • the processor 501 and the memory 503 are connected, for example, through a bus 502.
  • the electronic device 500 may further include a transceiver 504. It should be noted that, in practical applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not limit the embodiments of the present application.
  • the processor 501 is applied in the embodiment of the present application, and is configured to implement the functions of the message storage module 301 and the message sending module 302 shown in FIG. 3.
  • the transceiver 504 includes a receiver and a transmitter.
  • the processor 501 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure.
  • the processor 501 may also be a combination that realizes a computing function, for example, a combination including one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the bus 502 may include a path for transmitting information between the aforementioned components.
  • the bus 502 may be a PCI bus, an EISA bus, or the like.
  • the bus 502 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 5, but it does not mean that there is only one bus or one type of bus.
  • the memory 503 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, CD-ROM or other optical disk storage, or optical disk storage (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by a computer Any other media accessed, but not limited to this.
  • the electronic device transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and immediately forwards the message queue to the corresponding front end, so that the front end can Update some data on the page in real time and automatically, so that the operator can get the latest news without manually refreshing the page, avoiding the operator's delay due to missing the latest data, and reducing the workload of the operator.
  • the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
  • the electronic device 600 shown in FIG. 6 includes a processor 601 and a memory 603.
  • the processor 601 and the memory 603 are connected, for example, through a bus 602.
  • the electronic device 600 may further include a transceiver 604. It should be noted that, in practical applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not limit the embodiments of the present application.
  • the processor 601 is applied in the embodiment of the present application, and is configured to implement the functions of the receiving module 401, the extracting module 402, and the updating module 403 shown in FIG. 4.
  • the transceiver 604 includes a receiver and a transmitter.
  • the processor 601 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure.
  • the processor 601 may also be a combination that realizes a computing function, for example, a combination including one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the bus 602 may include a path for transmitting information between the aforementioned components.
  • the bus 602 may be a PCI bus, an EISA bus, or the like.
  • the bus 602 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only a thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
  • the memory 603 may be ROM or other types of static storage devices capable of storing static information and instructions, RAM or other types of dynamic storage devices capable of storing information and instructions, and may also be EEPROM, CD-ROM or other optical disk storage, optical disk storage (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by a computer Any other media accessed, but not limited to this.
  • the electronic device obtained in the embodiment of the present application obtains the data to be updated accurately and the position of the updated data in the page in a targeted manner.
  • the DOM is used to partially refresh the page data, so that the operator does not need to manually refresh the page. Obtain the latest news, avoid the operator's delay due to missing the latest data, and reduce the workload of the operator.
  • the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
  • the embodiment of the present application provides a computer-readable non-volatile storage medium.
  • a computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, the real-time update shown in the first embodiment is implemented. Method of page data.
  • the embodiment of the present application provides a computer-readable non-volatile storage medium.
  • a large number of new messages generated in the background are transferred to a corresponding message queue through an intermediate message piece, and the message queue is forwarded immediately.
  • the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
  • an embodiment of the present application further provides a computer-readable non-volatile storage medium.
  • the computer-readable non-volatile storage medium stores a computer program, and the program is executed by a processor to implement the second embodiment.
  • the method for updating page data in real time is not described in detail here.
  • An embodiment of the present application provides a computer-readable non-volatile storage medium.
  • a computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, the real-time update shown in the third embodiment is implemented. Method of page data.
  • the embodiment of the present application provides a computer-readable non-volatile storage medium.
  • the data required to be updated and the position of the updated data in the page are accurately obtained by orientation, and the page data is partially refreshed through the DOM. This allows the operator to get the latest news without manually refreshing the page, avoids the operator's delay in work due to missing the latest data, and reduces the workload of the operator.
  • the front end can accurately obtain the data that needs to be updated, without having to refresh the entire page again for a single latest data, reducing the consumption of business systems.
  • the embodiment of the present application further provides a computer-readable non-volatile storage medium.
  • the computer-readable non-volatile storage medium stores a computer program, and the fourth embodiment is implemented when the program is executed by a processor.
  • the method for updating page data in real time is not described in detail here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method and apparatus for real-time update of page data and an electronic device. The method comprises: receiving a message queue sent by a server (S201); extracting a new message in the message queue, and determining data to be written and a location identifier corresponding to the data to be written according to the new message (S202); and determining a location to be updated corresponding to the location identifier in the current page by means of a document object model (DOM), and updating data at the location to be updated to the data to be written (S203). By means of the method, directional and accurate acquisition of data to be updated and the location of the updated data in a page are realized, and the partial refresh of the page data is realized by means of the DOM, so that an operator can obtain the latest information without manually refreshing the page, avoiding the delays caused by the operator missing the latest data, and reducing the workload of the operator.

Description

实时更新页面数据的方法、装置、电子设备Method, device and electronic equipment for updating page data in real time
本申请要求于2018年7月19日提交中国专利局、申请号为201810797555.1,发明名称为“实时更新页面数据的方法、装置、电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on July 19, 2018, with application number 201810797555.1, and the invention name is "Method, Device, Electronic Device for Updating Page Data in Real Time", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及网页数据处理技术领域,具体而言,本申请涉及一种实时更新页面数据的方法、装置、电子设备。The present application relates to the technical field of webpage data processing. Specifically, the present application relates to a method, an apparatus, and an electronic device for updating page data in real time.
背景技术Background technique
互联网已经融入人们生活工作的方方面面。例如,生活中,人们越来越离不开网络购物、订购外卖,为了应对短时间内产生的大量订单,各家电商平台都建立了业务系统,方便及时获取到订单信息。又如,为了方便地进行企业管理和协同工作,越来越多的企业通过办公自动化OA系统进行企业内部流程审批、事务流转、文件审批等工作,实现了自动化、无纸化的网络办公和沟通方式。The Internet has been integrated into every aspect of people's lives and work. For example, in life, people are increasingly inseparable from online shopping and ordering takeaways. In order to cope with a large number of orders generated in a short period of time, various consumer electronics platforms have established business systems to facilitate timely and order information. For another example, in order to facilitate enterprise management and collaborative work, more and more enterprises use the office automation OA system to conduct enterprise internal process approval, transaction transfer, and document approval, etc., to achieve automated, paperless network office and communication the way.
现有的业务系统或OA系统中,主菜单栏一般会有类似“我的订单”、“我的任务”等选项,点击这些选项可以获取到当前待处理的订单或任务。更好一些的业务系统会在菜单项旁标注当待处理订单的数量,如“【我的订单(12)】”,以提示订单数量或任务数量,但是,仍需操作人员手动刷新页面才能获取最新的待处理事项的数量。In existing business systems or OA systems, the main menu bar will generally have options such as "My Order" and "My Task". Click these options to get the current pending order or task. Better business systems will mark the number of pending orders next to the menu item, such as "[My Order (12)]" to prompt the number of orders or tasks, but the operator still needs to manually refresh the page to obtain The number of the latest pending items.
发明人发现现有的业务系统或OA系统存在以下问题:操作人员需点手动击菜单项或者手动刷新页面才可获得最新消息,操作繁琐,一旦操作人员没有即时刷新页面,则有可能会遗漏任务,耽误工作。此外,无论是点击菜单项还是手动刷新页面,都需要重新读取整个页面的数据,使得业务系统产生无谓的消耗。The inventor found that the existing business system or OA system has the following problems: the operator needs to manually click on a menu item or manually refresh the page to get the latest news, the operation is tedious, and once the operator does not refresh the page immediately, the task may be missed , Delayed work. In addition, whether you click a menu item or manually refresh the page, you need to re-read the data of the entire page, making the business system useless.
发明内容Summary of the invention
本申请提供了一种实时更新页面数据的方法、装置、电子设备及计算机可读存储介质,可以解决需要操作人员手动刷新页面才可以获取最新消息的问题。所述技术方案如下:This application provides a method, device, electronic device, and computer-readable storage medium for updating page data in real time, which can solve the problem that an operator needs to manually refresh the page to obtain the latest news. The technical solution is as follows:
第一方面,本申请提供了一种实时更新页面数据的方法,该方法包括:In a first aspect, the present application provides a method for updating page data in real time. The method includes:
接收服务器发送的消息队列;提取消息队列中的新消息,根据新消息确定待写入数据以及待写入数据对应的位置标识;通过文档对象模型DOM确定在当前页面中与位置标识对应的待更新位置,将待更新位置处的数据更新为待写入数据。Receive the message queue sent by the server; extract new messages in the message queue, determine the data to be written and the position identifier corresponding to the data to be written according to the new message; determine the document to be updated corresponding to the position identifier in the current page through the document object model DOM Position to update the data at the position to be updated to the data to be written.
第二方面,本申请提供了另一种实时更新页面数据的方法,该方法包括:接收后台生成的新消息,并将新消息放入消息中间件中对应的消息队列,新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;在满足预设条件时,将消息中间件中的消息队列发送给与消息队列对应的前端,以使前端根据消息队列中的新消息更新当前页面。In a second aspect, the present application provides another method for updating page data in real time. The method includes: receiving a new message generated in the background, and placing the new message in a corresponding message queue in the message middleware. The new message includes the new data and The location identifier used to indicate the location to be updated in the current web page; when a preset condition is met, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current according to the new message in the message queue page.
第三方面,本申请提供了一种实时更新页面数据的装置,该装置包括:接收模块,用于接收服务器发送的消息队列;提取模块,用于提取消息队列中的新消息,根据新消息确定待写入数据以及待写入数据对应的位置标识;更新模块,用于通过文档对象模型DOM确定在当前页面中与位置标识对应的待更新位置,将待更新位置处的数据更新为待写入数据。In a third aspect, the present application provides a device for updating page data in real time. The device includes: a receiving module for receiving a message queue sent by a server; an extraction module for extracting a new message in the message queue, and determining according to the new message. The data to be written and the location identifier corresponding to the data to be written; an update module for determining the location to be updated corresponding to the location identifier in the current page through the document object model DOM, and updating the data at the location to be updated to be written data.
第四方面,本申请提供了一种实时更新页面数据的装置,该装置包括:消息存储模块,用于接收后台生成的新消息,并将新消息放入消息中间件中对应的消息队列,新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;消息发送模块,用于在满足预设条件时,将消息中间件中的消息队列发送给与消息队列对应的前端,以使前端根据消息队列中的新消息更新当前页面。In a fourth aspect, the present application provides a device for updating page data in real time. The device includes a message storage module for receiving a new message generated in the background and placing the new message in a corresponding message queue in the message middleware. The message includes new data and a location identifier used to indicate the location to be updated in the current webpage. The message sending module is used to send the message queue in the message middleware to the front end corresponding to the message queue when the preset conditions are met. Causes the front end to update the current page based on new messages in the message queue.
第五方面,本申请提供了一种电子设备,该电子设备包括:一个或多个处理器;存储器;一个或多个应用程序,其中一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个应用程序配置用于执行实时更新页面数据的方法的以下操作:接收服务器发送的消息队列;提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。In a fifth aspect, the present application provides an electronic device including: one or more processors; a memory; and one or more application programs, wherein one or more application programs are stored in the memory and configured as Executed by one or more processors, and one or more applications are configured to perform the following operations of the method of updating page data in real time: receiving a message queue sent by a server; extracting a new message in the message queue, and according to the new The message determines the data to be written and the location identifier corresponding to the data to be written; the document object model DOM is used to determine the location to be updated corresponding to the location identifier in the current page, and the data at the location to be updated is updated to the Data to be written.
第六方面,本申请提供了一种电子设备,其包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行实时更新页面数据的方法的以下操作:接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。According to a sixth aspect, the present application provides an electronic device including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and are And configured to be executed by the one or more processors, and the one or more applications are configured to perform the following operations of the method for updating page data in real time: receiving a new message generated in the background, and placing the new message in The corresponding message queue in the message middleware, the new message includes new data and a location identifier used to indicate a position to be updated in the current webpage; and when a preset condition is met, the message queue in the message middleware is sent to the The front end corresponding to the message queue is described, so that the front end updates the current page according to a new message in the message queue.
第七方面,本申请提供了一种计算机可读非易失性存储介质,计算机可读非易失性存储介质上存储有计算机程序,该程序被处理器执行时实现实时更新页面数据 的方法的以下操作:接收服务器发送的消息队列;提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。In a seventh aspect, the present application provides a computer-readable non-volatile storage medium. A computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, a method for real-time updating page data is implemented. The following operations: receive a message queue sent by the server; extract a new message in the message queue, determine the data to be written and the location identifier corresponding to the data to be written according to the new message; determine the current page through the document object model DOM A position to be updated corresponding to the position identifier, and data at the position to be updated is updated to the data to be written.
第八方面,本申请提供了一种计算机可读非易失性存储介质,所述计算机可读非易失性存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机可以执行实时更新页面数据的方法的以下操作:接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。According to an eighth aspect, the present application provides a computer-readable non-volatile storage medium, where the computer-readable non-volatile storage medium is used to store computer instructions, and when the computer instructions are run on the computer, the computer can execute real-time The method of updating page data has the following operations: receiving a new message generated in the background, and placing the new message in a corresponding message queue in the message middleware, where the new message includes new data and is used to indicate a pending update in the current web page The location identifier of the location; when a preset condition is met, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
本申请实施例提供的技术方案中,定向精准地获取需要更新的数据以及更新数据在页面中的位置,通过DOM实现了局部刷新页面数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新数据导致延误工作,同时减轻了操作人员的工作量。In the technical solution provided by the embodiment of the present application, the data to be updated and the position of the updated data in the page are accurately obtained through orientation, and the page data is partially refreshed through the DOM, so that the operator can obtain the latest news without manually refreshing the page, avoiding Operators are delayed due to missing the latest data, while reducing the workload of operators.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请实施例提供的一种实时更新页面数据的方法的流程示意图;FIG. 1 is a schematic flowchart of a method for updating page data in real time according to an embodiment of the present application;
图2为本申请实施例提供的另一种实时更新页面数据的方法的流程示意图;2 is a schematic flowchart of another method for updating page data in real time according to an embodiment of the present application;
图3为本申请实施例提供的一种实时更新页面数据的装置的结构示意图;3 is a schematic structural diagram of a device for updating page data in real time according to an embodiment of the present application;
图4为本申请实施例提供的另一种实时更新页面数据的装置的结构示意图;4 is a schematic structural diagram of another apparatus for updating page data in real time according to an embodiment of the present application;
图5为本申请实施例提供的一种电子设备的结构示意图;5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
图6为本申请实施例提供的另一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of another electronic device according to an embodiment of the present application.
具体实施方式detailed description
实施例一Example one
本申请实施例提供了一种实时更新页面数据的方法,如图1所示,该方法包括:步骤S101和步骤S102。An embodiment of the present application provides a method for updating page data in real time. As shown in FIG. 1, the method includes steps S101 and S102.
步骤S101、接收后台生成的新消息,并将新消息放入消息中间件中对应的消息队列,新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识。Step S101: Receive a new message generated in the background, and place the new message in a corresponding message queue in the message middleware. The new message includes new data and a location identifier used to indicate a location to be updated in the current webpage.
其中,后台生成新消息后,立即发送给服务器,每一条新消息都携带有一个主题,每个主题对应至少一个消息队列,每一个消息队列对应一个前端。服务器接收到后台生成的新消息后,依据新消息携带的主题将新消息存入消息中间件中相应的 消息队列中。Among them, after a new message is generated in the background, it is immediately sent to the server. Each new message carries a topic, each topic corresponds to at least one message queue, and each message queue corresponds to a front end. After receiving the new message generated in the background, the server stores the new message in the corresponding message queue in the message middleware according to the subject carried by the new message.
其中,消息中间件可选用ActiveMQ、RabbitMQ、Kafka、Jafka、RocketMQ等,在此不做限定。当消息队列发送给前端后,消息中间件会清空已发送的消息队列中的消息,等待服务器将后台产生的新消息写入消息队列。Among them, ActiveMQ, RabbitMQ, Kafka, Jafka, RocketMQ, etc. can be selected as the message middleware, which is not limited here. After the message queue is sent to the front end, the message middleware will empty the messages in the sent message queue, waiting for the server to write new messages generated in the background to the message queue.
其中,新数据为待更新到页面中的数据,本实施例中的新数据具体是指产生频率较高一类数据,例如:订单数据、任务数据。待更新位置为页面中某个需要更新数据的位置,如网页中某一表格中的某个单元格,菜单栏或任务栏中用于显示待处理事项的单元格。页面中每一个显示区域(如表格中的单元格)都对应了HMTL中的一个标签。The new data is data to be updated into the page. The new data in this embodiment specifically refers to a type of data with a higher generation frequency, such as order data and task data. The position to be updated is a position on the page where data needs to be updated, such as a cell in a table on a web page, a cell in a menu bar or task bar for displaying a to-do item. Each display area on the page (such as a cell in a table) corresponds to a label in HMTL.
步骤S102、在满足预设条件时,将消息中间件中的消息队列发送给与消息队列对应的前端,以使前端根据消息队列中的新消息更新当前页面。Step S102: When the preset condition is satisfied, send the message queue in the message middleware to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
其中,在满足预设条件时,根据消息队列对应的主题,将消息队列发送给相应的前端。前端在接收到消息队列后,从消息队列中提取出新消息,根据新消息中的位置标识确定当前网页中的待更新位置,通过AJAX(Asynchronous Javascript And XML,异步页面动态刷新)技术将当前网页中的待更新位置的数据更新为新数据,以实现自动更新页面数据。When the preset condition is satisfied, the message queue is sent to the corresponding front end according to the theme corresponding to the message queue. After receiving the message queue, the front end extracts new messages from the message queue, determines the position to be updated in the current web page based on the position identifier in the new message, and uses the AJAX (Asynchronous Javascript And XML, asynchronous page dynamic refresh) technology to update the current web page. The data in the position to be updated in is updated to new data to automatically update the page data.
其中,AJAX是一种用于创建快速动态网页的技术,AJAX使得后台与服务器只需进行少量数据交换,即可使网页实现异步更新,这意味着可以在不重新加载整个网页的情况下,对网页的局部进行更新。Among them, AJAX is a technology used to create fast dynamic web pages. AJAX enables the back-end to communicate with the server with a small amount of data to enable asynchronous updates of the web pages. This means that the entire web page can be updated without reloading the entire web page. Part of the web page is updated.
例如,订单系统中,订单数据在当前网页中的显示方式为:在菜单项中显示当前待处理的订单数量。将上述方法应用到订单系统中,具体过程为:后台将生成的新的订单数据发送给服务器,发送给服务器的新消息中包括:新的订单数据、该订单数据对应的主题以及位置标识,其中,位置标识指示了订单数据在页面中的显示位置;服务器接收到后台生成的新消息后,依据新信息携带的主题将新消息存入消息中间件中相应的消息队列中,服务器在满足预设条件时,将消息中间件中的消息队列发送给相应的前端;前端获取到新的消息队列后,从新的消息队列中提取出新的订单数据和位置标识,通过AJAX技术确定位置标识指示的当前网页中的待更新位置,即菜单项中显示当前待处理的订单数量对应的标签,按照新增的订单数量,将当前网页中的待更新位置的订单数量更新为新增订单后的数量,以实现自动更新页面数据。For example, in the order system, the display of order data on the current webpage is: the number of currently pending orders is displayed in a menu item. The above method is applied to the order system. The specific process is as follows: the new order data generated is sent to the server by the background, and the new message sent to the server includes: the new order data, the subject corresponding to the order data, and the location identifier, where The location identifier indicates the display position of the order data on the page. After receiving the new message generated in the background, the server stores the new message in the corresponding message queue in the message middleware according to the theme carried by the new information. When the condition is met, the message queue in the message middleware is sent to the corresponding front end; after the front end obtains the new message queue, the new order data and location identifier are extracted from the new message queue, and the current location indicator indication is determined by AJAX technology The position to be updated on the webpage, that is, the menu item displays a label corresponding to the number of currently pending orders. According to the number of new orders, the number of orders in the current webpage to be updated is updated to the number of new orders. Achieve automatic update of page data.
本实施例的实时更新页面数据的方法,通过中间消息件将后台产生的大量新消 息转存到相应的消息队列,并即时将消息队列转发到相应的前端,以使得前端能够实时、自动地更新页面中的一些数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,消息中间件有异常处理机制,业务系统只需将数据放入对应的消息队列即可,当系统发生异常并恢复异常后,消息中间件会自动重发消息,因此,通过消息中间件转发消息,无需担心断网断电等异常情况,提高了业务系统的稳定性。The method for real-time updating page data in this embodiment transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and immediately forwards the message queue to a corresponding front end, so that the front end can be updated in real time and automatically Some data in the page allows the operator to get the latest news without manually refreshing the page, avoiding the operator's delay in work due to missing the latest data, and reducing the workload of the operator. In addition, the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
实施例二Example two
本申请实施例提供了另一种可能的实现方式,在实施例一的基础上,还包括实施例二所示的方法。This embodiment of the present application provides another possible implementation manner. On the basis of Embodiment 1, the method shown in Embodiment 2 is further included.
其中,前端会定时向服务器发送获取消息队列的请求。可根据实际业务中新数据的产生频率自行设定定时发送请求的时间间隔,例如:当数据更新较为频繁时,前端可每隔0.5s向服务器发送获取消息队列的请求。Among them, the front end will periodically send a request to the server to obtain the message queue. You can set the time interval for sending requests according to the frequency of new data in the actual service. For example, when the data is updated frequently, the front end can send a request to the server to obtain the message queue every 0.5s.
在此基础上,步骤S102具体包括:当接收到前端发送的获取消息队列的请求时,通过消息中间件将相应的消息队列发送给请求的前端。On this basis, step S102 specifically includes: when receiving a request for obtaining a message queue sent by the front end, sending a corresponding message queue to the requesting front end through a message middleware.
上述由前端主动获取消息队列的方式容易产无谓的消耗。为此,本实施例中,使用websocket的长连接机制实现由服务器向前端主动推送消息队列,避免因前端不断轮询服务器而产生无谓的消耗。The foregoing method of actively acquiring a message queue by the front end is prone to unnecessary consumption. For this reason, in this embodiment, the long connection mechanism of the websocket is used to actively push the message queue from the server to the front end, so as to avoid unnecessary consumption caused by the front end continuously polling the server.
可选地,在建立长连接的基础上,步骤S102具体包括:通过与前端建立的长连接,定时将消息中间件中的消息队列发送给与消息队列对应的前端。Optionally, on the basis of establishing a long connection, step S102 specifically includes: regularly sending the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
其中,定时发送消息队列的时间间隔可根据实际业务中新数据的产生频率确定,产生频率越高,时间间隔越短。The time interval for sending the message queue regularly can be determined according to the frequency of generating new data in the actual service. The higher the frequency of generation, the shorter the time interval.
可选地,在建立长连接的基础上,步骤S102具体包括:当消息队列发生变化时,通过与前端建立的长连接,主动将消息中间件中的消息队列发送给与消息队列对应的前端。Optionally, based on establishing a long connection, step S102 specifically includes: when the message queue changes, actively sending the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
其中,可设定当服务器检测到消息队列中的新数据达到一定数量时,通过服务器与前端建立的长连接,主动将消息中间件中的消息队列发送给与消息队列对应的前端。Among them, when the server detects that a certain amount of new data in the message queue is reached, it actively sends the message queue in the message middleware to the front end corresponding to the message queue through the long connection established between the server and the front end.
可选地,步骤S102具体包括:将消息中间件中的消息队列缓存到Redis服务器中,通过Redis服务器将消息队列发送给消息队列对应的前端。Optionally, step S102 specifically includes: buffering the message queue in the message middleware to the Redis server, and sending the message queue to the front end corresponding to the message queue through the Redis server.
通过Redis服务器实现分布式缓存,将消息中间件中的消息队列缓存到Redis服务器中,然后通过Redis服务器将消息队列推送到前端。利用Redis服务器的高 可用性,以适应不同的数据类型及应用场景,同时,Redis服务器的分布式特性降低了数据丢失的概率,提高了系统的可靠性。Implement distributed caching through the Redis server, cache the message queue in the message middleware to the Redis server, and then push the message queue to the front end through the Redis server. The high availability of the Redis server is used to adapt to different data types and application scenarios. At the same time, the distributed nature of the Redis server reduces the probability of data loss and improves the reliability of the system.
实施例三Example three
在实施例一、二的基础上,本申请实施例还提供了一种实时更新页面数据的方法,如图2所示,该方法包括:步骤S201、步骤S202和步骤S203。Based on the first and second embodiments, this embodiment of the present application also provides a method for updating page data in real time. As shown in FIG. 2, the method includes: step S201, step S202, and step S203.
步骤S201、接收服务器发送的消息队列。Step S201: Receive a message queue sent by a server.
步骤S202、提取消息队列中的新消息,根据新消息确定待写入数据以及待写入数据对应的位置标识。In step S202, a new message in the message queue is extracted, and data to be written and a location identifier corresponding to the data to be written are determined according to the new message.
其中,新消息中包括新数据以及用于指示当前网页中的待更新位置的位置标识。根据新数据确定需要更新到当前页面中的数据,即待写入数据。一个消息队列中包括至少一个新消息。The new message includes new data and a location identifier used to indicate a location to be updated in the current webpage. According to the new data, the data to be updated to the current page, that is, the data to be written is determined. A message queue includes at least one new message.
步骤S203、通过文档对象模型DOM确定在当前页面中与位置标识对应的待更新位置,将待更新位置处的数据更新为待写入数据。Step S203: Determine the position to be updated corresponding to the position identifier in the current page through the document object model DOM, and update the data at the position to be updated to the data to be written.
其中,DOM(文档对象模型,Document Object Model)是HTML与XML的应用编程接口,DOM将整个页面映射为一个由层次节点组成的文件,以方便地获取、修改、添加或删除网页页面中的元素。Among them, the DOM (Document Object Model) is an application programming interface for HTML and XML. The DOM maps the entire page into a file consisting of hierarchical nodes to easily obtain, modify, add, or delete elements in web pages. .
本实施例的实时更新页面数据的方法应用于前端,与实施例一、二的应用于服务器端的方法相互配合,以实现根据后台产生的新数据对前端的页面进行实时更新。本实施例的中的相关名词的解释可参件实施例一和实施例二中的相关解释,在此不再赘述。The method for real-time updating page data of this embodiment is applied to the front end, and cooperates with the method applied to the server side of Embodiments 1 and 2 to achieve real-time updating of the front-end page according to new data generated in the background. For explanations of related terms in this embodiment, reference may be made to related explanations in Embodiment 1 and Embodiment 2, and details are not described herein again.
例如,在订单系统中,订单数据在当前页面中的显示方式为在菜单项中显示当前待处理的订单数量,后台产生的新数据可以是新增订单,也是是减少订单。将上述方法应用到订单系统中前端时,具体过程为:前端获取到服务器发送的新的消息队列后,从接收到的消息队列中提取出新的订单数据和位置标识,根据消息队列中新增的订单或减少的订单以及当前页面显示的订单数量,计算当前的订单数量(即待写入数据);然后,前端利用AJAX技术,通过DOM确定该位置标识指示的当前网页中的待更新位置,即菜单项中显示当前待处理的订单数量对应的标签,将当前网页中的待更新位置的订单数量更新为待写入数据,以实现自动更新页面菜单栏中的订单数量。For example, in the order system, the display of order data on the current page is to display the number of currently pending orders in a menu item. The new data generated in the background can be new orders or reduced orders. When the above method is applied to the front end of the order system, the specific process is: after the front end obtains a new message queue sent by the server, it extracts new order data and location identifiers from the received message queue, and according to the new addition in the message queue Orders or reduced orders and the number of orders displayed on the current page, calculate the current order number (that is, data to be written); then, the front end uses AJAX technology to determine the position to be updated in the current web page indicated by the position identifier through the DOM, That is, the menu item displays a label corresponding to the current number of orders to be processed, and updates the number of orders in the position to be updated on the current web page to data to be written to automatically update the number of orders in the menu bar of the page.
有些订单系统不只是显示订单数量,还显示具体的订单数据,如具体的货品型号、货品数量、供货期限等等。此时,前端获取到服务器发送的新的消息队列后, 从新接收到的消息队列中提取出新的订单数据和位置标识,从新数据中提取出订单数据作为待写入数据;然后,利用AJAX技术,通过DOM确定该位置标识指示的当前网页中的待更新位置,即当前页面中显示订单数据的位置对应的标签,将当前网页中的待更新位置的订单数量更新为待写入数据,以实现自动更新页面中新增或删除的订单数据。Some order systems not only display the order quantity, but also display specific order data, such as specific product models, product quantities, delivery periods, and so on. At this time, after the front end obtains a new message queue sent by the server, it extracts new order data and location identifiers from the newly received message queue, and extracts the order data from the new data as data to be written; then, it uses AJAX technology , Through the DOM to determine the position to be updated in the current web page indicated by the position identifier, that is, the label corresponding to the position where the order data is displayed on the current page, and update the number of orders in the position to be updated in the current web page to the data to be written to achieve Automatically update new or deleted order data on the page.
本实施例的实时更新页面数据的方法,定向精准地获取需要更新的数据以及更新数据在页面中的位置,通过DOM实现了局部刷新页面数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,前端可精确获取所需更新的数据,无需为了单个最新的数据将整个页面重新刷新一遍,减少业务系统的消耗。The method for real-time updating of page data in this embodiment acquires the data that needs to be updated and the position of the updated data in the page in a targeted and accurate manner, and implements partial refresh of the page data through the DOM, so that the operator can obtain the latest news without manually refreshing the page. Avoiding operator delays due to missing the latest data, while reducing operator workload. In addition, the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
实施例四Embodiment 4
本申请实施例提供了另一种可能的实现方式,在实施例三的基础上,还包括实施例四所示的方法。This embodiment of the present application provides another possible implementation manner. On the basis of Embodiment 3, the method shown in Embodiment 4 is further included.
如果短时间内后台生产的新消息过多,会导致前端无法快速消费新消息。为解决上述问题,本实施例的实时更新页面数据的方法还包括以下步骤:当单位时间内接收到的消息队列的数量超过阈值时,创建多个消费对象,由各个消费对象轮流消费接收到的消息队列。If too many new messages are produced in the background in a short period of time, the front-end cannot consume new messages quickly. In order to solve the above problem, the method for real-time updating page data in this embodiment further includes the following steps: when the number of message queues received in a unit time exceeds a threshold, a plurality of consumption objects are created, and each consumption object consumes the received data in turn. message queue.
其中,消费对象为处理消息队列的对象。消费是指通过创建的消费对象处理消息队列,即执行步骤S202、步骤S203的相关操作。Among them, the consumption object is an object that processes a message queue. Consumption refers to processing the message queue through the created consumption object, that is, performing the operations in steps S202 and S203.
通过检测接收到消息队列的数量,自适应地创建相应数量的消费对象,以提高前端应对后台生成的大量新数据的能力。By detecting the number of received message queues, a corresponding number of consumer objects are adaptively created to improve the ability of the front end to respond to a large amount of new data generated in the background.
本实施例的方法还包括以下步骤:获取预设的配置文件,配置文件中包括类型标识。The method of this embodiment further includes the following steps: obtaining a preset configuration file, and the configuration file includes a type identifier.
用户可通过配置文件设置前端需要从消息队列中提取的数据类型,以方便用户根据不同的业务需求快速做出调整。The user can set the type of data that the front-end needs to extract from the message queue through the configuration file, so that the user can quickly make adjustments according to different business needs.
本实施例中,后台发送的新消息的格式为key-value,value为新数据,key为新数据对应的类型标识。对新消息的结构不做要求,新消息可能是树结构,也可能是JSON结构,或是其他格式。In this embodiment, the format of the new message sent in the background is key-value, value is new data, and key is the type identifier corresponding to the new data. There is no requirement for the structure of the new message. The new message may be a tree structure, a JSON structure, or other formats.
相应地,步骤S202具体包括:从消息队列的新消息中提取出与配置文件中的类型标识对应的新数据,根据新数据确定待写入数据。Accordingly, step S202 specifically includes: extracting new data corresponding to the type identifier in the configuration file from the new message in the message queue, and determining the data to be written according to the new data.
前端成功获取到消息队列后,从AJAX的success块(success块即表示AJAX 成功获取到消息之后的处理代码块)中将获取到的队列消息提取出来,从队列消息中查找到配置文件中的类型标识,提取类型标识后的value值即可,再根据提取到的value确定待写入数据。因此,无论后台提供的数据是树结构还是JSON结构,都可以快速地实现数据的抽取,且用户可以通过配置文件根据实际业务需求方便地设置、更改需要提取的数据类型。After the front-end successfully obtains the message queue, the obtained queue message is extracted from the success block of AJAX (the success block indicates the processing code block after AJAX successfully obtained the message), and the type in the configuration file is found from the queue message. Identification, just extract the value after the type identification, and then determine the data to be written according to the extracted value. Therefore, no matter whether the data provided in the background is a tree structure or a JSON structure, the data can be quickly extracted, and the user can easily set and change the type of data to be extracted according to the actual business requirements through the configuration file.
可选地,步骤S202具体包括:提取新消息中的ID标识,ID标识为当前页面中各个标签的唯一标识。其中,标签为HTML标签。Optionally, step S202 specifically includes: extracting an ID identifier in the new message, where the ID identifier is a unique identifier of each tag in the current page. The tags are HTML tags.
相应地,步骤S203具体包括:通过DOM查询到与ID标识对应的目标标签,将目标标签中的数据更新为待写入数据。Accordingly, step S203 specifically includes: querying the target tag corresponding to the ID identifier through the DOM, and updating the data in the target tag to data to be written.
可选地,步骤S201之前还包括:定时向服务器发送获取消息队列的请求。Optionally, before step S201, the method further includes: sending a request for acquiring a message queue to the server periodically.
其中,可根据实际业务中新数据的产生频率自行设定定时发送请求的时间间隔,例如:当数据更新较为频繁时,前端可每隔0.5s向服务器发送获取消息队列的请求。服务器接收到前端发送的获取消息队列的请求后,通过消息中间件将相应的消息队列发送给请求的前端。Wherein, the time interval for sending the request can be set according to the frequency of new data in the actual service. For example, when the data is updated frequently, the front end can send a request to the server to obtain the message queue every 0.5s. After receiving the request to obtain the message queue sent by the front end, the server sends the corresponding message queue to the requesting front end through the message middleware.
上述由前端主动获取消息队列的方式容易产无谓的消耗。为此,本实施例中,使用websocket的长连接机制实现由服务器向前端主动推送消息队列,避免因前端不断轮询服务器而产生无谓的消耗。The foregoing method of actively acquiring a message queue by the front end is prone to unnecessary consumption. For this reason, in this embodiment, the long connection mechanism of the websocket is used to actively push the message queue from the server to the front end, so as to avoid unnecessary consumption caused by the front end continuously polling the server.
在建立长连接的基础上,步骤S201具体包括:通过与服务器建立的长连接,接收服务器发送的消息队列。On the basis of establishing a long connection, step S201 specifically includes: receiving the message queue sent by the server through the long connection established with the server.
实施例五Example 5
基于与实施例一、二相同的发明构思,本实施例提供了一种实时更新页面数据的装置,图3所示,该实时更新页面数据的装置30可以包括:消息存储模块301和消息发送模块302。Based on the same inventive concept as the first and second embodiments, this embodiment provides a device for updating page data in real time. As shown in FIG. 3, the device 30 for updating page data in real time may include a message storage module 301 and a message sending module. 302.
消息存储模块301,用于接收后台生成的新消息,并将新消息放入消息中间件中对应的消息队列,新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;The message storage module 301 is configured to receive a new message generated in the background and place the new message in a corresponding message queue in the message middleware. The new message includes new data and a location identifier for indicating a location to be updated in the current webpage.
消息发送模块302,用于在满足预设条件时,将消息中间件中的消息队列发送给与消息队列对应的前端,以使前端根据消息队列中的新消息更新当前页面。The message sending module 302 is configured to send the message queue in the message middleware to the front end corresponding to the message queue when the preset condition is satisfied, so that the front end updates the current page according to the new message in the message queue.
本实施例提供的实时更新页面数据的装置,通过中间消息件将后台产生的大量新消息转存到相应的消息队列,并即时将消息队列转发到相应的前端,以使得前端能够实时、自动地更新页面中的一些数据,使得操作人员无需手动刷新页面即可获 取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,消息中间件有异常处理机制,业务系统只需将数据放入对应的消息队列即可,当系统发生异常并恢复异常后,消息中间件会自动重发消息,因此,通过消息中间件转发消息,无需担心断网断电等异常情况,提高了业务系统的稳定性。The device for real-time updating page data provided by this embodiment transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and forwards the message queue to the corresponding front-end in real time, so that the front-end can automatically and real-timely Update some data in the page, so that the operator can get the latest news without manually refreshing the page, avoiding the operator's delay in work due to missing the latest data, and reducing the workload of the operator. In addition, the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
可选地,消息发送模块302具体用于通过与前端建立的长连接,定时将消息中间件中的消息队列发送给与消息队列对应的前端。Optionally, the message sending module 302 is specifically configured to regularly send the message queue in the message middleware to the front end corresponding to the message queue through the long connection established with the front end.
可选地,消息发送模块302具体用于当消息队列发生变化时,通过与前端建立的长连接,主动将消息中间件中的消息队列发送给与消息队列对应的前端。Optionally, the message sending module 302 is specifically configured to actively send the message queue in the message middleware to the front end corresponding to the message queue through a long connection established with the front end when the message queue changes.
可选地,消息发送模块302,用于在满足预设条件时,将消息中间件中的消息队列缓存到Redis服务器中,通过Redis服务器将消息队列发送给消息队列对应的前端,以使前端根据消息队列中的新消息更新当前页面。Optionally, the message sending module 302 is configured to cache the message queue in the message middleware to the Redis server when the preset conditions are met, and send the message queue to the corresponding front end of the message queue through the Redis server, so that the front end New messages in the message queue update the current page.
本实施例的实时更新页面数据的装置采用了与实施例一、二的实时更新页面数据的方法相同的发明构思,能够取得相同的技术效果,在此不再赘述。The apparatus for updating page data in real time in this embodiment adopts the same inventive concept as the method for updating page data in real time in Embodiments 1 and 2, and can obtain the same technical effects, which will not be repeated here.
实施例六Example Six
基于与实施三、四相同的发明构思,本申请实施例提供了一种实时更新页面数据的装置,如图4所示,该实时更新页面数据的装置40可以包括:接收模块401、提取模块402以及更新模块403。Based on the same inventive concepts as the third and fourth embodiments, an embodiment of the present application provides a device for updating page data in real time. As shown in FIG. 4, the device 40 for updating page data in real time may include a receiving module 401 and an extracting module 402. And update module 403.
接收模块401,用于接收服务器发送的消息队列。The receiving module 401 is configured to receive a message queue sent by a server.
提取模块402,用于提取消息队列中的新消息,根据新消息确定待写入数据以及待写入数据对应的位置标识。The extraction module 402 is configured to extract a new message in the message queue, and determine the data to be written and a location identifier corresponding to the data to be written according to the new message.
更新模块403,用于通过文档对象模型DOM确定在当前页面中与位置标识对应的待更新位置,将待更新位置处的数据更新为待写入数据。The update module 403 is configured to determine a position to be updated corresponding to the position identifier in the current page through the document object model DOM, and update data at the position to be updated to data to be written.
本实施例提供的实时更新页面数据的装置,定向精准地获取需要更新的数据以及更新数据在页面中的位置,通过DOM实现了局部刷新页面数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,前端可精确获取所需更新的数据,无需为了单个最新的数据将整个页面重新刷新一遍,减少业务系统的消耗。The device for updating page data in real time provided in this embodiment accurately acquires the data to be updated and the position of the updated data in the page. The DOM is used to partially refresh the page data, so that the operator can obtain the latest news without manually refreshing the page. , To avoid the operator's delay due to missing the latest data, while reducing the workload of the operator. In addition, the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
可选地,本实施例的装置还包括对象创建模块404,用于当单位时间内接收到的消息队列的数量超过阈值时,创建多个消费对象,由各个消费对象轮流消费接收到的消息队列。Optionally, the apparatus of this embodiment further includes an object creation module 404, which is configured to create multiple consumption objects when the number of message queues received in a unit time exceeds a threshold, and each consumption object consumes the received message queues in turn. .
可选地,本实施例的装置还包括配置文件获取模块405,用于获取预设的配置文件。其中,配置文件中包括类型标识。Optionally, the apparatus in this embodiment further includes a configuration file obtaining module 405, configured to obtain a preset configuration file. The configuration file includes a type identifier.
后台生成的新消息的格式为key-value,其中,value为新数据,key为新数据对应的类型标识。The format of the new message generated in the background is key-value, where value is the new data and key is the type identifier corresponding to the new data.
相应地,提取模块402具体用于:从消息队列的新消息中提取出与配置文件中的类型标识对应的新数据,根据新数据确定待写入数据。Accordingly, the extraction module 402 is specifically configured to extract new data corresponding to the type identifier in the configuration file from the new message in the message queue, and determine the data to be written according to the new data.
可选地,提取模块402具体用于:提取新消息中的ID标识。其中,ID标识为当前页面中各个标签的唯一标识。Optionally, the extraction module 402 is specifically configured to: extract an ID identifier in a new message. The ID identifier is a unique identifier of each tag in the current page.
可选地,更新模块403具体用于:通过文档对象模型DOM,查询到与ID标识对应的目标标签;将目标标签中的数据更新为待写入数据。Optionally, the update module 403 is specifically configured to: query the target tag corresponding to the ID identifier through the document object model DOM; and update the data in the target tag to data to be written.
可选地,接收模块401具体用于:通过与服务器建立的长连接,接收服务器发送的消息队列。Optionally, the receiving module 401 is specifically configured to receive a message queue sent by the server through a long connection established with the server.
本实施例的实时更新页面数据的装置采用了与实施例三、四的实时更新页面数据的方法相同的发明构思,能够取得相同的技术效果,在此不再赘述。The apparatus for updating page data in real time in this embodiment adopts the same inventive concept as the method for updating page data in real time in Embodiments 3 and 4, and can obtain the same technical effects, and details are not described herein again.
实施例七Example Seven
本申请实施例提供了一种电子设备,如图5所示,图5所示的电子设备500包括:处理器501和存储器503。其中,处理器501和存储器503相连,如通过总线502相连。可选地,电子设备500还可以包括收发器504。需要说明的是,实际应用中收发器504不限于一个,该电子设备500的结构并不构成对本申请实施例的限定。An embodiment of the present application provides an electronic device. As shown in FIG. 5, the electronic device 500 shown in FIG. 5 includes a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, for example, through a bus 502. Optionally, the electronic device 500 may further include a transceiver 504. It should be noted that, in practical applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not limit the embodiments of the present application.
其中,处理器501应用于本申请实施例中,用于实现图3所示的消息存储模块301和消息发送模块302的功能。收发器504包括接收机和发射机。The processor 501 is applied in the embodiment of the present application, and is configured to implement the functions of the message storage module 301 and the message sending module 302 shown in FIG. 3. The transceiver 504 includes a receiver and a transmitter.
处理器501可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器501也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The processor 501 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure. The processor 501 may also be a combination that realizes a computing function, for example, a combination including one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
总线502可包括一通路,在上述组件之间传送信息。总线502可以是PCI总线或EISA总线等。总线502可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 502 may include a path for transmitting information between the aforementioned components. The bus 502 may be a PCI bus, an EISA bus, or the like. The bus 502 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 5, but it does not mean that there is only one bus or one type of bus.
存储器503可以是ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM、 CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 503 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, CD-ROM or other optical disk storage, or optical disk storage (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by a computer Any other media accessed, but not limited to this.
与现有技术相比,本申请实施例提供的电子设备,通过中间消息件将后台产生的大量新消息转存到相应的消息队列,并即时将消息队列转发到相应的前端,以使得前端能够实时、自动地更新页面中的一些数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,消息中间件有异常处理机制,业务系统只需将数据放入对应的消息队列即可,当系统发生异常并恢复异常后,消息中间件会自动重发消息,因此,通过消息中间件转发消息,无需担心断网断电等异常情况,提高了业务系统的稳定性。Compared with the prior art, the electronic device provided in the embodiment of the present application transfers a large number of new messages generated in the background to a corresponding message queue through an intermediate message piece, and immediately forwards the message queue to the corresponding front end, so that the front end can Update some data on the page in real time and automatically, so that the operator can get the latest news without manually refreshing the page, avoiding the operator's delay due to missing the latest data, and reducing the workload of the operator. In addition, the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
实施例八Example eight
本申请实施例提供了一种电子设备,如图6所示,图6所示的电子设备600包括:处理器601和存储器603。其中,处理器601和存储器603相连,如通过总线602相连。可选地,电子设备600还可以包括收发器604。需要说明的是,实际应用中收发器604不限于一个,该电子设备600的结构并不构成对本申请实施例的限定。An embodiment of the present application provides an electronic device. As shown in FIG. 6, the electronic device 600 shown in FIG. 6 includes a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, for example, through a bus 602. Optionally, the electronic device 600 may further include a transceiver 604. It should be noted that, in practical applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not limit the embodiments of the present application.
其中,处理器601应用于本申请实施例中,用于实现图4所示的接收模块401、提取模块402以及更新模块403的功能。收发器604包括接收机和发射机。The processor 601 is applied in the embodiment of the present application, and is configured to implement the functions of the receiving module 401, the extracting module 402, and the updating module 403 shown in FIG. 4. The transceiver 604 includes a receiver and a transmitter.
处理器601可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器601也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The processor 601 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logical blocks, modules, and circuits described in connection with the present disclosure. The processor 601 may also be a combination that realizes a computing function, for example, a combination including one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
总线602可包括一通路,在上述组件之间传送信息。总线602可以是PCI总线或EISA总线等。总线602可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 602 may include a path for transmitting information between the aforementioned components. The bus 602 may be a PCI bus, an EISA bus, or the like. The bus 602 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only a thick line is used in FIG. 6, but it does not mean that there is only one bus or one type of bus.
存储器603可以是ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM、CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储 具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 603 may be ROM or other types of static storage devices capable of storing static information and instructions, RAM or other types of dynamic storage devices capable of storing information and instructions, and may also be EEPROM, CD-ROM or other optical disk storage, optical disk storage (Including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by a computer Any other media accessed, but not limited to this.
与现有技术相比,本申请实施例提供的电子设备,定向精准地获取需要更新的数据以及更新数据在页面中的位置,通过DOM实现了局部刷新页面数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,前端可精确获取所需更新的数据,无需为了单个最新的数据将整个页面重新刷新一遍,减少业务系统的消耗。Compared with the prior art, the electronic device provided in the embodiment of the present application obtains the data to be updated accurately and the position of the updated data in the page in a targeted manner. The DOM is used to partially refresh the page data, so that the operator does not need to manually refresh the page. Obtain the latest news, avoid the operator's delay due to missing the latest data, and reduce the workload of the operator. In addition, the front-end can accurately obtain the updated data without the need to refresh the entire page again for a single latest data, reducing the consumption of business systems.
实施例九Example Nine
本申请实施例提供了一种计算机可读非易失性存储介质,该计算机可读非易失性存储介质上存储有计算机程序,该程序被处理器执行时实现实施例一所示的实时更新页面数据的方法。The embodiment of the present application provides a computer-readable non-volatile storage medium. A computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, the real-time update shown in the first embodiment is implemented. Method of page data.
本申请实施例提供了一种计算机可读非易失性存储介质,与现有技术相比,通过中间消息件将后台产生的大量新消息转存到相应的消息队列,并即时将消息队列转发到相应的前端,以使得前端能够实时、自动地更新页面中的一些数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,消息中间件有异常处理机制,业务系统只需将数据放入对应的消息队列即可,当系统发生异常并恢复异常后,消息中间件会自动重发消息,因此,通过消息中间件转发消息,无需担心断网断电等异常情况,提高了业务系统的稳定性。The embodiment of the present application provides a computer-readable non-volatile storage medium. Compared with the prior art, a large number of new messages generated in the background are transferred to a corresponding message queue through an intermediate message piece, and the message queue is forwarded immediately. To the corresponding front end, so that the front end can update some data in the page in real time and automatically, so that the operator can get the latest news without manually refreshing the page, avoiding the operator's delay in work due to missing the latest data, and reducing the operator Workload. In addition, the message middleware has an exception handling mechanism, and the business system only needs to put data into the corresponding message queue. When the system is abnormal and recovers from the exception, the message middleware will automatically resend the message. Therefore, it is forwarded through the message middleware. Message, there is no need to worry about abnormal situations such as network and power failure, which improves the stability of business systems.
可选地,本申请实施例还提供了一种计算机可读非易失性存储介质,该计算机可读非易失性存储介质上存储有计算机程序,该程序被处理器执行时实现实施例二所示的实时更新页面数据的方法,在此不再赘述。Optionally, an embodiment of the present application further provides a computer-readable non-volatile storage medium. The computer-readable non-volatile storage medium stores a computer program, and the program is executed by a processor to implement the second embodiment. The method for updating page data in real time is not described in detail here.
实施例十Example 10
本申请实施例提供了一种计算机可读非易失性存储介质,该计算机可读非易失性存储介质上存储有计算机程序,该程序被处理器执行时实现实施例三所示的实时更新页面数据的方法。An embodiment of the present application provides a computer-readable non-volatile storage medium. A computer program is stored on the computer-readable non-volatile storage medium, and when the program is executed by a processor, the real-time update shown in the third embodiment is implemented. Method of page data.
本申请实施例提供了一种计算机可读非易失性存储介质,与现有技术相比,定向精准地获取需要更新的数据以及更新数据在页面中的位置,通过DOM实现了局部刷新页面数据,使得操作人员无需手动刷新页面即可获取最新消息,避免操作人员因遗漏最新的数据导致延误工作,同时减轻了操作人员的工作量。此外,前端可精确获取所需更新的数据,无需为了单个最新的数据将整个页面重新刷新一遍,减 少业务系统的消耗。The embodiment of the present application provides a computer-readable non-volatile storage medium. Compared with the prior art, the data required to be updated and the position of the updated data in the page are accurately obtained by orientation, and the page data is partially refreshed through the DOM. This allows the operator to get the latest news without manually refreshing the page, avoids the operator's delay in work due to missing the latest data, and reduces the workload of the operator. In addition, the front end can accurately obtain the data that needs to be updated, without having to refresh the entire page again for a single latest data, reducing the consumption of business systems.
可选地,本申请实施例还提供了一种计算机可读非易失性存储介质,该计算机可读非易失性存储介质上存储有计算机程序,该程序被处理器执行时实现实施例四所示的实时更新页面数据的方法,在此不再赘述。Optionally, the embodiment of the present application further provides a computer-readable non-volatile storage medium. The computer-readable non-volatile storage medium stores a computer program, and the fourth embodiment is implemented when the program is executed by a processor. The method for updating page data in real time is not described in detail here.

Claims (20)

  1. 一种实时更新页面数据的方法,包括:A method for updating page data in real time, including:
    接收服务器发送的消息队列;Receive the message queue sent by the server;
    提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;Extracting a new message in the message queue, and determining data to be written and a location identifier corresponding to the data to be written according to the new message;
    通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。A document object model DOM is used to determine a position to be updated corresponding to the position identifier in the current page, and the data at the position to be updated is updated to the data to be written.
  2. 根据权利要求1所述的方法,所述方法还包括:当单位时间内接收到的消息队列的数量超过阈值时,创建多个消费对象,由各个消费对象轮流消费接收到的消息队列。The method according to claim 1, further comprising: when the number of message queues received in a unit time exceeds a threshold, creating a plurality of consumption objects, and each consumption object consumes the received message queues in turn.
  3. 根据权利要求1所述的方法,所述方法还包括:获取预设的配置文件,所述配置文件中包括类型标识;The method according to claim 1, further comprising: obtaining a preset configuration file, wherein the configuration file includes a type identifier;
    所述新消息的格式为key-value,其中,value为新数据,key为所述新数据对应的类型标识;The format of the new message is key-value, where value is new data and key is a type identifier corresponding to the new data;
    所述提取所述消息队列中的新消息,根据所述新消息确定待写入数据,包括:The extracting a new message in the message queue and determining data to be written according to the new message includes:
    从所述消息队列的新消息中提取出与所述配置文件中的类型标识对应的新数据;Extracting new data corresponding to the type identifier in the configuration file from a new message in the message queue;
    根据所述新数据确定待写入数据。Data to be written is determined according to the new data.
  4. 根据权利要求1所述的方法,所述根据所述新消息确定待写入数据对应的位置标识,包括:提取所述新消息中的ID标识,所述ID标识为当前页面中各个标签的唯一标识;The method according to claim 1, wherein determining the location identifier corresponding to the data to be written according to the new message comprises: extracting an ID identifier in the new message, and the ID identifier is unique for each tag in the current page Identification
    所述通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据,包括:The determining a position to be updated corresponding to the position identifier in the current page through the document object model DOM, and updating the data at the position to be updated to the data to be written includes:
    通过DOM查询到与所述ID标识对应的目标标签;Querying a target tag corresponding to the ID identifier through a DOM query;
    将所述目标标签中的数据更新为所述待写入数据。Update the data in the target tag to the data to be written.
  5. 一种实时更新页面数据的方法,包括:A method for updating page data in real time, including:
    接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;Receiving a new message generated in the background, and placing the new message into a corresponding message queue in the message middleware, the new message including new data and a location identifier used to indicate a location to be updated in the current webpage;
    在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。When the preset condition is satisfied, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
  6. 根据权利要求5所述的方法,所述在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,包括:The method according to claim 5, wherein when the preset condition is satisfied, sending the message queue in the message middleware to the front end corresponding to the message queue comprises:
    通过与所述前端建立的长连接,定时将消息中间件中的消息队列发送给与所述消息队列对应的前端;Sending the message queue in the message middleware to the front end corresponding to the message queue through a long connection established with the front end;
    或,or,
    当消息队列发生变化时,通过与所述前端建立的长连接,主动将所述消息中间件中的消息队列发送给与所述消息队列对应的前端。When the message queue changes, the long-term connection established with the front end actively sends the message queue in the message middleware to the front end corresponding to the message queue.
  7. 一种实时更新页面数据的装置,包括:A device for updating page data in real time includes:
    接收模块,用于接收服务器发送的消息队列;A receiving module for receiving a message queue sent by a server;
    提取模块,用于提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;An extraction module, configured to extract a new message in the message queue, and determine data to be written and a location identifier corresponding to the data to be written according to the new message;
    更新模块,用于通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。An update module is configured to determine a position to be updated corresponding to the position identifier in the current page through a document object model DOM, and update data at the position to be updated to the data to be written.
  8. 一种实时更新页面数据的装置,包括:A device for updating page data in real time includes:
    消息存储模块,用于接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;A message storage module, configured to receive a new message generated in the background and place the new message into a corresponding message queue in the message middleware, where the new message includes new data and a location for indicating a location to be updated in the current webpage Identification
    消息发送模块,用于在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。A message sending module is configured to send a message queue in a message middleware to a front end corresponding to the message queue when a preset condition is satisfied, so that the front end updates a current page according to a new message in the message queue.
  9. 一种电子设备,其包括:An electronic device includes:
    一个或多个处理器;One or more processors;
    存储器;Memory
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行实时更新页面数据的方法的以下操作:One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications are configured to execute The following operations of the method of updating page data in real time:
    接收服务器发送的消息队列;Receive the message queue sent by the server;
    提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;Extracting a new message in the message queue, and determining data to be written and a location identifier corresponding to the data to be written according to the new message;
    通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。A document object model DOM is used to determine a position to be updated corresponding to the position identifier in the current page, and the data at the position to be updated is updated to the data to be written.
  10. 根据权利要求9所述的电子设备,所述操作还包括:当单位时间内接收到的消息队列的数量超过阈值时,创建多个消费对象,由各个消费对象轮流消费接收到的消息队列。The electronic device according to claim 9, the operation further comprising: when the number of message queues received in a unit time exceeds a threshold, creating a plurality of consumption objects, and each consumption object consumes the received message queues in turn.
  11. 根据权利要求9所述的电子设备,所述操作还包括:获取预设的配置文件,所述配置文件中包括类型标识;The electronic device according to claim 9, the operation further comprising: obtaining a preset configuration file, wherein the configuration file includes a type identifier;
    所述新消息的格式为key-value,其中,value为新数据,key为所述新数据对应的类型标识;The format of the new message is key-value, where value is new data and key is a type identifier corresponding to the new data;
    所述提取所述消息队列中的新消息,根据所述新消息确定待写入数据,包括:The extracting a new message in the message queue and determining data to be written according to the new message includes:
    从所述消息队列的新消息中提取出与所述配置文件中的类型标识对应的新数据;Extracting new data corresponding to the type identifier in the configuration file from a new message in the message queue;
    根据所述新数据确定待写入数据。Data to be written is determined according to the new data.
  12. 根据权利要求9所述的电子设备,所述根据所述新消息确定待写入数据对应的位置标识,包括:提取所述新消息中的ID标识,所述ID标识为当前页面中各个标签的唯一标识;The electronic device according to claim 9, wherein determining the location identifier corresponding to the data to be written according to the new message comprises: extracting an ID identifier in the new message, the ID identifier being a tag of each tag in the current page Uniquely identifies;
    所述通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据,包括:The determining a position to be updated corresponding to the position identifier in the current page through the document object model DOM, and updating the data at the position to be updated to the data to be written includes:
    通过DOM查询到与所述ID标识对应的目标标签;Querying a target tag corresponding to the ID identifier through a DOM query;
    将所述目标标签中的数据更新为所述待写入数据。Update the data in the target tag to the data to be written.
  13. 一种电子设备,其包括:An electronic device includes:
    一个或多个处理器;One or more processors;
    存储器;Memory
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用程序配置用于执行实时更新页面数据的方法的以下操作:One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications are configured to execute The following operations of the method of updating page data in real time:
    接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;Receiving a new message generated in the background, and placing the new message into a corresponding message queue in the message middleware, the new message including new data and a location identifier used to indicate a location to be updated in the current webpage;
    在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。When the preset condition is satisfied, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
  14. 根据权利要求13所述的电子设备,所述在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,包括:The electronic device according to claim 13, wherein the sending a message queue in a message middleware to a front end corresponding to the message queue when a preset condition is satisfied comprises:
    通过与所述前端建立的长连接,定时将消息中间件中的消息队列发送给与所述 消息队列对应的前端;Sending the message queue in the message middleware to the front end corresponding to the message queue through a long connection established with the front end;
    或,or,
    当消息队列发生变化时,通过与所述前端建立的长连接,主动将所述消息中间件中的消息队列发送给与所述消息队列对应的前端。When the message queue changes, the long-term connection established with the front end actively sends the message queue in the message middleware to the front end corresponding to the message queue.
  15. 一种计算机可读非易失性存储介质,所述计算机可读非易失性存储介质用于存储计算机指令,当其在计算机上运行时,使得计算机可以执行实时更新页面数据的方法的以下操作:A computer-readable non-volatile storage medium is used to store computer instructions. When the computer-readable non-volatile storage medium is run on a computer, the computer can perform the following operations of a method for updating page data in real time. :
    接收服务器发送的消息队列;Receive the message queue sent by the server;
    提取所述消息队列中的新消息,根据所述新消息确定待写入数据以及待写入数据对应的位置标识;Extracting a new message in the message queue, and determining data to be written and a location identifier corresponding to the data to be written according to the new message;
    通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据。A document object model DOM is used to determine a position to be updated corresponding to the position identifier in the current page, and the data at the position to be updated is updated to the data to be written.
  16. 根据权利要求15所述的非易失性存储介质,所述操作还包括:当单位时间内接收到的消息队列的数量超过阈值时,创建多个消费对象,由各个消费对象轮流消费接收到的消息队列。The non-volatile storage medium according to claim 15, the operation further comprising: when the number of message queues received in a unit time exceeds a threshold, creating a plurality of consumption objects, and each consumption object consumes the received message queue.
  17. 根据权利要求15所述的非易失性存储介质,所述操作还包括:获取预设的配置文件,所述配置文件中包括类型标识;The non-volatile storage medium according to claim 15, the operation further comprising: obtaining a preset configuration file, wherein the configuration file includes a type identifier;
    所述新消息的格式为key-value,其中,value为新数据,key为所述新数据对应的类型标识;The format of the new message is key-value, where value is new data and key is a type identifier corresponding to the new data;
    所述提取所述消息队列中的新消息,根据所述新消息确定待写入数据,包括:The extracting a new message in the message queue and determining data to be written according to the new message includes:
    从所述消息队列的新消息中提取出与所述配置文件中的类型标识对应的新数据;Extracting new data corresponding to the type identifier in the configuration file from a new message in the message queue;
    根据所述新数据确定待写入数据。Data to be written is determined according to the new data.
  18. 根据权利要求15所述的非易失性存储介质,所述根据所述新消息确定待写入数据对应的位置标识,包括:提取所述新消息中的ID标识,所述ID标识为当前页面中各个标签的唯一标识;The non-volatile storage medium according to claim 15, wherein determining the location identifier corresponding to the data to be written according to the new message comprises: extracting an ID identifier in the new message, and the ID identifier is a current page The unique identification of each label in the
    所述通过文档对象模型DOM确定在当前页面中与所述位置标识对应的待更新位置,将所述待更新位置处的数据更新为所述待写入数据,包括:The determining a position to be updated corresponding to the position identifier in the current page through the document object model DOM, and updating the data at the position to be updated to the data to be written includes:
    通过DOM查询到与所述ID标识对应的目标标签;Querying a target tag corresponding to the ID identifier through a DOM query;
    将所述目标标签中的数据更新为所述待写入数据。Update the data in the target tag to the data to be written.
  19. 一种计算机可读非易失性存储介质,所述计算机可读非易失性存储介质用 于存储计算机指令,当其在计算机上运行时,使得计算机可以执行实时更新页面数据的方法的以下操作:A computer-readable non-volatile storage medium is used to store computer instructions. When the computer-readable non-volatile storage medium is run on a computer, the computer can perform the following operations of a method for updating page data in real time. :
    接收后台生成的新消息,并将所述新消息放入消息中间件中对应的消息队列,所述新消息包括新数据以及用于指示当前网页中的待更新位置的位置标识;Receiving a new message generated in the background, and placing the new message into a corresponding message queue in the message middleware, the new message including new data and a location identifier used to indicate a location to be updated in the current webpage;
    在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,以使所述前端根据所述消息队列中的新消息更新当前页面。When the preset condition is satisfied, the message queue in the message middleware is sent to the front end corresponding to the message queue, so that the front end updates the current page according to the new message in the message queue.
  20. 根据权利要求19所述的非易失性存储介质,所述在满足预设条件时,将消息中间件中的消息队列发送给与所述消息队列对应的前端,包括:The non-volatile storage medium according to claim 19, wherein when the preset condition is satisfied, sending the message queue in the message middleware to the front end corresponding to the message queue comprises:
    通过与所述前端建立的长连接,定时将消息中间件中的消息队列发送给与所述消息队列对应的前端;Sending the message queue in the message middleware to the front end corresponding to the message queue through a long connection established with the front end;
    或,or,
    当消息队列发生变化时,通过与所述前端建立的长连接,主动将所述消息中间件中的消息队列发送给与所述消息队列对应的前端。When the message queue changes, the long-term connection established with the front end actively sends the message queue in the message middleware to the front end corresponding to the message queue.
PCT/CN2018/108084 2018-07-19 2018-09-27 Method and apparatus for real-time update of page data and electronic device WO2020015186A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810797555.1 2018-07-19
CN201810797555.1A CN108989429A (en) 2018-07-19 2018-07-19 The method, apparatus of real-time update page data, electronic equipment

Publications (1)

Publication Number Publication Date
WO2020015186A1 true WO2020015186A1 (en) 2020-01-23

Family

ID=64548731

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108084 WO2020015186A1 (en) 2018-07-19 2018-09-27 Method and apparatus for real-time update of page data and electronic device

Country Status (2)

Country Link
CN (1) CN108989429A (en)
WO (1) WO2020015186A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401819A (en) * 2020-04-08 2020-07-10 上海东普信息科技有限公司 Intersystem data pushing method and system
CN111831954A (en) * 2020-07-20 2020-10-27 汉海信息技术(上海)有限公司 Content data updating method and device, computer equipment and storage medium
CN111880955A (en) * 2020-08-04 2020-11-03 北京立通智联科技有限公司 Message processing method, device, terminal and medium for Internet of things equipment
CN112486473A (en) * 2020-11-30 2021-03-12 中国电子科技集团公司第二十八研究所 Kafka and Redis-based quasi-real-time target track display method
CN112596925A (en) * 2020-12-25 2021-04-02 中国农业银行股份有限公司 Transaction data transmission method and device
CN112887445A (en) * 2021-01-22 2021-06-01 北京金山云网络技术有限公司 Method and device for updating domain name information and domain name server
CN112925661A (en) * 2021-03-09 2021-06-08 广州虎牙科技有限公司 Message processing method and device, computer equipment and storage medium
CN113179304A (en) * 2021-04-22 2021-07-27 平安消费金融有限公司 Message issuing method, system, device and storage medium
CN113221049A (en) * 2021-04-27 2021-08-06 北京奇艺世纪科技有限公司 Page updating method and device, electronic equipment and storage medium
CN113407528A (en) * 2020-11-20 2021-09-17 广东美云智数科技有限公司 Authority data synchronization method, management device and storage medium
CN114070563A (en) * 2020-07-31 2022-02-18 中移(苏州)软件技术有限公司 Data processing method, device, terminal and storage medium

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110311959B (en) * 2019-06-19 2022-04-26 广州方硅信息技术有限公司 Method and device for message pushing and page updating and data processing system
CN110213302A (en) * 2019-07-11 2019-09-06 创新奇智(北京)科技有限公司 A kind of method, computer-readable medium and system pushing welcome's message
CN111177489A (en) * 2019-12-26 2020-05-19 贝壳技术有限公司 Object data display method and system
CN111563102A (en) * 2020-04-10 2020-08-21 中国联合网络通信集团有限公司 Cache updating method, server, system and storage medium
CN111797154A (en) * 2020-07-03 2020-10-20 紫光云技术有限公司 Json-based real-time extraction method
CN112417009A (en) * 2020-10-12 2021-02-26 南京江北新区生物医药公共服务平台有限公司 Visual display method and device for medical data
CN112565356B (en) * 2020-11-24 2023-04-21 北京百度网讯科技有限公司 Data storage method and device and electronic equipment
CN113378622A (en) * 2021-04-06 2021-09-10 青岛以萨数据技术有限公司 Specific person identification method, device, system and medium
CN113535862A (en) * 2021-07-20 2021-10-22 江苏创源电子有限公司 Business data pushing method and device, electronic equipment and storage medium
CN113590253B (en) * 2021-10-08 2022-02-15 深圳市信润富联数字科技有限公司 Server-side-based communication interaction method, device and storage medium
CN114721759B (en) * 2022-03-31 2023-11-24 珠海豹趣科技有限公司 Android desktop view display method and device and electronic equipment
CN116048828B (en) * 2022-05-26 2023-10-20 荣耀终端有限公司 Method for processing drawing message, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1956404A (en) * 2005-10-28 2007-05-02 国际商业机器公司 System and method for dynamically updating web pages using messaging-oriented middleware
CN101114936A (en) * 2007-09-06 2008-01-30 华为技术有限公司 Topological diagram display process, system and device
CN102916994A (en) * 2011-08-02 2013-02-06 华为技术有限公司 Page viewing method, server and terminal
CN103593396A (en) * 2013-10-08 2014-02-19 北京奇虎科技有限公司 Network resource extracting method and device based on browser

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8965864B2 (en) * 2006-10-31 2015-02-24 Sap Se Method and system for efficient execution and rendering of client/server interactive applications
CN101782912A (en) * 2009-06-23 2010-07-21 北京搜狗科技发展有限公司 Method and system for information prompt
CN102523177A (en) * 2011-12-19 2012-06-27 北京新媒传信科技有限公司 Method and system for realization of message push service
CN105095233A (en) * 2014-04-29 2015-11-25 广州市动景计算机科技有限公司 Local web image updating method, device and system
CN104462403B (en) * 2014-12-11 2018-03-02 华为技术有限公司 File truncation method and apparatus
CN106598659A (en) * 2016-12-08 2017-04-26 浪潮(苏州)金融技术服务有限公司 Data file construction method, method and device for updating application program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1956404A (en) * 2005-10-28 2007-05-02 国际商业机器公司 System and method for dynamically updating web pages using messaging-oriented middleware
CN101114936A (en) * 2007-09-06 2008-01-30 华为技术有限公司 Topological diagram display process, system and device
CN102916994A (en) * 2011-08-02 2013-02-06 华为技术有限公司 Page viewing method, server and terminal
CN103593396A (en) * 2013-10-08 2014-02-19 北京奇虎科技有限公司 Network resource extracting method and device based on browser

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111401819A (en) * 2020-04-08 2020-07-10 上海东普信息科技有限公司 Intersystem data pushing method and system
CN111401819B (en) * 2020-04-08 2023-07-11 上海东普信息科技有限公司 Intersystem data pushing method and system
CN111831954A (en) * 2020-07-20 2020-10-27 汉海信息技术(上海)有限公司 Content data updating method and device, computer equipment and storage medium
CN111831954B (en) * 2020-07-20 2023-11-03 汉海信息技术(上海)有限公司 Content data updating method, device, computer equipment and storage medium
CN114070563B (en) * 2020-07-31 2023-09-05 中移(苏州)软件技术有限公司 Data processing method, device, terminal and storage medium
CN114070563A (en) * 2020-07-31 2022-02-18 中移(苏州)软件技术有限公司 Data processing method, device, terminal and storage medium
CN111880955A (en) * 2020-08-04 2020-11-03 北京立通智联科技有限公司 Message processing method, device, terminal and medium for Internet of things equipment
CN113407528A (en) * 2020-11-20 2021-09-17 广东美云智数科技有限公司 Authority data synchronization method, management device and storage medium
CN112486473A (en) * 2020-11-30 2021-03-12 中国电子科技集团公司第二十八研究所 Kafka and Redis-based quasi-real-time target track display method
CN112596925A (en) * 2020-12-25 2021-04-02 中国农业银行股份有限公司 Transaction data transmission method and device
CN112596925B (en) * 2020-12-25 2024-02-23 中国农业银行股份有限公司 Transaction data transmission method and device
CN112887445B (en) * 2021-01-22 2023-04-07 北京金山云网络技术有限公司 Method and device for updating domain name information and domain name server
CN112887445A (en) * 2021-01-22 2021-06-01 北京金山云网络技术有限公司 Method and device for updating domain name information and domain name server
CN112925661A (en) * 2021-03-09 2021-06-08 广州虎牙科技有限公司 Message processing method and device, computer equipment and storage medium
CN112925661B (en) * 2021-03-09 2024-04-19 广州虎牙科技有限公司 Message processing method, device, computer equipment and storage medium
CN113179304B (en) * 2021-04-22 2022-10-28 平安消费金融有限公司 Message issuing method, system, device and storage medium
CN113179304A (en) * 2021-04-22 2021-07-27 平安消费金融有限公司 Message issuing method, system, device and storage medium
CN113221049A (en) * 2021-04-27 2021-08-06 北京奇艺世纪科技有限公司 Page updating method and device, electronic equipment and storage medium
CN113221049B (en) * 2021-04-27 2023-09-01 北京奇艺世纪科技有限公司 Page updating method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN108989429A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
WO2020015186A1 (en) Method and apparatus for real-time update of page data and electronic device
CN109189835B (en) Method and device for generating data wide table in real time
US8725793B2 (en) Architectural pattern for persistent web application design
US8260876B2 (en) System and method for reducing startup cost of a software application
US6910070B1 (en) Methods and systems for asynchronous notification of database events
KR101863981B1 (en) Using text messages to interact with spreadsheets
EP2874077B1 (en) Stateless database cache
WO2014134081A1 (en) Real-time communications using a restlike api
US8489694B2 (en) Peer-to-peer collaboration of publishers in a publish-subscription environment
US20220067024A1 (en) Facilitating performance of database operations using microservices
US20120224482A1 (en) Credit feedback system for parallel data flow control
CN112565342B (en) Message pushing method, device, equipment and storage medium based on weight calculation
WO2021073477A1 (en) Method and apparatus for supporting modification of consignee information
CN110764796A (en) Method and device for updating cache
CN113420043A (en) Data real-time monitoring method, device, equipment and storage medium
CN115455058A (en) Cache data processing method and device, computer equipment and storage medium
CN112883041B (en) Data updating method and device, electronic equipment and storage medium
CN107332703B (en) Method and device for checking multi-application logs
US8666954B2 (en) Reduced bandwidth cache coherency via checksum exchange
CN108932329B (en) Data query processing method and device
US9176645B1 (en) Manipulating collections of items in a user interface
US9306892B2 (en) Transaction message collector
AU2012327879A1 (en) Data interchange system
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
US8661454B2 (en) System and method for receiving and transmitting event information

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: 18926547

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: 18926547

Country of ref document: EP

Kind code of ref document: A1