CN114385674A - Platform message tracking method, system, device and storage medium - Google Patents
Platform message tracking method, system, device and storage medium Download PDFInfo
- Publication number
- CN114385674A CN114385674A CN202111649407.3A CN202111649407A CN114385674A CN 114385674 A CN114385674 A CN 114385674A CN 202111649407 A CN202111649407 A CN 202111649407A CN 114385674 A CN114385674 A CN 114385674A
- Authority
- CN
- China
- Prior art keywords
- message
- equipment
- message tracking
- tracking
- task
- 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.)
- Pending
Links
Images
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/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
-
- 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/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- 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
- G06F16/273—Asynchronous replication or reconciliation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Computing Systems (AREA)
- Information Transfer Between Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a platform message tracking method, a system, a device and a storage medium. According to a preset task creating strategy, creating a message tracking task of equipment in a ZNOde node form of a zookeeper, and writing a preset equipment identifier of the equipment into the ZNOde node; at a service node, inquiring whether a ZNOde node of current equipment exists in a zookeeper according to a preset equipment identifier, and judging whether message tracking is needed; if the message tracking is needed, writing the processing log message at the service node into a cache queue; and reading the log message from the cache queue and writing the log message into a database. The system comprises a message tracking task management module, a message tracking module, a message caching module and a message record persistence module. The method can track the uplink and downlink messages of the terminal equipment, is beneficial to improving the development efficiency, and is beneficial to improving the development performance through asynchronous processing of the messages. The method and the device can be widely applied to the technical field of the Internet of things.
Description
Technical Field
The present application relates to the field of internet of things technology, and in particular, to a method, system, device, and storage medium for platform message tracking.
Background
The PaaS platform of the Internet of things can be used for data flow of reported messages and issued instructions between a terminal and an application, however, the PaaS platform of the Internet of things is a black box for a terminal and an application developer, and the flow process of data among service modules of the PaaS platform of the Internet of things is invisible, so that the difficulty of analyzing and positioning problems of a third party developer is increased, and the development efficiency is low.
Disclosure of Invention
The present application aims to solve at least to some extent one of the technical problems existing in the prior art.
Therefore, an object of the embodiments of the present application is to provide a method for tracking a platform message, where the method is capable of tracking an uplink message and a downlink message of a terminal device, and is beneficial to improving development efficiency, and is beneficial to improving development performance through asynchronous processing of messages.
It is another object of embodiments of the present application to provide a platform message tracking system.
In order to achieve the technical purpose, the technical scheme adopted by the embodiment of the application comprises the following steps:
in one aspect, an embodiment of the present application provides a platform message tracking method, including the following steps:
according to the platform message tracking method, according to a preset task creation strategy, a message tracking task of equipment is created in a zookeeper ZNODE mode, and a preset equipment identification of the equipment is written into the ZNODE node; at a service node, inquiring whether a ZNode node of the current equipment exists in the zookeeper according to the preset equipment identification, and judging whether message tracking is needed; if message tracking is needed, processing log messages at the service node are written into a cache queue; and reading the processing log message from the cache queue and writing the processing log message into a database. The method can track the uplink and downlink messages of the terminal equipment, is favorable for improving the development efficiency, and is favorable for improving the development performance through asynchronous processing of the messages.
In addition, the platform message tracking method according to the above embodiment of the present application may further have the following additional technical features:
further, in the platform message tracking method according to the embodiment of the present application, the preset task creation policy includes: if the equipment has the message tracking task, the message tracking task of the equipment cannot be established; or if the number of the message tracking tasks is larger than a preset task number threshold, the message tracking tasks of the equipment cannot be created.
Further, in an embodiment of the present application, the method further includes: and if the message tracking task of the equipment stops, deleting the ZNOde node of the equipment.
Further, in an embodiment of the present application, the message tracking task of the device determines whether to stop by the following steps: if the tracking state identifier of the equipment is a preset state identifier, determining to stop a message tracking task of the equipment; or if a message tracking stopping instruction of the user is received, determining to stop the message tracking task of the equipment.
Further, in an embodiment of the present application, the method further includes: and if the service node is abnormal, determining that the tracking state identifier of the current equipment is an abnormal state identifier, and interrupting the service flow.
Further, in an embodiment of the present application, the reading the processing log message from the cache queue and writing the processing log message into a database includes: reading the processing log message from the cache queue, and writing the processing log message into a database in a relational data mode; or, the processing log message is read from the cache queue and written into a database in a key value data mode.
Further, in an embodiment of the present application, the method further includes: acquiring accumulated time length; and if the accumulated time length is equal to the preset time length, deleting the data with the time length greater than or equal to the preset storage time length in the database, and recalculating the accumulated time length.
On the other hand, an embodiment of the present application provides a platform message tracking system, including:
the message tracking task management module is used for creating a message tracking task of the equipment in a ZNOde node form of a zookeeper according to a preset task creation strategy and writing a preset equipment identifier of the equipment into the ZNOde node; the message tracking module is used for inquiring whether a ZNode node of the current equipment exists in the zookeeper or not according to the preset equipment identification at the service node and judging whether message tracking is needed or not; the message cache module is used for writing the processing log message at the service node into a cache queue when message tracking is needed; and the message record persistence module is used for reading the processing log message from the cache queue and writing the processing log message into a database.
In another aspect, an embodiment of the present application provides a platform message tracking apparatus, including:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, the at least one program causes the at least one processor to implement any of the platform message tracking methods described above.
In another aspect, the present embodiment provides a storage medium, in which a program executable by a processor is stored, and when the program executable by the processor is executed by the processor, the program is used to implement any one of the above platform message tracking methods.
According to the platform message tracking method in the embodiment of the application, according to a preset task creation strategy, a message tracking task of equipment is created in a ZNOde node form of a zookeeper, and a preset equipment identifier of the equipment is written into the ZNOde node; at a service node, inquiring whether a ZNode node of the current equipment exists in the zookeeper according to the preset equipment identification, and judging whether message tracking is needed; if message tracking is needed, processing log messages at the service node are written into a cache queue; and reading the processing log message from the cache queue and writing the processing log message into a database. The method can track the uplink and downlink messages of the terminal equipment, is favorable for improving the development efficiency, and is favorable for improving the development performance through asynchronous processing of the messages.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description is made on the drawings of the embodiments of the present application or the related technical solutions in the prior art, and it should be understood that the drawings in the following description are only for convenience and clarity of describing some embodiments in the technical solutions of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a specific embodiment of a platform message tracking method according to the present application;
fig. 2 is a schematic diagram of a reported message tracking process in the platform message tracking method proposed in the present application;
fig. 3 is a schematic flowchart illustrating a process of creating a message tracking task in the platform message tracking method according to the present application;
fig. 4 is a schematic flowchart of exception handling in the platform message tracking method proposed in the present application;
fig. 5 is a schematic flowchart of persistence of a tracking message in the platform message tracking method proposed in the present application;
fig. 6 is a schematic structural diagram of a specific embodiment of a platform message tracking system according to the present application;
fig. 7 is a schematic structural diagram of a specific embodiment of a platform message tracking apparatus according to the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application. The step numbers in the following embodiments are provided only for convenience of illustration, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
The PaaS platform of the Internet of things, the south docking terminal equipment and the north docking SaaS application bear data flow of reporting messages and issuing instructions between the terminals and the application. The PaaS platform of the Internet of things is a black box for terminals and application developers, and the process that data flow among service modules of the PaaS platform of the Internet of things is invisible. The platform of the internet of things reduces coupling between a terminal and an application, and meanwhile, when a third-party developer user is in butt joint with the PaaS platform of the internet of things, certain difficulties exist in analyzing and positioning problems.
The message tracking technology can realize unpacking of a data processing service flow of the Internet of things equipment in the PaaS platform of the Internet of things, record and present service flows of the equipment and the platform in a specified time period, facilitate positioning of a developer, check of interactive records of the platform, a terminal and application and improve development efficiency.
The principle of message tracking is that a probe is inserted into a key node of a service module of an internet of things platform, and service states or data snapshots and the like are recorded when data pass through the service nodes. When the platform of the internet of things is a single application, all the service modules are in the same application program, and the issuing of the message tracking task and the reporting and storing of the node data can be completed in one application through function calling.
The service scene of the high-performance Internet of things PaaS platform requires that the platform supports millions of concurrent devices and tens of millions of devices are online. Therefore, the internet of things platform mostly adopts a micro-service architecture to perform multi-node distributed deployment so as to ensure the availability and stability of services. In the micro-service architecture, the main modules are dispersed in a plurality of micro-service applications, each micro-service containing a plurality of instances. In the related art, the distributed message log recording method focuses on the application system as the main object, the focused services are the system operation log and the session log, and the realized functions include: 1. and collecting logs of the distributed system, wherein the logs generated by the distributed deployed application service are collected to a uniform storage space. 2. And the logs of a plurality of sequential service nodes of the session are tracked in a chained manner, and the preorder node sends a tracking service number and service content to a postorder node to record the logs in sequence. In summary, it is a concern to ensure that the terminal message can be tracked and recorded across application, distributed, and multi-service modules. Meanwhile, the tracking of all messages of the stock terminals on the platform needs to consume mass storage resources and slow down the system performance, so that a tracking strategy needs to be reasonably set, and the cost is reduced.
In view of this, embodiments of the present application provide a method and a system for tracking a platform message, and first, the method for tracking a platform message provided in an embodiment of the present application will be described with reference to the accompanying drawings.
Referring to fig. 1, a platform message tracking method is provided in this embodiment of the present application, and the platform message tracking method in this embodiment of the present application may be applied to a terminal, may also be applied to a server, and may also be software running in the terminal or the server. The terminal may be, but is not limited to, a tablet computer, a notebook computer, a desktop computer, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform. The platform message tracking method in the embodiment of the application mainly comprises the following steps:
s101: according to a preset task creating strategy, creating a message tracking task of equipment in a ZNOde node form of a zookeeper, and writing a preset equipment identifier of the equipment into the ZNOde node;
in the step, according to a preset task creating strategy, a message tracking task of the equipment is created in a ZNOde node form of the zookeeper, and a preset equipment identifier of the equipment is written into the ZNOde node. The zookeeper is a distributed service framework and is mainly used for solving some data management problems frequently encountered in distributed application. According to the method and the device, the message tracking task of the device is established in a zookeeper node mode, real-time message tracking task state information can be shared among all micro services deployed in a distributed mode, distributed consistency can be provided, consistency of the message tracking task state is guaranteed, and a multi-instance deployment mode under a micro service framework can be supported. Specifically, each message tracing task requires one ZNode node registered as a zookeeper. In some possible embodiments, when a message tracking task is created, the task ID, the device ID, the task status (tracking/stopping), the start time, and the scheduled end time are stored in the database, and the preset device identifier is written into the new zookeeper device node. The preset device identifier is used for representing the identifier of the terminal device, so that the preset device identifier has uniqueness and can be used for distinguishing different terminal devices. Optionally, for the above parameters, the preset device identifier may be a task ID, a device ID, or other identifiers that can distinguish the terminal devices. The preset task creating strategy is used for representing some condition limits which need to be considered when the message tracking task is created, and the preset task creating strategy can be used for limiting the type of the message tracking task, the creating time of the message tracking task and the task amount of a system when the message tracking task is created. The specific content of the preset device identifier and the preset task creation policy is not limited in the present application. In some possible embodiments, the above process may be: and the zookeeper client calls a currator Framework to create a permanent node ZNeode, and the path value is the equipment ID spliced by the message tracing path prefix (/ tracker/device /). And insert a message tracking task record in the database, each task can only be started once.
S102: at a service node, inquiring whether a ZNode node of the current equipment exists in the zookeeper according to the preset equipment identification, and judging whether message tracking is needed;
in this step, in the service processing process, after the message tracking point of the service node is triggered at the service node, whether the ZNode node of the current device exists in the zookeeper is queried according to the preset device identifier, and if the ZNode node of the current device exists in the zookeeper, it is determined that the terminal device needs to perform message tracking. That is, if there is a tracking task of the device, the data processing log of the node needs to be reported. In some possible embodiments, referring to the process shown in fig. 2, different service nodes in a data processing flow need to use a message tracker to perform message tracking in a code, and after data processing of a current service node is completed, a message tracking task checking and tracking record reporting function of the message tracker is triggered, that is, whether a ZNode node of a current device exists in a zookeeper is queried, and whether data generated by the node is transmitted to a subsequent process is judged. Specifically, according to an incoming device ID, the device ID and a prefix of a message tracking path are spliced to form a complete path, and a zookeeper client calls an interface of a Curator frame to check whether a given complete path exists, so as to determine whether message tracking is required.
S103: if message tracking is needed, processing log messages at the service node are written into a cache queue;
in this step, if message tracking is required, the processing log message at the service node is written into a cache queue. Specifically, the data is written into the message buffer queue by using the specified topic, and reporting the content may include: task ID, equipment ID, processed message body, service node name, service status code and timestamp. And message tracking records from all service modules of the distributed nodes are gathered in a message cache queue. The data logs of the terminal equipment needing to be tracked are reported to the message cache queue through the log burying points in the service, so that the decoupling of the service and the memory is realized, the asynchronous processing of log data persistence is realized, and the performance bottleneck brought by a large amount of concurrent I/O is relieved.
S104: and reading the processing log message from the cache queue and writing the processing log message into a database.
In this step, the log message is consumed and processed from the message queue and stored in the database for the web service to inquire and display. In some possible embodiments, the process is: the log message tracking record in the message cache queue is consumed by the message data memory, the log message record is consumed under topic specified by the message queue, the task ID, the equipment ID, the message body, the service node information and the like are analyzed according to the service model, and the message record is written into the database by the data memory, so that the persistence of the message tracking record is realized.
Optionally, in this embodiment of the present application, the preset task creation policy includes:
if the equipment has the message tracking task, the message tracking task of the equipment cannot be established;
or if the number of the message tracking tasks is larger than a preset task number threshold, the message tracking tasks of the equipment cannot be created.
In this step, the preset task creation policy may be to limit each terminal device to have only one message tracking task, or may be to limit the message tracking task data in the system within a reasonable range. If the above limit is exceeded, the message tracing task cannot be created. In some possible embodiments, referring to fig. 3, the process is: the user of the terminal equipment starts the message tracking task, and needs to check whether the equipment already has the message tracking task in progress or not, and set a message tracking task manager to finish the check work. Specifically, if present, no new task can be created. It is also necessary to check the current user's maximum number of message tracking tasks and refuse to add new tasks if the maximum number limit specified by the system is exceeded. And if the preset task creating strategies are met, starting the message tracking task, and creating in a zookeeper ZNOde mode. Those skilled in the art can understand that the preset task creation policies described above belong to an exemplary example, and in an actual use process, one of the preset task creation policies may be selected as the preset creation policy, two of the preset task creation policies may be selected as the preset creation policy, and other measurements may be selected as the preset task creation policy according to actual requirements. The application does not limit the specific content and the specific number of the preset task creation strategies.
Optionally, in an embodiment of the present application, the method further includes: and if the message tracking task of the equipment stops, deleting the ZNOde node of the equipment.
In this step, after the message tracking task of the current device is stopped, the node of the current device is deleted, which is beneficial to avoiding unnecessary message tracking on the terminal device and saving system resources.
Optionally, in this embodiment of the present application, the message tracking task of the device determines whether to stop by the following steps:
if the tracking state identifier of the equipment is a preset state identifier, determining to stop a message tracking task of the equipment;
or if a message tracking stopping instruction of the user is received, determining to stop the message tracking task of the equipment.
In this step, whether to stop the message tracking task of the current device is determined by checking the tracking state identifier of the current device. Specifically, the preset state identifies a state of a message tracking task for characterizing the current device, and may be stop, creation, or the like. The preset state identifier may represent a specific state by a number, for example, 1 represents start, and 0 represents stop; the state of the diagram can also be characterized by characters, illustratively start for start and stop for stop. In some possible embodiments, for the message tracking task which needs to be scheduled to stop, the method of the preset state identifier is selected to stop the message tracking task. Illustratively, the timer checks whether the message tracking task comparing the tracking state in the database expires at regular intervals (illustratively, set to 5 minutes), and for the expired (illustratively, it may be set to: creation time start + duration < (current time now)), the tracking state identifier of the corresponding terminal device is marked as the preset state identifier. The present application does not limit the representation and meaning of the specific preset state identifier.
Meanwhile, the stopping of the message tracking task can also be performed under the condition that the user has a need, namely, the message tracking task is manually stopped. Specifically, the user manually operates on the web page, the back end stops the message tracking task, the task state in the database is updated to stop, the zookeeper node of the device ID is deleted, and the message tracking task is ended.
Optionally, in an embodiment of the present application, the method further includes: and if the service node is abnormal, determining that the tracking state identifier of the current equipment is an abnormal state identifier, and interrupting the service flow.
In this step, if the captured service node is abnormal, it is determined that the tracking status identifier of the current device is an abnormal status identifier, and the system performs fault location and fault analysis under abnormal conditions according to the abnormal status identifier, and simultaneously interrupts the service flow. Meanwhile, if the exception is not captured, the data flow is interrupted at the node, and the exception is captured by the system. The specific process is shown in fig. 4. By setting the abnormal state identifier, a developer can quickly locate and troubleshoot problems which may occur in the process that the terminal is connected with the PaaS platform of the Internet of things by inquiring the message tracking record.
Optionally, in this embodiment of the present application, the reading the processing log message from the cache queue and writing the processing log message into a database includes:
reading the processing log message from the cache queue, and writing the processing log message into a database in a relational data mode;
or, the processing log message is read from the cache queue and written into a database in a key value data mode.
In this step, the processed log message is written into the database, and different modes can be selected for writing according to the characteristics of different data. In particular, as shown in fig. 5, the underlying database may be selected from a relational database (MySQL) or a NoSQL type database (HBase). According to the characteristics of the relational data and the key value data, different main keys and different query conditions are used respectively. The relational data should use the autonomic key, message tracking task ID and device ID as indexes. Key-value databases such as HBase should be stitched as keys using device ID-message task ID-timestamp. Meanwhile, when MySQL is used for storage, a timer needs to be implemented to regularly clear expired data in order to control the overall scale of data. When HBase storage is used, TTL can be directly set when a table is created, and expired data can be automatically cleaned.
Optionally, in an embodiment of the present application, the method further includes:
acquiring accumulated time length;
and if the accumulated time length is equal to the preset time length, deleting the data with the time length greater than or equal to the preset storage time length in the database, and recalculating the accumulated time length.
In this step, the timer processes the expired data, and a large amount of log data records are generated for device message tracking, which occupies a large amount of storage space and needs to periodically clean the outdated data. In some possible embodiments, the specific value of the preset storage time period may be set according to the capacity of the database, the busy degree of the system, or the requirement of the customer. The timing task regularly clears the message tracking records in the database according to the set data storage duration, so that the storage space is saved.
Optionally, the user may also use the message tracking task ID, the device ID, and the service node to query the message tracking record on the Web page, and display the data on the Web page. And checking the message tracking record of the corresponding equipment according to the ongoing task in the message tracking task list.
According to the description, the platform message tracking method provided by the application can track the uplink and downlink messages of the terminal equipment, is favorable for improving the development efficiency, and is favorable for improving the development performance through asynchronous processing of the messages.
Next, a platform message tracking system proposed according to an embodiment of the present application is described with reference to the accompanying drawings.
Fig. 6 is a structural diagram of a platform message tracking system according to an embodiment of the present application. The system specifically comprises:
the message tracking task management module 610 is configured to create a message tracking task of an apparatus in a form of a ZNode node of a zookeeper according to a preset task creation policy, and write a preset apparatus identifier of the apparatus into the ZNode node;
the message tracking module 620 is configured to query, at a service node, whether a ZNode node of the current device exists in the zookeeper according to the preset device identifier, and determine whether message tracking is required;
a message buffer module 630, configured to write the processing log message at the service node into a buffer queue when message tracking is required;
and the message record persistence module 640 is configured to read the processing log message from the cache queue and write the processing log message into a database.
It can be seen that the contents in the foregoing method embodiments are all applicable to this system embodiment, the functions specifically implemented by this system embodiment are the same as those in the foregoing method embodiment, and the advantageous effects achieved by this system embodiment are also the same as those achieved by the foregoing method embodiment.
Referring to fig. 7, an embodiment of the present application provides a platform message tracking apparatus, including:
at least one processor 710;
at least one memory 720 for storing at least one program;
the at least one program, when executed by the at least one processor 710, causes the at least one processor 710 to implement the platform message tracking method.
Similarly, the contents of the method embodiments are all applicable to the apparatus embodiments, the functions specifically implemented by the apparatus embodiments are the same as the method embodiments, and the beneficial effects achieved by the apparatus embodiments are also the same as the beneficial effects achieved by the method embodiments.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flowcharts of the present application are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in separate physical devices or software modules. It will also be appreciated that a detailed discussion regarding the actual implementation of each module is not necessary for an understanding of the present application. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the present application as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the application, which is defined by the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium, which includes programs for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable programs that can be considered for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with a program execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the programs from the program execution system, apparatus, or device and execute the programs. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the program execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable program execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the foregoing description of the specification, reference to the description of "one embodiment/example," "another embodiment/example," or "certain embodiments/examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: numerous changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.
While the present application has been described with reference to the preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (10)
1. A platform message tracking method is characterized by comprising the following steps:
according to a preset task creating strategy, creating a message tracking task of equipment in a ZNOde node form of a zookeeper, and writing a preset equipment identifier of the equipment into the ZNOde node;
at a service node, inquiring whether a ZNode node of the current equipment exists in the zookeeper according to the preset equipment identification, and judging whether message tracking is needed;
if message tracking is needed, processing log messages at the service node are written into a cache queue;
and reading the processing log message from the cache queue and writing the processing log message into a database.
2. The platform message tracking method of claim 1, wherein the preset task creation policy comprises:
if the equipment has the message tracking task, the message tracking task of the equipment cannot be established;
or if the number of the message tracking tasks is larger than a preset task number threshold, the message tracking tasks of the equipment cannot be created.
3. The platform message tracking method of claim 1, wherein the method further comprises:
and if the message tracking task of the equipment stops, deleting the ZNOde node of the equipment.
4. The platform message tracking method according to claim 3, wherein the message tracking task of the device determines whether to stop by:
if the tracking state identifier of the equipment is a preset state identifier, determining to stop a message tracking task of the equipment;
or if a message tracking stopping instruction of the user is received, determining to stop the message tracking task of the equipment.
5. The platform message tracking method of claim 1, wherein the method further comprises:
and if the service node is abnormal, determining that the tracking state identifier of the current equipment is an abnormal state identifier, and interrupting the service flow.
6. The platform message tracking method according to claim 1, wherein the reading the processing log message from the cache queue and writing the processing log message into a database comprises:
reading the processing log message from the cache queue, and writing the processing log message into a database in a relational data mode;
or, the processing log message is read from the cache queue and written into a database in a key value data mode.
7. The platform message tracking method of claim 1, wherein the method further comprises:
acquiring accumulated time length;
and if the accumulated time length is equal to the preset time length, deleting the data with the time length greater than or equal to the preset storage time length in the database, and recalculating the accumulated time length.
8. A platform message tracking system, comprising:
the message tracking task management module is used for creating a message tracking task of the equipment in a ZNOde node form of a zookeeper according to a preset task creation strategy and writing a preset equipment identifier of the equipment into the ZNOde node;
the message tracking module is used for inquiring whether a ZNode node of the current equipment exists in the zookeeper or not according to the preset equipment identification at the service node and judging whether message tracking is needed or not;
the message cache module is used for writing the processing log message at the service node into a cache queue when message tracking is needed;
and the message record persistence module is used for reading the processing log message from the cache queue and writing the processing log message into a database.
9. A platform message tracking apparatus, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the platform message tracing method of any one of claims 1-7.
10. A computer-readable storage medium in which a program executable by a processor is stored, characterized in that: the processor executable program when executed by a processor is for implementing the platform message tracking method of any one of claims 1-7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111649407.3A CN114385674A (en) | 2021-12-30 | 2021-12-30 | Platform message tracking method, system, device and storage medium |
PCT/CN2022/142863 WO2023125672A1 (en) | 2021-12-30 | 2022-12-28 | Platform message tracking method, system and apparatus, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111649407.3A CN114385674A (en) | 2021-12-30 | 2021-12-30 | Platform message tracking method, system, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114385674A true CN114385674A (en) | 2022-04-22 |
Family
ID=81200831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111649407.3A Pending CN114385674A (en) | 2021-12-30 | 2021-12-30 | Platform message tracking method, system, device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114385674A (en) |
WO (1) | WO2023125672A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115550305A (en) * | 2022-09-28 | 2022-12-30 | 深圳市凯迪仕智能科技股份有限公司 | Equipment control method and related device |
WO2023125672A1 (en) * | 2021-12-30 | 2023-07-06 | 天翼物联科技有限公司 | Platform message tracking method, system and apparatus, and storage medium |
CN117891628A (en) * | 2024-03-15 | 2024-04-16 | 山东乾云启创信息科技股份有限公司 | Cloud management platform long-time task execution result tracking method and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6083281A (en) * | 1997-11-14 | 2000-07-04 | Nortel Networks Corporation | Process and apparatus for tracing software entities in a distributed system |
CN105224445B (en) * | 2015-10-28 | 2017-02-15 | 北京汇商融通信息技术有限公司 | Distributed tracking system |
CN109600375B (en) * | 2018-12-13 | 2021-07-16 | 锐捷网络股份有限公司 | Message tracking method and device, electronic equipment and storage medium |
CN112910945B (en) * | 2020-12-08 | 2023-06-30 | 江苏苏宁云计算有限公司 | Request link tracking method and service request processing method |
CN114385674A (en) * | 2021-12-30 | 2022-04-22 | 天翼物联科技有限公司 | Platform message tracking method, system, device and storage medium |
-
2021
- 2021-12-30 CN CN202111649407.3A patent/CN114385674A/en active Pending
-
2022
- 2022-12-28 WO PCT/CN2022/142863 patent/WO2023125672A1/en unknown
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023125672A1 (en) * | 2021-12-30 | 2023-07-06 | 天翼物联科技有限公司 | Platform message tracking method, system and apparatus, and storage medium |
CN115550305A (en) * | 2022-09-28 | 2022-12-30 | 深圳市凯迪仕智能科技股份有限公司 | Equipment control method and related device |
CN115550305B (en) * | 2022-09-28 | 2024-03-01 | 深圳市凯迪仕智能科技股份有限公司 | Equipment control method and related device |
CN117891628A (en) * | 2024-03-15 | 2024-04-16 | 山东乾云启创信息科技股份有限公司 | Cloud management platform long-time task execution result tracking method and system |
CN117891628B (en) * | 2024-03-15 | 2024-05-28 | 山东乾云启创信息科技股份有限公司 | Cloud management platform long-time task execution result tracking method and system |
Also Published As
Publication number | Publication date |
---|---|
WO2023125672A1 (en) | 2023-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114385674A (en) | Platform message tracking method, system, device and storage medium | |
US7698602B2 (en) | Systems, methods and computer products for trace capability per work unit | |
WO2019134226A1 (en) | Log collection method, device, terminal apparatus, and storage medium | |
CN109308170B (en) | Data processing method and device | |
CN108228322B (en) | Distributed link tracking and analyzing method, server and global scheduler | |
US9910881B1 (en) | Maintaining versions of control plane data for a network-based service control plane | |
CN110750592A (en) | Data synchronization method, device and terminal equipment | |
US20180004797A1 (en) | Application resiliency management using a database driver | |
CN111367873A (en) | Log data storage method and device, terminal and computer storage medium | |
CN112685499A (en) | Method, device and equipment for synchronizing process data of work service flow | |
CN110502581B (en) | Distributed database system monitoring method and device | |
CN106649000B (en) | Fault recovery method of real-time processing engine and corresponding server | |
CN110445826B (en) | Session information acquisition method, device and server | |
CN114125015A (en) | Data acquisition method and system | |
CN103236938A (en) | Method and system for user action collection based on cache memory and asynchronous processing technology | |
CN111741080A (en) | Network file distribution method and device | |
CN112486831A (en) | Test system, test method, electronic equipment and storage medium | |
CN111435327B (en) | Log record processing method, device and system | |
CN116028479A (en) | Data reconciliation system, method, equipment and storage medium | |
CN105554134A (en) | Information synchronization and device | |
CN111324583A (en) | Method and device for classifying service logs | |
CN114895852A (en) | Data processing method, system, device, storage medium and electronic equipment | |
US20170262543A1 (en) | Method and system for improving sessions and open files enumerations by data structures changes | |
CN111371884A (en) | Data processing method, client, medium, request end and system in local area network | |
CN110990213A (en) | Method and device for monitoring user logs in cluster environment in real time |
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 |