A VSA-based Internet of Things entity service discovery method and computer-readable storage medium

By using VSA model to encode JSON workflows in the Internet of Things environment, generate hyperdimensional vectors, and match these vectors between nodes, the low efficiency and unreliability of service discovery in the Internet of Things environment is solved, and high-precision and efficient service discovery is achieved.

CN115988059BActive Publication Date: 2025-05-02NINGBO UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211587659.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-11
Publication Date
2025-05-02
Estimated Expiration
2042-12-11

AI Technical Summary

Technical Problem

In the Internet of Things environment, it is difficult for the prior art to efficiently discover and locate a large number of physical services, resulting in low efficiency, high cost, and unreliability problems in distributed service discovery.

Method used

Using the VSA-based IoT entity service discovery method, encode the JSON workflow, generate hyperdimensional vectors, and match these vectors between nodes to achieve high precision, efficient and highly robust service discovery.

Benefits of technology

It improves the efficiency and accuracy of service discovery in the Internet of Things environment, reduces costs, and solves the unreliability problem of distributed service discovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115988059B_ABST
    Figure CN115988059B_ABST
Patent Text Reader

Abstract

The present invention relates to an Internet of Things entity service discovery method based on VSA, which includes the following steps: Step 1, before each task is deployed to the corresponding node, encode the JSON workflow of the task through the VSA model to obtain the hyperdimensional vector HV_a corresponding to each JSON workflow and the superposition times M used in the encoding a , and send this information to the deployed node; Step 2, each node receives the hyperdimensional vector HV_0 and the superposition times M0 corresponding to the service request; Step 3, each node performs service discovery, specifically: determine whether M a is equal to M0. If so, match HV_a with HV_0 to obtain the matching result of each node; if not, the task matching fails and ends. A computer-readable storage medium is also disclosed. This method realizes high-precision, high-efficiency, and high-robust Internet of Things entity service discovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of service discovery, and in particular to a VSA-based Internet of Things entity service discovery method and a computer-readable storage medium. Background Art

[0002] The Internet of Things (IoT) technology connects a large number of ubiquitous heterogeneous devices in the real physical world to the Internet. The IoT covers a wide range of real-world scenarios such as medical care, transportation, education, and agriculture, expanding the number of edge-coordinated smart devices to provide services to users. Therefore, a large number of services are constantly generated in the IoT environment, and the types of services are complex. There will also be a lot of redundancy in services in the same scenario, resulting in reduced resource utilization.

[0003] For this reason, the service discovery mechanism was born, which locates and discovers tasks or services to reduce the waste of resources caused by repeated deployment. Service discovery refers to finding available services (such as device resources, information processing, data collection, etc.) in the network through certain strategies and mechanisms. It is mainly divided into service requesters and service providers. The former describes the target services or functions they need to use, while the latter describes the services they can provide. With the increasing number of IoT devices, the number of services is also increasing, and discovering and locating services has become an important challenge. Therefore, service discovery in the IoT scenario has also become a hot topic of research.

[0004] At present, many systems use centralized service discovery algorithms, which register and query services or tasks on servers using a registration center. The server is usually a predefined, stable infrastructure dedicated to system service management. However, due to the large number of devices, large search space, and large network traffic, it is difficult to effectively manage, resulting in scalability problems, so it is difficult to implement. To solve this technical problem, some service discovery solutions have gradually emerged in the prior art, such as distributed service discovery solutions. Although distributed service discovery solutions have solved the problems of traditional service discovery methods based on registration centers to a certain extent, distributed service discovery solutions still face other challenges, such as dynamic availability, geographical location restrictions, network instability, etc.

[0005] Therefore, the existing service discovery methods need to be further improved. Summary of the invention

[0006] The first technical problem to be solved by the present invention is to provide an IoT entity service discovery method based on VSA in response to the above-mentioned prior art, which solves the problem of low efficiency and high cost in searching and discovering a large number of entity services through a registration center or database in an IoT environment, and also solves the problem of unreliability of service discovery in distributed service discovery, thereby achieving highly accurate, efficient and robust IoT entity service discovery.

