Method, device and electronic equipment for processing internet of things data
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]有鉴于此,本申请实施例提供了一种物联网数据的处理方法、处理装置和电子设备,以解决现有的物联网数据处理过程中存在的及时性较差的问题
Smart Images

Figure CN122554489A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) technology, and in particular relates to a method, processing device, and electronic device for processing IoT data. Background Technology
[0002] The Internet of Things (IoT) relies on sensor perception, wireless communication, and information processing technologies to achieve networked interconnection of physical devices. It collects raw data on the environment and working conditions through various detection terminals, transmits the data over long distances via gateways and communication links, and then uses cloud services, databases, and message middleware to store, parse, and perform logical analysis. Finally, it relies on terminal management systems to complete equipment status monitoring, anomaly alarms, and linkage control. It is now widely used in many fields such as fire protection, industrial measurement and control, and smart homes.
[0003] The data collected by the Internet of Things (IoT) needs to be pushed to the front end (e.g., WebSocket / large screen) for display as soon as possible, and also needs to be persisted to the database. However, existing technologies are lacking in the timeliness of IoT data push, and the front end refresh latency is relatively high. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, apparatus, and electronic device for processing Internet of Things (IoT) data to address the problem of poor timeliness in existing IoT data processing.
[0005] A first aspect of this application provides a method for processing Internet of Things (IoT) data, comprising: when a message consumer receives parsed data corresponding to IoT data, in response to an event object corresponding to the parsed data, invoking a target business method; when a target aspect intercepts the invocation of the target business method, generating a target message based on the parsed data through the target aspect, and sending the target message to a message queue; and when sending the target message, using the target business method to store the parsed data in a database.
[0006] According to an embodiment of this application, the method for processing IoT data further includes: sending a target message in the message queue to a visualization display terminal, so as to display the target message through the visualization display terminal.
[0007] According to an embodiment of this application, when a target aspect intercepts a call to the target business method, generating a target message based on the parsed data through the target aspect includes: intercepting the call to the target business method through the target aspect to obtain an interception result; if the interception result shows that the call to the target business method was intercepted, triggering a pre-notification and obtaining method parameters related to the parsed data through the target aspect; and generating the target message based on the method parameters and the parsed data.
[0008] According to an embodiment of this application, obtaining method parameters related to the parsed data through the target aspect includes: using the target aspect to call a parameter acquisition method through a connection point object to extract the input parameters of the target business method, wherein the input parameters represent the method parameters.
[0009] According to an embodiment of this application, generating the target message based on the method parameters and the parsed data includes: performing serialization processing on the method parameters and the parsed data to obtain method parameters and parsed data in a target format; and generating the target message based on the method parameters and parsed data in the target format.
[0010] According to an embodiment of this application, the method for processing IoT data further includes: configuring the cut-off point of the target aspect in the target business method, so that the target aspect intercepts at the cut-off point, wherein the target business method includes a database data writing method.
[0011] According to embodiments of this application, the target aspect includes aspects programmed for aspect-oriented programming.
[0012] According to an embodiment of this application, the method for processing IoT data further includes: if the interception result shows that a call to the target business method has been intercepted, triggering a post-notification to send the target message to the message queue after the parsed data is stored in the database using the target business method; or, if the interception result shows that a call to the target business method has been intercepted, triggering a surround notification to send the target message to the message queue before and after the parsed data is stored in the database using the target business method.
[0013] According to an embodiment of this application, in response to an event object corresponding to the parsed data, a target business method is invoked, including: listening to the event object through a listener, so as to invoke the target business method when the event object is detected, wherein the event object is generated based on the parsed data.
[0014] A second aspect of this application provides an IoT data processing apparatus, comprising: a method invocation module, configured to, upon receiving parsed data corresponding to IoT data by a message consumer, invoke a target business method in response to an event object corresponding to the parsed data; a message generation module, configured to, upon intercepting the invocation of the target business method by a target aspect, generate a target message based on the parsed data through the target aspect, and send the target message to a message queue; and a data storage module, configured to, when sending the target message, use the target business method to store the parsed data in a database.
[0015] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0016] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0017] According to a fifth aspect of this application, a computer program product is also provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0018] The beneficial effects of this application embodiment compared with the prior art are as follows: by intercepting the call of the target business method through the target aspect, the target message is generated based on the parsed data through the target aspect, and the target message is sent to the message queue so that the target message in the message queue can be pushed. Then, the parsed data is written to the database using the target business method. The above method realizes "notification first and persistence later", which effectively improves the timeliness of real-time message push. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This illustration schematically depicts an application scenario of an IoT data processing method according to an embodiment of this application. Figure 2 A flowchart illustrating a method for processing IoT data according to an embodiment of this application is shown; Figure 3A flowchart illustrating a method for processing IoT data according to another embodiment of this application is shown; Figure 4 A structural block diagram of an IoT data processing apparatus according to an embodiment of this application is shown; Figure 5 A block diagram of an electronic device suitable for implementing the above-described method according to an embodiment of this application is shown. Detailed Implementation
[0021] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0023] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0024] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0025] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0026] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] In existing technologies, there are generally several approaches: The first is to send a notification message only after the database write is successful (store in the database first, then send the message). Front-end latency is related to both the database write time and the message queue latency. This approach results in high front-end refresh latency and a poor user experience when database writes are slow (e.g., with high concurrency). The second approach is a dual-threaded parallel solution, using two threads to perform database writes and message sending respectively. This method requires manual management of threads and error handling logic, resulting in high thread creation overhead and strong code intrusion. The third approach is an event publishing solution: manually calling `publisher.publishEvent()` at the end of the business method. This requires modifying the original business code and is highly intrusive. The fourth approach is to add an interceptor at the message consumer level. However, interception occurs before consumption, making it impossible to obtain the processed data. Furthermore, interception can only occur before message consumption, failing to obtain the final collected value object after business processing, resulting in incorrect interception timing.
[0028] In view of this, embodiments of this application provide a method, apparatus, and electronic device for processing Internet of Things (IoT) data, in order to solve at least one of the following problems in existing IoT data processing: poor timeliness, strong code intrusion, and incorrect interception timing.
[0029] In this embodiment, the target aspect intercepts the call to the target business method, thereby generating a target message based on the parsed data and sending the target message to the message queue so that the target message in the message queue can be pushed. Then, the target business method writes the parsed data into the database. The above method realizes "notification first, persistence later", which effectively improves the timeliness of real-time message push.
[0030] Figure 1 The illustration shows an application scenario diagram of the IoT data processing method according to an embodiment of this application.
[0031] like Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.
[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be, for example, various Internet of Things (IoT) devices, such as smoke detectors, heat detectors, flame detectors, and fire alarm buttons in fire scenarios.
[0033] Server 105 can be a server providing various services, such as a backend management server supporting data uploaded by the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). It can also provide data storage services, such as storing data through a database. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be a backend server for the aforementioned target application, used to provide backend services to the client of the target application.
[0034] It should be noted that the IoT data processing method provided in this application embodiment can generally be executed by server 105. Accordingly, the IoT data processing device provided in this application embodiment can generally be located in server 105.
[0035] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0036] Figure 2 A flowchart illustrating a method for processing IoT data according to an embodiment of this application is shown.
[0037] Please see Figure 2 One embodiment of a method for processing IoT data in this application may include operations S201 to S203: In operation S201, when the message consumer receives parsed data corresponding to IoT data, it calls the target business method in response to the event object corresponding to the parsed data.
[0038] In operation S202, if the target aspect intercepts the call to the target business method, the target aspect generates a target message based on the parsed data and sends the target message to the message queue.
[0039] In operation S203, when sending the target message, the target business method is used to store the parsed data in the database.
[0040] The message consumer can be specifically configured according to the actual scenario. This application embodiment uses a fire protection scenario as an example, but it is not limited to fire protection scenarios. Other scenarios, such as smart home scenarios, can also be used. In a fire protection scenario, the message consumer can be a terminal used by firefighters, a large screen in the fire control room, or a third-party terminal, such as a display terminal in a property monitoring room.
[0041] IoT data can be raw data uploaded by IoT devices, such as fire alarm devices, including but not limited to smoke detectors, heat detectors, flame detectors, and fire alarm buttons. Parsed data can be extracted from the raw data, including at least one type of data such as detection data, alarm type, device type, serial number, and installation location.
[0042] The target business method can refer to a database data writing method, through which parsed data can be written to the database. The database type can be specifically set based on actual needs, such as MySQL, Redis, MongoDB, etc. This embodiment uses MongoDB as an example. The aspect type of the target aspect can be specifically set based on actual needs. This embodiment uses an aspect of Aspect-Oriented Programming (AOP) in the Spring framework as an example.
[0043] When a message consumer receives parsed data corresponding to IoT data, it can generate an event object corresponding to the parsed data and respond to the event object to call the target business method. During the call, the target aspect can intercept the call to the target business method. When the call is intercepted, a target message can be generated based on the parsed data and sent to the message queue. The target message can be a Kafka message or other types of messages.
[0044] During the process of sending the target message to the message queue, the target business method can continue to store the parsed data in the database. In some embodiments, both the original IoT data and the parsed data can be stored in the database simultaneously.
[0045] According to the embodiments of this application, the call to the target business method is intercepted by the target aspect, thereby generating a target message based on the parsed data and sending the target message to the message queue so that the target message in the message queue can be pushed. Then, the parsed data is written to the database using the target business method. The above method realizes "notification first, persistence later", which effectively improves the timeliness of real-time message push.
[0046] According to an embodiment of this application, the method for processing IoT data further includes: sending a target message in a message queue to a visualization display terminal, so as to display the target message through the visualization display terminal.
[0047] There may be multiple target messages in the message queue. The target messages can be sent to the corresponding visualization display terminal, such as the large screen in the fire control room, according to the predetermined rules or order. The messages can then be displayed in the area of the IoT device corresponding to the target message on the visualization display terminal, or displayed in a waterfall information flow. The specific display method is not specifically limited here.
[0048] According to an embodiment of this application, when a target aspect intercepts a call to a target business method, a target message is generated based on parsed data through the target aspect, including: intercepting the call to the target business method through the target aspect and obtaining the interception result; if the interception result shows that the call to the target business method was intercepted, triggering a pre-notification and obtaining the method parameters related to the parsed data through the target aspect; and generating a target message based on the method parameters and the parsed data.
[0049] @Before Advice: Aspect logic that executes before the target business method. It can access the input parameters of the target business method, but cannot modify the method execution result.
[0050] The target aspect is highly correlated with the target business method. The target aspect can monitor in real time whether the target business method is called, thereby generating corresponding interception results. If the interception result confirms that the target business method call has been intercepted, a pre-notification is triggered, thereby obtaining the method parameters related to the parsed data through the aspect. Based on the obtained method parameters and parsed data, the target message is generated.
[0051] According to the embodiments of this application, by intercepting the target business method to trigger a pre-notification, the target message can be generated before the method is executed, thereby ensuring that the target message can be pushed in a timely manner and effectively improving the real-time display response speed.
[0052] According to an embodiment of this application, obtaining method parameters related to parsed data through a target aspect includes: using the target aspect to call a parameter acquisition method through a join point object, and intercepting the input parameters of the target business method, wherein the input parameters represent method parameters.
[0053] During the process of obtaining method parameters in the target aspect, the parameter retrieval method can be called through the join point object to intercept the input parameters of the target business method, such as obtaining method parameters through JoinPoint.getArgs(). This method can extract parameters according to position or extract arbitrary parameters, and does not require modification of the signature of the cut method, thus achieving non-intrusive parameter extraction.
[0054] According to an embodiment of this application, generating a target message based on method parameters and parsed data includes: serializing the method parameters and parsed data to obtain method parameters and parsed data in a target format; and generating a target message based on the method parameters and parsed data in the target format.
[0055] The target format type can be determined based on the database type. For example, when the database is MongoDB, the target format can be JSON.
[0056] During the production of the target message, the corresponding collection parameters can be extracted from the parsed data. The collection parameters and method parameters are then converted into JSON format through serialization. The target message is generated based on these two parameters, and then the utility class is called to send the target message to the Kafka message queue. After that, the target business method can be used to store the parsed data in the database.
[0057] According to the embodiments of this application, the time it takes for the message consumer to receive the target message is much shorter than the time it takes for the target business method to parse the data and write it into the database. This effectively improves the timeliness of message push by notifying first and then persisting the data.
[0058] According to an embodiment of this application, the method for processing IoT data further includes: configuring the cut-off point of the target aspect in the target business method so that the target aspect is intercepted at the cut-off point.
[0059] Before an aspect can intercept calls to a target business method, it needs to configure the pointcut of the aspect. For example, if the target business method is a MongoDB data write method, a pointcut can be configured in the target business method so that the aspect can intercept calls to the target business method through the pointcut.
[0060] In the above process, the code of the target business method remains unchanged and is unaware of the existence of the target aspect. If the target aspect in this embodiment is deleted, the message notification function can be removed without affecting the business logic. Moreover, the interception method through the pointcut can avoid mistakenly intercepting other methods, thus achieving precise and controllable control over the scope of influence of the target aspect.
[0061] According to an embodiment of this application, the method for processing IoT data further includes: if the interception result shows that a call to a target business method has been intercepted, triggering a post-notification to send the target message to a message queue after storing the parsed data in the database using the target business method; or, if the interception result shows that a call to a target business method has been intercepted, triggering a surround notification to send the target message to the message queue before and after storing the parsed data in the database using the target business method.
[0062] In some alternative embodiments, a post-notification can be triggered when a call to the target business method is intercepted. This approach is called "store first, notify later," meaning that the target business method stores the parsed data in the database and then sends the target message to the message queue.
[0063] In some alternative embodiments, around notification is triggered when a call to the target business method is intercepted, i.e., notification is given before and after the method, i.e., the target message is sent to the message queue before and after the parsed data is stored in the database using the target business method.
[0064] In some alternative embodiments, the IoT data processing methods can be applied to a reactive programming technology stack to achieve asynchronous parallelism of parallel data or messages.
[0065] According to an embodiment of this application, in response to an event object corresponding to parsed data, a target business method is invoked, including: listening to the event object through a listener so as to invoke the target business method when the event object is detected, wherein the event object is generated based on the parsed data.
[0066] After the message consumer receives the parsed data, it can generate an event object of the device-collected data based on the parsed data. The event object can be listened to by a listener program. When the event object is listened to, the target business method can be called to store the parsed data in the database.
[0067] Figure 3 A flowchart illustrating a method for processing IoT data according to another embodiment of this application is shown.
[0068] In one specific embodiment, such as Figure 3As shown, this example uses Kafka messages and MongoDB as the database. After the Kafka consumer receives the parsed data, it consumes KafkaanalogModel messages. This means the program, acting as a Kafka consumer, subscribes to a specified topic and continuously pulls and parses the data reported by the device. At this point, the Kafka message process can publish an event object (AnalogInfoEvent) containing the device's collected data. A listener (AepWmxDevicelistener in the diagram) listens for this event object, and when it is detected, the target business method is called, such as `processMogoDeviceCurrentData(data, deviceld)`, which processes the device's real-time data (parsed data) and stores it in MongoDB.
[0069] When the target aspect (i.e., the AOP aspect in the Spring framework) intercepts the call to the above target business method, it triggers the before notification @Before, which can send the target message to the Kafka real-time push topic (i.e., message queue), thereby pushing the target message in the Kafka real-time push topic to the front end / screen in real time.
[0070] When sending a target message, the target business method can be executed asynchronously. Thus, the Device Current Information MongoDB Service can write the parsed data to MongoDB through an atomic write (Upsert) operation, and notify the Device Current Information MongoDB Service after the write is complete.
[0071] In the above data processing, the time T1 required for the Kafka consumer to receive the message and complete the push is less than the time T2 required to write the data to MongoDB to complete data persistence. Therefore, the front end / screen can receive the parsed data before MongoDB.
[0072] To verify the feasibility of the IoT data processing method in this embodiment, stress tests and fault tests were conducted. In the stress test, with 1000 devices simultaneously reporting collected IoT data, the average latency of the front-end WebSocket notification was reduced by 35% compared to the previous method of storing data in the database before notification. In the fault test, when the message queue crashed, the abnormal sending of target messages in the target aspect did not affect database writing (the abnormality was swallowed), and the system continued to persist data normally.
[0073] Compared with existing technologies, the IoT data processing method of this application requires no modification to any existing business code, reducing the risk of code degradation. The front-end can receive the latest data notification before the database write is complete, effectively improving message real-time performance, especially in high-concurrency scenarios. The message push logic is centralized in the aspect class; modifying the push behavior (such as adding field filtering) only requires changing one place. Furthermore, the aspect and business logic are independent objects, allowing for separate testing.
[0074] Figure 4 A structural block diagram of an IoT data processing apparatus according to an embodiment of this application is shown.
[0075] like Figure 4 As shown, the IoT data processing device 400 includes a method calling module 410, a message generation module 420, and a data storage module 430.
[0076] The method invocation module 410 is used to invoke the target business method in response to the event object corresponding to the parsed data when the message consumer receives the parsed data corresponding to the IoT data.
[0077] The message generation module 420 is used to generate a target message based on parsed data by the target aspect when the target aspect intercepts the call to the target business method, and then send the target message to the message queue.
[0078] The data storage module 430 is used to store the parsed data in the database using the target business method when sending the target message.
[0079] According to the embodiments of this application, the call to the target business method is intercepted by the target aspect, thereby generating a target message based on the parsed data and sending the target message to the message queue so that the target message in the message queue can be pushed. Then, the parsed data is written to the database using the target business method. The above method realizes "notification first, persistence later", which effectively improves the timeliness of real-time message push.
[0080] According to embodiments of this application, the IoT data processing apparatus further includes a message sending module.
[0081] The message sending module is used to send target messages in the message queue to the visualization display terminal so that the target messages can be displayed through the visualization display terminal.
[0082] According to an embodiment of this application, the message generation module includes a call interception unit, a parameter acquisition unit, and a message generation unit.
[0083] The interception unit is used to intercept calls to the target business method through the target aspect and obtain the interception result.
[0084] The parameter acquisition unit is used to trigger a pre-notification if the interception result shows that the target business method call has been intercepted, and to obtain the method parameters related to the parsed data through the target aspect.
[0085] The message generation unit is used to generate the target message based on the method parameters and parsed data.
[0086] According to an embodiment of this application, the parameter acquisition unit includes a parameter truncation subunit.
[0087] The parameter extraction subunit is used to extract the input parameters of the target business method by calling the parameter retrieval method through the connection point object using the target aspect. The input parameters represent the method parameters.
[0088] According to an embodiment of this application, the message generation unit includes a serialization subunit and a message generation subunit.
[0089] The serialization subunit is used to serialize method parameters and parsed data to obtain method parameters and parsed data in the target format.
[0090] The message generation subunit is used to generate the target message based on the method parameters and parsed data of the target format.
[0091] According to embodiments of this application, the IoT data processing apparatus further includes a cut-point configuration module.
[0092] The pointcut configuration module is used to configure the pointcut of the target aspect in the target business method so that the target aspect can intercept at the pointcut. The target business method includes the database data writing method.
[0093] According to embodiments of this application, the target aspect includes aspects for aspect-oriented programming.
[0094] According to embodiments of this application, the IoT data processing apparatus further includes a follow-up notification module or a surround notification module.
[0095] The post-notification module is used to trigger a post-notification if the interception result shows that the call to the target business method has been intercepted, so that the target message is sent to the message queue after the parsed data is stored in the database using the target business method.
[0096] The surround notification module is used to trigger surround notifications if the interception results show that a call to the target business method has been intercepted, so that the target message is sent to the message queue before and after the parsed data is stored in the database using the target business method.
[0097] According to an embodiment of this application, the method invocation module includes a listening invocation unit.
[0098] The listener call unit is used to listen for event objects through a listener program, so as to call the target business method when the event object is listened for. The event object is generated based on parsed data.
[0099] According to embodiments of this application, any multiple modules among the method invocation module 410, message generation module 420, and data storage module 430 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the method invocation module 410, message generation module 420, and data storage module 430 can be at least partially implemented as hardware circuitry, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or implemented in hardware or firmware through any other reasonable means of integrating or packaging circuitry, or implemented in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the method invocation module 410, message generation module 420, and data storage module 430 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0100] Figure 5 A block diagram of an electronic device suitable for implementing the above-described method according to an embodiment of this application is shown.
[0101] like Figure 5 As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory 502 or a program loaded from a storage portion 508 into a random access memory 503. The processor 501 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0102] Random access memory 503 stores various programs and data required for the operation of electronic device 500. Processor 501, read-only memory 502, and random access memory 503 are interconnected via bus 504. Processor 501 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 502 and / or random access memory 503. It should be noted that the programs may also be stored in one or more memories other than read-only memory 502 and random access memory 503. Processor 501 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0103] According to embodiments of this application, the electronic device 500 may further include an input / output interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card, such as a local area network card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.
[0104] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0105] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 502, and / or random access memory 503, and / or one or more memories other than read-only memory 502 and random access memory 503 described above.
[0106] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0107] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0108] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0109] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0111] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A method for processing Internet of Things data, characterized in that, The method comprises the following steps: In the case that the message consumer receives parsed data corresponding to Internet of Things data, a target business method is called in response to an event object corresponding to the parsed data; In the case that the target aspect intercepts the call of the target business method, the target aspect generates a target message based on the parsed data and sends the target message to a message queue; When sending the target message, the parsed data is stored in a database using the target business method.
2. The processing method of Internet of Things data according to claim 1, characterized in that, Further comprising: Sending the target message in the message queue to a visual display terminal to display the target message through the visual display terminal. 3.The method of Claim 1, wherein, In the case that the target aspect intercepts the call of the target business method, the target aspect generates a target message based on the parsed data, comprising: The target aspect intercepts the call of the target business method to obtain an interception result; If the interception result shows that the call of the target business method is intercepted, a pre-notification is triggered, and the target aspect obtains method parameters related to the parsed data; According to the method parameters and the parsed data, the target message is generated.
4. The method of claim 3, wherein, The target aspect obtains the method parameters related to the parsed data by calling a parameter obtaining method through a connection point object, and intercepts incoming parameters of the target business method, wherein the incoming parameters represent the method parameters. According to the method parameters and the parsed data, the target message is generated, comprising:
5. The processing method of claim 3 or 4, wherein, Serializing the method parameters and the parsed data to obtain method parameters and parsed data in a target format; Based on the method parameters and the parsed data in the target format, the target message is generated. Further comprising:
6. The processing method of Internet of Things data according to claim 1 or 3, characterized in that, Configuring a pointcut of the target aspect in the target business method so that the target aspect intercepts at the pointcut, wherein the target business method comprises a database data writing method. The target aspect comprises an aspect-oriented aspect:
7. The processing method of Internet of Things data according to claim 2, wherein, Wherein, the processing method further comprises: If the interception result shows that the call of the target business method is intercepted, a post-notification is triggered to send the target message to the message queue after the parsed data is stored in the database using the target business method; Or If the interception result shows that the call of the target business method is intercepted, a wrapping notification is triggered to send the target message to the message queue before and after the parsed data is stored in the database using the target business method. In response to the event object corresponding to the parsed data, the target business method is called, comprising: 8.The method of Claim 1, wherein, The event object is generated based on the parsed data. The method comprises the following steps:
9. An apparatus for processing Internet of Things data, the apparatus comprising: A method call module is configured to call a target business method in response to an event object corresponding to parsed data in the case that a message consumer receives the parsed data corresponding to Internet of Things data; The message generation module is used to generate a target message based on the parsed data through the target aspect when the target aspect intercepts the call to the target business method, and send the target message to the message queue. The data storage module is used to store the parsed data in the database using the target business method when sending the target message.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.