Data subscription method, device and equipment, medium and vehicle
By integrating the DDS dynamic library and target channel in the distributed system, the data subscription management of the web front-end is realized, which solves the problem of inflexible data subscription operations and improves the user experience and operational convenience.
Patent Information
- Application Number
- CN202411045296.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, data subscription operations in distributed systems are not flexible enough, making it difficult for users to flexibly obtain published data, and subscribing data needs to be operated through the command line, resulting in cumbersome and unintuitive operations.
By integrating the data distribution service DDS dynamic library in the web front-end, it receives subscription request information, creates and manages subscription tasks, realizes flexible subscription, suspension, cancellation and modification of published data, and uses the target channel to transmit data to the web front-end to enrich the subscription data. Mode of operation.
It improves the flexibility for users to obtain published data, avoids command line operations, realizes multi-threaded dynamic subscription under the same process, and enhances the operability and intuitiveness of subscription data.
Smart Images

Figure CN118802884A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data subscription method, device, equipment, medium and vehicle. Background Art
[0002] In related technologies, Data Distribution Service (DDS) is an efficient, reliable, scalable, and secure data communication protocol that is widely used in distributed systems. Based on the DDS publish / subscribe architecture, publishers can publish data related to a topic, and subscribers can easily obtain the data they are interested in.
[0003] However, in actual business scenarios, operation and maintenance developers often need to view or debug data. In related technologies, data is only displayed through command lines, and because data is constantly changing, when users need to view or debug data, they can only take screenshots or stop the publisher from publishing data, which makes the way users obtain data inflexible. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data subscription method, device, equipment, medium and vehicle, which can improve the flexibility of users in obtaining published data.
[0005] According to a first aspect of an embodiment of the present disclosure, a data subscription method is provided, including:
[0006] Receive the subscription request information sent by the web front end through the target channel, and the web front end integrates the data distribution service DDS dynamic library;
[0007] In the case where the subscription request information is create subscription request information, creating a subscription task corresponding to the create subscription request information and saving it to the cache;
[0008] In the case where the subscription request information is target subscription request information, a target subscription task corresponding to the target subscription request information is acquired from the cache, and a target operation corresponding to the target subscription request information is performed on the target subscription task.
[0009] In an achievable implementation, the DDS dynamic library includes a first language version of the DDS dynamic library, and before receiving the subscription request information sent by the web front end through the target channel, the method further includes:
[0010] Compile and build the DDS code to obtain the DDS dynamic library;
[0011] The DDS dynamic library and the target library are integrated by using a project construction tool to obtain the first language version of the DDS dynamic library. The target library is used to assist the first language program in reading the second language used to construct the DDS code.
[0012] Create a web front end based on the first language version of the DDS dynamic library.
[0013] In an achievable implementation, before receiving the subscription request information sent by the web front end through the target channel, the method further includes:
[0014] Call the first function to create a publishing end;
[0015] Create a data writing object based on the publisher;
[0016] Call the second function of the data write object to publish the data to the corresponding global data space.
[0017] In an achievable implementation, the first language includes Java, the second language includes C or C++, and the DDS dynamic library and the target library are integrated using a project construction tool to obtain a first language version of the DDS dynamic library, and the target library is used to assist the first language program in reading the second language used to construct the DDS code, including:
[0018] The DDS dynamic library and the target library are integrated using the project building tool to obtain the Java version of the DDS dynamic library. The target library is used to assist the Java program in reading the C or C++ code used to build the DDS code.
[0019] In an achievable implementation, the target subscription request information includes suspend subscription request information, cancel subscription request information, or modify subscription request information. When the subscription request information is the target subscription request information, a target subscription task corresponding to the target subscription request information is obtained from a cache, and a target operation corresponding to the target subscription request information is performed on the target subscription task, including:
[0020] In the case where the subscription request information is a subscription pause request information, a target subscription task corresponding to the subscription pause request information is obtained from a cache; according to parameter information included in the subscription pause request information, a value of a first parameter of the target subscription task is modified to a first value, the first value indicating that the target subscription task is paused;
[0021] In the case where the subscription request information is a subscription cancellation request information, a target subscription task corresponding to the subscription cancellation request information is obtained from a cache; according to parameter information included in the subscription cancellation request information, a value of a second parameter of the target subscription task is modified to a second value, the second parameter is used to control a cancellation operation of the target subscription task, and the second value is used to cancel the target subscription task; and a cache corresponding to the target subscription task is released;
[0022] In the case where the subscription request information is a modification request information, the target subscription task corresponding to the modification request information is obtained from the cache; according to the parameter information included in the modification request information, the value of the second parameter of the target subscription task is modified to a third value, and the third value is used to cancel the target subscription task; the cache corresponding to the target subscription task is released; and the latest subscription task is created according to the parameter information included in the modification request information and saved in the cache.
[0023] In an achievable implementation, when the subscription request information is target subscription request information, after obtaining the target subscription task corresponding to the target subscription request information from the cache and performing the target operation corresponding to the target subscription request information on the target subscription task, the method further includes:
[0024] When the value of the parameter of the target subscription task indicates obtaining the published data, the published data is obtained from the global data space;
[0025] The target channel is used to transmit the published data to the web front end and the published data is displayed based on the display interface of the web front end.
[0026] According to a second aspect of an embodiment of the present disclosure, a data subscription device is provided, including:
[0027] The receiving module is used to receive the subscription request information sent by the web front end through the target channel, and the web front end integrates the data distribution service DDS dynamic library;
[0028] A creation module, used for creating a subscription task corresponding to the subscription creation request information and saving it to a cache when the subscription request information is subscription creation request information;
[0029] The acquisition module is used to acquire the target subscription task corresponding to the target subscription request information from the cache when the subscription request information is the target subscription request information, and perform the target operation corresponding to the target subscription request information on the target subscription task.
[0030] According to a third aspect of an embodiment of the present disclosure, a vehicle is provided, storing a set of instruction sets, which are executed by the vehicle to implement the data subscription method provided by the first aspect of the present disclosure.
[0031] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; a processor, configured to read executable instructions from the memory and execute the instructions to implement the data subscription method provided in the first aspect of the present disclosure.
[0032] According to a fifth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data subscription method provided in the first aspect of the present disclosure are implemented.
[0033] The technical solution provided by the embodiment of the present disclosure may include the following beneficial effects: receiving subscription request information sent by the web front end through the target channel, determining whether the subscription request information belongs to creation subscription request information or target subscription request information, and performing corresponding operations, thereby enriching the operation mode of subscription data, thereby improving the flexibility of user subscription data.
[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0036] Figure 1 The figure is a flow chart of a data subscription method according to an exemplary embodiment.
[0037] Figure 2 The invention is a flowchart showing the interaction between a web front end and a back end based on creating a subscription request information according to an exemplary embodiment.
[0038] Figure 3 The invention is a flowchart of a method for creating a web front end according to an exemplary embodiment.
[0039] Figure 4 The figure is a flow chart of another data subscription method according to an exemplary embodiment.
[0040] Figure 5 The invention is a flowchart showing the interaction between a web front-end and a back-end based on a subscription suspension request information according to an exemplary embodiment.
[0041] Figure 6 The present invention is a flowchart showing the interaction between a web front-end and a back-end based on the resumption of subscription request information according to an exemplary embodiment.
[0042] Figure 7 The present invention is a flowchart showing the interaction between a web front-end and a back-end based on unsubscribe request information according to an exemplary embodiment.
[0043] Figure 8 The present invention is a flowchart showing the interaction between a web front-end and a back-end based on modifying subscription request information according to an exemplary embodiment.
[0044] Fig. 9 The invention is a block diagram of a data subscription device according to an exemplary embodiment.
[0045] Fig.10 is a block diagram of a vehicle according to an exemplary embodiment.
[0046] Fig.11 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0047] Exemplary embodiments will be described in detail below with reference to the accompanying drawings.
[0048] It should be pointed out that the relevant embodiments and drawings are only for describing exemplary embodiments provided by the present disclosure, rather than all embodiments of the present disclosure, and it should not be understood that the present disclosure is limited to the relevant exemplary embodiments.
[0049] It should be noted that the terms "first", "second", etc. used in the present disclosure are only used to distinguish different steps, devices or modules, etc. The related terms neither represent any specific technical meanings nor indicate the order or interdependence between them.
[0050] It should be noted that the modifications of the terms "one", "multiple", and "at least one" used in the present disclosure are illustrative rather than restrictive. Unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0051] It should be noted that the term "and / or" used in this disclosure is used to describe the association relationship between associated objects, and generally indicates that there are at least three association relationships. For example, A and / or B can at least indicate the existence of three association relationships: A exists alone, A and B exist at the same time, and B exists alone.
[0052] It should be noted that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. Unless otherwise specified, the scope of the present disclosure is not limited by the order of description of the steps in the relevant embodiments.
[0053] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0054] Before describing the technical solutions provided by the embodiments of the present disclosure, in order to facilitate understanding of the embodiments of the present disclosure, the present disclosure specifically describes the related technical background and problems existing in the related technologies:
[0055] DDS is an efficient, reliable, scalable and secure data communication protocol, which is widely used in distributed systems. With the continuous development of fields including aerospace, automobiles, medical equipment, ships, and large-scale real-time applications such as intelligent transportation systems and smart grids. Although there are many implementations of DDS, and each implementation has different versions in several languages, most of them are based on C and C++, supplemented by Python. The current Internet architecture is mainly B / S architecture, and JAVA's best field happens to be server-side development; and now with the further development of technologies such as 5G, artificial intelligence, and the Internet of Things, real-time data transmission will become more important and widespread. Therefore, it is necessary to provide an upper-level application for DDS, let it be an experience, debugging tool, so that more people can understand and use this technology.
[0056] However, it is troublesome to subscribe to data in the related technology, because the subscription data is based on command line operations. For people who are not familiar with command line tools and commands, it is troublesome to experience and use it, and they need to be familiar with the relevant commands. For example: In actual business scenarios, production, research and testing related personnel need to monitor and debug subscription data. Due to the large number of topics and frequent data sending and receiving, and the data is constantly changing. If you view messages based on the native method, you need to execute a series of commands, which is very inconvenient for the relevant personnel. At the same time, in actual business scenarios, many times, there may be problems with the program or data. If there is a problem, it is difficult for the relevant personnel to debug.
[0057] In addition, since the domain and topic to be subscribed are hard-coded in the code, if you want to modify them, you can only modify the source code and perform the compilation and construction steps repeatedly, which is a waste of time. After subscribing to the data, the native subscription results are all output to the console in a unified manner. When the sent data is too long, it is not conducive to user observation. In addition, due to the characteristics of the Python language, the source code may be modified or leaked when implementing services based on Python, which poses a security risk.
[0058] Exemplary Methods
[0059] Figure 1 is a flow chart of a data subscription method according to an exemplary embodiment. Figure 1 As shown, steps S110-S130 are included.
[0060] In step S110, the subscription request information sent by the web front end is received through the target channel.
[0061] Receive subscription request information sent by the web front end through the target channel established with the web front end. The target channel is used to transmit data output by the front end or back end. The web front end integrates the data distribution service DDS dynamic library. The subscription request information is used to perform corresponding subscription operations on the data published by the back end publisher.
[0062] In one example, the target channel may be a websocket, and the DDS dynamic library may be a cyclonedds dynamic library.
[0063] In one embodiment, the user clicks on the desired subscription option on the display page of the web front end created by using cyclonedds, and the web front end sends the subscription request information input by the user to the back end through the websocket channel.
[0064] In step S120, when the subscription request information is create subscription request information, a subscription task corresponding to the create subscription request information is created and saved in the cache.
[0065] After the backend obtains the subscription request information sent by the web frontend, it determines the type of the subscription request information. If the determination result indicates that the subscription request information is a create subscription request information, a subscription task corresponding to the create subscription request information is created and saved to the cache. The created subscription task is used to subscribe to the data published by the publisher of the backend.
[0066] In one embodiment, after the back end obtains the create subscription request information sent by the web front end, the type of the subscription request information is determined. If the judgment result indicates that the subscription request information is a create subscription request information, the web front end carries relevant parameters to initiate a Hyper Text Transfer Protocol (HTTP) request to the back end to create a subscription. The back end encapsulates the parameter information into a subscription task based on the parameter information in the create subscription request information. After the subscription task is created, the subscription task is added to the thread pool and saved to the cache for subsequent suspension, modification, and cancellation. Among them, the cancel parameter and the suspend parameter of the subscription task are set to false.
[0067] In another embodiment, the steps of the web front end and the back end interacting based on creating a subscription request information are as follows: Figure 2As shown in the figure: In step 1, the publisher publishes the published data to the global data space. In step 2, the web front end creates a subscription task in the back end according to the subscription request information. In step 3, the created subscription task is added to the thread pool. In step 4, the created subscription task is saved to the cache. In step 5, the thread pool executes the subscription task in the pool and obtains the published data from the global data space. In step 6, after obtaining the published data, the back end pushes the published data to the web front end.
[0068] In step S130, when the subscription request information is target subscription request information, a target subscription task corresponding to the target subscription request information is acquired from the cache, and a target operation corresponding to the target subscription request information is performed on the target subscription task.
[0069] After the backend obtains the subscription request information sent by the web frontend, it determines the type of the subscription request information. If the determination result indicates that the subscription request information is the target subscription request information, the parameter information of the target subscription task in the cache is modified according to the parameter information in the target subscription request information to implement the corresponding target operation.
[0070] In one embodiment, the types of target operations may include: canceling a subscription task, pausing a subscription task, resuming a subscription task, and modifying a subscription task.
[0071] The technical solution provided by the embodiment of the present disclosure may include the following beneficial effects: receiving subscription request information sent by the web front end through the target channel. Determining whether the subscription request information belongs to creation subscription request information or target subscription request information, and performing corresponding operations, enriching the operation mode of subscription data, thereby improving the flexibility of user subscription data. And adding the subscription task to the thread pool, realizing the ability of multi-threaded operation dynamic subscription under the same process.
[0072] In one embodiment, the DDS dynamic library includes a first language version of the DDS dynamic library, before receiving the subscription request information sent by the web front end through the target channel, such as Figure 3 As shown, the data subscription method also includes steps S140-S160.
[0073] In step S140, the DDS code is compiled and constructed to obtain a DDS dynamic library.
[0074] Compile and build the DDS code to obtain the DDS dynamic library.
[0075] In an example, the code of cyclonedds is compiled and built to obtain the related dynamic library of cyclonedds.
[0076] In step S150, the DDS dynamic library and the target library are integrated using a project construction tool to obtain a first language version of the DDS dynamic library.
[0077] After obtaining the DDS dynamic library, the DDS dynamic library and the target library are packaged and integrated using a project construction tool to obtain a DDS dynamic library whose language version is the first language. The target library is used to assist the first language program in reading the second language used to construct the DDS code.
[0078] In one example, the project building tool may be Maven. The language types of the first language and the second language are not fixed, and may be languages such as Java, C, C++, Python, etc.
[0079] In step S160, a web front end is created based on the DDS dynamic library of the first language version.
[0080] After obtaining the DDS dynamic library whose language version is the first language, a web front end integrating the DDS dynamic library of the first language version is created.
[0081] The disclosed embodiment compiles and builds DDS code and integrates it with the target library to obtain a first language version of the DDS dynamic library, and then creates a web front end based on the first language version of the DDS dynamic library, so that the web front end has the function of subscribing to DDS data. Therefore, users can subscribe to data through the web front end, avoiding the need to subscribe to data through command line operations, thereby improving the flexibility of subscribing to data.
[0082] In one embodiment, before receiving the subscription request information sent by the web front end through the target channel, the data subscription method further includes steps S170-S190.
[0083] In step S170, a first function is called to create a publishing end.
[0084] In one example, the first function may be a create_publisher() function.
[0085] In one embodiment, the backend creates a publisher by calling the create_publisher() function of DomainParticipant.
[0086] In step S180, a data writing object is created based on the publishing end.
[0087] In one embodiment, after the publisher is created according to the create_publisher() function, the create_datawriter function in the publisher is called to create a data writer object (datawriter).
[0088] In step S190, the second function of the data writing object is called to publish the published data to the corresponding global data space.
[0089] In one example, the second function may be a write interface.
[0090] In one embodiment, after the data writing object is created, the published data is published to the global data space through the domain and topic according to the write interface in the data writing object.
[0091] The embodiment of the present disclosure creates a publishing terminal and a data writing object, and then calls the second function of the data writing object to publish data, so as to subsequently subscribe to the published data through a web front end.
[0092] In one embodiment, the first language includes Java, the second language includes C or C++, and the DDS dynamic library and the target library are integrated using a project construction tool to obtain the first language version of the DDS dynamic library. The target library is used to assist the first language program in reading the second language used to construct the DDS code, which may include step S151.
[0093] In step S151, the DDS dynamic library and the target library are integrated using a project construction tool to obtain a Java version of the DDS dynamic library.
[0094] The target library is used to assist the Java program in reading the C or C++ code used to build the DDS code.
[0095] In one example, the target library may be javacpp.
[0096] In one embodiment, Maven is used to integrate the cyclonedds dynamic library and javacpp to obtain a Java version of the cyclonedds dynamic library.
[0097] In the disclosed embodiment, a DDS dynamic library and a target library are integrated by using a project construction tool to obtain a Java version of the DDS dynamic library, which facilitates subsequent acquisition of a Java-based web front end and subscription of data based on the web front end, thereby improving the security and operability of subscription data.
[0098] In one embodiment, the target subscription request information includes suspend subscription request information or cancel subscription request information or modify subscription request information. When the subscription request information is the target subscription request information, the target subscription task corresponding to the target subscription request information is obtained from the cache, and the target operation corresponding to the target subscription request information is performed on the target subscription task, such as Figure 4 As shown, steps S131-S133 may be included.
[0099] In step S131, when the subscription request information is a pause subscription request information, the target subscription task corresponding to the pause subscription request information is obtained from the cache; according to the parameter information included in the pause subscription request information, the value of the first parameter of the target subscription task is modified to a first value, and the first value represents that the target subscription task is suspended.
[0100] In one example, the first parameter may be a suspend parameter, and the first value may be true.
[0101] In one embodiment, if the subscription request information is a subscription pause request information, the target subscription task corresponding to the subscription pause request information is obtained from the cache of the backend. According to the parameter information in the subscription pause request information, the value of the pause parameter required by the logic code for pausing or canceling the target subscription task is modified to a true value, so that the target subscription task is constantly polled in vain, thereby failing to obtain the published data, and realizing the subscription pause function.
[0102] In another embodiment, after pausing the subscription of published data, if the backend obtains the resume subscription request information sent by the web frontend, the target subscription task corresponding to the resume subscription request information is obtained from the cache of the backend. According to the parameter information in the resume subscription request information, the value of the pause parameter required by the logic code for pausing or canceling the target subscription task is modified to a false value (false), so that the target subscription task can obtain the published data and send the published data to the web frontend through the target channel.
[0103] In an example, the pseudo code of the logic for pausing or canceling a target subscription task is as follows:
[0104] / / Loop to determine whether to cancel
[0105] while(!cancel){
[0106] / / Whether to pause
[0107] if(suspend){
[0108] continue;
[0109] }
[0110] / / Get published data
[0111] take();
[0112] }
[0113] In one example, the steps of the web front-end and the back-end interacting based on the suspension subscription request information are as follows: Figure 5As shown in the figure: In step 1, the publisher publishes the published data to the global data space. In step 2, the web front end finds the corresponding target subscription task in the cache of the back end according to the pause subscription request information. In step 3, according to the parameter information in the pause subscription request information, the pause parameter of the target subscription task is modified. Among them, the value of the pause parameter is modified to a true value, so that the target subscription task will continuously poll in the process of executing the task, so that the published data cannot be obtained, and the function of pausing subscription is realized.
[0114] In another example, the steps of the web front-end and the back-end interacting based on the resume subscription request information are as follows: Figure 6 As shown: In step 1, the publisher publishes the published data to the global data space. In step 2, the web front end finds the corresponding target subscription task in the cache of the back end according to the resume subscription request information. In step 3, the pause parameter of the target subscription task is modified according to the parameter information in the resume subscription request information. Among them, the value of the pause parameter is modified to a false value. In step 4, when the value of the pause parameter is a false value, the target subscription task executes the take() method to obtain the published data in the global data space. In step 5, after obtaining the published data, the back end pushes the published data to the web front end.
[0115] In step S132, when the subscription request information is a cancel subscription request information, the target subscription task corresponding to the cancel subscription request information is obtained from the cache; according to the parameter information included in the cancel subscription request information, the value of the second parameter of the target subscription task is modified to a second value, the second parameter is used to control the cancellation operation of the target subscription task, and the second value is used to cancel the target subscription task; and the cache corresponding to the target subscription task is released.
[0116] In one embodiment, if the subscription request information is a subscription cancellation request information, the target subscription task corresponding to the subscription cancellation request information is obtained from the backend cache. According to the parameter information in the subscription cancellation request information, the value of the cancellation parameter required by the logic code for pausing or canceling the target subscription task is modified to a true value, so that the target subscription task jumps out of the loop. At the same time, the data reader object (datareader) related to the target subscription task is destroyed and the cache space is released.
[0117] In one example, the steps of the web front-end and back-end interaction based on the unsubscribe request information are as follows: Figure 7As shown: In step 1, the publisher publishes the published data to the global data space. In step 2, the web front end finds the corresponding target subscription task in the back-end cache according to the unsubscribe request information. In step 3, according to the parameter information in the unsubscribe request information, the cancellation parameter of the target subscription task is modified. Among them, the value of the cancellation parameter is modified to a true value, so that the target subscription task jumps out of the loop. At the same time, the data reader object (datareader) related to the target subscription task is destroyed and the cache space is released.
[0118] In step S133, when the subscription request information is a modification request information, the target subscription task corresponding to the modification request information is obtained from the cache; according to the parameter information included in the modification request information, the value of the second parameter of the target subscription task is modified to a third value, and the third value is used to cancel the target subscription task; the cache corresponding to the target subscription task is released; and the latest subscription task is created according to the parameter information included in the modification request information and saved in the cache.
[0119] In one embodiment, if the subscription request information is a modification subscription request information, the target subscription task corresponding to the modification subscription request information is obtained from the cache of the backend. According to the parameter information in the modification subscription request information, the value of the cancellation parameter required by the logic code for pausing or canceling the target subscription task is modified to a true value, so that the target subscription task jumps out of the loop. At the same time, the data reader object (datareader) related to the target subscription task is destroyed and the cache space is released. According to the parameter information in the modification subscription request information, the latest subscription task is created. The latest subscription task is added to the thread pool and saved in the cache.
[0120] In one example, the steps of the web front-end and the back-end interacting based on modifying the subscription request information are as follows: Figure 8 As shown: In step 1, the publisher publishes the published data to the global data space. In step 2, the web front end finds the corresponding target subscription task in the cache of the back end according to the modification subscription request information. In step 3, according to the parameter information in the cancellation subscription request information, the cancellation parameter of the target subscription task is modified. Among them, the value of the cancellation parameter is modified to a true value, so that the target subscription task jumps out of the loop. At the same time, the data reading object (datareader) related to the target subscription task is destroyed and the cache space is released. In step 4, the web front end creates the latest subscription task in the back end according to the modification subscription request information. In step 5, the latest subscription task created is added to the thread pool. In step 6, the latest subscription task created is saved to the cache. In step 7, the thread pool executes the latest subscription task in the pool and obtains the published data from the global data space. In step 8, after obtaining the published data, the back end pushes the published data to the web front end.
[0121] The disclosed embodiment obtains the target subscription task from the cache according to different information types of the target subscription request information, and executes the corresponding target operation, thereby enriching the operation mode of subscription data and improving the user experience.
[0122] In one embodiment, when the subscription request information is target subscription request information, after obtaining the target subscription task corresponding to the target subscription request information from the cache and performing the target operation corresponding to the target subscription request information on the target subscription task, the data subscription method also includes steps S210 and S220.
[0123] In step S210 , when the value of the parameter of the target subscription task indicates obtaining published data, the published data is obtained from the global data space.
[0124] In one embodiment, after modifying the parameter information of the target subscription task in the cache according to the parameter information in the target subscription request information, if the value of the parameter of the target subscription task indicates that the published data can be obtained currently, the corresponding published data is obtained from the global data space.
[0125] In step S220, the published data is transmitted to the web front end by using the target channel and the published data is displayed based on the display interface of the web front end.
[0126] In one embodiment, after the corresponding published data is acquired in the global data space, the published data is transmitted to the web front end through the target channel. After the web front end receives the published data, the published data is displayed to the user through a display page.
[0127] After acquiring the published data, the embodiment of the present disclosure sends the subscribed published data to the web front end through the target channel, so that the published data can be displayed more intuitively and the user experience is improved.
[0128] Exemplary Devices
[0129] Fig. 9 is a block diagram of a data subscription device according to an exemplary embodiment. Fig. 9 The device 900 includes a first module 910, a second module 920 and a third module 930.
[0130] The first module 910 is used to receive subscription request information sent by a web front end through a target channel, and the web front end integrates a data distribution service DDS dynamic library;
[0131] The second module 920 is used to create a subscription task corresponding to the subscription creation request information and save it to the cache when the subscription request information is subscription creation request information;
[0132] The third module 930 is used to obtain a target subscription task corresponding to the target subscription request information from the cache when the subscription request information is target subscription request information, and perform a target operation corresponding to the target subscription request information on the target subscription task.
[0133] In some embodiments, the data subscription device further includes a compiling module, which is used to compile and construct DDS code to obtain a DDS dynamic library;
[0134] The DDS dynamic library and the target library are integrated by using a project construction tool to obtain the first language version of the DDS dynamic library. The target library is used to assist the first language program in reading the second language used to construct the DDS code.
[0135] Create a web front end based on the first language version of the DDS dynamic library.
[0136] In some embodiments, the data subscription device includes a calling module, the calling module is used to call a first function to create a publishing end;
[0137] Create a data writing object based on the publisher;
[0138] Call the second function of the data write object to publish the data to the corresponding global data space.
[0139] In some embodiments, the data subscription device also includes an integration module, which is used to integrate the DDS dynamic library and the target library using a project construction tool to obtain a Java version of the DDS dynamic library. The target library is used to assist the Java program in reading the C or C++ code used to build the DDS code.
[0140] In some embodiments, the data subscription device further includes an acquisition module, which is used to, when the subscription request information is a suspension subscription request information, acquire a target subscription task corresponding to the suspension subscription request information from a cache; modify the value of a first parameter of the target subscription task to a first value according to parameter information included in the suspension subscription request information, wherein the first value indicates that the target subscription task is suspended;
[0141] In the case where the subscription request information is a subscription cancellation request information, a target subscription task corresponding to the subscription cancellation request information is obtained from a cache; according to parameter information included in the subscription cancellation request information, a value of a second parameter of the target subscription task is modified to a second value, the second parameter is used to control a cancellation operation of the target subscription task, and the second value is used to cancel the target subscription task; and a cache corresponding to the target subscription task is released;
[0142] In the case where the subscription request information is a modification request information, the target subscription task corresponding to the modification request information is obtained from the cache; according to the parameter information included in the modification request information, the value of the second parameter of the target subscription task is modified to a third value, and the third value is used to cancel the target subscription task; the cache corresponding to the target subscription task is released; and the latest subscription task is created according to the parameter information included in the modification request information and saved in the cache.
[0143] In some embodiments, the data subscription device further comprises an acquisition module, the acquisition module being used to acquire the published data from the global data space when the value of the parameter of the target subscription task represents the acquisition of the published data;
[0144] The target channel is used to transmit the published data to the web front end and the published data is displayed based on the display interface of the web front end.
[0145] Example Vehicles
[0146] Fig.10 1 is a block diagram of a vehicle 1000 according to an exemplary embodiment. The vehicle 1000 may be a fuel vehicle, a hybrid vehicle, an electric vehicle, a fuel cell vehicle or other types of vehicles.
[0147] Reference Fig.10 The vehicle 1000 may include multiple subsystems, for example, a driving system 1010, a control system 1020, a perception system 1030, a communication system 1040, an information display system 1050, and a computing system 1060. The vehicle 1000 may also include more or fewer subsystems, and each subsystem may also include multiple components, which are not described one by one here.
[0148] The driving system 1010 includes components that provide power movement for the vehicle 1000, such as an engine, an energy source, a transmission device, etc.
[0149] The control system 1020 includes components that provide control for the vehicle 1000, such as vehicle control, cockpit equipment control, and driving assistance control.
[0150] The perception system 1030 includes components that provide the vehicle 1000 with surrounding environment perception, such as a vehicle positioning system, a laser sensor, a voice sensor, an ultrasonic sensor, a camera device, and the like.
[0151] The communication system 1040 includes components that provide communication connections for the vehicle 1000, such as mobile communication networks (such as 3G, 4G, 5G networks, etc.), WiFi, Bluetooth, and Internet of Vehicles.
[0152] The information display system 1050 includes components for providing various information displays for the vehicle 1000, such as vehicle information display, navigation information display, entertainment information display, etc.
[0153] The computing and processing system 1060 includes components that provide data computing and processing capabilities for the vehicle 1000. The computing and processing system 1060 may include at least one processor 1061 and a memory 1062. The processor 1061 may execute instructions stored in the memory 1062.
[0154] The processor 1061 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.
[0155] Memory 1062 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0156] In the embodiment of the present disclosure, a set of instruction sets is stored in the memory 1062, and the processor 1061 can execute the instruction set to implement all or part of the steps of the data subscription method described in any of the above exemplary embodiments.
[0157] Exemplary Electronic Devices
[0158] Fig.11 1 is a block diagram of an electronic device 1100 according to an exemplary embodiment. The electronic device 1100 may be a vehicle controller, a vehicle terminal, a vehicle computer or other types of electronic devices.
[0159] Reference Fig.11 , the electronic device 1100 may include at least one processor 1110 and a memory 1120. The processor 1110 may execute instructions stored in the memory 1120. The processor 1110 is communicatively connected to the memory 1120 via a data bus. In addition to the memory 1120, the processor 1110 may also be communicatively connected to an input device 1130, an output device 1140, and a communication device 1150 via a data bus.
[0160] The processor 1110 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.
[0161] Memory 1120 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0162] In the embodiment of the present disclosure, executable instructions are stored in the memory 1120, and the processor 1110 can read the executable instructions from the memory 1120 and execute the instructions to implement all or part of the steps of the data subscription method described in any of the above exemplary embodiments.
[0163] Exemplary computer-readable storage media
[0164] In addition to the above methods and devices, the exemplary embodiments of the present disclosure may also be a computer program product or a computer-readable storage medium storing the computer program product. The computer product includes computer program instructions that can be executed by a processor to implement all or part of the steps described in any method in the above exemplary embodiments.
[0165] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and also conventional procedural programming languages, such as "C" language or similar programming languages and scripting languages (e.g., Python). The program code may be executed entirely on the user computing device, partially on the user computing device, as an independent software package, partially on the user computing device and partially on the remote computing device, or entirely on the remote computing device or server.
[0166] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of readable storage media include: a static random access memory (SRAM) with one or more wires electrically connected, an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic storage, a flash memory, a magnetic disk or an optical disk, or any suitable combination of the above.
[0167] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0168] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data subscription method, characterized in that: include: Receiving subscription request information sent by a web front end through a target channel, wherein the web front end integrates a data distribution service DDS dynamic library; In the case where the subscription request information is create subscription request information, creating a subscription task corresponding to the create subscription request information and saving it to a cache; In the case that the subscription request information is target subscription request information, a target subscription task corresponding to the target subscription request information is acquired from a cache, and a target operation corresponding to the target subscription request information is performed on the target subscription task.
2. The method according to claim 1, characterized in that The DDS dynamic library includes a first language version of the DDS dynamic library. Before receiving the subscription request information sent by the web front end through the target channel, the method further includes: Compile and build the DDS code to obtain the DDS dynamic library; Integrate the DDS dynamic library and the target library using a project construction tool to obtain the DDS dynamic library of the first language version, wherein the target library is used to assist the first language program in reading the second language used to construct the DDS code; The web front end is created based on the DDS dynamic library of the first language version.
3. The method according to claim 1, characterized in that Before receiving the subscription request information sent by the web front end through the target channel, the method further includes: Call the first function to create a publishing end; Creating a data writing object based on the publishing end; The second function of the data writing object is called to publish the published data to the corresponding global data space.
4. The method according to claim 2, characterized in that: The first language includes Java, the second language includes C or C++, and the DDS dynamic library and the target library are integrated by using a project construction tool to obtain the DDS dynamic library of the first language version, and the target library is used to assist the first language program to read the second language used to construct the DDS code, including: The DDS dynamic library and the target library are integrated by using a project construction tool to obtain the Java version of the DDS dynamic library, and the target library is used to assist the Java program in reading the C or C++ code used to construct the DDS code.
5. The method according to claim 1, characterized in that The target subscription request information includes suspend subscription request information, cancel subscription request information, or modify subscription request information. When the subscription request information is target subscription request information, obtaining a target subscription task corresponding to the target subscription request information from a cache, and performing a target operation corresponding to the target subscription request information on the target subscription task includes: In the case where the subscription request information is the subscription suspension request information, obtaining a target subscription task corresponding to the subscription suspension request information from a cache; and modifying a value of a first parameter of the target subscription task to a first value according to parameter information included in the subscription suspension request information, wherein the first value indicates that the target subscription task is suspended; In the case where the subscription request information is the unsubscribe request information, obtaining a target subscription task corresponding to the unsubscribe request information from a cache; modifying a value of a second parameter of the target subscription task to a second value according to parameter information included in the unsubscribe request information, wherein the second parameter is used to control a cancel operation of the target subscription task, and the second value is used to cancel the target subscription task; and releasing a cache corresponding to the target subscription task; In the case where the subscription request information is the modification subscription request information, obtaining the target subscription task corresponding to the modification subscription request information from the cache; according to the parameter information included in the modification subscription request information, modifying the value of the second parameter of the target subscription task to a third value, and the third value is used to cancel the target subscription task; releasing the cache corresponding to the target subscription task; creating the latest subscription task according to the parameter information included in the modification subscription request information and saving it in the cache.
6. The method according to claim 3, characterized in that In the case where the subscription request information is target subscription request information, after obtaining a target subscription task corresponding to the target subscription request information from a cache and performing a target operation corresponding to the target subscription request information on the target subscription task, the method further includes: In a case where the value of the parameter of the target subscription task represents obtaining the published data, obtaining the published data from the global data space; The target channel is used to transmit the published data to the web front end and the published data is displayed based on the display interface of the web front end.
7. A data subscription device, characterized in that: include: A receiving module, the receiving module is used to receive subscription request information sent by a web front end through a target channel, the web front end is integrated with a data distribution service DDS dynamic library; A creation module, wherein the creation module is used to create a subscription task corresponding to the subscription creation request information and save it to a cache when the subscription request information is subscription creation request information; An acquisition module is used to acquire a target subscription task corresponding to the target subscription request information from a cache when the subscription request information is target subscription request information, and to perform a target operation corresponding to the target subscription request information on the target subscription task.
8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the data subscription method described in any one of claims 1-6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the data subscription method described in any one of claims 1-6 are implemented.
10. A vehicle, characterized in that: A set of instruction sets is stored, and the instruction sets are executed by the vehicle to implement the data subscription method described in any one of claims 1-6.
