Data publishing method and device

By preprocessing the configuration data to be published on the industrial data platform and publishing messages in the in-memory database, the problems of poor user experience and low data release efficiency caused by downtime maintenance are solved, and the hot data release is realized, improving efficiency and real-time performance .

CN119293055APending Publication Date: 2025-01-10HNAC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411359227.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing industrial data platform needs to be shut down and maintained during data release, resulting in poor user experience, low data release efficiency, high operating costs and lack of real-time update capabilities.

Method used

By extracting the configuration data to be published for preprocessing, if the data is inconsistent with the in-memory database, the target topic message is released to the in-memory database, so that the service program in the target machine pulls the configuration data from the in-memory database for configuration adjustment, and realizes hot data release.

Benefits of technology

Improve user experience and data release efficiency, reduce operating costs, and realize real-time data updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293055A_ABST
    Figure CN119293055A_ABST
Patent Text Reader

Abstract

The invention provides a data publishing method and device which are applied to an industrial data platform, and the method comprises the steps: extracting to-be-published first configuration data; preprocessing the first configuration data to obtain second configuration data; writing the second configuration data into the memory database; and if the second configuration data is not consistent with third configuration data in the memory database, issuing a target theme message corresponding to the configuration type of the second configuration data to the memory database, so that a service program subscribing to the target theme message in the target machine pulls the second configuration data from the memory database for configuration adjustment. The industrial data platform can realize data hot release without shutdown, so that the user experience and the data release efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data publishing method and device. Background Art

[0002] With the development of industrial informatization, industrial data platforms have become important tools for enterprise management and decision-making. Currently, data release on industrial data platforms is done through maintenance, which involves suspending the platform before releasing the data.

[0003] However, on the one hand, the industrial data platform will stop maintenance during downtime, affecting the normal operation of the platform and resulting in a poor user experience; on the other hand, due to the limitations of downtime maintenance, data release needs to wait for a specific time window, resulting in low data release efficiency. Summary of the Invention

[0004] In view of this, an embodiment of the present invention provides a data publishing method and apparatus to solve the problems of poor user experience and low data publishing efficiency existing in existing data publishing methods.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention discloses a data publishing method, which is applied to an industrial data platform and includes:

[0007] Extracting first configuration data to be published;

[0008] preprocessing the first configuration data to obtain second configuration data;

[0009] Writing the second configuration data into the in-memory database;

[0010] If the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program subscribed to the target topic message in the target machine pulls the second configuration data from the memory database for configuration adjustment, wherein the second configuration data and the third configuration data have the same configuration type.

[0011] Preferably, extracting the first configuration data to be published includes:

[0012] According to the configuration item selected by the user on the industrial data platform, first configuration data to be published and related to the configuration item is extracted from the original data layer.

[0013] Preferably, if the second configuration data is inconsistent with the third configuration data in the memory database, publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, so that a service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, including:

[0014] If the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database according to the message channel corresponding to the configuration type of the second configuration data, so that a service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message includes at least an identifier for pulling the second configuration data.

[0015] Preferably, before publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, the method further includes:

[0016] According to the configuration item selected by the user on the industrial data platform, generating a first configuration file related to the selected configuration item;

[0017] According to the service item selected by the user on the industrial data platform, collecting first service files related to the selected service item;

[0018] Based on the first configuration file and the first service file, it is determined whether to restart the service program on the target machine or not.

[0019] Preferably, determining whether to restart or not to restart the service program on the target machine based on the first configuration file and the first service file includes:

[0020] Determine whether the hash value of the first configuration file is consistent with the hash value of the second configuration file in the target machine;

[0021] If the hash value of the first configuration file is inconsistent with the hash value of the second configuration file, stopping the service program on the target machine and performing a restart step;

[0022] If the hash value of the first configuration file is consistent with the hash value of the second configuration file, determining whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine;

[0023] If the hash value of the first service file is inconsistent with the hash value of the second service file, stopping the service program on the target machine and executing the restart step;

[0024] If the hash value of the first service file is consistent with the hash value of the second service file, the service program on the target machine is not restarted;

[0025] The restarting step includes:

[0026] Sending the first configuration file and the first service file to the target machine;

