CN116647488A - Equipment testing method based on virtual module, storage medium and electronic device - Google Patents
Equipment testing method based on virtual module, storage medium and electronic device Download PDFInfo
- Publication number
- CN116647488A CN116647488A CN202310637494.3A CN202310637494A CN116647488A CN 116647488 A CN116647488 A CN 116647488A CN 202310637494 A CN202310637494 A CN 202310637494A CN 116647488 A CN116647488 A CN 116647488A
- Authority
- CN
- China
- Prior art keywords
- gateway
- information
- module
- virtual module
- virtual
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 202
- 238000000034 method Methods 0.000 claims description 30
- 238000012795 verification Methods 0.000 claims description 25
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012790 confirmation Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000005406 washing Methods 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 238000004140 cleaning Methods 0.000 description 1
- 238000010411 cooking Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000000779 smoke Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000010408 sweeping Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/20—Arrangements for monitoring or testing data switching networks the monitoring system or the monitored elements being virtualised, abstracted or software-defined entities, e.g. SDN or NFV
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/06—Generation of reports
- H04L43/065—Generation of reports related to network devices
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
The application discloses a device testing method based on a virtual module, a storage medium and an electronic device, and relates to the technical field of intelligent home/intelligent families. Therefore, the test of the equipment can be realized through the virtual module, a physical module is not needed, the virtual module is not needed to be manually distributed, the test efficiency can be improved, and the test cost can be reduced.
Description
Technical Field
The application relates to the technical field of intelligent home/smart home, in particular to a device testing method based on a virtual module, a storage medium and an electronic device.
Background
At present, in the process of testing equipment, a bottom plate and physical modules are needed to be used for testing the equipment, however, the number of the physical modules is limited, and in some cases, the situation of lacking the physical modules exists, so that a tester cannot complete the test. Therefore, in the current process of testing equipment, a physical module is required to be relied on, and the efficiency is low.
Disclosure of Invention
The application provides a device testing method based on a virtual module, a storage medium and an electronic device, which are used for solving the defect of low efficiency caused by the fact that a physical module is needed in the prior art and improving the testing efficiency.
The application provides a device testing method based on a virtual module, which comprises the following steps:
establishing connection with a gateway based on equipment information corresponding to a virtual module, and sending a module online request to the gateway so that the gateway sends the equipment online request to a cloud platform based on the module online request;
and receiving the test information sent by the gateway through the virtual module, acquiring a test result corresponding to the test information, and sending the test result to the gateway through the virtual module so that the gateway sends the test result to the cloud platform.
According to the device testing method based on the virtual module, the device information comprises unique identification information;
the step of establishing connection between the device information corresponding to the virtual module and the gateway comprises the following steps:
receiving a gateway connection request sent by the gateway based on the unique identification information, and establishing connection with the gateway under the condition that the unique identification information meets a preset identification condition, wherein the gateway acquires the unique identification information from the cloud platform;
or alternatively, the first and second heat exchangers may be,
sending a module connection request to the gateway based on the unique identification information, so that the gateway sends a request comprising the unique identification information to the cloud platform; and receiving connection feedback information, and establishing connection with the gateway under the condition that the connection feedback information indicates that connection can be performed, wherein the connection feedback information is generated based on information sent to the gateway by the cloud platform, and the connection feedback information has a corresponding relation with the module connection request.
According to the device testing method based on the virtual module provided by the application, the step of establishing connection with the gateway comprises the following steps:
And filling gateway information corresponding to the gateway into the virtual module.
According to the device testing method based on the virtual module provided by the application, after the step of filling the gateway information corresponding to the gateway into the virtual module, the method further comprises the following steps:
and filling the equipment heartbeat information into the virtual module.
According to the device testing method based on the virtual module provided by the application, before the step of receiving the test information sent by the gateway through the virtual module, the method further comprises the following steps:
transmitting current heartbeat information to the gateway under the condition that the current time meets the preset time condition, so that the gateway transmits the test information to the virtual module under the condition that the current heartbeat information meets the preset heartbeat condition; or alternatively, the first and second heat exchangers may be,
receiving verification information sent by the gateway, and sending reply information acquired based on the verification information to the gateway, so that the gateway sends the test information to the virtual module under the condition that the reply information meets the preset verification condition.
According to the device testing method based on the virtual module provided by the application, before the step of receiving the verification information sent by the gateway, the method further comprises the following steps:
The virtual module sends a device binding request to the gateway so that the gateway sends a binding confirmation request to the cloud platform based on the device binding request, the cloud platform sends binding relation information to a terminal based on the binding confirmation request, and the terminal sends the test information to the cloud platform based on the binding relation information.
According to the device testing method based on the virtual module provided by the application, before the step of establishing connection between the device information corresponding to the virtual module and the gateway, the method further comprises the following steps:
creating the virtual module, and filling equipment information corresponding to the virtual module into the virtual module, wherein the equipment information comprises unique identification information.
The application also provides a device testing device based on the virtual module, which comprises:
the online module is used for establishing connection with the gateway based on the equipment information corresponding to the virtual module, and sending a module online request to the gateway so that the gateway sends the equipment online request to the cloud platform based on the module online request;
the testing module is used for receiving the testing information sent by the gateway through the virtual module, obtaining a testing result corresponding to the testing information, and sending the testing result to the gateway through the virtual module so that the gateway sends the testing result to the cloud platform.
The application also provides an electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor being arranged to implement a virtual module based device testing method as described in any of the above by execution of the computer program.
The present application also provides a computer-readable storage medium comprising a stored program, wherein the program when run performs a device testing method implementing any one of the virtual module-based devices described above.
According to the equipment testing method based on the virtual module, the storage medium and the electronic device, the equipment information corresponding to the virtual module is connected with the gateway, and the module online request is sent to the gateway, so that the gateway sends the equipment online request to the cloud platform based on the module online request, the virtual module receives the testing information sent by the gateway, the testing result corresponding to the testing information is obtained, and the virtual module sends the testing result to the gateway, so that the gateway sends the testing result to the cloud platform.
Through the mode, the equipment can be tested through the virtual module, a physical module is not needed, the virtual module is not needed to be manually distributed, the testing efficiency can be improved, and the testing cost can be reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a virtual module-based device testing method according to an embodiment of the application;
FIG. 2 is a schematic flow chart of a device testing method based on a virtual module according to the present application;
FIG. 3 is a second flow chart of a device testing method based on a virtual module according to the present application;
FIG. 4 is a schematic diagram of a virtual module-based device testing apparatus according to the present application;
FIG. 5 is a second schematic diagram of a device testing apparatus based on a virtual module according to the present application;
fig. 6 is a schematic structural diagram of an electronic device provided by the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of an embodiment of the present application, there is provided a device testing method based on a virtual module. The equipment testing method based on the virtual module is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described virtual module-based device testing method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In order to improve the testing efficiency, the embodiment of the application provides a device testing method, a device, a computer-readable storage medium, an electronic device and a computer program product based on a virtual module, and the device testing method based on the virtual module is described below with reference to fig. 2.
As shown in fig. 2, an embodiment of the present application provides a device testing method based on a virtual module, where the method includes:
s201, connection is established with a gateway based on equipment information corresponding to a virtual module, and a module online request is sent to the gateway, so that the gateway sends the equipment online request to a cloud platform based on the module online request.
In the case where the device needs to be tested, in order to facilitate the test of the device by the tester, the tester (user) may create a virtual device, where the virtual device includes at least a virtual module, that is, the virtual device may include a virtual module, and the virtual device may also include a virtual module and a virtual backplane.
The virtual device may include one or more virtual modules, that is, the virtual module may include one or more virtual modules, and after the virtual device is created, the virtual module may establish a connection with the gateway based on device information corresponding to the virtual module, where a WIFI (Wireless-Fidelity) connection is used between the virtual module and the gateway, that is, the virtual module is connected with the gateway through a Wireless network.
After the tester creates the virtual device, the virtual device and the gateway are in the same wireless network, and interact through the wireless network. That is, after the virtual device is started (after creation), the virtual device automatically has a network distribution function, and a developer is not required to perform manual network distribution connection, so that the workload of the developer can be saved, and the use experience of the developer can be improved.
After the virtual module and the gateway are connected, a module online request can be sent to the gateway, and after the gateway receives the module online request, the gateway can generate a device online request based on the module online request and send the device online request to the cloud platform.
The module online request carries unique identification information of the virtual module, wherein the unique identification information is an identification capable of representing the uniqueness of the virtual module and is also an identification for identifying the uniqueness of the virtual equipment. The module online request is a request created based on the WIFI protocol and unique identification information.
The device online request carries unique identification information of the virtual module, and the device online request is a request created based on http (Hypertext Transfer Protocol ) and the unique identification information.
After receiving the device online request, the cloud platform can determine that the device corresponding to the unique identification information is online based on the unique identification information included in the device online request, that is, determine that the virtual module is online.
And under the condition that the cloud platform determines that the virtual module is in the online failure, returning an equipment online failure message to the gateway, wherein the equipment online failure message is created based on the http and the unique identification information.
After receiving the equipment online failure message, the gateway can generate a module online failure message based on the equipment unique identifier included in the equipment online failure message and the WIFI protocol, so that the module online failure message is sent to a virtual module corresponding to the equipment unique identifier.
Therefore, the virtual module can receive the module online failure message based on the WIFI protocol, and the module online failure message is feedback information of the module online request. Correspondingly, the equipment online failure message is feedback information of the equipment online request.
In the case that the virtual module receives the module on-line failure message, the above step S201 may be re-executed until the module on-line success message is received.
And under the condition that the cloud platform determines that the virtual module is successful in online, returning an equipment online success message to the gateway, wherein the equipment online success message is created based on http and unique identification information.
After receiving the equipment online success message, the gateway can generate a module online success message based on the equipment unique identifier included in the equipment online success message and the WIFI protocol, so that the module online success message is sent to a virtual module corresponding to the equipment unique identifier.
Therefore, the virtual module can receive the module online success message based on the WIFI protocol, and the module online success message is feedback information of the module online request. Correspondingly, the equipment online success message is feedback information of the equipment online request.
In the case that the virtual module receives the module on-line success message, it is indicated that the virtual module has completed on-line, in which case the device test can be performed based on the virtual module, and thus, the test information can be transmitted to the virtual module based on the test type. The test type may be a test that interacts with the terminal and a test that does not interact with the terminal.
Under the condition that the test type is the test interacted with the terminal, the terminal can be triggered by the tester in a corresponding mode, after the terminal receives the test information issued by the tester, the test information can be forwarded to the cloud platform, the cloud platform can send the test information to the gateway, and the gateway can send the test information to the virtual module.
Under the condition that the test type is a test which does not interact with the terminal, a tester can trigger the cloud platform in a corresponding mode, the cloud platform can send the test information to the gateway after receiving the test information issued by the tester, and the gateway can send the test information to the virtual module.
S202, receiving test information sent by the gateway through the virtual module, obtaining a test result corresponding to the test information, and sending the test result to the gateway through the virtual module so that the gateway sends the test result to the cloud platform.
The virtual module can receive the test information sent by the gateway and acquire a test result corresponding to the test information based on the test information, in order to facilitate a tester to acquire the test result, the test result can be sent to the gateway through the virtual module, the gateway can send the test result to the cloud platform, and the cloud platform can transmit the test result according to the test type.
Under the condition that the test type is the test interacted with the terminal, the cloud platform can transmit the test result to the terminal, the terminal can display the test result after receiving the test result, and the user can see the information corresponding to the test result.
Under the condition that the test type is a test which does not interact with the terminal, the cloud platform can not transmit the test result, and the cloud platform can display the test result, so that a user can see information corresponding to the test result.
As an implementation manner, in the case that the virtual device includes the virtual module and the virtual chassis, the virtual module may send the test information to the virtual chassis, the virtual chassis may obtain the test result corresponding to the test information based on the test information, and then the virtual chassis may send the test result to the virtual module, so as to perform the step of sending the test result to the gateway.
As another embodiment, in the case that the virtual device includes only the virtual module, the virtual module may acquire a corresponding test result based on the test information, thereby performing the step of transmitting the test result to the gateway.
Therefore, in this embodiment, the device may be tested through the virtual module, without relying on the physical module, so that the test efficiency may be improved, and the test cost may be reduced. Moreover, the virtual module is adopted to test, so that the virtual devices can be accessed simultaneously, and the testing efficiency can be further improved.
As an implementation manner of the embodiment of the present application, the device information includes device unique identification information, where the device unique identification information may be an identification capable of characterizing uniqueness of a virtual device, which is set according to a preset rule. The device unique identification information may also be an encoding of the virtual device. This is reasonable.
The code of the virtual device is a unique code of the internet of things device corresponding to the virtual device determined by a user under the condition of creating the virtual device, and the unique code of the corresponding internet of things device is filled into the virtual device to serve as the code of the virtual device.
In an embodiment, the preset rule may be a rule preset by the user and based on a unique code of the internet of things device to determine the unique device identification information, for example, the unique device identification information may be information corresponding to the creation sequence capable of characterizing the virtual device further added on the basis of the unique code of the internet of things device. For another example, the device unique identification information can be information corresponding to the creation time capable of characterizing the virtual device further added on the basis of the unique code of the internet of things device.
The step of establishing connection with the gateway based on the device information corresponding to the virtual module may include:
Receiving a gateway connection request sent by the gateway based on the unique identification information, and establishing connection with the gateway under the condition that the unique identification information meets a preset identification condition, wherein the gateway acquires the unique identification information from the cloud platform;
or alternatively, the first and second heat exchangers may be,
sending a module connection request to the gateway based on the unique identification information, so that the gateway sends a request comprising the unique identification information to the cloud platform; and receiving connection feedback information, and establishing connection with the gateway under the condition that the connection feedback information indicates that connection can be performed, wherein the connection feedback information is generated based on information sent to the gateway by the cloud platform, and the connection feedback information has a corresponding relation with the module connection request.
That is, the establishment of connection with the gateway based on the device information corresponding to the virtual module is in the following two cases:
in the first case, the gateway may obtain the unique identification information from the cloud platform, and then, the gateway may create a gateway connection request together with the unique identification information and the WIFI protocol, and send the gateway connection request to the virtual module, where the virtual module may receive the gateway connection request sent by the gateway based on the unique identification information.
Wherein the preset identification condition is a condition set based on the unique identification information. The preset identification condition is a condition capable of representing that the unique identification information included in the gateway connection request has a corresponding relation with the unique identification information corresponding to the virtual module.
And under the condition that the virtual module determines that the unique identification information meets the preset identification condition, connection can be established with the gateway. Under the condition that the unique identification information is set according to a preset rule, whether the unique identification information included in the gateway connection request and the unique identification information corresponding to the virtual module have a corresponding relation or not can be determined, and under the condition that the corresponding relation exists, the unique identification information can be determined to meet the preset identification condition, so that connection with the gateway can be established. The preset identification condition may also be a condition capable of characterizing establishment of a connection with the gateway based on the unique identification information.
In the case that the unique identification information is the code of the virtual device, it may be determined whether the unique identification information included in the gateway connection request is consistent with the code of the virtual device, and in the case that the unique identification information is consistent with the code of the virtual device, it may be determined that the unique identification information satisfies a preset identification condition, so that connection may be established with the gateway.
When the unique identification information included in the gateway connection request and the unique identification information corresponding to the virtual module do not have a corresponding relationship, or the unique identification information included in the gateway connection request and the code of the virtual device are inconsistent, it can be determined that the unique identification information does not meet the preset identification condition, and the virtual module and the gateway cannot be connected.
In the second case, the virtual module may generate a module connection request based on the unique identification information and the WIFI protocol, and then may send the module connection request to the gateway, and after receiving the module connection request, the gateway may create a device connection request based on the unique identification information and the http, and then the gateway may send a request including the unique identification information (i.e. the device connection request) to the cloud platform.
The cloud platform can mark the unique identification information included in the equipment connection request, creates equipment feedback information based on the unique identification information and the http, sends the equipment feedback information to the gateway, creates connection feedback information based on the equipment feedback information and the WIFI protocol, and sends the connection feedback information to the virtual module.
The device feedback information is information which is generated by the cloud platform based on the unique identification information and needs to be fed back to the gateway, and the connection feedback information is information which is created by the gateway based on the device feedback information and needs to be sent to the virtual module.
The virtual module may receive the connection feedback information and establish a connection with the gateway if the connection feedback information indicates that a connection is available. The connection feedback information is generated based on information sent to the gateway by the cloud platform, and has a corresponding relation with the module connection request.
In case the connection feedback information indicates that no connection is possible, it is indicated that no connection can be established with the gateway.
It can be seen that in this embodiment, connection with the gateway may be established based on the unique identification information, so that the device may be tested based on the virtual module later.
As an implementation manner of the embodiment of the present application, the step of establishing a connection with the gateway may include:
and filling gateway information corresponding to the gateway into the virtual module. In this way, the virtual module can establish connection with the gateway so as to test the device based on the virtual module.
As an implementation manner of the embodiment of the present application, after the step of filling the gateway information corresponding to the gateway into the virtual module, the method may further include:
and filling the equipment heartbeat information into the virtual module. The device heartbeat information is used for the gateway to verify whether the virtual device is online. In one embodiment, the device heartbeat information may include a sending frequency, that is, the virtual module may send the current heartbeat information to the gateway when the current time satisfies a preset time condition.
The preset time condition may be a condition that a time interval between the current time and the last time of sending the heartbeat information is longer than a preset heartbeat time. The preset time condition may also be a condition that characterizes that the current time reaches a preset time point.
In another embodiment, the device heartbeat information may further include heartbeat identification information, where the heartbeat identification information has a corresponding relationship with the time point information, so that the gateway may obtain an accurate online condition of the virtual device. The time point information is information capable of identifying different time points.
As an implementation manner of the embodiment of the present application, before the step of receiving, by the virtual module, the test information sent by the gateway, the method may further include:
transmitting current heartbeat information to the gateway under the condition that the current time meets the preset time condition, so that the gateway transmits the test information to the virtual module under the condition that the current heartbeat information meets the preset heartbeat condition; or alternatively, the first and second heat exchangers may be,
receiving verification information sent by the gateway, and sending reply information acquired based on the verification information to the gateway, so that the gateway sends the test information to the virtual module under the condition that the reply information meets the preset verification condition.
In order to ensure that the virtual module can receive the test information, the gateway can perform online authentication on the virtual module, and in one embodiment, under the condition that the current time meets the preset time condition, the virtual module can send current heartbeat information to the gateway, wherein the current heartbeat information is generated based on equipment heartbeat information, the current heartbeat information carries unique identification information, and the current heartbeat information carries time point information.
Under the condition that the gateway receives the current heartbeat information, the gateway can determine that the virtual equipment corresponding to the unique identification information is online under the condition that the gateway stores the information with the corresponding relation with the unique identification information carried by the current heartbeat information, and can determine that the current heartbeat information meets the preset heartbeat condition, and can maintain the virtual equipment corresponding to the unique identification information online. And under the condition that the gateway receives the test information, the test information can be sent to the virtual module.
Under the condition that the gateway does not store the information with the corresponding relation with the unique identification information carried by the current heartbeat information, the virtual equipment corresponding to the unique identification information is determined to be not on line, and the current heartbeat information can be determined to not meet the preset heartbeat condition, so that the step of establishing connection with the virtual module can be executed according to actual requirements, and the information that the virtual module is not on line can be sent to the cloud platform. This is reasonable.
The preset heartbeat condition is a condition set based on current heartbeat information, and the preset heartbeat condition can be a condition for representing that the virtual device corresponding to the unique identification information is online.
In one embodiment, when the gateway receives the current heartbeat information, it may be determined whether a difference between time point information corresponding to the current heartbeat information and the current time is smaller than a preset heartbeat duration. And under the condition that the difference value between the time point information and the current time is smaller than the preset heartbeat time length, the virtual equipment corresponding to the unique identification information is indicated to be online and available, so that the current heartbeat information can be determined to meet the preset heartbeat condition.
And under the condition that the difference value between the time point information and the current time is not smaller than the preset heartbeat duration, the virtual equipment corresponding to the unique identification information is not on line or is not available, so that the current heartbeat information can be determined to not meet the preset heartbeat condition.
The preset heartbeat condition may be a condition that a difference value between time point information carried by the current heartbeat information and the current time is smaller than a preset heartbeat duration.
In another embodiment, the gateway may send the verification information to the virtual module when the current time satisfies the preset time condition, and the virtual module may receive the verification information sent by the gateway, and after obtaining the verification information, may obtain the corresponding reply information based on the verification information, and send the reply information to the gateway.
In order to be able to further verify the accuracy of the online, reply information may be generated based on the verification information and the heartbeat identification information comprised by the device heartbeat information. That is, it is reasonable that the reply information may or may not be generated based on the heartbeat identification information. The reply information carries unique identification information.
The gateway can time after sending the verification information, and can determine that the reply information meets the preset verification condition if the reply information is received within the preset time length and the reply information meets the preset reply requirement, so that the test information can be sent to the virtual module after the test information is received. The preset verification condition is that the gateway can be characterized to receive reply information within a preset time period, and the reply information is information generated based on the verification information.
If the reply message is not received within the preset time period, or if the reply message is received but the reply message does not meet the preset reply requirement, the reply message can be determined to not meet the preset verification condition, so that the virtual module can be marked as not being on-line, the step of establishing connection with the virtual module can be executed according to the actual requirement, and the message that the virtual module is not on-line can be sent to the cloud platform. This is reasonable.
Under the condition that the virtual equipment corresponding to the unique identification information carried by the reply message is online, the reply information can be determined to meet the preset reply requirement. Under the condition that the virtual equipment corresponding to the unique identification information carried by the reply message is not on line, the reply message can be determined to not meet the preset reply requirement.
When the virtual device corresponding to the unique identification information carried by the reply message is online and the heartbeat identification information is legal, the reply message can be determined to meet the preset reply requirement. When the virtual device corresponding to the unique identification information carried by the reply message is online, but the heartbeat identification information is illegal, the reply message can be determined to not meet the preset reply requirement. The preset reply requirement is a requirement that virtual equipment corresponding to the unique identification information carried by the reply message is characterized to be online and the heartbeat identification information is legal.
It can be seen that, in this embodiment, by receiving the verification information sent by the gateway, it is possible to verify whether the virtual device is online, so as to ensure that the virtual module can receive the test information.
As an implementation manner of the embodiment of the present application, in the case that the test type is a test that interacts with the terminal, the virtual device also needs to be bound with the user corresponding to the terminal. In this case, the device online information may be sent to the terminal if the cloud platform determines that the virtual device is successfully online.
Before the step of receiving the authentication information sent by the gateway, the method may further include:
The virtual module sends a device binding request to the gateway so that the gateway sends a binding confirmation request to the cloud platform based on the device binding request, the cloud platform sends binding relation information to a terminal based on the binding confirmation request, and the terminal sends the test information to the cloud platform based on the binding relation information.
The virtual module can create a device binding request based on a WIFI protocol and unique identification information and send the device binding request to the gateway, the gateway can create a binding confirmation request to the cloud platform based on http and the unique identification information after receiving the device binding request, and the cloud platform can bind the virtual module with the terminal and send binding feedback information to the gateway under the condition of receiving the binding confirmation request, wherein the binding feedback information is information created based on http and the unique identification information.
After receiving the binding feedback information, the gateway can create device binding feedback information based on the WIFI protocol and the unique identification information and send the device binding feedback information to the virtual module, wherein the binding feedback information can be binding success information or binding unsuccessful information. Accordingly, the device binding feedback information may be device binding success information or device unbinding success information.
Under the condition that the virtual equipment is successfully bound, the cloud platform can send binding relation information to the terminal, so that the terminal can acquire unique identification information of a virtual module with binding relation with the terminal, and further, under the condition that testing is required, the terminal can send testing information to the cloud platform based on the unique identification information and http.
And then the cloud platform can send the test information to the gateway based on the unique identification information and the http, and after the gateway receives the test information, the gateway can send the test information to the corresponding virtual module based on the WIFI protocol and the unique identification information, so that the virtual device can receive the test information.
Under the condition that the test type is a test which does not interact with the terminal, the cloud platform can send the test information to the gateway through the unique identification information and the http, and after the gateway receives the test information, the gateway can send the test information to the corresponding virtual module based on the WIFI protocol and the unique identification information, so that the virtual equipment can receive the test information.
It can be seen that in this embodiment, binding of the virtual module and the terminal may be completed, so as to implement testing of interaction with the terminal.
As an implementation manner of the embodiment of the present application, before the step of establishing a connection with the gateway based on the device information corresponding to the virtual module, the method may further include:
Creating the virtual module, and filling equipment information corresponding to the virtual module into the virtual module, wherein the equipment information comprises unique identification information.
In order to facilitate understanding of the device testing method based on the virtual module provided by the embodiment of the present application, an example of the device testing method based on the virtual module provided by the embodiment of the present application is described below with reference to fig. 3:
as shown in fig. 3, a device testing method based on a virtual module according to an embodiment of the present application may include the following steps:
s301, creating a virtual device.
S302, filling equipment information comprising unique identification information into the virtual module;
s303, establishing connection with the gateway based on the equipment information corresponding to the virtual module, and filling the gateway information corresponding to the gateway into the virtual module;
s304, filling the device heartbeat information into the virtual module.
The device testing method of the virtual module provided by the embodiment of the application is equivalent to being capable of opening the links of the virtual device, the gateway, the terminal and the cloud platform. Therefore, the testing can be realized through the interface corresponding to the cloud platform or the interface corresponding to the terminal.
Fig. 4 is a schematic structural diagram of a device testing apparatus based on a virtual module according to an embodiment of the present application, where a cloud platform, a gateway, and a virtual device are located at a server side. The gateway and the virtual module are based on a WIFI protocol, and interaction is performed among the gateway, the cloud platform and the terminal based on an http protocol.
The device testing apparatus for a virtual module provided by the present application will be described below, and the device testing apparatus for a virtual module described below and the device testing method for a virtual module described above may be referred to correspondingly to each other.
As shown in fig. 5, a device testing apparatus based on a virtual module, the apparatus includes:
the online module 510 is configured to establish connection with a gateway based on device information corresponding to the virtual module, and send a module online request to the gateway, so that the gateway sends the device online request to the cloud platform based on the module online request.
The test module 520 is configured to receive, through the virtual module, the test information sent by the gateway, obtain a test result corresponding to the test information, and send, through the virtual module, the test result to the gateway, so that the gateway sends the test result to the cloud platform.
As one implementation of the embodiment of the present application, the device information includes unique identification information.
The above-mentioned wire-up module 510 includes a first connection unit or a second connection unit.
The first connection unit is used for receiving a gateway connection request sent by the gateway based on the unique identification information, and establishing connection with the gateway under the condition that the unique identification information meets the preset identification condition, wherein the gateway acquires the unique identification information from the cloud platform.
Or alternatively, the first and second heat exchangers may be,
a second connection unit, configured to send a module connection request to the gateway based on the unique identification information, so that the gateway sends a request including the unique identification information to the cloud platform; and receiving connection feedback information, and establishing connection with the gateway under the condition that the connection feedback information indicates that connection can be performed, wherein the connection feedback information is generated based on information sent to the gateway by the cloud platform, and the connection feedback information has a corresponding relation with the module connection request.
As an implementation manner of the embodiment of the present application, the first connection unit or the second connection unit is specifically configured to fill gateway information corresponding to the gateway into the virtual module.
As an implementation manner of the embodiment of the present application, the apparatus further includes a filling module.
And the filling module is used for filling the equipment heartbeat information into the virtual module after filling the gateway information corresponding to the gateway into the virtual module.
As an implementation manner of the embodiment of the present application, the apparatus further includes a first heartbeat module or a second heartbeat module.
The first heartbeat module is used for sending current heartbeat information to the gateway under the condition that the current time meets the preset time condition before the test information sent by the gateway is received through the virtual module, so that the gateway sends the test information to the virtual module under the condition that the current heartbeat information meets the preset heartbeat condition.
Or alternatively, the first and second heat exchangers may be,
the second heartbeat module is used for receiving the verification information sent by the gateway before the virtual module receives the test information sent by the gateway, and sending the reply information acquired based on the verification information to the gateway, so that the gateway sends the test information to the virtual module under the condition that the reply information is determined to meet the preset verification condition.
As an implementation manner of the embodiment of the present application, the apparatus may further include a binding module.
And the binding module is used for sending a device binding request to the gateway by the virtual module before receiving the verification information sent by the gateway, so that the gateway sends a binding confirmation request to the cloud platform based on the device binding request, the cloud platform sends binding relation information to a terminal based on the binding confirmation request, and the terminal sends the test information to the cloud platform based on the binding relation information.
As an implementation manner of the embodiment of the application, the device can further comprise a creation module.
The device comprises a creation module, a gateway and a storage module, wherein the creation module is used for creating the virtual module and filling the device information corresponding to the virtual module into the virtual module before the connection between the device information corresponding to the virtual module and the gateway is established, and the device information comprises unique identification information.
Fig. 6 illustrates a physical schematic diagram of an electronic device, as shown in fig. 6, which may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, and memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a virtual module based device testing method comprising: and establishing connection with the gateway based on the equipment information corresponding to the virtual module, and sending a module online request to the gateway, so that the gateway sends the equipment online request to the cloud platform based on the module online request, receives the test information sent by the gateway through the virtual module, acquires a test result corresponding to the test information, and sends the test result to the gateway through the virtual module, so that the gateway sends the test result to the cloud platform.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present application also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a computer readable storage medium, where the computer program when executed by a processor can perform a device testing method based on a virtual module provided by the above methods, and the method includes: and establishing connection with the gateway based on the equipment information corresponding to the virtual module, and sending a module online request to the gateway, so that the gateway sends the equipment online request to the cloud platform based on the module online request, receives the test information sent by the gateway through the virtual module, acquires a test result corresponding to the test information, and sends the test result to the gateway through the virtual module, so that the gateway sends the test result to the cloud platform.
In still another aspect, the present application further provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where the program executes the virtual module-based device testing method provided by the above methods, where the method includes: and establishing connection with the gateway based on the equipment information corresponding to the virtual module, and sending a module online request to the gateway, so that the gateway sends the equipment online request to the cloud platform based on the module online request, receives the test information sent by the gateway through the virtual module, acquires a test result corresponding to the test information, and sends the test result to the gateway through the virtual module, so that the gateway sends the test result to the cloud platform.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (10)
1. A device testing method based on a virtual module, the method comprising:
establishing connection with a gateway based on equipment information corresponding to a virtual module, and sending a module online request to the gateway so that the gateway sends the equipment online request to a cloud platform based on the module online request;
and receiving the test information sent by the gateway through the virtual module, acquiring a test result corresponding to the test information, and sending the test result to the gateway through the virtual module so that the gateway sends the test result to the cloud platform.
2. The virtual module-based device testing method of claim 1, wherein the device information comprises unique identification information;
The step of establishing connection between the device information corresponding to the virtual module and the gateway comprises the following steps:
receiving a gateway connection request sent by the gateway based on the unique identification information, and establishing connection with the gateway under the condition that the unique identification information meets a preset identification condition, wherein the gateway acquires the unique identification information from the cloud platform;
or alternatively, the first and second heat exchangers may be,
sending a module connection request to the gateway based on the unique identification information, so that the gateway sends a request comprising the unique identification information to the cloud platform; and receiving connection feedback information, and establishing connection with the gateway under the condition that the connection feedback information indicates that connection can be performed, wherein the connection feedback information is generated based on information sent to the gateway by the cloud platform, and the connection feedback information has a corresponding relation with the module connection request.
3. The method for testing a virtual module-based device according to claim 2, wherein said step of establishing a connection with said gateway comprises:
and filling gateway information corresponding to the gateway into the virtual module.
4. A method for testing a device based on a virtual module according to claim 3, wherein after said step of populating said virtual module with gateway information corresponding to said gateway, said method further comprises:
And filling the equipment heartbeat information into the virtual module.
5. The virtual module-based device testing method of claim 1, wherein prior to the step of receiving test information sent by the gateway via the virtual module, the method further comprises:
transmitting current heartbeat information to the gateway under the condition that the current time meets the preset time condition, so that the gateway transmits the test information to the virtual module under the condition that the current heartbeat information meets the preset heartbeat condition; or alternatively, the first and second heat exchangers may be,
receiving verification information sent by the gateway, and sending reply information acquired based on the verification information to the gateway, so that the gateway sends the test information to the virtual module under the condition that the reply information meets the preset verification condition.
6. The virtual module-based device testing method of claim 5, wherein prior to the step of receiving authentication information sent by the gateway, the method further comprises:
the virtual module sends a device binding request to the gateway so that the gateway sends a binding confirmation request to the cloud platform based on the device binding request, the cloud platform sends binding relation information to a terminal based on the binding confirmation request, and the terminal sends the test information to the cloud platform based on the binding relation information.
7. The device testing method according to any one of claims 1 to 6, wherein before the step of establishing a connection with the gateway based on the device information corresponding to the virtual module, the method further comprises:
creating the virtual module, and filling equipment information corresponding to the virtual module into the virtual module, wherein the equipment information comprises unique identification information.
8. A virtual module-based device testing apparatus, the apparatus comprising:
the online module is used for establishing connection with the gateway based on the equipment information corresponding to the virtual module, and sending a module online request to the gateway so that the gateway sends the equipment online request to the cloud platform based on the module online request;
the testing module is used for receiving the testing information sent by the gateway through the virtual module, obtaining a testing result corresponding to the testing information, and sending the testing result to the gateway through the virtual module so that the gateway sends the testing result to the cloud platform.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 7 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310637494.3A CN116647488A (en) | 2023-05-31 | 2023-05-31 | Equipment testing method based on virtual module, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310637494.3A CN116647488A (en) | 2023-05-31 | 2023-05-31 | Equipment testing method based on virtual module, storage medium and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116647488A true CN116647488A (en) | 2023-08-25 |
Family
ID=87643133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310637494.3A Pending CN116647488A (en) | 2023-05-31 | 2023-05-31 | Equipment testing method based on virtual module, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116647488A (en) |
-
2023
- 2023-05-31 CN CN202310637494.3A patent/CN116647488A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106301785B (en) | Method and system for binding intelligent household equipment and intelligent terminal | |
CN109246604A (en) | Smart machine secure binding method, server, smart machine and ustomer premises access equipment | |
CN109525540A (en) | A kind of smart machine binding method and device | |
JP6512725B2 (en) | Method, apparatus, and system for connecting a node to a network | |
CN104348903A (en) | Communication system for establishing P2P connections and the corresponding devices | |
CN114938365B (en) | Function module updating method and device, storage medium and electronic device | |
CN110572857B (en) | Network connection processing method and device, electronic equipment and storage medium | |
CN116647488A (en) | Equipment testing method based on virtual module, storage medium and electronic device | |
CN108134711A (en) | Method, analogue simulation appliance system and the storage medium tested terminal APP | |
CN105721231B (en) | A kind of quality of service perception detection method and device | |
CN114844636A (en) | Method and device for updating access token, storage medium and electronic device | |
CN115174383B (en) | Equipment updating method, storage medium and electronic device | |
CN116170151A (en) | Internet of things terminal association method and Internet of things terminal association system | |
CN118432963A (en) | Service state adjusting method and device | |
CN106936798B (en) | Service authentication method and device | |
CN115484116B (en) | Processing method and device of equipment data, storage medium and electronic device | |
CN115174296B (en) | Equipment function access method and device, storage medium and electronic device | |
CN111669817B (en) | Terminal registration method and device | |
CN114760235B (en) | Method and device for executing dial testing task, storage medium and electronic device | |
CN115277412B (en) | Edge gateway upgrading method and device, storage medium and electronic device | |
CN115174513B (en) | Message pushing method and device, storage medium and electronic device | |
CN115174297B (en) | Method and device for updating attribute information, storage medium and electronic device | |
CN115695233B (en) | Link testing device, method, electronic equipment and computer program product | |
CN116578435A (en) | Fault processing method and device for intelligent household appliance terminal and electronic device | |
CN115314549B (en) | Offline equipment management method, storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |