Distributed real-time database and machine vision system
By designing a distributed real-time database, the problem of data processing and storage in machine vision system is solved, and distributed collaboration and real-time data updates of multiple clients are realized.
Patent Information
- Application Number
- CN202411994776.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
Data processing and storage in existing machine vision systems are concentrated on a single device and cannot be shared across multiple devices, limiting the possibility of distributed collaboration.
A distributed real-time database is designed, including a data management module, a data communication module and a data operation module, which supports the definition, storage and management of multiple data types, and communicates with multiple clients through a lightweight communication protocol to achieve dynamic operations and real-time updates.
It realizes the machine vision system's demand for diversified data, supports synchronous access and real-time updates of multiple clients, and realizes distributed collaboration of multiple clients.
Smart Images

Figure CN119903112A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision technology, and in particular to a distributed real-time database and a machine vision system. Background Art
[0002] In machine vision systems, databases play a vital role. They are responsible for storing, managing, and processing the large amounts of data generated by machine vision systems, and ensuring that data can be quickly accessed and processed when needed, so that machine vision systems can efficiently perform various visual tasks. Currently, data processing and storage in machine vision systems are concentrated on a single device and cannot be shared across multiple devices, limiting the possibility of distributed collaboration. Summary of the invention
[0003] The embodiments of the present application provide a distributed real-time database and a machine vision system to solve at least one of the above-mentioned technical problems.
[0004] The distributed real-time database of the implementation mode of the present application includes a data management module, a data communication module and a data operation module;
[0005] The data management module is used to define, store and manage variables of various data types, including any of scalars, characters and images;
[0006] The data communication module is used to communicate with multiple clients;
[0007] The data operation module is used to dynamically operate the variables according to the requests of the multiple clients.
[0008] In some embodiments, the data management module is provided with a first application programming interface, and the data management module is used to define the data structure of the variables of the plurality of data types based on a data serialization protocol through the first application programming interface, and store and manage the variables based on a hash table and a memory database;
[0009] The data structure includes the name, data type, current value of the variable and metadata of the associated operator tool.
[0010] In some embodiments, the data communication module is used to communicate with the multiple clients via a lightweight communication protocol.
[0011] In some implementations, the communication mode of the data communication module includes point-to-point communication, and the multiple clients operate the variables through the point-to-point communication requests.
[0012] In some embodiments, the communication mode of the data communication module includes publish-subscribe mode communication, and the publish-subscribe mode communication is used to broadcast the update information of the variable in real time, so as to synchronize the update information to the subscribing clients among the multiple clients in real time.
[0013] In some embodiments, the data operation module is provided with a second application programming interface, and the data operation module performs dynamic operations on the variables through the second application programming interface, and the dynamic operations include any one or more of creation, deletion, modification, and viewing.
[0014] In some implementations, the data operation module is provided with a concurrency control mechanism, and the concurrency control mechanism includes any one or more of a transaction mechanism, a version control, and a distributed lock.
[0015] In some implementations, the data operation module is provided with a notification mechanism, and the notification mechanism is used to push update notifications to the subscribing client through the publish-subscribe mode communication after each dynamic operation of the data operation module.
[0016] In some embodiments, the distributed real-time database further includes a visualization module, and the visualization module is used to dynamically display any one or more of the name, the data type, the current value, and the change trend of the variable.
[0017] The machine vision system of the implementation mode of the present application includes the distributed real-time database of any one of the above implementation modes.
[0018] In the distributed real-time database and machine vision system of the embodiment of the present application, the data management module defines, stores and manages variables of various data types, the data communication module communicates with multiple clients, and the data operation module dynamically operates the variables according to the requests of multiple clients. In this way, the needs of the machine vision system for diversified data can be met, the synchronous access and real-time update of multiple clients can be supported, and the distributed collaboration of multiple clients can be realized.
[0019] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0021] Figure 1 It is a module schematic diagram of a distributed real-time database in certain embodiments of the present application;
[0022] Figure 2 It is a module schematic diagram of a distributed real-time database in certain embodiments of the present application;
[0023] Figure 3 is a schematic diagram of a module of a machine vision system according to certain embodiments of the present application;
[0024] Figure 4 It is a module schematic diagram of a machine vision system of certain embodiments of the present application. DETAILED DESCRIPTION
[0025] The following is a further description of the embodiments of the present application in conjunction with the accompanying drawings. The same or similar reference numerals in the accompanying drawings represent the same or similar elements or elements with the same or similar functions from beginning to end. In addition, the embodiments of the present application described below in conjunction with the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the present application.
[0026] See also Figures 1 to 3 The embodiment of the present application provides a distributed real-time database 100. The distributed real-time database 100 includes a data management module 10, a data communication module 20 and a data operation module 30. The data management module 10 is used to define, store and manage variables of multiple data types, and the multiple data types include any of scalars, characters and images. The data communication module 20 is used to communicate with multiple clients 200. The data operation module 30 is used to dynamically operate the variables according to the requests of the multiple clients 200.
[0027] In the distributed real-time database 100 of the embodiment of the present application, the data management module 10 defines, stores and manages variables of various data types, the data communication module 20 communicates with multiple clients 200, and the data operation module 30 dynamically operates the variables according to the requests of the multiple clients 200. In this way, the needs of the machine vision system 1000 for diversified data can be met, the synchronous access and real-time update of multiple clients 200 can be supported, and the distributed collaboration of multiple clients 200 can be realized.
[0028] Specifically, the distributed real-time database 100 can be applied to the machine vision system 1000. The architecture of the distributed real-time database 100 is built based on shared memory and high-speed message transmission, and can support simultaneous access and real-time update of multiple clients 200.
[0029] The distributed real-time database 100 can store data in multiple physical nodes in a dispersed manner, realize data sharing and transparent access through network communication, and process data requests in real time. The distributed real-time database 100 combines the high availability, scalability and fault tolerance of the distributed database with the fast response and real-time processing capabilities of the real-time database.
[0030] In the implementation manner of the present application, the distributed real-time database 100 adopts a modular design and is divided into modules according to functions. The distributed real-time database 100 may include a data management module 10, a data communication module 20 and a data operation module 30.
[0031] The data management module 10 can support the definition, storage and management of variables of multiple data types. The multiple data types can include any of scalars, characters and images. The scalars can also include integer type scalars, single-precision floating point type scalars and double-precision floating point type scalars. In other words, the multiple data types can include any of integer type scalars, single-precision floating point type scalars, double-precision floating point type scalars, characters and images. It should be noted that multiple includes two or more.
[0032] The data communication module 20 can realize the communication between the distributed real-time database 100 and the multiple clients 200. For example, the multiple clients 200 can send requests to the data communication module 20 to operate the variables stored in the distributed real-time database 100; or obtain the variables stored in the distributed real-time database 100; or, when the variables of the distributed real-time database 100 are updated, the update information of the variables can be broadcast to the multiple clients 200 through the data communication module 20.
[0033] When the data communication module 20 receives a request sent by any client 200 , the data operation module 30 may perform corresponding dynamic operations on the variables according to the request of the client 200 .
[0034] In related technologies, data processing and storage of machine vision systems are concentrated on a single device. When the amount of data increases or the processing complexity increases, it is easy to reach the performance limit of the device, resulting in slower response, and the stored data cannot be shared across multiple devices, limiting the possibility of distributed collaboration.
[0035] In the implementation mode of the present application, a distributed real-time database 100 is constructed, the data management module 10 can define, store and manage variables of various data types, the data communication module 20 communicates with multiple clients 200, and receives requests sent by multiple clients 200, so that the data operation module 30 can dynamically operate the variables according to the requests of multiple clients 200. In this way, the needs of the machine vision system 1000 for diversified data can be met, the synchronous access and real-time update of multiple clients 200 can be supported, and the distributed collaboration of multiple clients 200 can be realized.
[0036] See also Figure 1 In some embodiments, the data management module 10 is provided with a first application programming interface. The data management module 10 is used to define the data structure of variables of multiple data types based on the data serialization protocol through the first application programming interface, and store and manage the variables based on the hash table and the memory database. The data structure includes the name, data type, current value of the variable, and metadata of the associated operator tool.
[0037] Specifically, the data management module 10 provides a first application programming interface (API) that can support the calling of common programming languages. The first application programming interface can support the definition, storage and management of variables of multiple data types.
[0038] The data serialization protocol can adopt the Protobuf protocol. The Protobuf protocol is a language-neutral, platform-neutral, extensible mechanism protocol for serializing structured data. Through the extension characteristics of the Protobuf protocol, the data type can be flexibly expanded without destroying the current data structure, so that the distributed real-time database 100 can adapt to the changing needs in different application scenarios in the future and have long-term adaptability and upgrade capabilities.
[0039] In addition, the Protobuf protocol has streaming transmission capability. For large data objects, such as image type variables, streaming transmission allows the client 200 to gradually receive and process data instead of waiting for the entire variable to be transmitted. This helps reduce memory overhead.
[0040] The data serialization protocol can be used to define the data structure of variables of various data types and perform protocol encapsulation, thereby facilitating data serialization and cross-platform transmission of variables. Protocol encapsulation refers to packaging and transmitting variables according to a specific communication protocol. The data structure may include the name of the variable, data type, current value, and metadata of the associated operator tool. The associated operator tool refers to the machine vision processing algorithm related to the variable. The metadata may be the data type of the processing result obtained by the corresponding algorithm. In an example, the code for defining the name of the variable may be as follows:
[0041]
[0042]
[0043] Among them, "string name=1" means defining a character type variable named "name" with an identifier of 1. oneof value{...} means defining a variable, which may contain the following variables: "int32 int_value=2" means defining a 32-bit integer type variable named "int_value" with an identifier of 2, which can be used to store 32-bit integer type variables. "float float_value=3" means defining a single-precision floating-point type variable named "float_value" with an identifier of 3, which can be used to store single-precision floating-point type variables. "doubledouble_value=4" means defining a double-precision floating-point type variable named "double_value" with an identifier of 4, which can be used to store double-precision floating-point type variables. "string string_value=5" means defining a character type variable named "string_value" with an identifier of 5, which can be used to store character type variables. "bytes image_value=6" means defining a byte field named "image_value" with an identifier of 6, which can be used to store image type variables.
[0044] It should be noted that in a given Variable message instance, at most one of the variables int_value, float_value, double_value, string_value and image_value can be set.
[0045] Afterwards, the storage and management of variables can be performed based on a hash table (HashMap) and a memory database. The hash table can store various types of data, can meet the needs of storing variables of multiple data types in the distributed real-time database 100 of the embodiment of the present application, and can also support subsequent dynamic operations on the variables. In addition, since the time complexity of the hash function is O(1), the hash table can provide faster data access speed, and can realize efficient access of variables.
[0046] In-memory databases, such as Redis, store variables in memory, which can provide faster reading and writing speeds. At the same time, the in-memory database can also ensure that the variables can be restored after the machine vision system 1000 is restarted. In this way, the persistence capability of the distributed real-time database 100 can be enhanced, avoiding memory competition and conflict problems that arise as the application scenario becomes more complicated.
[0047] In the related art, the stored variables lack a unified data management mechanism, which makes the variables easy to be lost or difficult to maintain.
[0048] In the implementation mode of the present application, a unified first application programming interface is provided to define, store and manage variables based on a data serialization protocol, a hash table and a memory database, so as to facilitate unified management and maintenance of variables in the distributed real-time database 100, and the variables are not easily lost.
[0049] See also Figure 1 and Figure 3 In some embodiments, the data communication module 20 is used to communicate with multiple clients 200 via a lightweight communication protocol.
[0050] Specifically, a lightweight communication protocol such as a lightweight Zero Message Queue (ZMQ) protocol can adopt an asynchronous communication mode, thereby reducing the waiting time of message transmission and reducing the delay of message processing. In addition, the ZMQ protocol supports concurrent processing, can process multiple messages at the same time, and has a high throughput. In this way, the communication efficiency between the distributed real-time database 100 and multiple clients 200 can be improved.
[0051] See also Figure 1 and Figure 3 In some implementations, the communication method of the data communication module 20 includes point-to-point communication, and multiple clients 200 operate on variables through point-to-point communication requests.
[0052] Specifically, the communication mode of the data communication module 20 includes point-to-point communication. Point-to-point communication means that each client 200 can directly transmit information to the distributed real-time database 100, and this communication mode does not need to be transferred through a central server or network equipment. Multiple clients 200 can operate variables through point-to-point communication requests. For example, the client 200 can request to create a variable, and the code for creating a variable can be as follows:
[0053] Variable newVar;
[0054] newVar.set_name("Temperature");
[0055] newVar.set_int_value(25);
[0056] zmq::message_t request(newVar.ByteSizeLong());
[0057] newVar.SerializeToArray(request.data(),request.size());
[0058] socket.send(request);
[0059] The name of the created variable is "Temperature", the value of the variable is 25, and the created variable is serialized and sent through the ZMQ protocol. It should be noted that the created variable is encapsulated through the Protobuf protocol to achieve efficient serialization and decoding of the variable, and the Protobuf protocol can provide dynamic protocol support, and the format and content of the message can be adjusted according to actual application requirements.
[0060] See also Figure 1 and Figure 3 In some embodiments, the communication method of the data communication module 20 includes publish-subscribe mode communication, and the publish-subscribe mode communication is used to broadcast the update information of the variable in real time to synchronize the update information to the subscribing client 200 among the multiple clients 200 in real time.
[0061] Specifically, the distributed real-time database 100 can adopt an event-driven mechanism to achieve efficient update of variables through Pub Sub communication. Under the event-driven mechanism, the distributed real-time database 100 communicates with multiple clients 200 through events and is decoupled from each other. Even if a client 200 changes, other clients 200 will not be directly affected, making the machine vision system 1000 easier to expand and maintain.
[0062] Publish-subscribe mode communication can realize one-to-many communication. In the publish-subscribe mode, the publisher does not directly send messages to specific subscribers, but publishes messages to one or more topics, and subscribers receive messages by subscribing to these topics, thereby decoupling the publisher and the subscriber so that they can run and expand independently. In the implementation mode of the present application, the publisher is the distributed real-time database 100, and the subscriber is the multiple clients 200.
[0063] The data communication module 20 broadcasts the update information of the variables in real time through publish-subscribe mode communication, and synchronizes the update information of the variables to the subscribing clients 200 among the multiple clients 200 in real time, so as to support the real-time synchronization of multiple clients 200 and realize the efficient update of the variables.
[0064] See also Figure 1 In some embodiments, the data operation module 30 is provided with a second application programming interface, and the data operation module 30 performs dynamic operations on variables through the second application programming interface, and the dynamic operations include any one or more of creation, deletion, modification, and viewing.
[0065] Specifically, the data operation module 30 is provided with a standardized second application programming interface, which can support the calling of common programming languages. The variables can be dynamically operated through the second application programming interface, so that the content in the distributed real-time database 100 is flexibly configured and managed, and the adaptability and development efficiency of the machine vision system 1000 are improved.
[0066] The dynamic operation may include any one of creation, deletion, modification, and viewing; or the dynamic operation may include any two of creation, deletion, modification, and viewing; or the dynamic operation may include any three of creation, deletion, modification, and viewing; or all of them may be included. For example, a variable may be created through the second application programming interface, and the code for creating the variable may be as follows:
[0067] distributedDatabase->createVariable("Speed", 30.5);
[0068] For another example, a variable may be deleted through the second application programming interface, and the code for deleting the variable may be as follows:
[0069] distributedDatabase->deleteVariable("Temperature");
[0070] In addition, the data layer of the distributed real-time database 100 supports direct binding of machine vision algorithms to optimize the efficiency of the entire link from input to output. The data layer is the part that stores variables and operates on variables. Direct binding of machine vision algorithms allows the data layer to directly call and execute machine vision algorithms. In this way, the entire data operation process is as efficient as possible.
[0071] See also Figure 1 In some implementations, the data operation module 30 is provided with a concurrency control mechanism, and the concurrency control mechanism includes any one or more of a transaction mechanism, a version control, and a distributed lock.
[0072] Specifically, a concurrency control mechanism is set in the data operation module 30, and the concurrency control mechanism may include any one of a transaction mechanism, version control, and a distributed lock; or, may include any two of the transaction mechanism, version control, and distributed lock, or may include all of them. In this way, high-concurrency data operations can be implemented, distributed transactions can be supported, and the consistency and integrity of variables can be maintained when multiple clients 200 access and operate variables at the same time.
[0073] Among them, the transaction mechanism has the characteristics of atomicity, consistency, isolation and persistence, which can ensure that transactions across multiple nodes can be executed correctly in a distributed environment.
[0074] Version control is a concurrency control strategy that allows multiple transactions to read different versions of the same data item at the same time. A version chain can be maintained for each data item. Each node in the chain corresponds to a version of the data item. Transactions can select the appropriate version to read based on their own timestamp or version number. In this way, there is no interference from other concurrent transactions, ensuring concurrency safety.
[0075] A distributed lock is a mechanism for controlling access to shared resources in a distributed environment. At any time, only one client 200 can operate on a variable. In this way, operations on the same variable by multiple clients 200 can be coordinated, thereby avoiding problems caused by concurrent updates.
[0076] See also Figure 1 and Figure 3 In some embodiments, the data operation module 30 is provided with a notification mechanism, which is used to push update notifications to the subscribing client 200 through publish-subscribe mode communication after each dynamic operation of the data operation module 30 .
[0077] Specifically, each time the data operation module 30 performs a dynamic operation on a variable, the notification mechanism can push an update notification to the corresponding subscribing client 200 among the multiple clients 200. In this way, all dynamic operations can be synchronized to the subscribing client 200 in real time. Figure 3 As shown, if client A subscribes to a topic related to variable b, after the data operation module 30 performs a dynamic operation on variable b, the notification mechanism can push an update notification about variable b to client A, and the notification may include the operation type, variable name, update content, etc.
[0078] See also Figure 1 and Figure 4 In some implementations, the distributed real-time database 100 further includes a visualization module 40, which is used to dynamically display any one or more of the variable's name, data type, current value, and change trend.
[0079] Specifically, the visualization module 40 is arranged on the client 200, and can provide the user with a graphical interface for real-time viewing, operation and analysis of variables. The graphical interface can be developed using QML based on the Qt framework. Qt is a graphical user interface application development framework. QML is a declarative language used to create user interfaces in the Qt framework, allowing users to describe the appearance and behavior of the user interface in an intuitive and efficient manner. Based on the powerful functions of the Qt framework and the rapid development capabilities of QML, a high-quality graphical interface can be jointly constructed.
[0080] According to actual application requirements, in the graphical interface, any one of the variable name, data type, current value, and change trend can be dynamically displayed; or any two of the variable name, data type, current value, and change trend can be dynamically displayed; or any three of the variable name, data type, current value, and change trend can be dynamically displayed; or all of them can be dynamically displayed. For example, for image type variables, real-time image preview can be performed in the graphical interface. Of course, other display content can also be added according to actual application requirements, and there is no limitation here.
[0081] In an example, the code for dynamically updating the variables displayed in the graphical interface is as follows:
[0082] ListView{
[0083] Model: variableModel
[0084] Delegate: Text{
[0085] Text: name+“:”+value
[0086] }
[0087] }
[0088] With the above code, the name and current value of the variable can be displayed in text form.
[0089] When the data operation module 30 dynamically operates the variables so that the variables currently displayed in the graphical interface are updated, the notification mechanism of the data operation module 30 can push the update notification to the visualization module 40 through the publish-subscribe mode communication, so that the graphical interface updates the display content according to the update notification. In one example, the graphical interface can also display the change trend of the variables, for example, for numerical variables, a variable change trend graph is provided to display its change trend.
[0090] In addition, multiple function buttons can be set in the graphical interface, and the user can send corresponding requests by pressing the function buttons. For example, a create variable button, a delete variable button, a modify variable button, and a view variable button can be set. When the user presses the create variable button, the client 200 can send a create variable request; when the user presses the delete variable button, the client 200 can send a delete variable request; when the user presses the modify variable button, the client 200 can send a modify variable request; when the user presses the view variable button, the client 200 can send a view variable request. The function buttons can be set according to actual application requirements, and examples are not given here one by one.
[0091] In this way, the update of variables can be fed back to the client 200 in real time, and can support real-time rendering of large-scale variables, improving visualization efficiency. For numerical variables, the graphical interface can intuitively display the current value and change trend of the variable; for image type variables, streaming preview can be performed in the graphical interface, which is suitable for data-intensive and status monitoring scenarios in machine vision, and can improve user experience and operation efficiency.
[0092] In some embodiments, the distributed real-time database 100 also supports load balancing and dynamic expansion. Load balancing can receive requests from the client 200 and distribute these requests to multiple nodes according to a certain algorithm, which can significantly improve the overall throughput and response speed of the distributed real-time database 100 and reduce the load pressure of a single node. Dynamic expansion can automatically adjust resource allocation according to the current load of the distributed real-time database 100 to meet the changing needs. In this way, overload can be effectively avoided to ensure the stability and scalability of the distributed real-time database 100.
[0093] The distributed real-time database 100 is also integrated with a fault-tolerant mechanism. When the distributed real-time database 100 detects that a node fails, the fault-tolerant mechanism will be triggered immediately and automatically switch the task to other normal nodes to ensure the integrity and reliability of the data.
[0094] See also Figure 2 and Figure 3The embodiment of the present application further provides a machine vision system 1000. The machine vision system 1000 includes the distributed real-time database 100 of any of the above embodiments.
[0095] Specifically, the machine vision system 1000 may include a distributed real-time database 100 and multiple clients 200. The distributed real-time database 100 is used to define, store and manage data such as variables collected or processed by the machine vision system 1000. The multiple clients 200 are interactive interfaces between users and the machine vision system 1000. Users can monitor the status of the machine vision system 1000 or operate the machine vision system 1000 through the clients 200. In addition, the machine vision system 1000 may also include other auxiliary devices such as image acquisition equipment and algorithm processing units.
[0096] In summary, in the distributed real-time database 100 and the machine vision system 1000 of the embodiment of the present application, the data management module 10 defines, stores and manages variables of various data types, the data communication module 20 communicates with multiple clients 200, and the data operation module 30 dynamically operates the variables according to the requests of the multiple clients 200. In this way, the needs of the machine vision system 1000 for diversified data can be met, the synchronous access and real-time update of multiple clients 200 can be supported, and the distributed collaboration of multiple clients 200 can be realized.
[0097] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0098] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0099] A person of ordinary skill in the art will appreciate that all or part of the steps carried by the method for implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment. In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.
[0100] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application. The scope of the present application is defined by the claims and their equivalents.
Claims
1. A distributed real-time database, characterized in that: It includes a data management module, a data communication module and a data operation module; The data management module is used to define, store and manage variables of various data types, including any of scalars, characters and images; The data communication module is used to communicate with multiple clients; The data operation module is used to dynamically operate the variables according to the requests of the multiple clients.
2. The distributed real-time database according to claim 1, characterized in that: The data management module is provided with a first application programming interface, and the data management module is used to define the data structure of the variables of the plurality of data types based on a data serialization protocol through the first application programming interface, and store and manage the variables based on a hash table and a memory database; The data structure includes the name, data type, current value of the variable and metadata of the associated operator tool.
3. The distributed real-time database according to claim 1, characterized in that: The data communication module is used to communicate with the multiple clients through a lightweight communication protocol.
4. The distributed real-time database according to any one of claims 1 to 3, characterized in that: The communication mode of the data communication module includes point-to-point communication, and the multiple clients operate the variables through the point-to-point communication request.
5. The distributed real-time database according to any one of claims 1 to 3, characterized in that: The communication mode of the data communication module includes publish-subscribe mode communication, and the publish-subscribe mode communication is used to broadcast the update information of the variable in real time, so as to synchronize the update information to the subscribing clients among the multiple clients in real time.
6. The distributed real-time database according to any one of claims 1 to 3, characterized in that: The data operation module is provided with a second application programming interface, and the data operation module performs dynamic operations on the variables through the second application programming interface, and the dynamic operations include any one or more of creation, deletion, modification, and viewing.
7. The distributed real-time database according to any one of claims 1 to 3, characterized in that: The data operation module is provided with a concurrency control mechanism, and the concurrency control mechanism includes any one or more of a transaction mechanism, a version control, and a distributed lock.
8. The distributed real-time database according to claim 5, characterized in that: The data operation module is provided with a notification mechanism, and the notification mechanism is used to push update notifications to the subscription client through the publish-subscribe mode communication after each dynamic operation of the data operation module.
9. The distributed real-time database according to claim 2, characterized in that: The distributed real-time database also includes a visualization module, and the visualization module is used to dynamically display any one or more of the name, the data type, the current value, and the change trend of the variable.
10. A machine vision system, characterized in that: The invention comprises a distributed real-time database as described in any one of claims 1 to 9.