Data Monitoring Method and Device, Storage Medium, Electronic Device

By calling back the target container when the target application is enabled, the container configuration database and information channel are determined, and the functional interface is configured through this channel, the problem of poor compatibility of the target application for multiple target containers is solved, and the reuse of functional codes and code standardization is achieved.

CN113934591BActive Publication Date: 2025-06-27QINGDAO HAIER TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111137442.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-27
Publication Date
2025-06-27
Estimated Expiration
2041-09-27

AI Technical Summary

Technical Problem

The target application has poor compatibility with multiple target containers, and it is impossible to determine the corresponding functional interface calls based on the target container.

Method used

When the target application is enabled, the callback is made to the target container bound to the target application, and the callback result is obtained; the container configuration database corresponding to the target container is determined based on the callback result, and the information channel established by the encapsulated database and the basic component database is used to configure the function type corresponding to each business function of the target application to determine the functional interface corresponding to each business function; the status data of the corresponding device of the target application is monitored through the functional interface.

Benefits of technology

It solves the problem of poor compatibility of target applications for multiple target containers, improves functional code reuse between different containers, reduces the writing of duplicate code, and improves the code standardization and consistency of corresponding functional interfaces of target applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934591B_ABST
    Figure CN113934591B_ABST
Patent Text Reader

Abstract

The present invention provides a data monitoring method, device, storage medium, and electronic device. The method includes: when a target application is enabled, performing a callback on a target container bound to the target application to obtain a callback result; determining a container configuration database corresponding to the target container according to the callback result, and determining an information channel established by the container configuration database through an encapsulated database and a basic component database; using the information channel to configure a function type corresponding to each business function of the target application to determine a function interface corresponding to each business function; and monitoring status data of a device corresponding to the target application through the function interface. This solves the problems in the prior art that the target application has poor compatibility with multiple target containers and cannot determine corresponding function interface calls according to the target container, improves the reuse of functional codes between different containers, reduces the writing of duplicate codes, and improves the standardization and consistency of the codes of the function interfaces corresponding to the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular, to a data monitoring method, device, storage medium, and electronic device. Background Art

[0002] With the development of technology, a variety of excellent cross-platform development solutions have emerged continuously. In order to adopt better cross-platform solutions, it is inevitable that old and obsolete solutions coexist simultaneously. Each cross-platform solution has its own container environment. Therefore, when developing business code, due to different containers, a large amount of differential code needs to be added to implement the call of corresponding basic functions, and the different containers of the business code to be developed are highly adapted through the differential code to ensure the use of the code; however, during the subsequent testing of the business code, it is necessary to ensure the code quality through manual review, and there are many problems such as a large number of duplicate codes and difficulty in maintenance.

[0003] In view of the problems in the related art that the target application has poor compatibility with multiple target containers and cannot determine the corresponding function interface calls according to the target containers, no effective technical solutions have been proposed yet. Summary of the Invention

[0004] Embodiments of the present invention provide a data monitoring method, device, storage medium, and electronic device to at least solve the problems in the related art that the target application has poor compatibility with multiple target containers and cannot determine the corresponding function interface calls according to the target containers.

[0005] According to an embodiment of the present invention, there is provided a data monitoring method, including: when the target application is enabled, performing a callback on the target container bound to the target application to obtain a callback result; determining the container configuration database corresponding to the target container according to the callback result, and determining the information channel established by the container configuration database through the encapsulated database and the basic component database; using the information channel to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function; and monitoring the status data of the device corresponding to the target application through the function interface.

[0006] In an exemplary embodiment, before monitoring the status data of the device corresponding to the target application through the function interface, the above method further includes: obtaining indication information determined by a target object on the target application, where the indication information is used to indicate the target status data corresponding to the device change information that the target object needs to obtain; and determining the target function interface to be monitored according to the indication information.

[0007] In an exemplary embodiment, after determining the target function interface to be monitored according to the indication information, the method further includes: obtaining device parameters corresponding to the target function interface, where the device parameters include: a device identifier to be monitored through the target function interface; in a case where the target function interface determines that the device parameters meet a preset data monitoring condition, feedbacking a call message to the basic component database and the encapsulation database through the information channel, where the call message is used to indicate to create a call interface in the basic component database and the encapsulation database according to the indication information.

[0008] In an exemplary embodiment, in a case where the target function interface determines that the device parameters meet a preset data monitoring condition, feedbacking a call message to the basic component database and the encapsulation database through the information channel includes: obtaining a target call interface for creating the indication information in the encapsulation database; in a case where a function to be executed is sent to the basic component database through the target call interface, obtaining a response message feedbacked by the basic component database, where the response message is used to indicate that the basic component library has executed a corresponding monitoring operation according to the indication information.

[0009] In an exemplary embodiment, after obtaining the response message feedbacked by the basic component database, the method further includes: in a case where a component in the basic component database monitors that the device data has changed, receiving the changed data uploaded by the component through the information channel; parsing the changed data to obtain target status data corresponding to the indication information.

[0010] In an exemplary embodiment, after using the information channel to configure a function type corresponding to each service function of the target application to determine a function interface corresponding to each service function, the method further includes: determining an interface creator corresponding to the function interface, where the interface creator is used to indicate an interface definition object for business type encapsulation in the encapsulation database; binding the interface creator to the function interface.

[0011] In an exemplary embodiment, after monitoring status data of a device corresponding to the target application through the function interface, the method further includes: determining an update frequency of the status data, where the update frequency is used to indicate the number of feedbacks of the status data within a target period; in a case where the update frequency is lower than a preset threshold, prompting a target object to re-initiate the indication information.

[0012] According to another embodiment of the present invention, a data monitoring device is provided, including: a callback module, configured to perform a callback on a target container bound to the target application when the target application is enabled, to obtain a callback result; a determination module, configured to determine a container configuration database corresponding to the target container according to the callback result, and determine an information channel established by the container configuration database through an encapsulation database and a basic component database; a configuration module, configured to use the information channel to configure a function type corresponding to each service function of the target application, to determine a function interface corresponding to each service function; a monitoring module, configured to monitor status data of a device corresponding to the target application through the function interface.

[0013] In an exemplary embodiment, the above device further includes: an acquisition module, configured to acquire indication information determined by a target object on a target application, where the indication information is used to indicate target status data corresponding to device change information that the target object needs to acquire; and determine a target function interface to be monitored according to the indication information.

[0014] In an exemplary embodiment, the above acquisition module is further configured to acquire device parameters corresponding to the target function interface, where the device parameters include: a device identifier to be monitored through the target function interface; when the device parameters are determined by the target function interface to meet a preset data monitoring condition, feedback a call message to the basic component database and the encapsulation database through the information channel, where the call message is used to indicate creating a call interface in the basic component database and the encapsulation database according to the indication information.

[0015] In an exemplary embodiment, the above acquisition module is further configured to acquire a target call interface for creating the indication information in the encapsulation database; when a function to be executed is sent to the basic component database through the target call interface, acquire a response message fed back by the basic component database, where the response message is used to indicate that the basic component library has performed a corresponding monitoring operation according to the indication information.

[0016] In an exemplary embodiment, the above acquisition module further includes: a receiving unit, configured to receive change data uploaded by the component through the information channel when data of the device monitored by the component in the basic component database changes; and parse the change data to obtain target status data corresponding to the indication information.

[0017] In an exemplary embodiment, the above device further includes: a binding module, configured to determine an interface creator corresponding to the function interface, where the interface creator is used to indicate an interface definition object for encapsulating a service type in an encapsulation database; and bind the interface creator to the function interface.

[0018] In an exemplary embodiment, the above device further includes: a prompting module, configured to determine an update frequency of the status data, where the update frequency is used to indicate the number of feedback times of the status data within a target period; and prompt a target object to re-initiate an indication message when the update frequency is lower than a preset threshold.

[0019] According to another embodiment of the present invention, there is also provided a storage medium storing a computer program, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0020] According to another embodiment of the present invention, there is also provided an electronic device including a memory and a processor, where the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0021] Through the present invention, when a target application is enabled, a target container bound to the target application is called back to obtain a callback result; a container configuration database corresponding to the target container is determined according to the callback result, and an information channel established by the container configuration database with a basic component database through an encapsulation database is determined; the information channel is used to configure a function type corresponding to each service function of the target application to determine a function interface corresponding to each service function; and the status data of a device corresponding to the target application is monitored through the function interface. That is to say, through the callback of the target container bound to the target application, the information channel between the created container configuration database, encapsulation database, and basic component database is determined according to the callback result, and then the corresponding function interface is called according to the information channel to implement the monitoring of the status data of the device corresponding to the target application. Therefore, problems in the prior art such as poor compatibility of a target application with multiple target containers and inability to determine corresponding function interface calls according to a target container can be solved, the reuse of function codes between different containers is improved, the writing of duplicate codes is reduced, and the standardization and consistency of the code of the function interface corresponding to the target application are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and the schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:

[0023] Figure 1It is a hardware structure block diagram of a computer terminal for a data monitoring method according to an embodiment of the present invention;

[0024] Figure 2 It is a flowchart of a data monitoring method according to an embodiment of the present invention;

[0025] Figure 3 It is a timing diagram that can be called according to an alternative embodiment of the present invention;

[0026] Figure 4 It is a system framework diagram of function calls according to an embodiment of the present invention;

[0027] Figure 5 It is a structure block diagram of a data monitoring device according to an embodiment of the present invention. Detailed implementation manners

[0028] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence.

[0030] The method embodiments provided by the embodiments of the present application can be executed in a computer terminal or a computing device similar to a device terminal. Taking running on a computer terminal as an example, Figure 1 It is a hardware structure block diagram of a computer terminal for a data monitoring method according to an embodiment of the present invention. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in Figure 1 the processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that, Figure 1 the structure shown in Figure 1 is only schematic, and it does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than Figure 1 shown in

[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data monitoring method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the computer terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a data monitoring method is provided. Figure 2 It is a flowchart of the data monitoring method according to the embodiments of the present invention, and this process includes the following steps:

[0034] Step S202, when the target application is enabled, perform a callback on the target container bound to the target application to obtain a callback result;

[0035] Optionally, the callback in this embodiment means that when it is determined that the target application is enabled, in order to ensure the accurate monitoring of subsequent device message data, by determining the target container bound to the target application, further determining the container configuration service corresponding to the target container, creating a corresponding information channel in the corresponding container configuration base library through the container configuration service, setting the message sending channel from the basic component database to the container configuration database, and initializing and encapsulating the database, and then encapsulating different message sending channels through the encapsulated database, creating a function interface for the service corresponding to the encapsulated message sending channel, and adding the corresponding interface creator.

[0036] Among them, the container configuration database includes: container configuration service and container configuration base library, and the encapsulated database includes: encapsulated layer base library and encapsulated layer service.

[0037] Step S204: Determine the container configuration database corresponding to the target container according to the callback result, and determine the information channel established by the container configuration database with the basic component database through the encapsulation database;

[0038] Step S206: Configure the function type corresponding to each business function of the target application using the information channel to determine the function interface corresponding to each business function;

[0039] Step S208: Listen for the status data of the device corresponding to the target application through the function interface.

[0040] Through the above steps, when the target application is enabled, the target container bound to the target application is called back to obtain a callback result; according to the callback result, the container configuration database corresponding to the target container is determined, and the information channel established by the container configuration database with the basic component database through the encapsulation database is determined; the function type corresponding to each business function of the target application is configured using the information channel to determine the function interface corresponding to each business function; the status data of the device corresponding to the target application is listened for through the function interface. That is to say, through the callback of the target container bound to the target application, the information channel between the created container configuration database, encapsulation database, and basic component database is determined according to the callback result, and then the corresponding function interface is called according to the information channel to implement the listening of the status data of the device corresponding to the target application. Therefore, problems in the prior art such as poor compatibility of the target application with multiple target containers and inability to determine the corresponding function interface call according to the target container can be solved, the reuse of function codes between different containers is improved, the writing of duplicate codes is reduced, and the standardization and consistency of the code of the function interface corresponding to the target application are improved.

[0041] In an exemplary embodiment, before listening for the status data of the device corresponding to the target application through the function interface, the method further includes: obtaining the indication information determined by the target object on the target application, where the indication information is used to indicate the target status data corresponding to the device change information that the target object needs to obtain; determining the target function interface to be listened for according to the indication information.

[0042] It can be understood that different types of status data in the device need to call different function interfaces for listening. Therefore, it is necessary to determine the corresponding target function interface according to the needs of the target object, so that the target function interface to be called meets the test requirements of the target object and the writing requirements of the code.

[0043] In an exemplary embodiment, after determining the target function interface to be monitored according to the indication information, the method further includes: obtaining device parameters corresponding to the target function interface, where the device parameters include: a device identifier to be monitored through the target function interface; in a case where the target function interface determines that the device parameters meet a preset data monitoring condition, feeding back a call message to the basic component database and the encapsulation database through the information channel, where the call message is used to indicate creating a call interface in the basic component database and the encapsulation database according to the indication information.

[0044] That is to say, when obtaining the status data of the device corresponding to the target application through the target function interface, in order to ensure the rapid acquisition of the status data in the device to be monitored and the accuracy of the acquisition of the status data in the device, when the target function interface is called, a device identifier of the device to be monitored is sent to the target function interface, where the device identifier is used to uniquely indicate the device, and in a case where the target function interface determines that the device identifier meets the call condition, the call message is sent to the container configuration database, and the call message is fed back to the basic component database and the encapsulation database through the information channel.

[0045] In an exemplary embodiment, in a case where the target function interface determines that the device parameters meet a preset data monitoring condition, feeding back a call message to the basic component database and the encapsulation database through the information channel includes: obtaining a target call interface for creating the indication information in the encapsulation database; in a case where a function to be executed for the call is sent to the basic component database through the target call interface, obtaining a response message fed back by the basic component database, where the response message is used to indicate that the basic component library has performed a corresponding monitoring operation according to the indication information.

[0046] In an exemplary embodiment, after obtaining the response message fed back by the basic component database, the method further includes: in a case where a component in the basic component database monitors that the device data has changed, receiving the changed data uploaded by the component through the information channel; parsing the changed data to obtain target status data corresponding to the indication information.

[0047] In short, create the corresponding interface in combination with the interface creator pre-created in the container configuration database, set the interface call return function, set the data change listener, and then perform data encapsulation through the encapsulation layer base library in the database. Determine the specific interface for the execution of the data change listener after encapsulation according to the encapsulation layer service. Then determine the corresponding specific call function in the basic component database. After the function in the basic component database is executed, synchronize the execution result to the encapsulation database and upload it level by level through the information channel to the display interface of the target application to prove that the status data of the device to be monitored by the target object can be obtained.

[0048] In an exemplary embodiment, after using the information channel to configure the function type corresponding to each service function of the target application to determine the function interface corresponding to each service function, the above method further includes: determining the interface creator corresponding to the function interface, where the interface creator is used to indicate the interface definition object for business type encapsulation in the encapsulation database; binding the interface creator to the function interface.

[0049] In an exemplary embodiment, after listening to the status data of the device corresponding to the target application through the function interface, the above method further includes: determining the update frequency of the status data, where the update frequency is used to indicate the number of feedbacks of the status data within the target period; in the case where the update frequency is lower than the preset threshold, prompting the target object to resend the indication information.

[0050] To better understand the process of the above data monitoring method, the following describes the above data monitoring method process in combination with optional embodiments.

[0051] In an optional embodiment of the present invention, a function call method for data monitoring is mainly provided. When the App starts, the container framework will have a function callback at the start of loading. At this time, an information channel is created to build an information transfer pipeline from the basic component layer (D layer) through the encapsulation layer (C layer) - container configuration layer (B layer) - function interface layer (A layer) to enable the subsequent synchronous return message of the call and the monitored data change message to be successfully transmitted. At the same time, initialization work is also done for each layer under the function call at the start of container loading, and there is an interface creator in the encapsulation layer. The interface creator can create an interface caller when an interface needs to be called, so as to execute the interface by calling the function of the basic component (D layer).

[0052] After the initialization and preparation are completed, when the user clicks on a function on the business page, the function call is initiated. Here, taking the interface for registering the listening of device status changes as an example, the data flow of the present invention is described. When the user enters the device details page, it is necessary to start listening for changes to the device. If there is a data change, the corresponding view effect will be displayed on the page.

[0053] After calling the interface for registering the listening of device changes, the execution status of the interface will be immediately returned. This return is a synchronous return, and only one return is made for each call. After the listener is successfully registered, when the status of the device changes, a message about the device change will be sent to the listener. At this time, the message reporting is an asynchronous data change, and the asynchronous message reporting is real-time and allows multiple reports.

[0054] As an alternative implementation, as Figure 3 shown, the sequence diagram of the function call of the alternative embodiment of the present invention includes the following steps:

[0055] Step 1: When the APP is started, call the bound target container in the container configuration layer (layer B); and create an information channel in the container configuration base library in the container configuration layer (layer B), and set the message sending channel from the basic component layer (layer D) to the container configuration layer (layer B).

[0056] Step 2: When the message sending channel is determined, initialize the encapsulation layer (layer C), and encapsulate the message sending channel through the encapsulation layer base library and the encapsulation layer service in the initialized encapsulation layer (layer C) to form an API (Application Programming Interface), and add the corresponding interface creator.

[0057] Step 3: Determine the requirement for the target object to listen for device changes when entering the details page of the device card corresponding to the target application.

[0058] Step 4: Call and subscribe to the device change interface, and send parameter information when calling and subscribing to the corresponding function interface. Among them, the parameter information includes: device ID (i.e., device identifier).

[0059] Step 5: When the parameters pass the verification of the function interface, continue to call the container configuration service in the container configuration layer (layer B), and call the content in the container configuration base library through the parent class.

[0060] Step 6: Create an interface through the interface creator, set the return function of the interface call, and set the data change listener corresponding to the device data.

[0061] Step 7: The encapsulation layer (Layer C) determines the corresponding specific execution interface, calls the specific function to execute, synchronously returns the interface listening status to the device card page, and informs the target object that the function interface has completed the listening response;

[0062] Step 8: In the case of detecting data changes of the device, report the detected data changes level by level.

[0063] As an optional implementation manner, Figure 4 This is the system framework diagram of the function call of the embodiment of the present invention. As Figure 4 shown, the code is processed in layers. The request is sent from the business page, passes through the function interface layer (Layer A), and is called to the encapsulation layer (Layer C) through the container configuration layer (Layer B), and finally calls the function code of the basic component layer (Layer D). Furthermore, by extracting the code of Layer B and Layer C into a base library, the duplication of code is reduced, and at the same time, the maintenance cost is reduced. After extraction, the amount of code to be written in the container configuration layer (Layer B) is very small, and only the message channel name for configuring the issued command and the message channel name for feeding back the listening information upward need to be configured; because of the existence of the base library, the encapsulation layer (Layer C) can also reduce duplicate code, and provides an Action class for each business function to process the input parameters and return the result after execution.

[0064] Regarding the code quality, since the code in the container configuration layer (Layer B) is only the configuration of the names of two message channels, the quality can be ensured through manual review; while the encapsulation layer (Layer C) creates the creation of the channel from the encapsulation layer (Layer C) to the function interface layer. The subsequent asynchronous message transmission is realized by establishing a message channel. Further, through the layering of the business, the functional code is segmented to achieve the purpose of supporting multiple containers.

[0065] In summary, through the optional embodiment of the present invention, by encapsulating functions and extracting the configured code into a container configuration library, it is possible to isolate containers well while ensuring the reuse of functional code, and it solves the problem of multiple containers well. That is, the optional embodiment of the present invention extracts a unified base library for container configuration and interface encapsulation, ensures that different services adopt the desired standard technologies, reduces the writing of duplicate code, standardizes and standardizes the functional plug-ins, strengthens the communication efficiency of the team, facilitates the maintenance and development of the overall software, improves the production efficiency of the team, and reduces the losses caused by inconsistent specifications and writing of similar functional codes in the team.

[0066] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.

[0067] In this embodiment, a data monitoring device is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0068] Figure 5 is a structural block diagram of a data monitoring device according to an embodiment of the present invention, as Figure 5 shown, the device includes:

[0069] (1) A callback module 52, configured to perform a callback on a target container bound to the target application when the target application is enabled, to obtain a callback result;

[0070] (2) A determination module 54, configured to determine a container configuration database corresponding to the target container according to the callback result, and determine an information channel established by the container configuration database through an encapsulated database and a basic component database;

[0071] (3) A configuration module 56, configured to configure a function type corresponding to each service function of the target application by using the information channel, to determine a function interface corresponding to each service function;

[0072] (4) A monitoring module 58, configured to monitor status data of a device corresponding to the target application through the function interface.

[0073] Through the above device, when the target application is enabled, a callback is performed on the target container bound to the target application to obtain a callback result; according to the callback result, a container configuration database corresponding to the target container is determined, and an information channel established by the container configuration database through the encapsulation database and the basic component database is determined; the information channel is used to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function; the status data of the device corresponding to the target application is monitored through the function interface. That is to say, through the callback of the target container bound to the target application, according to the callback result, the information channel between the created container configuration database, encapsulation database, and basic component database is determined, and then the corresponding function interface is called according to the information channel to implement the monitoring of the status data of the device corresponding to the target application. Therefore, it can solve the problems in the prior art that the target application has poor compatibility with multiple target containers and cannot determine the corresponding function interface call according to the target container, improve the reuse of function codes between different containers, reduce the writing of duplicate codes, and improve the standardization and consistency of the codes of the function interfaces corresponding to the target application.