[0027] Restart the service program on the target machine.

[0028] A second aspect of an embodiment of the present invention discloses a data publishing device, which is applied to an industrial data platform and includes:

[0029] an extraction unit, configured to extract first configuration data to be published;

[0030] a preprocessing unit, configured to preprocess the first configuration data to obtain second configuration data;

[0031] A writing unit, configured to write the second configuration data into a memory database;

[0032] a publishing unit, configured to publish a target topic message corresponding to a configuration type of the second configuration data to the in-memory database if the second configuration data is inconsistent with the third configuration data in the in-memory database, so that a service program in a target machine that has subscribed to the target topic message pulls the second configuration data from the in-memory database for configuration adjustment, wherein the second configuration data and the third configuration data have the same configuration type.

[0033] Preferably, the extraction unit is specifically configured to extract, from the original data layer, first configuration data to be published that is related to the configuration item selected by the user on the industrial data platform.

[0034] Preferably, the publishing unit is specifically used to: if the second configuration data is inconsistent with the third configuration data in the memory database, publish a target topic message corresponding to the configuration type of the second configuration data to the memory database according to the message channel corresponding to the configuration type of the second configuration data, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message at least includes an identifier for pulling the second configuration data.

[0035] Preferably, it also includes:

[0036] A generating unit, configured to generate a first configuration file related to a configuration item selected by a user on the industrial data platform;

[0037] A collecting unit, configured to collect, according to the service item selected by the user on the industrial data platform, a first service file related to the selected service item;

[0038] The processing unit is configured to determine whether to restart the service program on the target machine based on the first configuration file and the first service file.

[0039] Preferably, the processing unit includes:

[0040] A first determination module, configured to determine whether a hash value of the first configuration file is consistent with a hash value of a second configuration file in a target machine;

[0041] a first stopping module, configured to stop the service program on the target machine and perform a restart step if the hash value of the first configuration file is inconsistent with the hash value of the second configuration file;

[0042] a second determining module, configured to determine whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine if the hash value of the first configuration file is consistent with the hash value of the second configuration file;

[0043] a second stopping module, configured to stop the service program on the target machine and execute the restarting step if the hash value of the first service file is inconsistent with the hash value of the second service file;

[0044] a processing module, configured to not restart the service program on the target machine if the hash value of the first service file is consistent with the hash value of the second service file;

[0045] The restarting step includes:

[0046] Sending the first configuration file and the first service file to the target machine;

[0047] Restart the service program on the target machine.

[0048] A data publishing method and device provided based on the above-mentioned embodiment of the present invention is applied to an industrial data platform. The method is: extracting the first configuration data to be published; preprocessing the first configuration data to obtain the second configuration data; writing the second configuration data into the memory database; if the second configuration data is inconsistent with the third configuration data in the memory database, publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment. In this solution, the first configuration data to be published is preprocessed to obtain the second configuration data. If the second configuration data is inconsistent with the third configuration data in the memory database, it is determined that a configuration modification has occurred, and publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data for configuration adjustment. The industrial data platform can realize hot data publishing without shutting down, thereby improving user experience and improving data publishing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0050] Figure 1 A flowchart of a data publishing method provided by an embodiment of the present invention;

[0051] Figure 2 This is an example diagram of the data publishing interface of the industrial data platform provided by an embodiment of the present invention;

[0052] Figure 3 This is a structural block diagram of a data publishing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0054] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0055] With the development of industrial informatization, industrial data platforms have become important tools for enterprise management and decision-making. Currently, data release on industrial data platforms is done through maintenance, which involves suspending the platform before releasing the data.

[0056] However, the method of using downtime maintenance to publish data has the following defects and shortcomings:

[0057] 1. Impact on the operation of the industrial data platform: Traditional downtime maintenance methods require the industrial data platform to stop service for a period of time, which directly affects the normal operation of the industrial data platform and user experience; for users who need real-time access to data, downtime maintenance may cause significant losses.

[0058] 2. Increased operating costs: Downtime maintenance not only affects the normal operation of the industrial data platform, but also increases the operating costs of the enterprise. For example, during the downtime maintenance of the industrial data platform, professional maintenance personnel need to be arranged to predict and prepare for possible problems, which will increase operating costs.

