CN110597909A - Method for keeping state consistency of client and multi-terminal equipment - Google Patents
Method for keeping state consistency of client and multi-terminal equipment Download PDFInfo
- Publication number
- CN110597909A CN110597909A CN201910862964.XA CN201910862964A CN110597909A CN 110597909 A CN110597909 A CN 110597909A CN 201910862964 A CN201910862964 A CN 201910862964A CN 110597909 A CN110597909 A CN 110597909A
- Authority
- CN
- China
- Prior art keywords
- terminal
- client
- state
- storage system
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
- G06F16/2386—Bulk updating operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The invention discloses a method for keeping the state consistency of a client and a multi-terminal device.A service program opens a UDP terminal monitoring port, monitors the heartbeat of a terminal 1 … terminal N, compares a list of N terminal state key values at the same moment with high-speed stored data in batches, updates high-speed storage according to the comparison result, changes offline to online and updates the recording state time on line; changing N terminal state key value pairs with the terminal states of less than (current time-M seconds) and online in high-speed storage into offline in batches at fixed time (M seconds), and updating the recorded state time; updating the storage system for the client to inquire the latest state, integrating the comparison/increment results and updating the storage system in batch; and a full-quantity synchronization prevention mechanism is used for synchronizing the memory data to the storage system at long intervals according to the number of the terminals, and is used as a synchronization prevention mechanism. The invention greatly reduces the consumption of CPU and bandwidth resources and reduces the pressure of the server.
Description
Technical Field
The invention relates to the technical field of internet, in particular to a method for keeping the state consistency of a client and multi-terminal equipment.
Background
With the rapid development of internet technology, users are more and more generally accessing the internet through terminals to handle various services. In order to provide better user experience and ensure the on-line stability of the terminal, the terminal state (on-line and off-line) needs to be monitored in real time, so that when the terminal state is found to be abnormal, relevant measures are taken in time to solve the problem.
Due to the continuous increase of the traffic, particularly the rapid development of new technologies such as cloud platforms and clusters, more and more systems require to access more and more terminals, and the existing conventional client terminal synchronization terminal state method (the terminal is updated and stored online, the terminal state which is not online after timed refresh overtime is offline, and the client terminal inquires and stores data) has the problems of wasting a large amount of CPU and bandwidth resources, poor timeliness and accuracy of state monitoring of multiple terminals (more than 500 terminals), and the like.
Disclosure of Invention
In view of the above, in order to solve the above problems in the prior art, the present invention provides a method for keeping states of a client and multiple terminal devices consistent.
The invention solves the problems through the following technical means:
a method for keeping the state consistency of a client and a multi-terminal device comprises the following steps:
s1, client real-time query: the client inquires a storage system as required and monitors the state of the terminal in real time;
s2, service program starting initialization: when a program is started, setting starting self-starting, acquiring an N terminal state key value pair comprising a device number, an online/offline state and recording state time from a storage system, and writing the N terminal state key value pair into high-speed storage;
s3, a synchronous processing mechanism:
s31, online processing terminal: the service program starts a UDP terminal monitoring port, monitors the heartbeat of a terminal 1 … terminal N, quickly accesses the server program at regular time through UDP, compares the N terminal state key value pair list at the same moment with the data stored at high speed in batch, updates the high-speed storage according to the comparison result, changes the storage on line off line, and updates the recording state time on line;
s32, processing terminal offline: changing N terminal state key value pairs with the terminal states of less than (current time-M seconds) and online in high-speed storage into offline in batches at fixed time (M seconds), and updating the recorded state time;
s33, updating the storage system for the client to inquire the latest state, integrating the comparison/increment results of S31 and S32 and updating the storage system in batch;
and S34, performing full synchronization, namely synchronizing the memory data to the storage system at long intervals according to the number of terminals to serve as a synchronous prevention mechanism.
Further, the client includes a WEB in BS mode and a WinForm in CS mode.
Further, the storage system includes databases of Mysql, SQL Server, Oracle, sqlilte, PostgreSql, mariidb, and Cloud databases of arrying Cloud, tenuous Cloud, Amazon Aws, Oracle Cloud, microsoft azure.
Further, high-speed memory refers to random access memory RAM, read only memory ROM, and the memory of CACHE.
Further, a service refers to code that can implement the idea of an algorithm.
Further, the terminal refers to all devices with a system capable of sending a UDP command, including a mobile phone, a computer, a notebook computer, and a single chip microcomputer.
Compared with the prior art, the invention has the beneficial effects that at least:
the invention greatly reduces the consumption of CPU and bandwidth resources, reduces the pressure of the server, and improves the timeliness and accuracy of monitoring the terminal state, and the more the terminal data in the scene is, the better the application effect is.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flow chart of a method for keeping the states of a client and a multi-terminal device consistent according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. It should be noted that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and all other embodiments obtained by those skilled in the art without any inventive work based on the embodiments of the present invention belong to the protection scope of the present invention.
Examples
The invention mainly comprises five parts, including client, storage system, high-speed storage (such as memory, etc.), service program, terminal (terminal 1 … terminal N). The client comprises WEB in a BS mode, WinForm in a CS mode and the like; the storage system comprises databases such as Mysql, SQL Server, Oracle, SqlLite, PostgreSQL, MariaDB and the like, and Cloud databases such as Array Cloud database, Tencent Cloud database, Amazon rows, Oracle Cloud, Microsoft Azure and the like, and other storage systems; high-speed storage refers primarily to the memory of Random Access Memory (RAM), read-only memory (ROM), and CACHE (CACHE); a service program, which refers to a code that can realize an algorithm idea; the terminal refers to all equipment with a system, such as a mobile phone, a computer, a notebook computer, a single chip microcomputer and the like, which can send a UDP instruction. The main flow of the system comprises three parts, namely client real-time query, service program start initialization and synchronous processing mechanism. The following describes the system operation flow. The terminal state of the invention mainly refers to the online state and the offline state of the terminal. As shown in fig. 1, wherein:
the object lifeline. Representing an object or component.
I activate. Appear on the lifeline, indicating that the participant performed some operation.
→ messages.
-return message.
A self-association message.
The invention discloses a method for keeping the state consistency of a client and a plurality of terminal devices, which comprises the following steps:
1. client real-time query
And the client inquires the storage system as required to monitor the state of the terminal in real time.
2. Service program start initialization
When the program is started, the startup self-starting is set, the N terminal state key value pairs (equipment numbers, online/offline states and recording state time) are obtained from the storage system and are written into the high-speed storage.
3. Synchronous processing mechanism
(1) The processing terminal is online. The service program starts a UDP terminal monitoring port, monitors the heartbeat of the terminal 1 … terminal N (the server program is accessed rapidly at fixed time through UDP), compares the N terminal state key value pair list at the same time with the data stored at high speed in batch, and updates the high-speed storage according to the comparison result (the off-line is changed into the on-line state, and the on-line is updated to record the state time).
(2) And (5) processing terminal offline. And (3) regularly (M seconds) changing the N terminal state key value pairs which are less than the current time-M seconds and have the terminal states online in the high-speed storage into offline in batch, and updating the recording state time.
(3) And updating the storage system for the client to inquire the latest state. Integrating the comparison/increment results of (1) and (2) and updating the storage system in batches.
(4) A preventive mechanism of full-scale synchronization. And (4) full synchronization, namely synchronizing the memory data to the storage system at long intervals according to the number of the terminals. As a preventive mechanism for synchronization.
The invention greatly reduces the consumption of CPU and bandwidth resources, reduces the pressure of the server, and improves the timeliness and accuracy of monitoring the terminal state, and the more the terminal data in the scene is, the better the application effect is.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (6)
1. A method for keeping the state consistency of a client and multi-terminal equipment is characterized by comprising the following steps:
s1, client real-time query: the client inquires a storage system as required and monitors the state of the terminal in real time;
s2, service program starting initialization: when a program is started, setting starting self-starting, acquiring an N terminal state key value pair comprising a device number, an online/offline state and recording state time from a storage system, and writing the N terminal state key value pair into high-speed storage;
s3, a synchronous processing mechanism:
s31, online processing terminal: the service program starts a UDP terminal monitoring port, monitors the heartbeat of a terminal 1 … terminal N, quickly accesses the server program at regular time through UDP, compares the N terminal state key value pair list at the same moment with the data stored at high speed in batch, updates the high-speed storage according to the comparison result, changes the storage on line off line, and updates the recording state time on line;
s32, processing terminal offline: changing N terminal state key value pairs with the terminal states of less than (current time-M seconds) and online in high-speed storage into offline in batches at fixed time (M seconds), and updating the recorded state time;
s33, updating the storage system for the client to inquire the latest state, integrating the comparison/increment results of S31 and S32 and updating the storage system in batch;
and S34, performing full synchronization, namely synchronizing the memory data to the storage system at long intervals according to the number of terminals to serve as a synchronous prevention mechanism.
2. The method for keeping the states of the client and the multi-terminal device consistent according to claim 1, wherein the client comprises a WEB in BS mode and a WinForm in CS mode.
3. The method of claim 1, wherein the storage system comprises databases of Mysql, SQL Server, Oracle, sqlilte, PostgreSql, mariidb, and cloud databases of airy cloud, Tencent cloud, Amazon rows, OracleCloud, Microsoft Azure.
4. The method for keeping client and multi-terminal device states consistent as claimed in claim 1, wherein the high-speed storage refers to RAM, ROM, and CACHE memory.
5. The method for keeping the states of the client and the multi-terminal device consistent according to claim 1, wherein the service program refers to a code capable of implementing an algorithm idea.
6. The method for keeping the states of the client and the multi-terminal device consistent as claimed in claim 1, wherein the terminal refers to any device with a system capable of sending UDP commands, including a mobile phone, a computer, a notebook, and a single chip.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910862964.XA CN110597909B (en) | 2019-09-12 | 2019-09-12 | Method for keeping state consistency of client and multi-terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910862964.XA CN110597909B (en) | 2019-09-12 | 2019-09-12 | Method for keeping state consistency of client and multi-terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110597909A true CN110597909A (en) | 2019-12-20 |
CN110597909B CN110597909B (en) | 2023-03-14 |
Family
ID=68859241
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910862964.XA Active CN110597909B (en) | 2019-09-12 | 2019-09-12 | Method for keeping state consistency of client and multi-terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110597909B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414392A (en) * | 2020-03-25 | 2020-07-14 | 浩鲸云计算科技股份有限公司 | Cache asynchronous refresh method, system and computer readable storage medium |
Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090031096A1 (en) * | 2007-07-23 | 2009-01-29 | Randall Smith | Storage system and method for recovering from a system failure |
CN103067194A (en) * | 2011-10-24 | 2013-04-24 | 中兴通讯股份有限公司 | Monitoring method and monitoring system for terminal online state |
CN103974032A (en) * | 2013-02-04 | 2014-08-06 | 祝怀月 | Monitoring and management system of security equipment |
CN105025063A (en) * | 2014-04-29 | 2015-11-04 | 刘广威 | Online data transmission method for large-scale terminal equipment |
CN105677849A (en) * | 2016-01-06 | 2016-06-15 | 北京京东尚科信息技术有限公司 | Data updating method and device |
CN106453648A (en) * | 2016-11-29 | 2017-02-22 | 海信集团有限公司 | Device state determining method and device of smart home devices |
CN106603706A (en) * | 2016-12-29 | 2017-04-26 | Tcl集团股份有限公司 | Synchronization method and synchronization system of controlled equipment state information, and mobile terminal |
CN107046552A (en) * | 2016-02-05 | 2017-08-15 | 华为技术有限公司 | Data synchronization unit, method and distributed memory system based on heartbeat |
CN107770011A (en) * | 2017-09-30 | 2018-03-06 | 四川长虹电器股份有限公司 | App controls the implementation method and state synchronization method of multiple equipment |
CN107798015A (en) * | 2016-09-06 | 2018-03-13 | 盛趣信息技术(上海)有限公司 | Game services end offline operation method |
CN108093067A (en) * | 2017-12-25 | 2018-05-29 | 惠州Tcl家电集团有限公司 | Information-pushing method, Cloud Server and computer storage media based on Internet of Things |
CN108334505A (en) * | 2017-01-19 | 2018-07-27 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device, server and inventory system |
CN109005528A (en) * | 2018-07-06 | 2018-12-14 | 杭州涂鸦信息技术有限公司 | A kind of bluetooth mesh gateway data polymerization report method |
CN109639756A (en) * | 2018-10-31 | 2019-04-16 | 广东电网有限责任公司信息中心 | A kind of terminal network incidence relation is shown and equipment accesses real-time monitoring system |
US20190132135A1 (en) * | 2017-10-30 | 2019-05-02 | DuploCloud, LLC | Systems and methods for secure access to native cloud services to computers outside the cloud |
CN109905286A (en) * | 2017-12-11 | 2019-06-18 | 北京京东尚科信息技术有限公司 | A kind of method and system of monitoring device operating status |
CN110149218A (en) * | 2019-04-04 | 2019-08-20 | 视联动力信息技术股份有限公司 | A kind for the treatment of method and apparatus of warning information |
-
2019
- 2019-09-12 CN CN201910862964.XA patent/CN110597909B/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090031096A1 (en) * | 2007-07-23 | 2009-01-29 | Randall Smith | Storage system and method for recovering from a system failure |
CN103067194A (en) * | 2011-10-24 | 2013-04-24 | 中兴通讯股份有限公司 | Monitoring method and monitoring system for terminal online state |
CN103974032A (en) * | 2013-02-04 | 2014-08-06 | 祝怀月 | Monitoring and management system of security equipment |
CN105025063A (en) * | 2014-04-29 | 2015-11-04 | 刘广威 | Online data transmission method for large-scale terminal equipment |
CN105677849A (en) * | 2016-01-06 | 2016-06-15 | 北京京东尚科信息技术有限公司 | Data updating method and device |
CN107046552A (en) * | 2016-02-05 | 2017-08-15 | 华为技术有限公司 | Data synchronization unit, method and distributed memory system based on heartbeat |
CN107798015A (en) * | 2016-09-06 | 2018-03-13 | 盛趣信息技术(上海)有限公司 | Game services end offline operation method |
CN106453648A (en) * | 2016-11-29 | 2017-02-22 | 海信集团有限公司 | Device state determining method and device of smart home devices |
CN106603706A (en) * | 2016-12-29 | 2017-04-26 | Tcl集团股份有限公司 | Synchronization method and synchronization system of controlled equipment state information, and mobile terminal |
CN108334505A (en) * | 2017-01-19 | 2018-07-27 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device, server and inventory system |
CN107770011A (en) * | 2017-09-30 | 2018-03-06 | 四川长虹电器股份有限公司 | App controls the implementation method and state synchronization method of multiple equipment |
US20190132135A1 (en) * | 2017-10-30 | 2019-05-02 | DuploCloud, LLC | Systems and methods for secure access to native cloud services to computers outside the cloud |
CN109905286A (en) * | 2017-12-11 | 2019-06-18 | 北京京东尚科信息技术有限公司 | A kind of method and system of monitoring device operating status |
CN108093067A (en) * | 2017-12-25 | 2018-05-29 | 惠州Tcl家电集团有限公司 | Information-pushing method, Cloud Server and computer storage media based on Internet of Things |
CN109005528A (en) * | 2018-07-06 | 2018-12-14 | 杭州涂鸦信息技术有限公司 | A kind of bluetooth mesh gateway data polymerization report method |
CN109639756A (en) * | 2018-10-31 | 2019-04-16 | 广东电网有限责任公司信息中心 | A kind of terminal network incidence relation is shown and equipment accesses real-time monitoring system |
CN110149218A (en) * | 2019-04-04 | 2019-08-20 | 视联动力信息技术股份有限公司 | A kind for the treatment of method and apparatus of warning information |
Non-Patent Citations (3)
Title |
---|
MINHO JU 等: "Energy-efficient batch scheduling for background network services in mobile devices", 《INTERNATIONAL CONFERENCE ON CONSUMER ELECTRONICS》 * |
姚捷灵: "云化平台业务连续性保障方案", 《电信技术》 * |
林智劼: "基于DAAS模式的物联网网关的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414392A (en) * | 2020-03-25 | 2020-07-14 | 浩鲸云计算科技股份有限公司 | Cache asynchronous refresh method, system and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110597909B (en) | 2023-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103326958B (en) | Monitoring data caching method and system | |
CN108390933B (en) | Message distribution method, device, server and storage medium | |
CN113285884B (en) | Flow control method and system | |
CN112422610B (en) | Intelligent gateway method and system based on distributed object storage | |
CN110597909B (en) | Method for keeping state consistency of client and multi-terminal equipment | |
CN112463254A (en) | Method, device and equipment for acquiring webpage loading time and storage medium | |
CN115934414A (en) | Data backup method, data recovery method, device, equipment and storage medium | |
CN112838980B (en) | Message processing method, system, device, electronic equipment and storage medium | |
CN111221700A (en) | Cluster node state monitoring method, device, equipment and readable storage medium | |
CN107277624B (en) | Duration calculation method and device | |
CN111092774A (en) | Configuration method and equipment of acquisition gateway | |
CN113467718B (en) | Data processing method and device, electronic equipment and storage medium | |
KR20180011183A (en) | How to Remove Message Notifications, Systems, and Servers | |
CN113553074B (en) | Applet distribution control method, device, electronic equipment and storage medium | |
CN111714899A (en) | Real-time game fighting system and method | |
CN104767880A (en) | Communication number management method | |
CN114201462A (en) | Method and device for synchronizing table data, computer equipment and storage medium | |
CN114143590A (en) | Video playing method, server and storage medium | |
CN113901374A (en) | Webpage refreshing method and device, electronic equipment and storage medium | |
CN113904940A (en) | Resource adjusting method and device, electronic equipment and computer readable storage medium | |
CN112351072B (en) | Message pushing method and terminal | |
CN107809743A (en) | A kind of information synchronization method, terminal device and computer-readable recording medium | |
CN117635195A (en) | User matching method and device, electronic equipment and storage medium | |
CN110457392B (en) | Copy reading and writing method and device | |
CN115297076B (en) | Offline message pulling method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |