Custom protocol detection method, cloud platform and storage medium

By obtaining the target protocol and device type, and using the cloud platform to configure and verify the custom protocols for business functions, the problem of low detection efficiency in the existing technology is solved, and fast and accurate custom protocol detection is achieved, which is suitable for the iterative upgrade of smart home appliances.

CN120281690APending Publication Date: 2025-07-08HISENSE HOME APPLIANCES GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311842033.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the method of using interface tools to detect custom protocols is inefficient and cannot quickly and accurately detect custom protocols of smart home appliances, which restricts the iteration speed of smart home appliances.

Method used

Provide a custom protocol detection method, by obtaining target protocol types and device types, verifying the configuration and business functions of the custom protocol based on these types, including conflict verification and executability verification, and using the cloud platform to achieve automated detection.

Benefits of technology

It realizes fast, efficient and accurate custom protocol detection, with a wide range of applications, reducing the development work of technicians when adding protocol detection, and improving the accuracy and iteration speed of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281690A_ABST
    Figure CN120281690A_ABST
Patent Text Reader

Abstract

The invention discloses a custom protocol detection method, a cloud platform and a storage medium, and belongs to the technical field of networks. The method comprises the steps that a target protocol type and a target equipment type are acquired, the target protocol type is the type of a current to-be-detected target custom protocol, and the target equipment type is the type of an intelligent household appliance which adopts the target custom protocol to realize a service function; based on the target protocol type and the target device type, verifying the configuration and / or service function of the target custom protocol; and if the verification is passed, determining that the detection of the target custom protocol is passed, otherwise, determining that the detection of the target custom protocol is not passed. According to the method and the device, the configuration and / or the service function of the target custom protocol are / is verified, so that the target custom protocol can be detected, and the application range is wide; if the configuration and the service function of the target custom protocol are verified, the accuracy of custom protocol detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technologies, and in particular, to a method for detecting a custom protocol, a cloud platform, and a storage medium. Background Art

[0002] In the context of the popularization of smart homes and the ever-changing era of smart home appliances, in order to achieve the iterative upgrade of smart home appliances, it is necessary to quickly develop custom protocols to implement the related functions of smart home appliances. Among them, it is particularly important to detect the correctness of the custom protocol. In the related art, interface tools (such as Postman) are used to detect custom protocols. However, as the types of smart home appliances increase, the number of custom protocols also increases accordingly. The method of using interface tools to detect custom protocols is significantly inefficient and will restrict the iterative speed of smart home appliances. Therefore, how to quickly and accurately detect the correctness of custom protocols has become an urgent problem to be solved. Summary of the Invention

[0003] This application provides a method for detecting a custom protocol, a cloud platform, and a storage medium, which can solve the problem of detecting custom protocols in the related art. The technical solutions are as follows:

[0004] On the one hand, a method for detecting a custom protocol is provided. The method includes:

[0005] Obtain a target protocol type and a target device type, where the target protocol type is the type of the target custom protocol to be detected currently, and the target device type is the type of a smart home appliance device that uses the target custom protocol to implement business functions;

[0006] Based on the target protocol type and the target device type, verify the configuration and / or business functions of the target custom protocol;

[0007] If the verification is passed, it is determined that the target custom protocol passes the detection; otherwise, it is determined that the target custom protocol fails the detection.

[0008] Optionally, the verifying the configuration and / or business functions of the target custom protocol based on the target protocol type and the target device type includes:

[0009] Based on the target protocol type and the target device type, perform a conflict verification on the configuration of the target custom protocol; and / or

[0010] Based on the target device type, perform an executability verification on the business functions of the target custom protocol through a test device.

[0011] Optionally, the conflict verification of the configuration of the target custom protocol based on the target protocol type and the target device type includes:

[0012] Based on the target protocol type and the target device type, obtain the rule configuration information of the target custom protocol, where the rule configuration information includes the position configuration information of multiple fields;

[0013] Based on the position configuration information of the multiple fields, verify the cross-conflict of the multiple fields;

[0014] If there is no cross-conflict among the multiple fields, determine that the configuration of the target custom protocol has no conflict; otherwise, determine that the configuration of the target custom protocol has a conflict.

[0015] Optionally, the position configuration information includes the byte start bit, the bit start bit, and the bit length; the verification of the cross-conflict of the multiple fields based on the position configuration information of the multiple fields includes:

[0016] Based on the byte start bit and the bit start bit of the multiple fields, sort the multiple fields in the order of position to obtain a field sorting result;

[0017] Based on the byte start bit, the bit start bit, and the bit length of the multiple fields, determine the bit positions occupied by the multiple fields respectively;

[0018] If there is no cross between the bit positions occupied by every two adjacent fields in the field sorting result, determine that there is no cross-conflict among the multiple fields;

[0019] If there is a cross between the bit positions occupied by any two adjacent fields in the field sorting result, determine that there is a cross-conflict among the multiple fields.

[0020] Optionally, the verification of the executability of the service function of the target custom protocol by a test device based on the target device type includes:

[0021] Based on the target device type, obtain the service test instruction set and the service test data set corresponding to the target custom protocol, where the service test instruction set includes multiple service test instructions, and the service test data set includes the service test data corresponding to the multiple service test instructions;

[0022] Control the test device to execute at least one service test instruction in the service test instruction set through the target custom protocol;

[0023] If it is determined that the test device can implement the corresponding service functions after executing the at least one service test instruction based on the service test data set, it is determined that the executability verification of the service function of the target custom protocol passes; otherwise, it is determined that the executability verification of the service function of the target custom protocol fails.

[0024] Optionally, before obtaining the target protocol type and the target device type, the method further includes:

[0025] In response to the release operation of the target custom protocol, perform the step of obtaining the target protocol type and the target device type.

[0026] On the other hand, a cloud platform is provided, and the cloud platform includes:

[0027] A processor, configured to obtain a target protocol type and a target device type, where the target protocol type is the type of the target custom protocol to be currently detected, and the target device type is the type of the smart home appliance device that implements the service function using the target custom protocol;

[0028] The processor is further configured to verify the configuration and / or service function of the target custom protocol based on the target protocol type and the target device type;

[0029] The processor is further configured to, if the verification passes, determine that the target custom protocol passes the detection; otherwise, determine that the target custom protocol fails the detection.

[0030] Optionally, the processor is specifically configured to:

[0031] Verify the conflict of the configuration of the target custom protocol based on the target protocol type and the target device type; and / or

[0032] Verify the executability of the service function of the target custom protocol through a test device based on the target device type.

[0033] Optionally, the processor is further configured to:

[0034] Obtain the rule configuration information of the target custom protocol based on the target protocol type and the target device type, where the rule configuration information includes the position configuration information of multiple fields;

[0035] Verify the cross-conflict of the multiple fields based on the position configuration information of the multiple fields;

[0036] If there is no cross-conflict among the multiple fields, determine that the configuration of the target custom protocol has no conflict; otherwise, determine that the configuration of the target custom protocol has a conflict.

[0037] Optionally, the position configuration information includes a byte start bit, a bit start bit, and a bit length; the processor is further configured to:

[0038] Sort the multiple fields in the order of position based on the byte start bit and the bit start bit of the multiple fields to obtain a field sorting result;

[0039] Determine the bit positions occupied by the multiple fields respectively based on the byte start bit, the bit start bit, and the bit length of the multiple fields;

[0040] If there is no intersection in the bit positions occupied by every two adjacent fields in the field sorting result, it is determined that there is no intersection conflict among the multiple fields;

[0041] If there is an intersection in the bit positions occupied by any two adjacent fields in the field sorting result, it is determined that there is an intersection conflict among the multiple fields.

[0042] Optionally, the processor is further configured to:

[0043] Based on the target device type, obtain a service test instruction set and a service test data set corresponding to the target custom protocol, where the service test instruction set includes multiple service test instructions, and the service test data set includes service test data corresponding to the multiple service test instructions;

[0044] Control the test device to execute at least one service test instruction in the service test instruction set through the target custom protocol;

[0045] If it is determined that the test device can implement the corresponding service functions after executing the at least one service test instruction based on the service test data set, it is determined that the executability verification of the service functions of the target custom protocol passes; otherwise, it is determined that the executability verification of the service functions of the target custom protocol fails.

[0046] Optionally, the processor is further configured to:

[0047] In response to the release operation of the target custom protocol, execute the steps of obtaining the target protocol type and the target device type.

[0048] On the other hand, a computer-readable storage medium is provided, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned custom detection method are implemented.

[0049] On the other hand, a computer program product including instructions is provided, and when the instructions run on a computer, the computer is made to execute the steps of the above-mentioned custom detection method.

[0050] The technical solution provided by this application can at least bring the following beneficial effects:

[0051] By obtaining the target protocol type and the target device type, and based on the target protocol type and the target device type, verifying the configuration and / or business functions of the target custom protocol, the detection of the target custom protocol can be achieved. The applicable scope is wide. Even if there is a newly added custom protocol, technicians do not need to develop code separately; moreover, if both the configuration of the target custom protocol and its business functions are verified, the accuracy of custom protocol detection can be improved. Description of the Drawings

[0052] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0053] Figure 1 It is a schematic structural diagram of an implementation environment provided by an embodiment of this application;

[0054] Figure 2 It is a flowchart of a custom protocol detection method provided by an embodiment of this application;

[0055] Figure 3 It is a rule configuration information of a control type custom protocol adopted by a certain air conditioner device provided by an embodiment of this application;

[0056] Figure 4 It is a field sorting result of a control type custom protocol adopted by a certain air conditioner device provided by an embodiment of this application;

[0057] Figure 5 It is another field sorting result of a control type custom protocol adopted by a certain air conditioner device provided by an embodiment of this application;

[0058] Figure 6 It is yet another field sorting result of a control type custom protocol adopted by a certain air conditioner device provided by an embodiment of this application;

[0059] Figure 7 It is a schematic structural diagram of a cloud platform provided by an embodiment of this application. Detailed Embodiments

[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will further describe the implementation manners of this application in detail with reference to the drawings.

[0061] Before explaining the custom protocol detection method provided by the embodiments of the present application in detail, the application scenarios and implementation environments involved in the embodiments of the present application will be introduced first.

[0062] In the context of the popularization of smart homes and the ever-changing era of smart home appliances, in order to achieve the iterative upgrade of smart home appliances, it is necessary to quickly develop custom protocols to implement the related functions of smart home appliances. For example, functions such as remote control of smart home appliances can be realized. If there is an error in the custom protocol, it may cause the operation of smart home appliances to malfunction. Therefore, it is particularly important to detect the correctness of the custom protocol.

[0063] In the related art, an interface tool is used to detect the custom protocol. For example, Postman can be used to detect the custom protocol. However, as the types of smart home appliances increase, the number of custom protocols also increases. When using Postman to detect the custom protocol of a newly added type of smart home appliance, after a technician invokes Postman, separate code needs to be developed for this custom protocol to perform the detection. Therefore, the detection speed of the custom protocol will be reduced, thus restricting the iterative speed of smart home appliances.

[0064] Based on this, the embodiments of the present application provide a custom protocol detection method, which can be automatically adapted according to the custom protocols of various device types. That is to say, even when detecting the custom protocol of a newly added device type, technicians do not need to develop code separately and can directly use this method to perform efficient and accurate custom protocol detection.

[0065] The implementation environment in the embodiments of the present application includes a cloud platform 101. The cloud platform 101 is used to obtain the type of the target custom protocol to be detected currently, that is, the target protocol type, and obtain the type of the smart home appliance device that implements the service function using the target custom protocol, that is, the target device type, and based on the target protocol type and the target device type, verify the configuration of the target custom protocol. If the verification passes, it is determined that the target custom protocol passes the detection; otherwise, it is determined that the target custom protocol fails the detection.

[0066] The cloud platform 101 can be an independent server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, detection services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, or a cloud computing service center.

[0067] In some embodiments, please refer toFigure 1 The implementation environment further includes a test device 102, and the cloud platform 101 can be communicatively connected to the test device 102. This communicative connection can be a wired or wireless connection, and the embodiments of the present application do not make any limitation thereto.

[0068] In Figure 1 the shown implementation environment, the cloud platform 101 is further configured to control the test device 102 to execute at least one service test instruction in the service test instruction set through a target custom protocol, so as to verify the service function of the target custom protocol.

[0069] The test device 102 can be any kind of smart home appliance, such as a smart TV, a smart speaker, a smart air conditioner, etc.

[0070] Those skilled in the art should understand that the above-mentioned cloud platform 101 and test device 102 are only examples. Other existing or future possible cloud platforms or test devices, if applicable to the embodiments of the present application, should also be included within the protection scope of the embodiments of the present application and are hereby incorporated herein by reference.

[0071] It should be noted that the application scenarios and implementation environments described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the emergence of new application scenarios and the evolution of implementation environments, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0072] Next, a detailed explanation of the custom protocol detection method provided by the embodiments of the present application will be given.

[0073] Figure 2 is a flowchart of a custom protocol detection method provided by the embodiments of the present application, and this method is applied to a cloud platform. Please refer to Figure 2 and this method includes the following steps.

[0074] Step 201: Obtain a target protocol type and a target device type. The target protocol type is the type of the target custom protocol to be currently detected, and the target device type is the type of the smart home appliance device that implements service functions using the target custom protocol.

[0075] The types of custom protocols include control types, status types, function types, etc. Among them, the control-type custom protocol can be used to control a device, the status-type protocol can be used to keep a device in a certain state, and the function-type custom protocol can be used to enable a device to implement a certain function. The device types include air conditioner types, refrigerator types, washing machine types, etc.

[0076] In some embodiments, the target custom protocol can be configured by technicians. That is to say, technicians can select any intelligent home appliance device and configure a certain type of custom protocol so that the intelligent home appliance device can implement corresponding service functions by adopting this custom protocol.

[0077] Therefore, in order to obtain the target protocol type and the target device type, the cloud platform can provide a configuration interface, which may include an input box for the target protocol type and an input box for the target device type. In this way, technicians can input the target protocol type to be detected currently in the input box for the target protocol type, and input the target device type corresponding to the target custom protocol in the input box for the target device type, so that the cloud platform can obtain the target protocol type and the target device type.

[0078] It should be noted that the above is to obtain the target protocol type and the target device type by technicians inputting in the configuration interface. In actual applications, other methods can also be used to obtain the target protocol type and the target device type, and the embodiments of the present application do not limit this.

[0079] In some embodiments, before obtaining the target protocol type and the target device type, the steps of obtaining the target protocol type and the target device type can also be executed in response to the release operation of the target custom protocol. That is to say, the cloud platform can detect the target custom protocol by the method provided in the embodiments of the present application before releasing the target custom protocol.

[0080] Step 202: Verify the configuration and / or service functions of the target custom protocol based on the target protocol type and the target device type.

[0081] In some embodiments, conflict verification can be performed on the configuration of the target custom protocol based on the target protocol type and the target device type; and / or, based on the target device type, the test device can perform executability verification on the service functions of the target custom protocol.

[0082] That is to say, in some embodiments, only conflict verification can be performed on the configuration of the target custom protocol. In other embodiments, only executability verification can be performed on the service functions of the target custom protocol. In still other embodiments, both conflict verification can be performed on the configuration of the target custom protocol and executability verification can be performed on the service functions of the target custom protocol.

[0083] As an example, the configuration of the target custom protocol can be verified for conflicts first, and then the executability of the business functions of the target custom protocol can be verified. Of course, in actual applications, the executability of the business functions of the target custom protocol can also be verified first, and then the configuration of the target custom protocol can be verified for conflicts. The embodiments of the present application do not limit this.

[0084] In some embodiments, the configuration of the target custom protocol can be verified for conflicts through the following steps (1)-(3).

[0085] (1) Based on the target protocol type and the target device type, obtain the rule configuration information of the target custom protocol, where the rule configuration information includes the position configuration information of multiple fields.

[0086] The custom protocol of a certain type configured for a device type is unique. That is to say, the configuration of the custom protocol of a certain type adopted by a certain type of smart home appliance device is consistent. For example, the configuration of the control custom protocol adopted by all smart air conditioner devices of type X is consistent. Thus, the cloud platform can obtain the rule configuration information of the target custom protocol corresponding to the target protocol type and the target device type from its own database based on the target protocol type and the target device type.

[0087] The target custom protocol may include multiple fields, and the rule configuration information of the target custom protocol includes the position configuration information of the multiple fields. Therefore, by obtaining the rule configuration information of the target custom protocol, the position configuration information of the multiple fields can be obtained for subsequent steps.

[0088] (2) Based on the position configuration information of the multiple fields, verify the cross-conflicts of the multiple fields.

[0089] In some embodiments, the position configuration information includes the byte start bit, the bit start bit, and the bit length; the cross-conflicts of the multiple fields can be verified through the following steps a-d.

[0090] a. Based on the byte start bit and the bit start bit of the multiple fields, sort the multiple fields in the order of position to obtain a field sorting result.

[0091] Among them, the byte start bit is used to indicate the position of the start byte configured for each field in the custom protocol. For example, please refer to Figure 3 , Figure 3 is the rule configuration information of a control custom protocol adopted by a certain air conditioner device. From Figure 3As can be seen from the table shown, the byte start bit of the wind speed control field is 1, the byte start bit of the temperature control field is also 1, the byte start bit of the wind direction control field is 3, and the byte start bit of the mode control is 2.

[0092] The bit start bit is used to indicate the position of the start bit configured for each field in the custom protocol. That is, each byte contains 8 bits, and the bit start bit is the position of the start bit of each field in that byte. For example, please refer to Figure 3 , from Figure 3 it can be seen that the bit start bit of the wind speed control field is 7, the bit start bit of the temperature control field is 3, the bit start bit of the wind direction control field is 5, and the bit start bit of the mode control field is 7.

[0093] When sorting the multiple fields in the order of their positions based on the byte start bits and bit start bits of the multiple fields, the sorting can be first performed in ascending order of the byte start bits. For fields with the same byte start bit, the sorting is then performed in descending order of the bit start bits, so as to obtain the field sorting result. For example, according to Figure 3 the rule configuration information shown, sorting the wind speed control field, the temperature control field, the wind direction control field, and the mode control field, the field sorting result as shown in Figure 4 can be obtained. From the field sorting result shown in Figure 4 , it can be seen that the order of the above four fields is: the wind speed control field, the temperature control field, the mode control field, and finally the wind direction control field.

[0094] b. Determine the bit positions occupied by the multiple fields respectively based on the byte start bits, bit start bits, and bit lengths of the multiple fields.

[0095] The bit length indicates the number of bits occupied by each field. In some embodiments, for each field in the multiple fields, the start byte where the field is located can be determined according to the byte start bit of the field, and the start bit where the field is located can be determined from the start byte where the field is located according to the bit start bit of the field. Then, starting from the start bit, the bits with the bit number equal to the bit length of the field are determined as the bit positions occupied by the field. For example, in combination with Figure 3 the rule configuration information shown and Figure 4From the field sorting result shown, the byte start bit of the wind speed control field is 1, the bit start bit is 7, and the bit length is 1. Thus, it can be determined that the bit position occupied by the wind speed control field is the 7th bit of the 1st byte; the byte start bit of the temperature control is 1, the bit start bit is 3, and the bit length is 2. Thus, it can be determined that the bit positions occupied by the temperature control field are the 3rd bit and the 2nd bit of the 1st byte; similarly, it can be determined that the bit positions occupied by the wind direction control field are the 5th bit, the 4th bit, the 3rd bit, the 2nd bit, the 1st bit, and the 0th bit of the 3rd byte; the bit positions occupied by the mode control field are the 7th bit, the 6th bit, the 5th bit, and the 4th bit of the 2nd byte.

[0096] It should be noted that the above is based on the byte start bit, bit start bit, and bit length of the multiple fields to determine the bit positions respectively occupied by the multiple fields. In practical applications, the bit positions respectively occupied by the multiple fields can also be determined by other means, and the embodiments of the present application do not limit this.

[0097] c. If there is no overlap in the bit positions occupied by every two adjacent fields in the field sorting result, it is determined that there is no crossover conflict among the multiple fields.

[0098] Continuing the above description, after determining the bit positions respectively occupied by the multiple fields, it can be determined whether there is a situation where one or more bit positions are occupied by multiple fields at the same time according to the field sorting result, that is, according to the field sorting result, it is determined whether there is a crossover conflict among the multiple fields.

[0099] In some embodiments, the bit positions respectively occupied by the i-th field and the (i + 1)-th field in the field sorting result are compared in sequence. If there is no overlap in the bit positions of the i-th field and the (i + 1)-th field, it is determined that there is no overlap in the bit positions of the i-th and (i + 1)-th fields, and there is no crossover conflict among the multiple fields. That is to say, if there is no overlap in the bit positions respectively occupied by every two adjacent fields, it is determined that there is no crossover conflict among the multiple fields.

[0100] For example, as Figure 4For the field sorting result shown, by comparing the bit positions occupied by adjacent wind speed control fields and temperature control fields respectively, it can be determined that there is no overlap between the wind speed control field and the temperature control field; by comparing the bit positions occupied by adjacent temperature control fields and mode control fields respectively, it can be determined that there is no overlap between the temperature control field and the mode control field; by comparing the bit positions occupied by adjacent mode control fields and wind direction control fields respectively, it can be determined that there is no overlap between the mode control field and the wind direction control field. In summary, since the bit positions occupied by each pair of adjacent fields do not overlap, it can be determined that there are no cross conflicts among the wind speed control field, the temperature control field, the mode control field, and the wind direction control field.

[0101] d. If there is an overlap in the bit positions occupied by any two adjacent fields in the field sorting result, it is determined that there is a cross conflict among the multiple fields.

[0102] In some embodiments, the bit positions occupied by the i-th field and the (i + 1)-th field in the field sorting result can be compared respectively. If there is an overlap in the bit positions of the i-th field and the (i + 1)-th field, it is determined that there is an overlap in the bit positions of the i-th and (i + 1)-th fields, and it is determined that there is a cross conflict among the multiple fields. That is to say, if after one or more comparisons of the bit positions occupied by each pair of adjacent fields, as long as there is at least one comparison result indicating an overlap in the bit positions occupied by the two fields, it is determined that there is a cross conflict among the multiple fields.

[0103] For example, as Figure 5 shown in the field sorting result, Figure 5 is another field sorting result of a custom control protocol adopted by a certain air conditioning device. By comparing the bit positions occupied by the adjacent temperature control field and mode control field in Figure 5 , it can be determined that there is no cross conflict between the temperature control field and the mode control field; by comparing the bit positions occupied by the adjacent mode control field and wind speed control field respectively, it can be determined that both the mode control field and the wind speed control field occupy the 4th bit in the 2nd byte. Therefore, there is an overlap between the mode control field and the wind speed control field; by comparing the bit positions occupied by the adjacent wind speed control field and wind direction control field respectively, it can be determined that there is no overlap between the wind speed control field and the wind direction control field. In summary, because there is an overlap between the mode control field and the wind speed control field, it is determined that there is a cross conflict among the above four fields.

[0104] In some other embodiments, in the field sorting result, it is possible that the bit positions occupied by a certain field include all the bit positions occupied by one or more other fields. Therefore, after determining the bit positions occupied by the multiple fields respectively, the bit positions occupied by the multiple fields in the field sorting result can be compared simultaneously. If it is compared that at least one bit position is occupied by multiple fields simultaneously, it is determined that there is a cross conflict among the multiple fields.

[0105] For example, as Figure 6 shown in the field sorting result, it can be obtained that the bit positions occupied by the mode control field are the 5th bit, 4th bit, 3rd bit, 2nd bit, 1st bit, 0th bit in the 1st byte and the 7th bit, 6th bit, 5th bit, 4th bit, 3rd bit in the 2nd byte; the bit positions occupied by the temperature control field are the 3rd bit and 2nd bit in the 1st byte; the bit positions occupied by the wind speed control field are the 7th bit, 6th bit, and 5th bit in the 2nd byte; the bit positions occupied by the wind direction control field are the 5th bit, 4th bit, 3rd bit, 2nd bit, 1st bit, and 0th bit in the 3rd byte. By comparing the bit positions occupied by the above four fields simultaneously, it can be determined that the 3rd bit and 2nd bit in the 1st byte are occupied by the mode control field and the temperature field simultaneously. Therefore, there is a cross in the bit positions occupied by the mode control field and the temperature control field. Similarly, the 7th bit, 6th bit, and 5th bit in the 2nd byte are occupied by the mode control field and the wind speed control field simultaneously. Therefore, there is a cross in the bit positions occupied by the mode control field and the wind speed control field. In summary, it can be determined that there is a cross conflict among the multiple fields.

[0106] (3) If there is no cross conflict among the multiple fields, it is determined that the configuration of the target custom protocol has no conflict; otherwise, it is determined that the configuration of the target custom protocol has a conflict.

[0107] In some embodiments, based on the position configuration information of the multiple fields, it can be determined whether there is a cross conflict among the multiple fields. If there is no cross conflict among the multiple fields, it is determined that the configuration of the target custom protocol has no conflict, that is, the target custom protocol passes the configuration conflict verification; if there is a cross conflict among the multiple fields, it is determined that the configuration of the target custom protocol has a conflict, that is, the target custom protocol fails the configuration conflict verification.

[0108] In some embodiments, the executability verification of the service function of the target custom protocol can be performed by a test device according to the following steps (1)-(3).

[0109] (1) Based on the target device type, obtain the service test instruction set and service test data set corresponding to the target custom protocol. The service test instruction set includes multiple service test instructions, and the service test data set includes the service test data corresponding to the multiple service test instructions.

[0110] In some embodiments, due to different device types, the service functions that can be achieved by the adopted custom protocols are also different. Therefore, the service test instruction set and service test data set used to verify the executability of the service functions of the custom protocol are also different. Thus, the cloud platform can obtain the service test instruction set and service test data set corresponding to the target custom protocol based on the target device type.

[0111] Among them, the service test instruction set includes multiple service test instruction sets. The multiple service test instructions are used to test whether the test device can achieve the corresponding service functions after adopting the target custom protocol. That is to say, the multiple service test instructions can test the executability of multiple fields in the target custom protocol. For example, if the target device is an air-conditioning device, the service test instruction to control the temperature to decrease can test the executability of the temperature control field in the target custom protocol, and the service test instruction to control the wind speed to increase can test the executability of the wind speed control field in the target custom protocol, and so on. Different service test instructions can test the executability of the corresponding fields.

[0112] The service test data set includes multiple service test data corresponding to the multiple service test instructions. The multiple service test data are used to verify the correctness of the test device executing the service test instructions. That is to say, the multiple service test data are the correct data after the test device completes the service test instructions. For example, if the target device is an air-conditioning device, the service test data corresponding to the service test instruction to control the wind speed to increase is that the wind speed generated by the test device increases, and the service test data corresponding to the service test instruction to control the temperature to increase is that the temperature of the wind generated by the test device increases.

[0113] Due to the increase in device types and the update and iteration of devices, the original service test instruction set may not be able to meet the requirements for verifying the executability of the service functions of the newly added custom protocol. Therefore, the service test instruction set can update and expand the included service test instructions during the process of custom protocol testing.

[0114] As an example, it is possible to determine whether a service test instruction set includes service test instructions that enable a test device to implement the multiple service functions by parsing the multiple service functions corresponding to multiple fields of a custom protocol. If there are no corresponding service test instructions in the service test instruction set that can enable the test device to implement at least one of the multiple service functions, new service test instructions are added to the service test instruction set based on the at least one service function. Of course, in actual applications, the service test instruction set can also be updated manually. That is, before verifying the executability of the service functions of the target custom protocol, technicians can update and expand the service test instruction set according to the service functions corresponding to the multiple fields included in the target custom protocol. That is, the embodiments of the present application do not limit the method for updating and expanding the service test instruction set.

[0115] It should be noted that the service test instruction set can be the service test instruction set corresponding to multiple types of custom protocols, or it can be only the service test instruction set corresponding to the target custom protocol. The embodiments of the present application do not limit this.

[0116] (2) Control the test device to execute at least one service test instruction in the service test instruction set through the target custom protocol.

[0117] In some embodiments, at least one service test instruction can be extracted from the service test instruction set according to the functions corresponding to the multiple fields included in the target custom protocol. The at least one service test instruction corresponds one-to-one with at least one of the multiple fields included in the target custom protocol. Then, the test device is controlled to execute the at least one service test instruction to test the executability of the at least one field.

[0118] As an example, if the target protocol type is a control type, the target device type is an air conditioner type, and the target custom protocol includes a wind speed control field, a temperature control field, a wind direction control field, and a mode control field, the cloud platform can extract at least three service test instructions from the service test instruction set based on the functions corresponding to the above four fields. The three service test instructions can be used to test the executability of the corresponding three fields among the above four fields respectively. For example, the three service test instructions extracted based on the above four fields can be to control the temperature to rise, control the wind speed to decrease, and control the mode to switch to the sleep mode. Among them, the service test instruction to control the temperature to rise is used to test the executability of the temperature control field, the service test instruction to control the wind speed to decrease is used to test the executability of the wind speed control field, and the control mode to switch to the sleep mode is used to test the executability of the mode control field. Since the target custom protocol does not include a control device shutdown field, the extracted test service instruction cannot be to control the device to shut down.

[0119] (3) If it is determined that the test device can achieve the corresponding service functions after executing the at least one service test instruction based on the service test data set, it is determined that the executability verification of the service function of the target custom protocol passes; otherwise, it is determined that the executability verification of the service function of the target custom protocol fails.

[0120] Based on the above description, the service test data set is used to verify the correctness of the test device executing the service test instruction. Therefore, after the test device can be controlled by the target custom protocol to execute at least one service test instruction in the service test instruction set, the service execution data obtained after the test device executes the at least one service test instruction can be compared with the service test data corresponding to the at least one service test instruction, so as to determine whether the service execution data of the at least one service test instruction is consistent with the corresponding service test data.

[0121] If the test device can achieve the corresponding service functions after executing the at least one service test instruction, that is, if the service execution data obtained after the test device executes the at least one service test instruction is consistent with the service test data corresponding to the at least one service test instruction, it is determined that the executability verification of the service function of the target custom protocol passes; if the test device cannot achieve the corresponding service functions after executing any one of the at least one service test instruction, that is, if the service execution data of any one of the service test instructions executed by the test device is inconsistent with the service test data corresponding to the service test instruction, it is determined that the executability verification of the target custom protocol fails.

[0122] Step 203: If the verification passes, it is determined that the target custom protocol is detected to pass; otherwise, it is determined that the target custom protocol is detected to fail.

[0123] In some embodiments, in the case of only performing conflict verification on the configuration of the target custom protocol, if the conflict verification of the configuration of the target custom protocol passes, it is determined that the target custom protocol is detected to pass; if the conflict verification of the configuration of the target custom protocol fails, it is determined that the target custom protocol is detected to fail.

[0124] In other embodiments, in the case of only performing executability verification on the service function of the target custom protocol, if the executability verification of the service function of the target custom protocol passes, it is determined that the target custom protocol is detected to pass; if the executability verification of the service function of the target custom protocol fails, it is determined that the target custom protocol is detected to fail.

[0125] In some other embodiments, when both the conflict verification of the configuration of the target custom protocol and the executability verification of the business function of the target custom protocol are performed, if the verifications in both of the above aspects pass, it is determined that the detection of the target custom protocol passes; if the verification in any one of the above two aspects fails, it is determined that the detection of the target custom protocol fails. That is to say, if the conflict verification of the configuration of the target custom protocol passes, but the executability verification of the business function fails, it is determined that the detection of the target custom protocol fails. Similarly, if the executability verification of the business function of the target custom protocol passes, but the conflict verification of the configuration fails, it is also determined that the detection of the target custom protocol fails.

[0126] Based on the above description, the cloud platform can detect the target custom protocol by using the method provided in the embodiments of the present application before publishing the target custom protocol. In this way, when it is determined that the detection of the target custom protocol passes, the publishing of the target custom protocol can be continued; when it is determined that the detection of the target custom protocol fails, the publishing of the target custom protocol is not executed, that is, the publishing operation of the target custom protocol fails.

[0127] The embodiments of the present application can realize the detection of the target custom protocol by obtaining the target protocol type and the target device type, and verifying the configuration and / or business function of the target custom protocol based on the target protocol type and the target device type. The applicable range is wide. Even if there is a newly added custom protocol, technicians do not need to develop code separately; moreover, if both the configuration of the target custom protocol and its business function are verified, the accuracy of the custom protocol detection can be improved. Furthermore, before the cloud platform publishes the target custom protocol, the method provided in the embodiments of the present application is automatically used to detect the target custom protocol, realizing the automatic operation of the custom protocol test.

[0128] Figure 7 It is a schematic structural diagram of a cloud platform 700 provided by the embodiments of the present application. Please refer to Figure 7 , the cloud platform 700 includes: a processor 701.

[0129] The processor 701 is configured to obtain a target protocol type and a target device type, where the target protocol type is the type of the target custom protocol to be currently detected, and the target device type is the type of the smart home appliance device that implements the business function using the target custom protocol;

[0130] The processor 701 is further configured to verify the configuration and / or business function of the target custom protocol based on the target protocol type and the target device type;

[0131] The processor 701 is further configured to, if the verification is passed, determine that the target custom protocol passes the detection; otherwise, determine that the target custom protocol fails the detection.

[0132] Optionally, the processor 701 is specifically configured to:

[0133] Perform conflict verification on the configuration of the target custom protocol based on the target protocol type and the target device type; and / or

[0134] Perform executability verification on the service function of the target custom protocol through a test device based on the target device type.

[0135] Optionally, the processor 701 is further configured to:

[0136] Obtain the rule configuration information of the target custom protocol based on the target protocol type and the target device type, where the rule configuration information includes the position configuration information of multiple fields;

[0137] Verify the cross-conflict of the multiple fields based on the position configuration information of the multiple fields;

[0138] If there is no cross-conflict among the multiple fields, determine that the configuration of the target custom protocol has no conflict; otherwise, determine that the configuration of the target custom protocol has a conflict.

[0139] Optionally, the position configuration information includes the byte start bit, the bit start bit, and the bit length; the processor 701 is further configured to:

[0140] Sort the multiple fields in the order of position based on the byte start bit and the bit start bit of the multiple fields to obtain a field sorting result;

[0141] Determine the bit positions occupied by the multiple fields respectively based on the byte start bit, the bit start bit, and the bit length of the multiple fields;

[0142] If there is no cross between the bit positions occupied by every two adjacent fields in the field sorting result, determine that there is no cross-conflict among the multiple fields;

[0143] If there is a cross between the bit positions occupied by any two adjacent fields in the field sorting result, determine that there is a cross-conflict among the multiple fields.

[0144] Optionally, the processor 701 is further configured to:

[0145] Obtain the service test instruction set and the service test data set corresponding to the target custom protocol based on the target device type, where the service test instruction set includes multiple service test instructions, and the service test data set includes the service test data corresponding to the multiple service test instructions;

[0146] Control the test device to execute at least one service test instruction in the service test instruction set through the target custom protocol;

[0147] If it is determined that the test device can achieve the corresponding service functions after executing at least one service test instruction based on the service test data set, it is determined that the executability verification of the service function of the target custom protocol passes; otherwise, it is determined that the executability verification of the service function of the target custom protocol fails.

[0148] Optionally, the processor 701 is further configured to:

[0149] In response to the release operation of the target custom protocol, execute the steps of obtaining the target protocol type and the target device type.

[0150] In the embodiments of the present application, by obtaining the target protocol type and the target device type, and based on the target protocol type and the target device type, verifying the configuration and / or service function of the target custom protocol, the detection of the target custom protocol can be achieved, with a wide range of applications. Even if there are newly added custom protocols, technicians do not need to develop code separately; moreover, if both the configuration of the target custom protocol and its service function are verified, the accuracy of custom protocol detection can be improved. Furthermore, before the target custom protocol is released on the cloud platform, the method provided in the embodiments of the present application is automatically used to detect the target custom protocol, realizing the automated operation of custom protocol testing.

[0151] It should be noted that: when the cloud platform 700 provided in the above embodiments detects a custom protocol, only the division of the above-mentioned functional devices is used for illustration. In practical applications, the above functions can be allocated to different functional devices according to needs, that is, the internal structure of the cloud platform 700 is divided into different functional devices to complete all or part of the functions described above. In addition, the cloud platform 700 provided in the above embodiments and the embodiments of the custom protocol detection method belong to the same concept, and the specific implementation process is detailed in the method embodiments and will not be elaborated here.

[0152] In some embodiments, a computer-readable storage medium is further provided. The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the custom protocol detection method in the above embodiments are implemented. For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0153] It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.

[0154] It should be understood that all or part of the steps of implementing the above embodiments can be realized by software, hardware, firmware, or any combination thereof. When implemented using software, it can be realized in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above computer-readable storage medium.

[0155] That is, in some embodiments, a computer program product containing instructions is also provided. When it runs on a computer, it causes the computer to execute the steps of the above-mentioned custom protocol detection method.

[0156] It should be understood that the "at least one" mentioned herein refers to one or more, and "a plurality" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B can mean A or B; the "and / or" herein is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the terms "first", "second", etc. do not limit the quantity and execution order, and the terms "first", "second", etc. do not necessarily mean different.

[0157] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of the present application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

[0158] The above are the embodiments provided by the present application, which are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A custom protocol detection method, characterized in that, The method includes: Obtaining a target protocol type and a target device type, where the target protocol type is the type of a target custom protocol to be currently detected, and the target device type is the type of an intelligent home appliance device that implements business functions using the target custom protocol; Based on the target protocol type and the target device type, verifying the configuration and / or business functions of the target custom protocol; If the verification passes, it is determined that the target custom protocol passes the detection; otherwise, it is determined that the target custom protocol fails the detection.

2. The method according to claim 1, wherein The verifying the configuration and / or business functions of the target custom protocol based on the target protocol type and the target device type includes: Based on the target protocol type and the target device type, performing conflict verification on the configuration of the target custom protocol; and / or Based on the target device type, performing executability verification on the business functions of the target custom protocol through a test device.

3. The method according to claim 2, wherein The performing conflict verification on the configuration of the target custom protocol based on the target protocol type and the target device type includes: Based on the target protocol type and the target device type, obtaining rule configuration information of the target custom protocol, where the rule configuration information includes position configuration information of multiple fields; Based on the position configuration information of the multiple fields, verifying cross-conflicts of the multiple fields; If there are no cross-conflicts among the multiple fields, it is determined that the configuration of the target custom protocol has no conflicts; otherwise, it is determined that the configuration of the target custom protocol has conflicts.

4. The method according to claim 3, characterized in that The position configuration information includes a byte start bit, a bit start bit, and a bit length; the verifying cross-conflicts of the multiple fields based on the position configuration information of the multiple fields includes: Based on the byte start bits and bit start bits of the multiple fields, sorting the multiple fields in the order of position to obtain a field sorting result; Based on the byte start bits, bit start bits, and bit lengths of the multiple fields, determining the bit positions occupied by the multiple fields respectively; If there are no intersections in the bit positions occupied by every two adjacent fields in the field sorting result, it is determined that there are no cross-conflicts among the multiple fields; If there are intersections in the bit positions occupied by any two adjacent fields in the field sorting result, it is determined that there are cross-conflicts among the multiple fields.

5. The method according to claim 2, wherein The performing executability verification on the business functions of the target custom protocol through a test device based on the target device type includes: Based on the target device type, obtaining a business test instruction set and a business test data set corresponding to the target custom protocol, where the business test instruction set includes multiple business test instructions, and the business test data set includes business test data corresponding to the multiple business test instructions; Controlling the test device to execute at least one business test instruction in the business test instruction set through the target custom protocol; If it is determined that the test device can achieve the corresponding service functions after executing the at least one service test instruction based on the service test data set, it is determined that the executability verification of the service function of the target custom protocol passes; otherwise, it is determined that the executability verification of the service function of the target custom protocol fails.

6. The method according to claim 1, wherein Before obtaining the target protocol type and the target device type, the method further includes: In response to the release operation of the target custom protocol, execute the step of obtaining the target protocol type and the target device type.

7. A cloud platform, characterized in that, The cloud platform includes: A processor, configured to obtain a target protocol type and a target device type, where the target protocol type is the type of the target custom protocol to be currently detected, and the target device type is the type of the smart home device that implements service functions using the target custom protocol; The processor is further configured to verify the configuration and / or service function of the target custom protocol based on the target protocol type and the target device type; The processor is further configured to, if the verification passes, determine that the target custom protocol passes the detection; otherwise, determine that the target custom protocol fails the detection.

8. The cloud platform according to claim 7, characterized in that, Specifically, the processor is configured to: Verify conflicts in the configuration of the target custom protocol based on the target protocol type and the target device type; and / or Verify the executability of the service function of the target custom protocol through a test device based on the target device type.

9. The cloud platform according to claim 7, wherein The processor is further configured to: In response to the release operation of the target custom protocol, execute the step of obtaining the target protocol type and the target device type.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the method according to any one of claims 1-6 are implemented.