[0007] The second technical problem to be solved by the present invention is to provide a computer-readable storage medium capable of executing the above-mentioned VSA-based Internet of Things entity service discovery method in response to the above-mentioned prior art.

[0008] The technical solution adopted by the present invention to solve the above-mentioned first technical problem is: a VSA-based IoT entity service discovery method, which is used to find a task matching a service request from A tasks deployed by A nodes of the IoT, wherein each of the A nodes deploys a task, and A is a positive integer, comprising the following steps:

[0009] Step 1: Before each task is deployed to the corresponding node, the JSON workflow of the task is encoded through the VSA model to obtain the hyperdimensional vector HV_a corresponding to each JSON workflow and the number of superpositions M used in the encoding. a , and send this information to the deployed nodes;

[0010] Step 2: Each node receives the hyperdimensional vector HV_0 and the number of superpositions M0 corresponding to the service request, and obtains the hyperdimensional vector HV_a and the number of superpositions M of the JSON workflow corresponding to its own node deployment task. a ;

[0011] Step 3: Each node performs service discovery, specifically:

[0012] Judge M a Is it equal to M0? If so, match the hyperdimensional vector HV_a of the JSON workflow corresponding to each node deployment task with the hyperdimensional vector HV_0 corresponding to the service request to obtain the matching result of each node; if not, the task matching fails and ends.

[0013] As an improvement, the specific steps for encoding each JSON workflow in step 1 are:

[0014] Step 1-1, create an empty hyperdimensional vector HV and an empty atomic vector memory C; and set the dimension size of the hyperdimensional vector HV to N, and the vector space V∈{0,1} N , and set the initial value of the number of superposition times Num to 0;

[0015] Step 1-2: Assume that there are b task modules in the JSON workflow, where b is a positive integer, and each task module contains multiple keywords. Map each keyword in the JSON workflow into an atomic vector, and store the mapped atomic vector in the atomic vector storage C;

[0016] The keywords in each task module include the value corresponding to the type key and the values ​​corresponding to other valid keys. The type key is the type of the current task module. The atomic vector mapped by each keyword is an N-dimensional vector randomly generated from the vector space in step 1-1.

[0017] Step 1-3, set the initial value of i to 1;

[0018] Step 1-4: Bind all valid keywords except the type key in the i-th task module of the current JSON workflow in an XOR manner to form the first vector ARG i ;

[0019]

[0020] in, are the atomic vectors corresponding to the first valid keyword, the atomic vector corresponding to the second valid keyword, and the atomic vector corresponding to the Dth valid keyword in the i-th task module of the JSON workflow except the type key, respectively. D is the total number of valid keywords except the type key in the i-th task module of the JSON workflow. XOR represents exclusive OR operation.

[0021] Step 1-5: For the first vector ARG i Circularly shift left one bit to get the second vector PARG i ;

[0022] Step 1-6: Set the second vector PARG i The atomic vector type corresponding to the type key in the i-th task module of the JSON workflow i Superimpose and circularly shift the superimposed vectors to the left by 2(i-1) bits to obtain the third vector HV i ;

[0023] Step 1-7: The third vector HV i Superimpose the vector with the current hyperdimensional vector HV, and use the superimposed vector to update the current hyperdimensional vector HV;

[0024] Step 1-8, add 2 to the current stacking times Num and update the current stacking times Num;

[0025] Step 1-9, determine whether the value of i is b, if yes, go to step 1-10; if no, add 1 to the current value of i to update the current value of i, and execute steps 1-4 to 1-8 in sequence;

[0026] Step 1-10, output the final hyperdimensional vector HV' and the final superposition number Num', and accumulate the final hyperdimensional vector HV' with an N-dimensional random vector randomly generated in the vector space to obtain the accumulated hyperdimensional vector HV';

[0027] Step 1-11, let e be 1, 2, ... N in sequence, and judge whether the element at the e-th position in the accumulated super-dimensional vector HV" is less than (Num'+1) / 2. If so, set the element at the e-th position in the accumulated super-dimensional vector HV" to 0; if not, set the element at the e-th position in the accumulated super-dimensional vector HV" to 1;