[0059] 3. Inefficient data release: Due to the limitations of downtime maintenance, data release needs to wait for a specific time window, which leads to inefficient data release.

[0060] 4. Lack of real-time update capability: The shutdown maintenance method cannot achieve real-time data update. Currently, enterprises have increasingly higher requirements for the real-time nature of data, and the shutdown maintenance method cannot meet this demand for real-time data update.

[0061] To address the above-mentioned defects and deficiencies, this solution proposes a data publishing method and device, which pre-processes the first configuration data to be published to obtain second configuration data. If the second configuration data is inconsistent with the third configuration data in the memory database, it is determined that a configuration modification has occurred, and a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data for configuration adjustment. The industrial data platform can realize hot data publishing without shutting down, thereby improving user experience and data publishing efficiency, reducing operating costs and realizing real-time data updates.

[0062] It should be noted that some of the uses of the industrial data platform are: focusing on device access, data collection and storage, data processing, and data interaction with third-party systems, and providing an interface for standard data services to the outside world; it is a basic R&D platform that aims to reduce the development difficulty for developers and reduce repeated R&D.

[0063] See also Figure 1 , shows a flow chart of a data publishing method provided by an embodiment of the present invention, the data publishing method is applied to an industrial data platform, and the data publishing method includes:

[0064] Step S101: extracting first configuration data to be published.

[0065] It should be noted that when publishing data through the industrial data platform, users can select corresponding configuration items and service items in the industrial data platform; the configuration data is stored in the original data layer (or the specified database), and the configuration data can be used to generate related files (such as generating engineering structure files).

[0066] In the specific implementation of step S101 , first configuration data related to the configuration item to be published is extracted from the original data layer according to the configuration item selected by the user on the industrial data platform.

[0067] That is, according to the configuration items selected by the user on the industrial data platform when publishing data, first configuration data is extracted from the original data layer, and the first configuration data is the configuration data to be published.

[0068] Step S102: pre-process the first configuration data to obtain second configuration data.

[0069] To ensure data consistency and data integrity, in the specific implementation of step S102 , the extracted first configuration data to be published is preprocessed to obtain second configuration data, which is the first configuration data after preprocessing.

[0070] Specifically, preprocessing such as format conversion and data assembly is performed on the first configuration data to obtain the second configuration data.

[0071] Step S103: writing the second configuration data into the memory database.

[0072] In the specific implementation of step S103 , the second configuration data is written into the memory database, wherein the memory database has a publish-subscribe function, for example, the memory database may be a Redis cache.

[0073] It should be noted that Redis's publish-subscribe (pub / sub) is a message communication model in which the publisher (pub) sends messages and the subscriber (sub) receives messages. The Redis client can subscribe to any number of message channels.

[0074] It should be further explained that when the industrial data platform publishes configuration data, configuration data of different configuration types are used to determine different configuration modification situations, that is, configuration data of a certain configuration type is used to determine whether a certain configuration modification exists.

[0075] The configuration modifications mentioned above include but are not limited to the following: modification of project structure files, modification of communication instance-network configuration, modification of communication instance-protocol configuration, modification of the model corresponding to the communication instance, or addition or subtraction of forwarding configuration;

[0076] Each of the above configuration modification situations corresponds to a certain configuration type.

[0077] Before writing the second configuration data into the memory database, the second configuration data is compared with the third configuration data already in the memory database, and the second configuration data and the third configuration data have the same configuration type.

[0078] If the second configuration data is inconsistent with the third configuration data in the memory database, it is determined that a configuration modification corresponding to the configuration type of the second configuration data has occurred, and steps S103 and S104 are executed;

[0079] If the second configuration data is consistent with the third configuration data in the memory database, it is determined that no configuration modification corresponding to the configuration type of the second configuration data has occurred, and step S103 is executed and the process ends.

[0080] For example, assuming that the configuration type of the second configuration data is used to determine whether a project structure file modification occurs, the second configuration data can generate a project structure file; the project structure file generated by the second configuration data is compared with the project structure file already existing in the memory database, and the project structure file already existing in the memory database is the third configuration data;

[0081] If the project structure file generated by the second configuration data is inconsistent with the project structure file already existing in the memory database, it indicates that a configuration modification situation of the project structure file modification has occurred, and steps S103 and S104 are executed.

[0082] Step S104: If the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that subscribes to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the second configuration data and the third configuration data have the same configuration type.

[0083] During the specific implementation of step S104, if the second configuration data is inconsistent with the third configuration data in the memory database, indicating that a configuration modification corresponding to the configuration type of the second configuration data has occurred, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment.

[0084] Specifically, if the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database according to the message channel corresponding to the configuration type of the second configuration data, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message at least includes an identifier (ID) for pulling the second configuration data.

[0085] After the service program in the target machine that subscribes to the target topic message obtains the identifier for pulling the second configuration data, the service program can pull the second configuration data from the memory database according to the identifier to perform configuration adjustment (or configuration modification), thereby completing the hot release of the configuration data.

[0086] It should be noted that for different configuration types, the available message channels and message contents are pre-set for the configuration modification situations corresponding to the configuration types. The following are examples of the message channels and message contents set for each configuration modification situation:

[0087] 1. Modification of project structure files:

[0088] Message channel: facchangechannel;

[0089] Message content: Project ID.

[0090] 2. Communication Example - Network Configuration Modification:

[0091] Message channel: netchangechannel;

[0092] Message content: a collection of communication instance IDs.

[0093] 3. Communication Example - Protocol Configuration Modification:

[0094] Message channel: protocolchangechannel;

[0095] Message content: a collection of communication instance IDs.

[0096] 4. Modify the model corresponding to the communication instance or increase or decrease the forwarding configuration:

[0097] Message channel: CommRelateChangeChannel;

[0098] Message content: a collection of communication instance IDs.

[0099] It should be noted that the project structure file refers to: the industrial data platform is configured according to the project, including network configuration, model configuration, instance configuration, communication configuration, etc. The core is the instance, and the project structure file is the file formed by the conversion of instance data.

[0100] Project ID is an identifier used to distinguish different projects.

[0101] The communication instance ID is an identifier used to distinguish different communication instances.

[0102] The above are examples of message channels and message contents that can be used in different configuration modification situations. In actual applications, corresponding message channels and message contents that can be used will be set for different configuration modification situations, and they will not be listed here one by one.

[0103] In actual applications, this solution supports multiple memory database instances (such as Redis instances). Different topic messages can be published to the memory database through these different memory database instances.

[0104] For example, assuming that the configuration type of the second configuration data is used to determine whether a project structure file modification has occurred, if the second configuration data is inconsistent with the third configuration data in the memory database, indicating that a project structure file modification has occurred, a facchangechannel message (target topic message) is published to the Redis cache based on the facchangechannel message channel. The message content of the facchangechannel message is the project ID.

[0105] At this time, the service program that subscribes to the facchangechannel message in the target machine pulls the second configuration data according to the project ID to complete the configuration adjustment.

[0106] It should be noted that, for different configuration modification situations, the service program performs configuration adjustment in different ways according to the second configuration data, as detailed below:

[0107] For the configuration modification of the project structure file, the configuration adjustment method is: each service program on the target machine dynamically updates the project information according to the message content of the target topic message.

[0108] For the configuration modification case of communication example - network configuration modification, the configuration adjustment method is: the communication main program (service program) on the target machine restarts the communication subroutine.

[0109] For the configuration modification of communication instance-protocol configuration modification, the configuration adjustment method is: the communication main program on the target machine restarts the corresponding communication subroutine.

[0110] For the configuration modification of the model modification or the increase or decrease of the forwarding configuration corresponding to the communication instance, the configuration adjustment method is: the communication main program on the target machine restarts the corresponding communication subroutine.

[0111] Judging from the contents of the above embodiments, the industrial data platform can realize hot data release without downtime, improve user experience and data release efficiency, reduce operating costs and realize real-time data update.

[0112] It is understandable that before publishing the target topic message corresponding to the configuration type of the second configuration data to the in-memory database (equivalent to before publishing the data), this solution also provides a management method for the service program on the target machine, which is specifically explained as follows:

