Internet of Things platform function test method and system, electronic equipment and storage medium
By processing and analyzing the interactive data between the Internet of Things platform and terminal, using word embedding and forward and reverse prediction models, the test efficiency and accuracy problems caused by instability of the Internet of Things terminal are solved, and efficient and accurate functional testing is achieved.
Patent Information
- Application Number
- CN202411723105.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Due to the instability of IoT terminals, due to various factors such as environment, hardware, and software, the testing efficiency of IoT platforms is inefficient and it is difficult to accurately determine whether the platform has functional defects.
By obtaining the interactive data between the platform and the terminal, performing word segmentation and word vector replacement processing, determining the word vector characteristics, and performing word embedding processing based on the number of messages, obtaining feature vectors, and inputting them to the forward and reverse prediction model to obtain functional test results.
It realizes accurate judgment of whether the IoT platform has functional defects, reduces the difficulty of testing, and improves the accuracy of test results.
Smart Images

Figure CN119892684A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a method, system, electronic device and storage medium for functional testing of an Internet of Things platform. Background Art
[0002] With the rapid development of IoT technology, the stable operation of IoT platforms and terminal devices has become a key factor affecting the performance of the entire IoT system. However, IoT terminals are often unstable due to various factors such as environment, hardware, and software, which poses a great challenge to the testing of IoT platforms. Specifically, when a test fails, it is impossible to determine whether the test failure is caused by the unstable operation of the terminal. The testing methods in related technologies often rely on manual operations, which are inefficient and difficult to accurately determine whether there are problems with the IoT platform. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide an efficient Internet of Things platform function testing method, system, electronic device and storage medium.
[0004] To achieve the above purpose, an embodiment of the present application proposes a method for functional testing of an Internet of Things platform, the method comprising: obtaining interactive data between a platform and a terminal; the interactive data includes several use cases; each of the use cases includes several messages; the interactive data is segmented and word vector replaced to obtain word vector features; based on the word vector features, the number of messages corresponding to each first word in each use case is determined; the number of messages is the number of messages including a preset word in each use case; the preset word is a word similar to the first word; based on the number of messages, each message is word embedded to determine a feature vector; the feature vector is input into a forward and reverse prediction model to obtain a prediction result, and the functional test result of the Internet of Things platform is determined according to the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case. The embodiment of the present application processes the interactive data between the platform and the terminal, and obtains a feature vector by word embedding based on the number of messages, and then predicts through a forward prediction model to obtain a functional test result. The embodiment of the present application can accurately determine whether the Internet of Things platform has functional defects, which is conducive to reducing the difficulty of testing and improving the accuracy of test results.
[0005] In some embodiments, the method provided in the embodiment of the present application, based on the number of messages, performing word embedding processing on each message to determine a feature vector includes:
[0006] For each word in the message, the first n components to be embedded are determined according to the first number and the number of messages; the remaining components to be embedded are determined according to the second number and the number of messages; the first number is the number of all positive use cases, and the second number is the number of all negative use cases; the positive use case is a use case in which the instruction between the platform and the terminal is successfully communicated, and the negative use case is a use case in which the instruction between the platform and the terminal is not successfully communicated; n is a positive integer;
[0007] A feature vector is determined based on the first n components and the remaining components.
[0008] In some embodiments, the method provided by the embodiment of the present application, the determining the first n components to be embedded according to the first number and the number of messages, includes:
[0009] Determine the i-th component as the quotient of the first number of use cases and the cardinality of positive use cases; wherein the first number of use cases is the number of positive use cases with the number of messages being i-1, and the cardinality of positive use cases is determined based on the first number and the second number; and i is a positive integer less than n;
[0010] Determine the nth component as the quotient of the second use case number and the positive use case cardinality; wherein the second use case number is the number of positive use cases whose number of messages is not less than n-1.
[0011] In some embodiments, the method provided by the embodiment of the present application, wherein the step of determining the embedded remaining component according to the second number and the number of messages comprises:
[0012] Determine the jth component as the quotient of the third number of use cases and the cardinality of negative use cases; wherein the third number of use cases is the number of negative use cases with the number of messages being jn-1, and the cardinality of negative use cases is determined based on the second number and the first number; j is a positive integer greater than n and less than m, and m is the length of the embedded word vector;
[0013] Determine the mth component as the quotient of the fourth use case number and the negative use case cardinality; wherein the fourth use case number is the number of negative use cases whose number of messages is not less than n-1.
[0014] In some embodiments, the method provided by the embodiment of the present application, wherein the feature vector is input into a forward and reverse prediction model to obtain a prediction result, and a functional test result of the Internet of Things platform is determined according to the prediction result, including:
[0015] Input the feature vector of the first negative case into the forward and reverse prediction models to obtain the prediction results;
[0016] If, in the prediction results, there is at least one reverse probability greater than a first threshold, determining that the first negative use case is a platform failure;
[0017] Alternatively, if in the prediction result, the reverse probability of each of the messages is less than or equal to a first threshold, it is determined that the first negative use case belongs to a terminal failure.
[0018] In some embodiments, the method provided by the embodiment of the present application, the word segmentation and word vector replacement processing of the interaction data to obtain word vector features includes:
[0019] Performing natural word segmentation on the interaction data to determine word segmentation features;
[0020] For each second word in the word segmentation feature, a word vector feature corresponding to the second word is determined through a preset word vector table.
[0021] In some embodiments, the method provided in the embodiment of the present application, wherein each second word in the word segmentation feature is determined by using a preset word vector table to determine the word vector feature corresponding to the second word, comprises:
[0022] If the word vector table includes the second word, determining a word vector feature corresponding to the second word in the word vector table;
[0023] If the word vector table does not contain the second word, and the second word is a recognizable integer and floating point number, searching the word vector table for a third word similar to the second word, and determining that the word vector feature corresponding to the third word is the word vector feature corresponding to the second word;
[0024] If the second word is not included in the word vector table, and the second word is an unrecognizable integer and floating point number, select several fourth words adjacent to the second word, and determine the word vector feature corresponding to the second word through the word vector table based on several word vector features corresponding to the several fourth words.
[0025] To achieve the above purpose, another aspect of the embodiment of the present application provides an Internet of Things platform function testing system, the system comprising:
[0026] The first module is used to obtain the interaction data between the platform and the terminal; the interaction data includes a number of use cases; each of the use cases includes a number of messages;
[0027] The second module is used to perform word segmentation and word vector replacement processing on the interaction data to obtain word vector features;
[0028] The third module is used to determine the number of messages corresponding to each first word in each of the use cases based on the word vector feature; the number of messages is the number of messages including a preset word in each of the use cases; the preset word is a word similar to the first word;
[0029] A fourth module is used to perform word embedding processing on each of the messages based on the number of the messages to determine a feature vector;
[0030] The fifth module is used to input the feature vector into the forward and reverse prediction model to obtain a prediction result, and determine the functional test result of the Internet of Things platform based on the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case.
[0031] To achieve the above objective, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above method when executing the computer program.
[0032] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0033] The embodiment of the present application at least includes the following beneficial effects: the method provided by the embodiment of the present application includes: obtaining the interactive data between the platform and the terminal; the interactive data includes several use cases; each of the use cases includes several messages; the interactive data is segmented and word vector replaced to obtain word vector features; based on the word vector features, the number of messages corresponding to each first word in each use case is determined; the number of messages is the number of messages including preset words in each use case; the preset words are words similar to the first words; based on the number of messages, each message is word embedded to determine the feature vector; the feature vector is input into the forward and reverse prediction model to obtain the prediction result, and the functional test result of the Internet of Things platform is determined according to the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case. The embodiment of the present application processes the interactive data between the platform and the terminal, and obtains the feature vector by word embedding based on the number of messages, and then predicts through the forward direction prediction model to obtain the functional test result. The embodiment of the present application can accurately determine whether the Internet of Things platform has functional defects, which is conducive to reducing the difficulty of testing and improving the accuracy of test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flowchart of an embodiment of the Internet of Things platform function testing method provided by the present application;
[0035] Figure 2 It is a structural diagram of an embodiment of the Internet of Things platform functional testing architecture provided by the present application;
[0036] Figure 3 It is a flowchart of another embodiment of the Internet of Things platform function testing method provided by the present application;
[0037] Figure 4 is a flowchart of an embodiment of the word embedding process provided by the present application;
[0038] Figure 5 is a flowchart of an embodiment of the embedding process of the first n components provided by the present application;
[0039] Figure 6 is a flowchart of an embodiment of a process for embedding a residual component provided by the present application;
[0040] Figure 7 is a flowchart of an embodiment of the fault judgment process provided by the present application;
[0041] Figure 8 It is a flow chart of an embodiment of the data processing process provided by the present application;
[0042] Fig. 9 It is a structural diagram of the Internet of Things platform function testing system provided in an embodiment of the present application;
[0043] Fig.10 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0045] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0046] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0048] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0049] Internet of Things Platform: refers to a software platform based on Internet technology and sensor technology, which is used to realize the development, management and operation of Internet of Things applications.
[0050] Physical network terminals: such as smart lamps, smart meters, smart meters, smart circuit breakers and smart air conditioners and other hardware devices.
[0051] The inherent uncertainty of IoT terminals: such as low power consumption of equipment, relatively inaccurate but adequate equipment used due to project costs, and unstable wireless networks leading to unstable terminals.
[0052] With the rapid development of IoT technology, the stability of IoT platforms and terminal devices has become a key factor affecting the performance of the entire IoT system. However, IoT terminals are often unstable due to various factors such as environment, hardware, and software, which poses a great challenge to the testing of IoT platforms. Traditional testing methods often rely on manual operations, which are inefficient and difficult to accurately determine whether there are problems with the IoT platform.
[0053] In view of this, a method for testing the functionality of an Internet of Things platform is provided in an embodiment of the present application. The instructions issued by the platform and the response data of the terminal are collected through automated means, and the data is mined and analyzed through an artificial neural network. In the case of inherent uncertainty in the Internet of Things terminal, it is possible to accurately determine whether there is a problem with the Internet of Things platform.
[0054] The functional testing method of the Internet of Things platform provided in the embodiment of the present application relates to the field of Internet of Things technology. The functional testing method of the Internet of Things platform provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The server can also be a node server in the blockchain network; the software can be an application that implements the functional testing method of the Internet of Things platform, etc., but is not limited to the above forms.
[0055] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0056] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0057] Figure 1 This is an optional flowchart of the Internet of Things platform function testing method provided in the embodiment of the present application; Figure 1 The method may include but is not limited to steps S100 to S500.
[0058] Step S100, acquiring interaction data between the platform and the terminal; the interaction data includes several use cases; each use case includes several messages;
[0059] Step S200, performing word segmentation and word vector replacement processing on the interaction data to obtain word vector features;
[0060] Step S300, based on the word vector feature, determine the number of messages corresponding to each first word in each use case; the number of messages is the number of messages including a preset word in each use case; the preset word is a word similar to the first word;
[0061] Step S400, based on the number of messages, perform word embedding processing on each message to determine a feature vector;
[0062] Step S500, input the feature vector into the forward and reverse prediction model to obtain the prediction result, and determine the functional test result of the Internet of Things platform according to the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case.
[0063] The interactive data in the embodiment of the present application can be based on a custom script to achieve data transmission between the platform and the terminal to obtain the interactive data. Figure 2 The structure shown, the system includes an Internet of Things platform, an Internet of Things terminal, a data collection terminal (recording) and artificial neural network data mining. The functional test result in this application can be a terminal failure or a platform failure.
[0064] In some embodiments, reference Figure 3 As shown in the flowchart, the functional testing process provided by this application includes the following steps:
[0065] Step S11, the automated script simulates a human operating platform;
[0066] Step S12: the platform sends instructions to the terminal;
[0067] Step S13: The terminal reports response data to the above instruction;
[0068] Step S14: Record the instructions sent by the platform and the data of the terminal response, that is, obtain the interaction data;
[0069] Step S15: The data mining module mines the data of successful and failed platform instruction delivery, that is, determines the positive use cases and negative use cases;
[0070] Step S16: Analyze the data using an artificial neural network to obtain a prediction result.
[0071] Step S17: Determine whether the test error belongs to the physical network platform or the terminal.
[0072] It should be noted that in the embodiments of the present application, if the functional test result of a use case is passed, it is called a positive use case, otherwise it is called a negative use case, and a use case includes several messages. The positive use cases and negative use cases in the embodiments of the present application are real test results obtained by performing interaction tests between the platform and the terminal. According to the test data / interaction data, it can be determined whether the instructions between the platform and the terminal are successfully communicated. The words in the embodiments of the present application are embodied by word vector features, and the word vector features are word vectors of several words. The word embedding processing in the embodiments of the present application is performed based on the number of messages obtained above, and the feature vector is obtained by preprocessing the number of messages.
[0073] In summary, the present invention provides a test scheme for analyzing the interaction data between the platform and the terminal through an artificial neural network to determine whether there are functional defects in the business code of the IoT platform when there is inherent uncertainty in the IoT terminal. The present invention is based on the reality of the green and energy-saving IoT projects that are currently being implemented. With limited user input, an intelligent algorithm is used to replace manual troubleshooting to determine whether there are problems with the IoT platform code, thereby improving test efficiency.
[0074] In some embodiments, reference Figure 4 As shown, the method provided in the embodiment of the present application performs word embedding processing on each message based on the number of messages to determine a feature vector, including:
[0075] Step S410: for each word in the message, determine the first n components to be embedded according to the first number and the number of messages; determine the remaining components to be embedded according to the second number and the number of messages; the first number is the number of all positive use cases, and the second number is the number of all negative use cases; a positive use case is a use case in which the instruction between the platform and the terminal is successfully communicated, and a negative use case is a use case in which the instruction between the platform and the terminal is not successfully communicated; n is a positive integer;
[0076] Step S420: Determine a feature vector according to the first n components and the remaining components.
[0077] In some possible implementations, the message is subjected to word embedding processing, that is, the number of messages is preprocessed to obtain a feature vector. In some embodiments, the feature vector can be determined based on the number of messages of positive use cases and the number of positive use cases; the feature vector can be determined based on the number of messages of negative use cases and the number of negative use cases. This application does not limit the specific logic of the feature vector determination process, and those skilled in the art can set the calculation logic according to needs.
[0078] In some embodiments, reference Figure 5 As shown, the method provided in the embodiment of the present application determines the first n components to be embedded according to the first number and the number of messages, including:
[0079] Step S411, determine that the i-th component is the quotient of the first use case number and the positive use case cardinality; wherein the first use case number is the number of positive use cases with i-1 messages, and the positive use case cardinality is determined based on the first number and the second number; i is a positive integer less than n;
[0080] Step S412: Determine the nth component as the quotient of the second use case number and the positive use case cardinality; wherein the second use case number is the number of positive use cases whose number of messages is not less than n-1.
[0081] In some possible implementations, m in the embodiment of the present application may be 64, and the corresponding n may be 32 or 16. In other embodiments, m in the embodiment of the present application may be 32, and the value of n is adjusted accordingly; similarly, m in the embodiment of the present application may also be 128, and the value of n is adjusted accordingly. The present application does not limit the specific values of m and n, and those skilled in the art may set appropriate values according to actual application scenarios, data transmission frequency, etc.
[0082] In some embodiments, reference Figure 6 As shown, the method provided in the embodiment of the present application determines the embedded remaining component according to the second number and the number of messages; including:
[0083] Step S421, determine that the jth component is the quotient of the third number of use cases and the cardinality of negative use cases; wherein the third number of use cases is the number of negative use cases with jn-1 messages, and the cardinality of negative use cases is determined based on the second number and the first number; j is a positive integer greater than n and less than m, and m is the length of the embedded word vector;
[0084] Step S422: Determine the mth component as the quotient of the fourth use case number and the negative use case cardinality; wherein the fourth use case number is the number of negative use cases whose number of messages is not less than n-1.
[0085] In some possible implementations, after the interaction data is segmented and replaced with word vectors, the word embedding process provided in the embodiment of the present application embeds each message and each word, but the embedding method is not to look up from the pre-trained word vector table, but to calculate a vector with a length of 64 according to the number of similar messages counted above through the following steps:
[0086] Step S31, for i from 1 to 31, the i-th component of the word embedding is the number of cases in which similar words appear in the positive cases (i-1) divided by the cardinality of positive cases, where the cardinality of positive cases is equal to 10% of the total number of positive cases plus the total number of cases.
[0087] Step S32, for i=32 (i.e., n=32 in the embodiment of the present application), the i-th component of the word embedding is the number of use cases in which the number of messages in which similar words appear in the positive use cases is not less than 31 divided by the cardinality of positive use cases, where the cardinality of positive use cases is equal to 10% of the total number of positive use cases plus the total number of use cases.
[0088] Step S33, for i from 33 to 63 (i in this process and step S34 is j in the embodiment of the present application), the i-th component of the word embedding is the number of cases in which similar words appear in the negative case (i-33) divided by the cardinality of negative cases, where the cardinality of negative cases is equal to 10% of the total number of negative cases plus the total number of cases.
[0089] Step S34, for i=64, the i-th component of the word embedding is the number of use cases in which the number of messages in which similar words appear in the negative use cases is not less than 31 divided by the cardinality of negative use cases, where the cardinality of negative use cases is equal to 10% of the total number of negative use cases plus the total number of use cases (of course, it can be understood that the calculation formulas for positive use cases and negative use cases can be adjusted, and this application does not make specific limitations).
[0090] In some embodiments, reference Figure 7 As shown, the method provided in the embodiment of the present application inputs the feature vector into the forward and reverse prediction models to obtain the prediction results, and determines the functional test results of the Internet of Things platform according to the prediction results, including:
[0091] Step S510, inputting the feature vector of the first negative case into the forward and reverse prediction models to obtain a prediction result;
[0092] Step S520: If there is at least one reverse probability greater than a first threshold value in the prediction result, it is determined that the first negative use case belongs to a platform failure;
[0093] Alternatively, in step S530, if in the prediction result, the reverse probability of each message is less than or equal to the first threshold, it is determined that the first negative use case belongs to a terminal failure.
[0094] In some possible implementations, the positive direction prediction model in the embodiments of the present application may be an artificial intelligence model or other models that can implement classification, and the present application does not make any specific limitations.
[0095] The process of evaluating the platform function based on the prediction results of the positive direction prediction model is as follows:
[0096] Step S41: The word embedding results of each message of each negative use case are sent to a neural network with an LSTM layer, a fully connected layer and a Re lu layer for classification, and the positive and negative prediction results are output after classification.
[0097] Step S42: For each message of each negative use case, if at least one reverse probability is greater than 0.5, the negative use case is considered to be a functional error of the IoT service platform. The use case, the messages with a reverse probability greater than 0.5 in the use case and their reverse probabilities are output for the tester to record as test results.
[0098] Step S43: If the reverse probability of each negative use case is no greater than 0.5, it is considered that the use case is caused by an unstable terminal environment and the IoT service platform function test has passed.
[0099] In some embodiments, reference Figure 8 As shown, the method provided in the embodiment of the present application performs word segmentation and word vector replacement processing on the interaction data to obtain word vector features, including:
[0100] Step S210: Perform natural word segmentation on the interactive data to determine word segmentation features;
[0101] Step S220: For each second word in the word segmentation feature, determine the word vector feature corresponding to the second word through a preset word vector table.
[0102] In some possible implementations, the first word, the second word, the third word, the fourth word, etc. in the embodiments of the present application all refer to words, and are divided by numbers for convenience of description.
[0103] In some embodiments, the method provided in the embodiment of the present application determines the word vector feature corresponding to the second word for each second word in the word segmentation feature through a preset word vector table, including:
[0104] If the word vector table includes the second word, determine the word vector feature corresponding to the second word in the word vector table;
[0105] If the word vector table does not contain the second word, and the second word is a recognizable integer and floating point number, search the word vector table for a third word similar to the second word, and determine that the word vector feature corresponding to the third word is the word vector feature corresponding to the second word;
[0106] If the second word is not included in the word vector table, and the second word is an unrecognizable integer and floating point number, select several fourth words adjacent to the second word, and determine the word vector feature corresponding to the second word through the word vector table based on several word vector features corresponding to the several fourth words.
[0107] In the embodiment of the present application, between steps S11-S17 and steps S31-S34, the following steps are also included:.
[0108] Step S21: Perform natural word segmentation on the terminal and platform interaction data recorded in a use case. Natural word segmentation here mainly involves natural word segmentation of structured data such as XML and JSON, extracting Chinese and English words separated by punctuation marks, without intelligent word segmentation of Chinese, but preprocessing of binary data and Base64 data into a text format that can be naturally segmented.
[0109] Step S22, for the word segmentation result, use the pre-trained word vector table to find the corresponding word vector, and for the words that are not in the word embedding table, the recognizable integers and floating-point numbers will be replaced by the word vector of the closest numerical value in the table, that is, the word vector feature of the second word is determined by the third word similar to the second word; and the words that cannot be recognized as integers and floating-point numbers are obtained by averaging the word vectors of the words before and after them, that is, the word vector feature of the second word is determined by several fourth words. It should be noted that the fourth word can come from any message / use case containing the second word. The fourth word can represent the two words before and after the second word, and the fourth word can also represent the N words immediately before the second word, and the N words immediately after. This application does not limit the number of fourth words.
[0110] Step S23: For each word in the use case, count the number of messages in which similar words appear in each positive use case and negative use case, respectively. Similar words refer to words whose word vector Euclidean distance is less than a threshold F.
[0111] It should be noted that the pre-trained word vector table used in this application can be strengthened by recording messages, adjusting word vectors or adding new words. In some embodiments, the word vector table can be obtained from relevant public materials or established based on specific applications. This application does not limit the source of the word vector table.
[0112] The following is a detailed description and explanation of the solution of the embodiment of the present invention in conjunction with a specific application example:
[0113] This service uses the edge gateway to scan low-power terminals and requires online low-power terminals to respond. However, in order to save energy, low-power terminals may be in sleep mode or processing other matters when receiving instructions, and may not always receive instructions and respond. If manual testing is used, the terminal sometimes responds and sometimes does not. Testers alone cannot determine whether there is a problem with the scanning instruction sent by the business platform, or whether the business platform sends the scanning instruction normally but the terminal does not respond. Other means such as simulation, log inspection, or cooperation with terminal technicians are needed to determine, resulting in a sharp increase in the difficulty and cost of testing technology.
[0114] In this regard, the specific implementation method of the solution provided by this application is as follows:
[0115] Step S51. Execute the automated script to scan online terminals in multiple zones through the platform. Execute 5,000 times in each zone. There should be a 1-minute difference between each gateway scanning instruction. Collect the results of each functional test to see if the corresponding online terminal is found. If the corresponding online terminal is found, it is a positive use case. If not, it is a reverse use case.
[0116] Step S52: The data aggregation terminal records the instructions issued by the platform and the data responded by the terminal, and performs natural word segmentation on the data interacting between the terminal and the platform according to the method, and calculates the feature vector based on the results of the functional test collected by the automated script.
[0117] Step S53. The feature vector is put into the artificial neural network for classification. If the output of the neural network is greater than 0.5, then the gateway scanning service of the Internet of Things service platform has a code function defect problem. For example, in some cases, there is a bug in the service code, resulting in no scanning instruction or incorrect scanning instruction parameters. In this case, the feature vectors of several keywords contained in the scanning instruction will be abnormal, resulting in the output of the neural network being greater than 0.5. On the contrary, if there is no bug in the service code, the feature vector will not be abnormal, and the output of the neural network will not be greater than 0.5.
[0118] Currently, when testing the IoT platform, it takes a lot of time to test whether the platform has functional defects because of the inherent uncertainty of the IoT terminal. Generally, others will test the platform and terminal separately, and simulate the terminal when testing the platform, but this will be somewhat different from the actual effect. This application proposes a method in which the system uses an artificial neural network to judge the historical execution data of the platform and the terminal based on the interaction data between the recorded terminal and the platform. Without the need for manual judgment, data mining is performed through the artificial neural network to achieve rapid testing of the IoT business platform.
[0119] The embodiment of the present application accurately determines whether the service code of the Internet of Things service platform has functional defects when there is inherent uncertainty in the terminal. The method is universal and does not need to be customized for specific services. The embodiment of the present application is conducive to reducing the difficulty and workload of functional testing.
[0120] The embodiment of the present application records the interaction data between the IoT platform and the terminal for judgment. The embodiment of the present application counts the number of occurrences of words in a message in other messages by the similarity of word embedding. The embodiment of the present application preprocesses the number of occurrences of words in a message in other messages into vectors, and then classifies them through a neural network with an LSTM layer.
[0121] See also Fig. 9 The embodiment of the present application also provides an Internet of Things platform function testing system, which can implement the above-mentioned Internet of Things platform function testing method, and the system includes:
[0122] The first module 810 is used to obtain the interaction data between the platform and the terminal; the interaction data includes a number of use cases; each use case includes a number of messages;
[0123] The second module 820 is used to perform word segmentation and word vector replacement processing on the interaction data to obtain word vector features;
[0124] The third module 830 is used to determine the number of messages corresponding to each first word in each use case based on the word vector feature; the number of messages is the number of messages including the preset word in each use case; the preset word is a word similar to the first word;
[0125] The fourth module 840 is used to perform word embedding processing on each message based on the number of messages to determine a feature vector;
[0126] The fifth module 850 is used to input the feature vector into the forward and reverse prediction model to obtain the prediction result, and determine the functional test result of the Internet of Things platform based on the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case.
[0127] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0128] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned Internet of Things platform function testing method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0129] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0130] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0131] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0132] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the Internet of Things platform function testing method of the embodiment of this application;
[0133] Input / output interface 903, used to implement information input and output;
[0134] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0135] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0136] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0137] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned Internet of Things platform function testing method is implemented.
[0138] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0139] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0140] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0141] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0142] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0144] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0145] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0146] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0147] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0149] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0150] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for testing the functionality of an Internet of Things platform, characterized in that: The method comprises: Acquire interaction data between the platform and the terminal; the interaction data includes a plurality of use cases; each of the use cases includes a plurality of messages; Performing word segmentation and word vector replacement processing on the interaction data to obtain word vector features; Based on the word vector feature, determine the number of messages corresponding to each first word in each of the use cases; the number of messages is the number of messages including a preset word in each of the use cases; the preset word is a word similar to the first word; Based on the number of messages, perform word embedding processing on each message to determine a feature vector; The feature vector is input into a forward and reverse prediction model to obtain a prediction result, and a functional test result of the Internet of Things platform is determined based on the prediction result; the prediction result is a forward probability or a reverse probability of each message in the use case.
2. The method according to claim 1, characterized in that The step of performing word embedding processing on each of the messages based on the number of the messages to determine a feature vector includes: For each word in the message, the first n components to be embedded are determined according to the first number and the number of messages; the remaining components to be embedded are determined according to the second number and the number of messages; the first number is the number of all positive use cases, and the second number is the number of all negative use cases; the positive use case is a use case in which the instruction between the platform and the terminal is successfully communicated, and the negative use case is a use case in which the instruction between the platform and the terminal is not successfully communicated; n is a positive integer; A feature vector is determined based on the first n components and the remaining components.
3. The method according to claim 2, characterized in that The step of determining the first n components to be embedded according to the first number and the number of messages includes: Determine the i-th component as the quotient of the first number of use cases and the cardinality of positive use cases; wherein the first number of use cases is the number of positive use cases with the number of messages being i-1, and the cardinality of positive use cases is determined based on the first number and the second number; and i is a positive integer less than n; Determine the nth component as the quotient of the second use case number and the positive use case cardinality; wherein the second use case number is the number of positive use cases whose number of messages is not less than n-1.
4. The method according to claim 2, characterized in that: The step of determining the remaining embedded component according to the second number and the number of messages comprises: Determine the jth component as the quotient of the third number of use cases and the cardinality of negative use cases; wherein the third number of use cases is the number of negative use cases with the number of messages being jn-1, and the cardinality of negative use cases is determined based on the second number and the first number; j is a positive integer greater than n and less than m, and m is the length of the embedded word vector; Determine the mth component as the quotient of the fourth use case number and the negative use case cardinality; wherein the fourth use case number is the number of negative use cases whose number of messages is not less than n-1.
5. The method according to claim 1, characterized in that The step of inputting the feature vector into a forward and reverse prediction model to obtain a prediction result, and determining a functional test result of the Internet of Things platform according to the prediction result, comprises: Input the feature vector of the first negative case into the forward and reverse prediction models to obtain the prediction results; If, in the prediction results, there is at least one reverse probability greater than a first threshold, determining that the first negative use case is a platform failure; Alternatively, if in the prediction result, the reverse probability of each of the messages is less than or equal to a first threshold, it is determined that the first negative use case belongs to a terminal failure.
6. The method according to claim 1, characterized in that The word segmentation and word vector replacement processing of the interaction data to obtain word vector features includes: Performing natural word segmentation on the interaction data to determine word segmentation features; For each second word in the word segmentation feature, a word vector feature corresponding to the second word is determined through a preset word vector table.
7. The method according to claim 6, characterized in that The step of determining the word vector feature corresponding to each second word in the word segmentation feature by using a preset word vector table includes: If the word vector table includes the second word, determining a word vector feature corresponding to the second word in the word vector table; If the word vector table does not contain the second word, and the second word is a recognizable integer and floating point number, searching the word vector table for a third word similar to the second word, and determining that the word vector feature corresponding to the third word is the word vector feature corresponding to the second word; If the second word is not included in the word vector table, and the second word is an unrecognizable integer and floating point number, select several fourth words adjacent to the second word, and determine the word vector feature corresponding to the second word through the word vector table based on several word vector features corresponding to the several fourth words.
8. An Internet of Things platform function testing system, characterized in that: The system comprises: The first module is used to obtain the interaction data between the platform and the terminal; the interaction data includes a number of use cases; each of the use cases includes a number of messages; The second module is used to perform word segmentation and word vector replacement processing on the interaction data to obtain word vector features; The third module is used to determine the number of messages corresponding to each first word in each of the use cases based on the word vector feature; the number of messages is the number of messages including a preset word in each of the use cases; the preset word is a word similar to the first word; A fourth module is used to perform word embedding processing on each of the messages based on the number of the messages to determine a feature vector; The fifth module is used to input the feature vector into the forward and reverse prediction model to obtain a prediction result, and determine the functional test result of the Internet of Things platform based on the prediction result; the prediction result is the forward probability or reverse probability of each message in the use case.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Internet-of-Things data flow detection method based on double LSTM iterative learning
CN111866128A
Fault detection method, device and system and computer readable storage medium
CN112804336A
Automatic interface testing method and device, electronic equipment and storage medium
CN114116506A
Fault studying and judging method of Internet of Things equipment
CN114760194A
Skill word evaluation method and device, electronic device, and non-transitory computer readable storage medium
US20210406464A1