[0074] In an exemplary embodiment, the above device further includes: an acquisition module, configured to acquire indication information determined by a target object on a target application, where the indication information is used to indicate target status data corresponding to device change information that the target object needs to acquire; and determine a target function interface to be monitored according to the indication information.

[0075] It can be understood that different types of status data in the device need to call different function interfaces for monitoring. Therefore, it is necessary to determine the corresponding target function interface according to the needs of the target object, so that the target function interface to be called meets the test requirements of the target object and the writing requirements of the code.

[0076] In an exemplary embodiment, the above acquisition module is further configured to acquire device parameters corresponding to the target function interface, where the device parameters include: a device identifier to be monitored through the target function interface; when the target function interface determines that the device parameters meet a preset data monitoring condition, a call message is fed back to the basic component database and the encapsulation database through the information channel, where the call message is used to indicate to create a call interface in the basic component database and the encapsulation database according to the indication information.

[0077] That is to say, when obtaining the status data of the device corresponding to the target application through the target function interface, in order to ensure the rapid acquisition of the status data in the device to be monitored and the accuracy of the acquisition of the status data in the device, when the target function interface is called, the device identifier of the device to be monitored is sent to the target function interface, where the device identifier is used to uniquely indicate the device, and when the target function interface determines that the device identifier meets the call condition, the call message is sent to the container configuration database, and the call message is fed back to the basic component database and the encapsulation database through the information channel.

[0078] In an exemplary embodiment, the above-mentioned acquisition module is further configured to acquire a target call interface for creating the indication information in the encapsulation database; when the function to be executed is sent to the basic component database through the target call interface, acquire the response message fed back by the basic component database, where the response message is used to indicate that the basic component library has performed the corresponding monitoring operation according to the indication information.

[0079] In an exemplary embodiment, the above-mentioned acquisition module further includes: a receiving unit, configured to receive the changed data uploaded by the component through the information channel when the component in the basic component database monitors that the data of the device has changed; parse the changed data to obtain the target status data corresponding to the indication information.

[0080] In short, in combination with the interface creator pre-created in the container configuration database, create the corresponding interface, set the interface call return function, set the data change listener, and then perform data encapsulation through the encapsulation layer base library in the encapsulation database, and determine the specific interface for executing the data change listener after encapsulation according to the encapsulation layer service. Then, determine the corresponding specific call function in the basic component database. After the function in the basic component database is completed, synchronize the execution result to the encapsulation database and upload it to the display interface of the target application through the information channel step by step to prove that the status data of the device to be monitored by the target object can be acquired.

[0081] In an exemplary embodiment, the above-mentioned device further includes: a binding module, configured to determine the interface creator corresponding to the function interface, where the interface creator is used to indicate the interface definition object for business type encapsulation in the encapsulation database; bind the interface creator to the function interface.

[0082] In an exemplary embodiment, the above-mentioned device further includes: a prompting module, configured to determine the update frequency of the status data, where the update frequency is used to indicate the number of feedbacks of the status data within the target period; when the update frequency is lower than the preset threshold, prompt the target object to re-initiate the indication information.

[0083] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: all the above-mentioned modules are located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0084] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. Wherein, the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0085] In an exemplary embodiment, in this embodiment, the above storage medium can be configured to store a computer program for executing the following steps:

[0086] S1, when the target application is enabled, perform a callback on the target container bound to the target application to obtain a callback result;

[0087] S2, determine the container configuration database corresponding to the target container according to the callback result, and determine the information channel established by the container configuration database through the encapsulated database and the basic component database;

[0088] S3, use the information channel to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function;

[0089] S4, monitor the status data of the device corresponding to the target application through the function interface.

[0090] In an exemplary embodiment, in this embodiment, the above storage medium may include but is not limited to: USB flash drive, read-only memory (abbreviated as ROM), random access memory (abbreviated as RAM), mobile hard disk, magnetic disk or optical disc, etc., various media that can store computer programs.

[0091] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0092] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device. Wherein, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0093] In an exemplary embodiment, in this embodiment, the above processor can be configured to execute the following steps through a computer program:

[0094] S1, when the target application is enabled, perform a callback on the target container bound to the target application to obtain a callback result;

[0095] S2, determine the container configuration database corresponding to the target container according to the callback result, and determine the information channel established by the container configuration database through the encapsulated database and the basic component database;

[0096] S3, use the information channel to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function;

[0097] S4, monitor the status data of the device corresponding to the target application through the function interface.

[0098] In an exemplary embodiment, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated here.

[0099] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. In an exemplary embodiment, they can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0100] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A data monitoring method, characterized in that, Including: When the target application is enabled, perform a callback on the target container bound to the target application to obtain a callback result; Determine the container configuration database corresponding to the target container according to the callback result, and determine the information channel established by the container configuration database through the encapsulation database and the basic component database; Use the information channel to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function; Monitor the status data of the device corresponding to the target application through the function interface; Wherein, the container configuration database includes: container configuration services and a container configuration base library, and the encapsulation database includes: an encapsulation layer base library and encapsulation layer services.

2. The data monitoring method according to claim 1, wherein Before monitoring the status data of the device corresponding to the target application through the function interface, the method further includes: Obtain the indication information determined by the target object on the target application, where the indication information is used to indicate the target status data corresponding to the device change information that the target object needs to obtain; Determine the target function interface to be monitored according to the indication information.

3. The data monitoring method according to claim 2, wherein After determining the target function interface to be monitored according to the indication information, the method further includes: Obtain the device parameters corresponding to the target function interface, where the device parameters include: the device identifier to be monitored through the target function interface; When the target function interface determines that the device parameters meet the preset data monitoring conditions, feedback a call message to the basic component database and the encapsulation database through the information channel, where the call message is used to indicate creating a call interface in the basic component database and the encapsulation database according to the indication information.

4. The data monitoring method according to claim 3, when the target function interface determines that the device parameters meet the preset data monitoring conditions, feedback a call message to the basic component database and the encapsulation database through the information channel, including: Obtain the target call interface for creating the indication information in the encapsulation database; When the function to be executed is sent to the basic component database through the target call interface, obtain the response message feedback by the basic component database, where the response message is used to indicate that the basic component library has performed the corresponding monitoring operation according to the indication information.

5. The data monitoring method according to claim 4, wherein After obtaining the response message feedback by the basic component database, the method further includes: When the components in the basic component database detect that the device data has changed, receive the changed data uploaded by the components through the information channel; Parse the changed data to obtain the target status data corresponding to the indication information.

6. The data monitoring method according to claim 1, wherein After using the information channel to configure the function type corresponding to each business function of the target application to determine the function interface corresponding to each business function, the method further includes: Determine the interface creator corresponding to the function interface, where the interface creator is used to indicate the interface definition object for business type encapsulation in the encapsulation database; Bind the interface creator to the functional interface.

7. The data monitoring method according to claim 1, wherein After listening to the status data of the device corresponding to the target application through the functional interface, the method further includes: Determine the update frequency of the status data, where the update frequency is used to indicate the number of feedbacks of the status data within a target period; In the case where the update frequency is lower than a preset threshold, prompt the target object to resend the indication information.

8. A data monitoring device, characterized in that, Includes: A callback module, configured to, when the target application is enabled, perform a callback on the target container bound to the target application to obtain a callback result; A determination module, configured to determine the container configuration database corresponding to the target container according to the callback result, and determine the information channel established by the container configuration database through the encapsulation database and the basic component database; A configuration module, configured to use the information channel to configure the function type corresponding to each service function of the target application to determine the functional interface corresponding to each service function; A monitoring module, configured to monitor the status data of the device corresponding to the target application through the functional interface; Wherein, the container configuration database includes: container configuration services and a container configuration base library, and the encapsulation database includes: an encapsulation layer base library and encapsulation layer services.

9. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, wherein the computer program is configured to execute the method described in any one of claims 1 to 7 when running.

10. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data connection establishing method and device

    CN105491135A