[0113] In some embodiments, before publishing a target topic message corresponding to the configuration type of the second configuration data to the in-memory database, a first configuration file related to the selected configuration item is generated according to the configuration item selected by the user on the industrial data platform, that is, the first configuration file is generated based on the configuration item selected when the second configuration data is published.

[0114] It should be noted that the first configuration file includes but is not limited to the localsetting file and the network file; among them, the localsetting file and the network file are the fundamental files of the program network structure. Once the localsetting file and the network file are modified, it means that the network structure or key parameters of the entire system have undergone major modifications. At this time, all programs must be closed and restarted.

[0115] Localsetting contains at least the following fields: project identifier (factoryKey), machine identifier (machineKey), and machine name (machineName).

[0116] The network file contains at least the following fields: project name (factoryName), project identifier (factoryKey), machine (machine), IP list (ipAddr), service type (serverType), machine name (machineName), machine identifier (machineKey), communication server (commServer), redis server (redisServer), default database (defaultDB), maximum number of rows on the device (deviceMaxRowNum), limit on the number of rows that can be saved to disk on the device (limitSaveRownum), time interval limit on the number of cache rows that can be pulled from the disk at each time (limitReadBatchNum), stand-alone or sentinel mode (redisMode), sentinel password (sentinelPassword), sentinel port (sentinelPort), host name (masterName), real-time database type (DBType), file server (fileServer), and history server (DBServer).

[0117] According to the service items selected by the user on the industrial data platform, the first service files related to the selected service items are collected, that is, the first service files are collected according to the service items selected when the second configuration data is released. The first service files are used to ensure that all files required for the service program to run are ready.

[0118] For example, assuming that the service item selected on the industrial data platform is the hzdbs historical data service, the corresponding first service file can be obtained from the service program directory.

[0119] After the first configuration file is generated and the first service file is collected, it is determined whether to restart the service program on the target machine or not based on the first configuration file and the first service file.

[0120] In some specific embodiments, determining whether to restart or not to restart the service program on the target machine is specifically implemented by: determining whether a hash value of a first configuration file is consistent with a hash value (e.g., an MD5 code) of a second configuration file in the target machine, and the first configuration file and the second configuration file are configuration files with the same name;

[0121] If the hash value of the first configuration file is inconsistent with the hash value of the second configuration file, stop the service program on the target machine and perform the following restart steps;

[0122] If the hash value of the first configuration file is consistent with the hash value of the second configuration file, determining whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine, the first service file and the second service file are service files with the same name;

[0123] If the hash value of the first service file is inconsistent with the hash value of the second service file, stop the service program on the target machine and perform the following restart steps;

[0124] If the hash value of the first service file is consistent with the hash value of the second service file, the service program on the target machine is not restarted;

[0125] The restarting step mentioned above includes: sending the first configuration file and the first service file to the target machine; and restarting the service program on the target machine.

[0126] It should be noted that the MD5 code is a hash function that can convert data of any length into a hash value of a fixed length.

[0127] For example: compare the MD5 codes of the first configuration file (including the localsetting file and the network file) and the second configuration file (including the localsetting file and the network file) on the target machine;

[0128] If the MD5 codes of the first configuration file and the second configuration file are inconsistent, the corresponding service program on the target machine is stopped;

[0129] If the MD5 codes of the first configuration file and the second configuration file are consistent, then further compare the MD5 codes of the first service file and the second service file on the target machine;

[0130] When the MD5 codes of the first service file and the second service file are inconsistent, the corresponding service program on the target machine is stopped.

[0131] After stopping the service program, the first configuration file and the first service file are sent to the target machine to ensure that the files on the target machine are consistent with expectations;

[0132] Then restart the stopped service program on the target machine through the systemctl command.

[0133] The service program in the target machine is managed in the above manner, and then a target topic message corresponding to the configuration type of the second configuration data is published to the memory database.

[0134] To better understand the content of each of the above embodiments, the overall process of managing service programs and publishing configuration data is illustrated through processes A1-A7:

[0135] A1. Extract the first configuration data to be published.

[0136] A2. Preprocess the first configuration data to obtain second configuration data.

[0137] A3. Write the second configuration data into the memory database; if the second configuration data is inconsistent with the third configuration data in the memory database, record the target topic message that needs to be published corresponding to the configuration type of the second configuration data.

[0138] A4. Generate a first configuration file and collect first service files.

[0139] A5. Compare the MD5 codes of the first configuration file and the second configuration file on the target machine;

[0140] If the MD5 codes of the first configuration file and the second configuration file are inconsistent, the corresponding service program on the target machine is stopped;

[0141] If the MD5 codes of the first configuration file and the second configuration file are consistent, then further compare the MD5 codes of the first service file and the second service file on the target machine;

[0142] When the MD5 codes of the first service file and the second service file are inconsistent, the corresponding service program on the target machine is stopped.

[0143] A6. After stopping the service program, the first configuration file and the first service file are sent to the target machine to ensure that the files on the target machine are consistent with expectations; and the stopped service program on the target machine is restarted.

[0144] A7. Publish the target topic message recorded in A3 above to the memory database, so that the service program subscribed to the target topic message in the target machine pulls the second configuration data from the memory database to perform configuration adjustment.

[0145] To further understand the contents of the above embodiments, the following content is used to illustrate from the perspective of practical application:

[0146] Assume that an industrial data platform is used to collect meter data on site. Initially, there are 100 meters in the system, and now 10 more meters are needed. Then, how can the user Figure 2 On the data publishing interface of the industrial data platform shown, select service items, target machines, etc., and add 10 new model instances.

[0147] After completing the above selection, the second configuration data is published to the target machines so that these target machines can collect data from the newly added 10 electricity meters;

[0148] During the release of the second configuration data, the first configuration data is first extracted and preprocessed to obtain the second configuration data, and a new project structure file is generated based on the second configuration data;

[0149] Since 10 new model instances have been added, the project structure file will change. At this time, the FacChangeChannel message (target topic message) will be published through Redis. In this example, since the service file has not been modified, there is no need to restart the service program.

[0150] After the second configuration data is published, the subscriber (the service program on the target machine) will pull the second configuration data according to the project ID in the message content of the facchangechannel message and perform corresponding processing to ensure that the data of the newly added 10 meters can be collected and processed.

[0151] The above is an example of this solution.

[0152] Based on the above embodiments and examples, this solution has the following mechanisms and processing strategies:

[0153] Hierarchical message notification mechanism: Based on different configuration modification situations (project structure file modification, communication instance - network configuration modification, etc.), this solution adopts a hierarchical message notification mechanism, publishing the changed content to the in-memory database (reids) through specific message channels. Different configuration modification situations correspond to different message channels, making the transmission and processing of messages more efficient and orderly.

[0154] File differential processing strategy: Before releasing configuration data, the difference between the first configuration file (including the localsetting file and the network file) and the second configuration file on the target machine, as well as the difference between the second service file and the second service file on the target machine, are used to determine whether to restart the service program of the target machine. This differential processing strategy ensures that necessary file updates are performed while minimizing service interruptions, thereby improving system availability and stability.

[0155] Service update mechanism based on message subscription: After the second configuration data is released, each service program obtains the second configuration data (equivalent to the changed content) by subscribing to the message channel and performs corresponding processing. These processes include dynamically updating factory information, restarting communication subroutines, etc. This service update mechanism based on message subscription can ensure that service programs can respond to changes in real time and ensure system synchronization and consistency.

[0156] Unified hot release process: The hot release process provided by this solution covers the complete process of data extraction, preprocessing, file collection, service management, and message notification, making the entire hot release process standardized and easy to operate and maintain.

[0157] In general, this solution can achieve the following technical effects:

[0158] Improve system stability and availability: Adopt a file differentiation processing strategy, restarting the service program only when there are file differences during the data release process, minimizing service interruptions and ensuring high system availability.

[0159] Refined management and maintenance: Through a hierarchical message notification mechanism and fine-grained configuration updates, various configuration modifications can be accurately handled, improving system flexibility and maintainability.

[0160] Ensure service consistency and data accuracy: The service update mechanism based on message subscription enables each service program to respond to changes in real time, ensuring service consistency and data accuracy.