[0028] Step 1-12: Use the hyperdimensional vector HV" processed in step 1-11 as the hyperdimensional vector after the current JSON workflow encoding is completed.

[0029] Preferably, the value of N in step 1-1 is 10000.

[0030] In order to reduce the scale of the task system, before mapping each keyword in the JSON workflow into an atomic vector, the step 1-2 further includes:

[0031] The keywords of the JSON workflow are filtered to remove the features that do not affect the task composition, and finally the filtered keywords are mapped into atomic vectors.

[0032] Furthermore, the specific process of service discovery in step 3 is as follows:

[0033] Step 3-1, determine M a Is it equal to M0? If yes, go to step 3-2; if not, the task matching fails and ends;

[0034] Step 3-2: Obtain the final expression of the super-dimensional vector HV' in the encoding process of the super-dimensional vector HV_a, specifically:

[0035] HV'=HV1+HV2+…HV b

[0036] =type1+PARG1+ρ 2 (type2)+ρ 2 (PARG2)+…ρ 2(b-1) (type b )+ρ 2(b-1) (PARG b )

[0037] Among them, ρ 2 (type2) means type2 is cyclically shifted left by 2 bits; ρ 2 (PARG2) means PARG2 is cyclically shifted left by 2 bits; 2(b-1) (type b ) indicates type b Circularly shift left by 2(b-1) bits; ρ 2(b-1) (PARG b ) means PARG is cyclically shifted left by 2(b-1) bits;

[0038] Step 3-3, sort the intermediate vectors in the encoding process of the super-dimensional vector HV_a in the following order to obtain a vector set V_a, where the vectors in the vector set V_a are as follows from the earliest to the latest:

[0039] type1、PARG1、ρ 2 (type2),ρ 2 (PARG2), 2(b-1) (type b ),ρ 2(b-1) (PARG b )

[0040] Step 3-4, record the position of the vector in the vector set V_a as m, and the initial value of m is 1;

[0041] Step 3-5, calculate the normalized Hamming distance L between the mth vector in the vector set V_a obtained in the encoding process of the hyperdimensional vector HV_a and the mth vector in the vector set V_0 obtained in the encoding process of HV_0, and determine whether L is less than the preset threshold L0. If so, the mth vector is matched successfully, and the process proceeds to step 3-6; if not, it indicates that the match fails, and the process ends;

[0042] Step 3-6: Circularly shift each vector in the current vector set V_a right by one position to update the vector set V_a, and circularly shift each vector in the current vector set V_0 right by two positions to update the vector set V_0, and determine whether the value of m is M0. If so, the task of the node successfully matches the service request; if not, add 1 to the current value of m to update the current value of m, and execute step 3-5.

[0043] The technical solution adopted by the present invention to solve the above-mentioned second technical problem is: a computer-readable storage medium, characterized in that: a computer program is stored on the computer-readable storage medium, and when the computer program is run by the processor, it executes the above-mentioned Internet of Things entity service discovery method to find a task matching the request from A tasks deployed by A nodes of the Internet of Things, and output the discovered task results.

[0044] Compared with the prior art, the advantages of the present invention are: by using the VSA model to encode each JSON workflow, the JSON workflow is transformed into a hyperdimensional vector, thereby performing distributed representation and exposing matching one by one, and two identical vectors in space are still closer to each other than any other vectors. Therefore, the present method solves the problem of low efficiency and high cost in searching and discovering a large number of entity services through a registration center or database in the Internet of Things environment, and solves the problem of unreliability of service discovery in distributed service discovery, thereby achieving highly accurate, efficient and robust Internet of Things entity service discovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 The figure is a flow chart of a VSA-based IoT entity service discovery method in an embodiment of the present invention.

[0046] Figure 2 A schematic diagram of task division in an embodiment of the present invention;

[0047] Figure 3 This is a time chart required for service discovery based on VSA and database in an embodiment of the present invention;

[0048] Figure 4 This is a comparison diagram of normalized Hamming distance results under different service complexities in an embodiment of the present invention;

[0049] Figure 5 This is a comparison diagram of mismatched results under different service complexities in an embodiment of the present invention;

[0050] Figure 6 This is a comparison diagram of the minimum, maximum and average distances under different service complexities in an embodiment of the present invention;

[0051] Figure 7 This is a comparison chart of response delays of different service discovery methods in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The present invention is further described in detail below with reference to the accompanying drawings.

[0053] The VSA-based IoT entity service discovery method in this embodiment is used to find a task matching a service request from A tasks deployed by A nodes of the IoT, where each of the A nodes deploys a task, and A is a positive integer.

[0054] like Figure 1 As shown, the VSA-based IoT entity service discovery method in this embodiment includes the following steps:

[0055] Step 1: Before each task is deployed to the corresponding node, the JSON workflow of the task is encoded through the VSA model to obtain the hyperdimensional vector HV_a corresponding to each JSON workflow and the number of superpositions M used in the encoding. a , and send this information to the deployed nodes;

[0056] Vector symbolic architecture (VSA), a term coined by psychologist RW Gayler, is a set of models for representing and manipulating data in high-dimensional space. The idea was originally proposed in cognitive psychology and cognitive neuroscience as a connectionist model of symbolic reasoning. In VSA, information is represented by very high dimensional vectors, which are called high vectors or hyperdimensional vectors. Symbols are represented by hyperdimensional vectors, and the encoded information is distributed across all components of the vector. Vector symbolic architecture is a lossy dimensionality reduction method that enables large amounts of data to be compressed into a fixed-size vector in a way that captures similarities between associations and enables classification to be established in the data. Such vector representations are recursive, as originally proposed by Hinton, because they allow higher-level abstractions to be represented in the same format as their lower-level components. VSAs are able to support a large number of cognitive tasks, such as semantic composition and matching, representing meaning and order, analogy mapping, and logical reasoning. They are highly resilient to noise, have neurologically plausible analogs, and can be exploited in existing distributed cognitive architectures;

[0057] The specific steps to encode each JSON workflow are:

[0058] Step 1-1, create an empty hyperdimensional vector HV and an empty atomic vector memory C; and set the dimension size of the hyperdimensional vector HV to N, and the vector space V∈{0,1} N , and set the initial value of the number of superposition times Num to 0;

[0059] In this embodiment, the value of N is 10000;

[0060] Step 1-2, assuming that there are b task modules in the JSON workflow, where b is a positive integer, each task module contains multiple keywords, each keyword in the JSON workflow is mapped into an atomic vector, and the mapped atomic vector is stored in the atomic vector memory C; wherein the task module represents the relationship between the tasks in the workflow;

[0061] Before mapping each keyword in the JSON workflow into an atomic vector, step 1-2 also includes:

[0062] Filter the keywords of the JSON workflow, filter out the features that do not affect the task composition, and finally map the filtered keywords into atomic vectors;

[0063] The keywords in each task module include the value corresponding to the type key and the values ​​corresponding to other valid keys. The type key is the type of the current task module. The atomic vector mapped by each keyword is an N-dimensional vector randomly generated from the vector space in step 1-1.

[0064] Step 1-3, set the initial value of i to 1;

[0065] Step 1-4: Bind all valid keywords except the type key in the i-th task module of the current JSON workflow in an XOR manner to form the first vector ARG i ;

[0066]

[0067] in, are the atomic vectors corresponding to the first valid keyword, the atomic vector corresponding to the second valid keyword, and the atomic vector corresponding to the Dth valid keyword in the i-th task module of the JSON workflow except the type key, respectively. D is the total number of valid keywords except the type key in the i-th task module of the JSON workflow. XOR represents exclusive OR operation.

[0068] Step 1-5: For the first vector ARG i Circularly shift left one bit to get the second vector PARG i ;

[0069] Step 1-6: Set the second vector PARG i The atomic vector type corresponding to the type key in the i-th task module of the JSON workflow i Superimpose and circularly shift the superimposed vectors to the left by 2(i-1) bits to obtain the third vector HV i ;

[0070] Step 1-7: The third vector HV i Superimpose the vector with the current hyperdimensional vector HV, and use the superimposed vector to update the current hyperdimensional vector HV;

[0071] Step 1-8, add 2 to the current stacking times Num and update the current stacking times Num;

[0072] Step 1-9, determine whether the value of i is b, if yes, go to step 1-10; if no, add 1 to the current value of i to update the current value of i, and execute steps 1-4 to 1-8 in sequence;

[0073] Step 1-10, output the final hyperdimensional vector HV' and the final superposition number Num', and accumulate the final hyperdimensional vector HV' with an N-dimensional random vector randomly generated in the vector space to obtain the accumulated hyperdimensional vector HV';

[0074] Step 1-11, let e be 1, 2, ... N in sequence, and judge whether the element at the e-th position in the accumulated super-dimensional vector HV" is less than (Num'+1) / 2. If so, set the element at the e-th position in the accumulated super-dimensional vector HV" to 0; if not, set the element at the e-th position in the accumulated super-dimensional vector HV" to 1;

[0075] Step 1-12, using the hyperdimensional vector HV" processed in step 1-11 as the hyperdimensional vector after the current JSON workflow encoding is completed;

[0076] Let the hyperdimensional vector corresponding to the task deployed by the ath node be HV_a, and let the number of superpositions representing HV_a be M a ; a∈{1, 2…A}; the M a Corresponding to the final number of superpositions Num' in steps 1-10;

[0077] Step 2: Each node receives the hyperdimensional vector HV_0 and the number of superpositions M0 corresponding to the service request, and obtains the hyperdimensional vector HV_a and the number of superpositions M of the JSON workflow corresponding to its own node deployment task. a ;

[0078] The hyperdimensional vector HV_0 and the number of superpositions M0 corresponding to the service request are calculated in the same way as in the task encoding, and M0 corresponds to the final number of superpositions in steps 1-10;

[0079] Step 3: Each node performs service discovery, specifically:

[0080] Judge M a Is it equal to M0? If so, match the hyperdimensional vector HV_a of the JSON workflow corresponding to each node deployment task with the hyperdimensional vector HV_0 corresponding to the service request to obtain the matching result of each node; if not, the task matching fails and ends.

[0081] The specific matching method is:

[0082] Step 3-1, determine M a Is it equal to M0? If yes, go to step 3-2; if not, the task matching fails and ends;

[0083] Step 3-2: Obtain the final expression of the super-dimensional vector HV' in the encoding process of the super-dimensional vector HV_a, specifically:

[0084] HV'=HV1+HV2+…HV b

[0085] =type1+PARG1+ρ 2 (type2)+ρ 2 (PARG2)+…ρ 2(b-1) (type b )+ρ 2(b-1) (PARG b )

[0086] Among them, ρ 2 (type2) means type2 is cyclically shifted left by 2 bits; ρ 2 (PARG2) means PARG2 is cyclically shifted left by 2 bits; 2(b-1) (type b ) indicates type b Circularly shift left by 2(b-1) bits; ρ 2(b-1) (PARG b ) indicates PARG b Circularly shift left by 2(b-1) positions;

[0087] Step 3-3, sort the intermediate vectors in the encoding process of the super-dimensional vector HV_a in the following order to obtain a vector set V_a, where the vectors in the vector set V_a are as follows from the earliest to the latest:

[0088] 11. PARG1, ρ 2 (type2),ρ 2 (PARG2), 2(b-1) (type b ),ρ 2(b-1) (PARG b )

[0089] Step 3-4, record the position of the vector in the vector set V_a as m, and the initial value of m is 1;

[0090] Step 3-5, calculate the normalized Hamming distance L between the mth vector in the vector set V_a obtained in the encoding process of the hyperdimensional vector HV_a and the mth vector in the vector set V_0 obtained in the encoding process of HV_0, and determine whether L is less than the preset threshold L0. If so, the mth vector is matched successfully and the process proceeds to step 3-6; if not, it indicates that the match fails and the process ends; in this embodiment, L0=N*0.48;

[0091] Step 3-6: Circularly shift each vector in the current vector set V_a right by one position to update the vector set V_a, and circularly shift each vector in the current vector set V_0 right by two positions to update the vector set V_0, and determine whether the value of m is M0. If so, the task of the node is successfully matched with the service request; if not, add 1 to the current value of m to update the current value of m, and execute step 3-5.

[0092] When the task matching fails, the node will only send the matching failure information to the requester. The purpose of sending here is not only to tell the requester that the task matching has failed, but also to tell the requester that it is running normally, so that the system can make a judgment and process it.

[0093] In addition, a computer program is stored on the computer-readable storage medium of this embodiment. When the computer program is run by the processor, it executes the above-mentioned Internet of Things entity service discovery method to find a task matching the request from A tasks deployed by A nodes of the Internet of Things, and outputs the discovered task results.

[0094] In order to test the method, in this embodiment, a desktop PC is used as the master node (Master) of the platform (CPU: 4-core Intel(R) Core(TM) i5-7500CPU@3.40GHz memory: 16G hard disk storage: 1T), and the following two different types of devices are added to NBUFlow: (1) a virtual machine as an edge server (Edge Server) (CPU: 4-core Intel(R) Core(TM) i5-10500CPU@3.10GHz memory: 8G storage capacity: 60G), (2) two Raspberry Pi 4Bs as device layer nodes (Pi1, Pi2) (CPU: 4-core ARMv7, memory: 4G, storage capacity is 16G), and connected to the platform using WiFi network.

[0095] At the same time, in order to facilitate testing, in this embodiment, each Raspberry Pi node and edge server node is initialized with a camera device installed and an entity service for capturing images is deployed, such as Figure 2 In the Camera node shown in the figure, the service parameters of the two Raspberry Pis Pi1 and Pi2 are different, and the service parameters of the edge server are consistent with those of Pi1. The content of the experiment is mainly divided into two aspects. On the one hand, it verifies its efficient service discovery mechanism, and on the other hand, it verifies the high accuracy and high robustness of the method.

[0096] First of all, efficiency is the key. We designed a registration center-based service discovery method and used the classic MySQL database to store service data. We deployed the MySQL database on the master node and stored service features. To highlight the effect of the experiment, we randomly generated 100, 1,000, and 10,000 copies of service data and queried them one by one. The results are as follows: Figure 3 As shown in the figure, in the database-based case, the service discovery time will increase rapidly as the number of services increases. In the IoT environment, there are many services and they are easy to change. In the database-based approach, every time the service parameters change, the database has to add a piece of data or modify the original data, which makes management more difficult and difficult to maintain. Figure 3 As can be seen from the figure, when the amount of data increases by the same multiple, the change in matching time is much smaller than that of database query, and it can still maintain efficient work.

[0097] Secondly, high accuracy and high robustness are designed to verify the accuracy of service discovery in a distributed service discovery environment. Figure 2 Taking the Camera service shown in the figure as an example, the discovery is based on the VSA method. When matching the same service, the node that responds first will be preferred. Here, when matching the same service as Pi1, two results will be obtained. The other one is the edge server. In the environment of this experiment, the edge server responds faster than Pi1, so the matching result of the edge server will be obtained. The same experiment was tested 1000 times and the normalized Hamming distance under different task complexities was obtained. The results are shown in Figure 4 and Figure 5 As shown. When the distance between the two vectors is around 0.5, it means that the service does not match, and when it is below a certain threshold, it means that the service matches. In this scenario, the threshold is set to 0.48, and when the task complexity is 5 (in this scenario, it is the number of superimposed NodeRed modules, and in general, the number of modules of the entity service is basically one or two), it is still possible to obtain a service discovery success rate of almost 100%. And through Figure 5 and Figure 6 It can be seen that the stability of the discovery mechanism is also quite good, with basically no major fluctuations, and it can remain stable even when the service complexity changes.

[0098] Next, for distributed service discovery, the experiment simulated a distributed discovery mode based on MQTT, and performed topic discovery by constructing a task description tree, such as / edge / camera / image_size / 200*300. This topic indicates that an image capture service is required at the edge, and the image quality is required to be 200*300 pixels. This solution performs entity service discovery through the corresponding topics defined during service construction, stores the topic tree in different gateway nodes, and forwards requests through routing. This method can effectively perform service discovery and ensure the stability of the system, and will not fail to run due to the failure of a certain node. However, this method will incur a lot of costs when initializing the service tree, and when a new service is generated, the topic tree stored in all gateways needs to be modified. In addition, through experiments on discovery efficiency, the VSA-based solution has good performance in stability and latency.