[0161] Optimized resource utilization: By collecting and publishing files on demand, unnecessary file transfer and processing are reduced, and system resource utilization is optimized.

[0162] Corresponding to a data publishing method provided by the above embodiment of the present invention, see Figure 3 , an embodiment of the present invention further provides a structural block diagram of a data publishing device, the data publishing device is applied to an industrial data platform, the data publishing device includes: an extraction unit 100, a pre-processing unit 200, a writing unit 300 and a publishing unit 400;

[0163] The extraction unit 100 is configured to extract first configuration data to be published.

[0164] In a specific implementation, the extraction unit 100 is specifically used to extract first configuration data related to the configuration item to be published from the original data layer according to the configuration item selected by the user on the industrial data platform.

[0165] The preprocessing unit 200 is configured to preprocess the first configuration data to obtain second configuration data.

[0166] The writing unit 300 is configured to write the second configuration data into the memory database.

[0167] Publishing unit 400 is used to publish a target topic message corresponding to the configuration type of the second configuration data to the memory database if the second configuration data is inconsistent with the third configuration data in the memory database, so that the service program subscribed to the target topic message in the target machine pulls the second configuration data from the memory database for configuration adjustment, wherein the configuration type of the second configuration data is the same as that of the third configuration data.

[0168] In a specific implementation, the publishing unit 400 is specifically used to: if the second configuration data is inconsistent with the third configuration data in the memory database, publish a target topic message corresponding to the configuration type of the second configuration data to the memory database according to the message channel corresponding to the configuration type of the second configuration data, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message at least includes an identifier for pulling the second configuration data.

[0169] In an embodiment of the present invention, the first configuration data to be published is preprocessed to obtain the second configuration data. If the second configuration data is inconsistent with the third configuration data in the memory database, it is determined that a configuration modification has occurred, and a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data for configuration adjustment. The industrial data platform can realize hot data publishing without shutting down, thereby improving user experience and improving data publishing efficiency.

[0170] Preferably, combined Figure 3 The data publishing device further includes:

[0171] The generating unit is configured to generate a first configuration file related to the configuration item selected by the user on the industrial data platform.

[0172] The collecting unit is configured to collect first service files related to a service item selected by a user on the industrial data platform.

[0173] The processing unit is configured to determine whether to restart or not restart the service program on the target machine based on the first configuration file and the first service file.

[0174] The processing unit includes a first judgment module, a second judgment module, a first stop module, a second stop module and a processing module. The execution principle of each module is as follows:

[0175] The first judgment module is used to judge whether the hash value of the first configuration file is consistent with the hash value of the second configuration file in the target machine.

[0176] The first stopping module is configured to stop the service program on the target machine and execute a restart step if the hash value of the first configuration file is inconsistent with the hash value of the second configuration file.

[0177] The second judgment module is configured to judge whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine if the hash value of the first configuration file is consistent with the hash value of the second configuration file.

[0178] The second stopping module is used to stop the service program on the target machine and execute a restart step if the hash value of the first service file is inconsistent with the hash value of the second service file.

[0179] The processing module is configured to not restart the service program on the target machine if the hash value of the first service file is consistent with the hash value of the second service file.

[0180] The restart steps include:

[0181] Sending the first configuration file and the first service file to the target machine;

[0182] Restart the service program on the target machine.

[0183] In summary, an embodiment of the present invention provides a data publishing method and device, which pre-processes the first configuration data to be published to obtain second configuration data. If the second configuration data is inconsistent with the third configuration data in the memory database, it is determined that a configuration modification has occurred, and a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data for configuration adjustment. The industrial data platform can realize hot data publishing without shutting down, thereby improving user experience and improving data publishing efficiency.

[0184] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0185] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0186] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data publishing method, characterized in that: The method is applied to an industrial data platform, and the method comprises: Extracting first configuration data to be published; preprocessing the first configuration data to obtain second configuration data; Writing the second configuration data into the in-memory database; If the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database, so that the service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the second configuration data has the same configuration type as the third configuration data.

2. The method according to claim 1, characterized in that Extract the first configuration data to be published, including: According to the configuration item selected by the user on the industrial data platform, first configuration data to be published and related to the configuration item is extracted from the original data layer.

3. The method according to claim 1, characterized in that If the second configuration data is inconsistent with the third configuration data in the memory database, publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, so that a service program in the target machine that subscribes to the target topic message pulls the second configuration data from the memory database for configuration adjustment, including: If the second configuration data is inconsistent with the third configuration data in the memory database, a target topic message corresponding to the configuration type of the second configuration data is published to the memory database according to a message channel corresponding to the configuration type of the second configuration data, so that a service program in the target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message includes at least an identifier for pulling the second configuration data.

4. The method according to any one of claims 1 to 3, characterized in that: Before publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database, the method further includes: According to the configuration item selected by the user on the industrial data platform, generating a first configuration file related to the selected configuration item; According to the service item selected by the user on the industrial data platform, collecting a first service file related to the selected service item; Based on the first configuration file and the first service file, determine whether to restart the service program on the target machine or not.

5. The method according to claim 4, characterized in that Determining whether to restart or not restart a service program on a target machine based on the first configuration file and the first service file includes: Determine whether the hash value of the first configuration file is consistent with the hash value of the second configuration file in the target machine; If the hash value of the first configuration file is inconsistent with the hash value of the second configuration file, stopping the service program on the target machine and performing a restart step; If the hash value of the first configuration file is consistent with the hash value of the second configuration file, determining whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine; If the hash value of the first service file is inconsistent with the hash value of the second service file, stopping the service program on the target machine and executing the restarting step; If the hash value of the first service file is consistent with the hash value of the second service file, the service program on the target machine is not restarted; The restarting step includes: Sending the first configuration file and the first service file to the target machine; Restart the service program on the target machine.

6. A data publishing device, characterized in that: The device is applied to an industrial data platform, and comprises: An extraction unit, used for extracting first configuration data to be published; a preprocessing unit, configured to preprocess the first configuration data to obtain second configuration data; A writing unit, used for writing the second configuration data into a memory database; A publishing unit is used to publish a target topic message corresponding to the configuration type of the second configuration data to the memory database if the second configuration data is inconsistent with the third configuration data in the memory database, so that the service program subscribed to the target topic message in the target machine pulls the second configuration data from the memory database for configuration adjustment, wherein the second configuration data is of the same configuration type as the third configuration data.

7. The device according to claim 6, characterized in that The extraction unit is specifically used to extract first configuration data related to the configuration item to be published from the original data layer according to the configuration item selected by the user on the industrial data platform.

8. The device according to claim 6, characterized in that The publishing unit is specifically used for: if the second configuration data is inconsistent with the third configuration data in the memory database, publishing a target topic message corresponding to the configuration type of the second configuration data to the memory database according to a message channel corresponding to the configuration type of the second configuration data, so that a service program in a target machine that has subscribed to the target topic message pulls the second configuration data from the memory database for configuration adjustment, wherein the message content of the target topic message at least includes an identifier for pulling the second configuration data.

9. The device according to any one of claims 6 to 8, characterized in that: Also includes: A generating unit, configured to generate a first configuration file related to the selected configuration item according to the configuration item selected by the user on the industrial data platform; A collecting unit, configured to collect, according to the service item selected by the user on the industrial data platform, a first service file related to the selected service item; The processing unit is used to determine whether to restart or not restart the service program on the target machine based on the first configuration file and the first service file.

10. The device according to claim 9, characterized in that The processing unit comprises: A first determination module, configured to determine whether a hash value of the first configuration file is consistent with a hash value of a second configuration file in a target machine; A first stopping module, configured to stop the service program on the target machine and execute a restart step if the hash value of the first configuration file is inconsistent with the hash value of the second configuration file; a second judgment module, configured to judge whether the hash value of the first service file is consistent with the hash value of the second service file in the target machine if the hash value of the first configuration file is consistent with the hash value of the second configuration file; A second stopping module, configured to stop the service program on the target machine and execute the restarting step if the hash value of the first service file is inconsistent with the hash value of the second service file; a processing module, configured to not restart the service program on the target machine if the hash value of the first service file is consistent with the hash value of the second service file; The restarting step includes: Sending the first configuration file and the first service file to the target machine; Restart the service program on the target machine.