[0099] Finally, we experimented with the distributed structured service discovery method based on hash tables, using the classic Chord algorithm to implement consistent hashing. Due to the limited number of nodes in the distributed architecture, we set up multiple nodereds as virtual nodes for testing in the NBUFlow platform. In order to reduce the impact of other factors such as the network, we uniformly used the MQTT protocol for communication, and tested the average latency of a single response as a benchmark. Figure 7 As shown in the MQTT method. In the laboratory, the response delays of different service discovery methods were tested under 10, 20 to 50 nodes, among which DHT is a distributed hash table method, FLOODING uses flooding to send service discovery requests, and VSA is the solution of this application. As can be seen from the figure, DHT and FLOODING can maintain a good response speed when the number of nodes is small, but when the number of nodes increases, the response time increases rapidly, mainly due to the increase in routing hops caused by the increase in nodes and the increase in the cost of registering services. VSA performs well. The reasons are briefly stated. First, because VSA uses edge nodes for routing forwarding, it can maintain stability in communication. Secondly, the discovery mode adopted does not require each node to manage all service registrations. Through simple XOR operations, stable and fast responses can be achieved.

[0100] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A VSA-based IoT entity service discovery method for finding a task matching a service request from A tasks deployed by A nodes of the IoT, wherein each of the A nodes deploys a task, A is a positive integer, and is characterized in that The steps include: Step 1: Before each task is deployed to the corresponding node, the JSON workflow of the task is encoded through the VSA model to obtain the hyperdimensional vector HV_a corresponding to each JSON workflow and the number of superpositions M used in the encoding. a , and send this information to the deployed nodes; Step 2: Each node receives the hyperdimensional vector HV_0 and the number of superpositions M0 corresponding to the service request, and obtains the hyperdimensional vector HV_a and the number of superpositions M of the JSON workflow corresponding to its own node deployment task. a ; Step 3: Each node performs service discovery, specifically: Judge M a Is it equal to M0? If so, match the hyperdimensional vector HV_a of the JSON workflow corresponding to each node deployment task with the hyperdimensional vector HV_0 corresponding to the service request to obtain the matching result of each node; if not, the task matching fails and ends.

2. The method for discovering an Internet of Things entity service according to claim 1, characterized in that: The specific steps for encoding each JSON workflow in step 1 are: Step 1-1, create an empty hyperdimensional vector HV and an empty atomic vector memory C; and set the dimension size of the hyperdimensional vector HV to N, and the vector space V∈{0,1} N , and set the initial value of the number of superposition times Num to 0; Step 1-2: Assume that there are b task modules in the JSON workflow, where b is a positive integer, and each task module contains multiple keywords. Map each keyword in the JSON workflow into an atomic vector, and store the mapped atomic vector in the atomic vector storage C; The keywords in each task module include the value corresponding to the type key and the values ​​corresponding to other valid keys. The type key is the type of the current task module. The atomic vector mapped by each keyword is an N-dimensional vector randomly generated from the vector space in step 1-1. Step 1-3, set the initial value of i to 1; Step 1-4: Bind all valid keywords except the type key in the i-th task module of the current JSON workflow in an XOR manner to form the first vector ARG i ; in, are the atomic vectors corresponding to the first valid keyword, the atomic vector corresponding to the second valid keyword, and the atomic vector corresponding to the Dth valid keyword in the i-th task module of the JSON workflow except the type key, respectively. D is the total number of valid keywords except the type key in the i-th task module of the JSON workflow. XOR represents exclusive OR operation. Step 1-5: For the first vector ARG i Circularly shift left one bit to get the second vector PARG i ; Step 1-6: Set the second vector PARG i The atomic vector type corresponding to the type key in the i-th task module of the JSON workflow i Superimpose and circularly shift the superimposed vectors to the left by 2(i-1) bits to obtain the third vector HV i ; Step 1-7: The third vector HV i Superimpose the vector with the current hyperdimensional vector HV, and use the superimposed vector to update the current hyperdimensional vector HV; Step 1-8, add 2 to the current stacking times Num and update the current stacking times Num; Step 1-9, determine whether the value of i is b, if yes, go to step 1-10; if no, add 1 to the current value of i to update the current value of i, and execute steps 1-4 to 1-8 in sequence; Step 1-10, output the final hyperdimensional vector HV' and the final superposition number Num', and accumulate the final hyperdimensional vector HV' with an N-dimensional random vector randomly generated in the vector space to obtain the accumulated hyperdimensional vector HV'; Step 1-11, let e be 1, 2, ... N in sequence, and judge whether the element at the e-th position in the accumulated super-dimensional vector HV" is less than (Num'+1) / 2. If so, set the element at the e-th position in the accumulated super-dimensional vector HV" to 0; if not, set the element at the e-th position in the accumulated super-dimensional vector HV" to 1; Step 1-12: Use the hyperdimensional vector HV" processed in step 1-11 as the hyperdimensional vector after the current JSON workflow encoding is completed.

3. The method for discovering an Internet of Things entity service according to claim 2, characterized in that: The value of N in step 1-1 is 10000.

4. The method for discovering an Internet of Things entity service according to claim 2, wherein: Before mapping each keyword in the JSON workflow into an atomic vector, the steps 1-2 further include: The keywords of the JSON workflow are filtered to remove the features that do not affect the task composition, and finally the filtered keywords are mapped into atomic vectors.

5. The method for discovering an Internet of Things entity service according to claim 2, characterized in that: The specific process of service discovery in step 3 is as follows: Step 3-1: Determine M a Is it equal to M0? If yes, go to step 3-2; if not, the task matching fails and ends; Step 3-2: Obtain the final expression of the super-dimensional vector HV' in the encoding process of the super-dimensional vector HV_a, specifically: HV'=HV1+HV2+…HV b =type1+PARG1+ρ 2 (type2)+p 2 (PARG2)+…p 2(b-1) (type b )+r 2(b-1) (PARG bb ) Among them, ρ 2 (type2) means type2 is cyclically shifted left by 2 bits; ρ 2 (PARG2) means PARG2 is cyclically shifted left by 2 bits; 2(b-1) (type b ) indicates type b Circularly shift left by 2(b-1) bits; ρ 2(b-1) (PARG b ) means PARG is cyclically shifted left by 2(b-1) bits; Step 3-3, sort the intermediate vectors in the encoding process of the super-dimensional vector HV_a in the following order to obtain a vector set V_a, where the vectors in the vector set V_a are as follows from the earliest to the latest: type1、PARG1、p 2 (type2)、p 2 (PARG2)、p 2(b-1) (type b )、r 2(b-1) (PARG b ) Step 3-4, record the position of the vector in the vector set V_a as m, and the initial value of m is 1; Step 3-5, calculate the normalized Hamming distance L between the mth vector in the vector set V_a obtained in the encoding process of the hyperdimensional vector HV_a and the mth vector in the vector set V_0 obtained in the encoding process of HV_0, and determine whether L is less than the preset threshold L0. If so, the mth vector is matched successfully, and the process proceeds to step 3-6; if not, it indicates that the match fails, and the process ends; Step 3-6: Circularly shift each vector in the current vector set V_a right by one position to update the vector set V_a, and circularly shift each vector in the current vector set V_0 right by two positions to update the vector set V_0, and determine whether the value of m is M0. If so, the task of the node is successfully matched with the service request; if not, add 1 to the current value of m to update the current value of m, and execute step 3-5.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the Internet of Things entity service discovery method as described in any one of claims 1 to 5, so as to find a task matching the request from A tasks deployed by A nodes of the Internet of Things, and output the discovered task results.

Citation Information

Patent Citations

  • Decentralized mobile edge computing resource discovery and selection method and system

    CN111556514A

  • Software-defined NFV-based security service chain arrangement and deployment method and system

    CN114024747A