System updating method, device, electronic device and storage medium
By creating temporary configuration objects and comparing configuration files when the Source component changes, dynamically updating the running status of the data source component, the data loss problem caused by Source component changes is solved, and system updates are achieved without interruption data flow.
Patent Information
- Application Number
- CN202410454859.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-04-16
AI Technical Summary
When the Source component changes, all components of the system need to be restarted, which may cause data flow interruption and data loss.
When a configuration file update condition is detected, a temporary configuration object is created, and the current configuration file is compared with the new configuration file to dynamically determine the running status of the data source component to ensure that the components are updated without restarting the system.
It realizes updating system components without interrupting data flow, avoiding data loss, and improving system update flexibility and data security.
Smart Images

Figure CN118245088B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a system updating method, device, electronic device and storage medium. Background Art
[0002] In the prior art, when the configuration file loaded into the system changes, it is necessary to re-read the components, channels, topology and other information in the configuration file. According to the requirements of the new configuration, the system needs to restart each component, such as the Source component, the Sink component and the Channel component, but during the restart, the original running component instance will be stopped, and the data transmission may be briefly interrupted due to the restart of the components in the system. Once each component is successfully restarted, the data transmission will continue and be processed according to the rules of the new configuration. The system will continue to monitor the changes in the configuration file to capture further changes at any time.
[0003] Currently, even if the configurations of the Sink and Channel components are fixed, once the configuration of the Source component changes, most components including the Source, Sink, and Channel components need to be restarted, which may interrupt the data flow and cause data loss. Summary of the invention
[0004] The embodiments of the present disclosure provide a system update method, device, electronic device and storage medium for solving the technical problem that when a Source component is changed and each system component needs to be restarted, data loss may occur.
[0005] According to one aspect of an embodiment of the present disclosure, a system update method is provided, which is applicable to a system including a data source component, a buffer channel component, and a receiver component, and the method includes:
[0006] When it is detected that the first configuration file currently loaded into the system meets the specified configuration update condition, a configuration event processing instruction is triggered to create a temporary configuration object;
[0007] Compare the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used to control at least one corresponding data source component to keep running;
[0008] The component configuration data about the buffer channel component and the receiver component in the first configuration file is written into the updated temporary configuration object, so that the operation of each component in the system is instructed according to the current temporary configuration object.
[0009] In a possible implementation, the method further includes:
[0010] Extracting a first component list in the first configuration file and a second component list in the second configuration file;
[0011] Among them, the first component list records at least one first data source operation component to be run and at least one data source component to be configured that is controlled by each first data source operation component; the second component list records at least one currently running second data source operation component and at least one currently running data source component that is controlled by each second data source operation component.
[0012] In a possible implementation, comparing the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then updating them into the temporary configuration object includes:
[0013] Traversing the second component list, and detecting whether each second data source running component is consistent with any first data source running component in the first component list;
[0014] The corresponding second data source operation component when the consistency is detected is used as a temporary data source operation component, and the temporary data source operation component is written into the temporary configuration object to control the data source component related to the temporary data source operation component to keep running.
[0015] In a possible implementation, the method further includes:
[0016] When it is detected that at least one second data source running component is inconsistent with any of the first data source running components, the corresponding second data source running component is determined to be a component to be deleted, and creation of a first thread is triggered;
[0017] A component stop operation is called in the first thread, where the component stop operation is used to instruct to remove the component to be deleted from a component management list, where the component management list records a second data source running component currently running in the system.
[0018] In a possible implementation, the method further includes:
[0019] Traversing the first component list, and when detecting that at least one first data source running component is inconsistent with any second data source running component in the second component list, determining the corresponding first data source running component as a component to be added, and triggering the creation of a second thread;
[0020] A component start operation is called in the second thread, where the component start operation is used to instruct to add the component to be added to the component management list and run the component to be added.
[0021] In a possible implementation, when it is detected that the first configuration file currently loaded into the system meets the specified configuration update condition, the configuration event processing instruction is triggered, YY+232004P
[0022] Before creating a temporary configuration object, include:
[0023] Extending a preset Application class to generate an ApplicationExt class file, wherein the ApplicationExt class file includes a trigger operation for indicating an instruction for processing a configuration event;
[0024] Based on the ApplicationExt class file, the startup script of the system is executed.
[0025] In a possible implementation, the configuration update condition includes:
[0026] The attribute information about the data source component changes;
[0027] The attribute information includes type information, location information and data format information of the data source connected to the data source component.
[0028] According to another aspect of an embodiment of the present disclosure, a system update device is provided, which is applicable to a system including a data source component, a buffer channel component, and a receiver component, and the device includes:
[0029] A trigger module, configured to trigger a configuration event processing instruction to create a temporary configuration object when detecting that the first configuration file currently loaded into the system meets a specified configuration update condition;
[0030] A configuration comparison module, used for comparing the first configuration file with the second configuration file currently running in the system, so as to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used for controlling at least one corresponding data source component to keep running;
[0031] The configuration update module is used to write the component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object.
[0032] According to another aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:
[0033] at least one processor; and,
[0034] a memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system updating method described in the above embodiment.
[0036] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the system updating method described in the above embodiments.
[0037] The system update method provided by the embodiment of the present disclosure triggers a configuration event processing instruction to create a temporary configuration object when it is detected that the first configuration file currently loaded into the system reaches the specified configuration update condition, and then compares the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then updates them to the temporary configuration object. The temporary data source running component is used to control at least one corresponding data source component to keep running, so that the component configuration data about the buffer channel component and the receiver component in the first configuration file is written into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object. In this way, by comparing the differences before and after the configuration file is updated, the data source running component and the data source component that have not been changed are dynamically determined, and the component configuration data of the above components and the buffer channel component and the receiver component are written into the temporary configuration object and then executed, thereby realizing the update of each component in the system without interrupting the data flow. This helps to dynamically update data source components and ensure the integrity of temporary configuration objects so that the system can transmit data normally without restarting most components in the system, including Source components, Sink components, and Channel components. It solves the technical problem that changes in Source components require restarting system components, which can easily lead to data loss. It improves the flexibility of system updates and ensures data security.
[0038] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A flowchart of a system updating method provided by an embodiment of the present disclosure;
[0041] Figure 2 A schematic diagram of the structure of the system architecture provided by the embodiment of the present disclosure;
[0042] Figure 3 A schematic diagram of the structure of a system updating device provided by an embodiment of the present disclosure;
[0043] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0045] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0046] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0047] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0048] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0049] Embodiment 1
[0050] Figure 1 A flowchart of a system updating method provided in an embodiment of the present disclosure is applicable to a system including a data source component, a buffer channel component and a receiver component. The system updating method includes steps S101 to S103.
[0051] S101. When it is detected that a first configuration file currently loaded into the system meets a specified configuration update condition, a configuration event processing instruction is triggered to create a temporary configuration object.
[0052] It should be noted that the system is installed with a data source component, a buffer channel component and a receiver component. The system can be a terminal device with a data transmission function, such as a Flume data acquisition system, which is not limited in this disclosure. Figure 2 , is a structural diagram of the system architecture provided in the embodiment of the present disclosure. The system 200 includes a data source component 201, a buffer channel component 202, and a receiver component 203. The data source component 201 can be a Source component, which is used to receive data from different data sources and pass it to the next component. The data received by the data source component can be network data, log files, etc. The buffer channel component 202 can be a Channel component, which is used to cache the data collected by the Source component and wait for the receiver component to read the data. The receiver component 203 can be a Sink component, which is used to poll the events in the Channel component and pull them out, write these events to the storage or send them to another Flume Agent.
[0053] In some embodiments, before the process of triggering the processing configuration event instruction to create a temporary configuration object when detecting that the first configuration file currently loaded into the system reaches the specified configuration update condition, the process includes:
[0054] Extending a preset Application class to generate an ApplicationExt class file, wherein the ApplicationExt class file includes a trigger operation for indicating an instruction for processing a configuration event;
[0055] Based on the ApplicationExt class file, the startup script of the system is executed.
[0056] It should be noted that the Application class is the entry point of the system (such as the Flume system), and the configuration event processing instruction (such as the corresponding handleConfigurationEvent method) is the core method used to handle configuration changes in the system. When the configuration file changes, such as the configuration file is modified or a new configuration is obtained from the remote configuration center, the system will trigger the configuration event processing instruction (i.e., trigger the handleConfigurationEvent method) through event notification, so as to start, stop or restart some components in the system according to the new configuration information to ensure that the system can respond to configuration changes in a timely manner.
[0057] In this embodiment, the Application class is modified and renamed to ApplicationExt, and then recompiled and packaged so that the generated ApplicationExt class file and related dependencies are placed in the system's plug-in directory (such as the plugins.d directory). In the system's startup script, the startup class needs to be modified to ApplicationExt to ensure that the system uses the ApplicationExt class file to start the system's application, so as to flexibly handle configuration changes, thereby using the ApplicationExt class file to initialize and run the system's startup script.
[0058] In some embodiments, the configuration update condition includes:
[0059] The attribute information about the data source component changes;
[0060] The attribute information includes type information, location information and data format information of the data source connected to the data source component.
[0061] In the present disclosure, the system dynamically loads a configuration file and detects whether the first configuration file currently loaded into the system meets the specified configuration update condition, that is, whether the configuration file has changed. Specifically, when it is determined that at least one of the type information, location information, and data format information about the data source component recorded in the first configuration file has changed, it is determined that the configuration update condition has been met, for example, it is detected that the flume.properties file has been modified. Therefore, the present disclosure can cope with the situation of multiple data source accesses of different types, locations, or data formats, and implements changes to the data source component without restarting the data source component, the buffer channel component, and the receiver component, and has strong compatibility and applicability.
[0062] S102: Compare the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used to control at least one corresponding data source component to keep running.
[0063] In some embodiments, the method further comprises:
[0064] Extracting a first component list in the first configuration file and a second component list in the second configuration file;
[0065] Among them, the first component list records at least one first data source operation component to be run and at least one data source component to be configured that is controlled by each first data source operation component; the second component list records at least one currently running second data source operation component and at least one currently running data source component that is controlled by each second data source operation component.
[0066] In the present disclosure, when a change occurs to the currently loaded first configuration file, a configuration event processing instruction is triggered (i.e., the handleConfigurationEvent method is triggered), and a temporary configuration object is created, and the new and old configuration files of the system are compared, so that the system is updated using the temporary configuration object without restarting the component, thereby ensuring the continuity of the data flow. Wherein, during the comparison process of the configuration files, it is determined that there is no configuration data that has changed in the currently running second configuration file, which means that the configuration data does not need to be reloaded and only needs to continue to be used. Then, the data source operation component indicated in the configuration data (i.e., the temporary data source operation component) is added to the temporary configuration object to keep the data source operation component running. It should be noted that the data source operation component (such as Source Runner) is used to start and manage the operation of one or more data source components. When configuring the system, the number and correspondence between the data source components and the data source operation components can be reasonably set and managed to ensure the correctness and efficiency of data processing.
[0067] S103. Write the component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object, so that the operation of each component in the system is instructed according to the current temporary configuration object.
[0068] In the present disclosure, the component configuration data of the data source running component and the data source component that have not been changed in the first configuration file, as well as the buffer channel component and the receiver component that have not been changed, are added to the temporary configuration object to ensure that the system can respond to configuration changes while maintaining the continuity of data transmission without interrupting the data flow and restarting multiple components. Therefore, when faced with multiple data sources accessing data of different types, locations, and data formats, the system update method configured in the present disclosure can complete the integration of various data sources, implement regular polling to monitor changes in log files or other data sources, and transmit the data to the big data processing system, ensuring real-time and automaticity. Secondly, by being able to adapt to a variety of different data sources, new log sources can be flexibly accessed without interrupting existing data flows. In addition, the present disclosure is suitable for large-scale collection of large amounts of log data for analysis and processing, reducing the complexity of maintaining and expanding the system.
[0069] In an optional embodiment, the method further includes:
[0070] Based on the temporary data source running component, data source component, buffer channel component and receiver component in the executed temporary configuration object, a corresponding temporary linked list is created, wherein the temporary linked list includes each component in the temporary configuration object and a temporary component identifier, location information and a temporary script file for implementing the temporary configuration for each component;
[0071] The temporary component identifiers and temporary script files in the temporary linked list are allocated to corresponding components so that each component executes the temporary script file.
[0072] Based on the above embodiment, in one embodiment, the method further includes:
[0073] Obtaining, in the first configuration file, a first correspondence relationship between each temporary data source running component and at least one data source component, a second correspondence relationship between each data source component and at least one buffer channel component, and a third correspondence relationship between each buffer channel component and at least one receiver component;
[0074] Based on at least one corresponding relationship between any component, a temporary identifier of the executed temporary configuration object and the corresponding position information, a temporary component identifier of the component is generated.
[0075] It should be noted that, for the above-mentioned embodiment, a temporary configuration file needs to be created for each component in the temporary configuration object. Then, with the increase of configuration files (such as newly loaded configuration files, temporary configuration objects and running configuration files), a large amount of redundant data is caused, the management complexity of the system will also increase, and the components indicated by each configuration file may also conflict, making it difficult to ensure accurate control of the corresponding components. In this regard, specifically, the position information in the temporary linked list can be the data storage location of the temporary data source running component, the data source component, the buffer channel component and the receiver component, or it can be the storage location of the temporary script file in each component data, so that the relevant temporary script file can be quickly found through the position information, thereby improving the efficiency of data cleaning and data positioning. The temporary script file is a program script for the current temporary configuration object and acts on the component. The temporary component identifier is used to characterize the component to be executed during the execution of this temporary configuration object. The component takes into account the relationship between its upper and lower connection points in order to distinguish each component and achieve precise control.
[0076] More specifically, for the temporary component identification of the temporary data source operation component, a hash calculation is performed based on the first correspondence between the temporary data source operation component and the at least one data source component controlled, the location information of the temporary component identification, and the temporary identification to generate the corresponding temporary component identification. For the temporary component identification of the data source component, a hash calculation is performed based on the first correspondence between the data source component and the temporary data source operation component that controls the data source component, the second correspondence between the data source component and at least one buffer channel component, the location information of the data source component, and the temporary identification to generate the corresponding temporary component identification. For the temporary component identification of the buffer channel component, a hash calculation is performed based on the second correspondence between the buffer channel component and the corresponding data source component, the third correspondence between the buffer channel component and at least one receiver component, the location information of the buffer channel component, and the temporary identification to generate the corresponding temporary component identification. For the temporary component identification of the receiver component, a hash calculation is performed based on the third correspondence between the temporary component identification and the corresponding at least one buffer channel component, the location information of the temporary component identification, and the temporary identification to generate the corresponding temporary component identification.
[0077] Therefore, this embodiment centrally manages and standardizes the temporary component identification, location information and temporary script files of multiple components in the temporary configuration object by configuring a temporary linked list, and establishes an association relationship between the temporary configuration object and the components to be run, so that after executing the temporary configuration object, data cleaning can be performed based on the temporary linked list to remove duplicate or unnecessary data, thereby reducing redundant data. At the same time, the temporary component identification of the component is established by configuring the temporary linked list and the correspondence between the upper and lower connection points of the component, the location information and the temporary identification of the temporary configuration object, taking into account the interactive relationship between the components in the system and being suitable for the operation application scenario of the temporary configuration object, thereby achieving precise control of the components to be run by the temporary configuration object, avoiding the situation where repeated and large configuration files cause interference control, and reducing the complexity of component management.
[0078] The system update method provided in this embodiment triggers a configuration event processing instruction to create a temporary configuration object when it is detected that the first configuration file currently loaded into the system reaches the specified configuration update condition, and then compares the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then updates them to the temporary configuration object. The temporary data source running component is used to control at least one corresponding data source component to keep running, so that the component configuration data about the buffer channel component and the receiver component in the first configuration file is written into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object. In this way, by comparing the differences before and after the configuration file is updated, the data source running component and the data source component that have not been changed are dynamically determined, and the component configuration data of the above components and the buffer channel component and the receiver component are written into the temporary configuration object and then executed, thereby realizing the update of each component in the system without interrupting the data flow. This helps to dynamically update data source components and ensure the integrity of temporary configuration objects so that the system can transmit data normally without restarting most components in the system, including Source components, Sink components, and Channel components. It solves the technical problem that changes in Source components require restarting system components, which can easily lead to data loss. It improves the flexibility of system updates and ensures data security.
[0079] In some embodiments, comparing the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then updating them into the temporary configuration object includes:
[0080] Traversing the second component list, and detecting whether each second data source running component is consistent with any first data source running component in the first component list;
[0081] The corresponding second data source operation component when the consistency is detected is used as a temporary data source operation component, and the temporary data source operation component is written into the temporary configuration object to control the data source component related to the temporary data source operation component to keep running.
[0082] In this embodiment, the second component list in the currently running second configuration file (i.e., the old configuration file) is traversed to check whether each second data source operation component exists in the first component list (i.e., the new configuration file), that is, to compare whether the second data source operation component is consistent with any first data source operation component. If there are consistent components, it is considered that the data source operation component in the old configuration file exists in the new configuration file, which means that the configuration for the data source operation component has not changed, and there is no need to reload it, and it needs to continue to be used, so the data source operation component (i.e., the temporary data source operation component) is added to the temporary configuration object to ensure that it remains in operation. Therefore, this embodiment adds the unchanged data source operation component to the temporary configuration object, so as to keep the data source operation component running, and can keep the system transmitting data correctly without restarting the entire system component.
[0083] In some embodiments, the method further comprises:
[0084] When it is detected that at least one second data source running component is inconsistent with any of the first data source running components, the corresponding second data source running component is determined to be a component to be deleted, and creation of a first thread is triggered;
[0085] A component stop operation is called in the first thread, where the component stop operation is used to instruct to remove the component to be deleted from a component management list, where the component management list records a second data source running component currently running in the system.
[0086] In this embodiment, if there is at least one second data source running component that is inconsistent with any first data source running component, it is considered that the second data source running component in the old configuration file does not exist in the new configuration file, which means that the second data source running component is not applicable to the current configuration to be updated, and then a first thread is triggered to be created. Specifically, a component stop operation is called in the thread, such as the supervisor.unsupervise(oldSources.get(oldSource)) method, to remove the second data source running component from the component management list that records the currently running data source running components, ensuring that the second data source running component is stopped.
[0087] Therefore, this embodiment stops the expired data source running component by comparing the new configuration file with the old configuration file, so as to facilitate the dynamic update of the data source and improve the efficiency and accuracy of the system update.
[0088] In some embodiments, the method further comprises:
[0089] Traversing the first component list, and when detecting that at least one first data source running component is inconsistent with any second data source running component in the second component list, determining the corresponding first data source running component as a component to be added, and triggering the creation of a second thread;
[0090] A component start operation is called in the second thread, where the component start operation is used to instruct to add the component to be added to the component management list and run the component to be added.
[0091] In this embodiment, the first component list records the first data source operation component that is consistent with the second data source operation component and other first data source operation components except the data source operation component. Specifically, the first component list in the currently loaded first configuration file (i.e., the new configuration file) is traversed to extract the above-mentioned other first data source operation components, i.e., the data source operation components newly added in the new configuration file, and then trigger the creation of the second thread. That is, the component startup operation is called in the thread, such as the supervisor.supervise(newSources.get(newSource), new SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START) method, to add the first data source operation component to the component management list and start the operation of the first data source operation component. Therefore, this embodiment starts the newly added data source operation component by comparing the new configuration file with the old configuration file, which facilitates the dynamic update of the data source and improves the efficiency and accuracy of the system update.
[0092] Furthermore, the component configuration data of the buffer channel component and the receiver component in the first configuration file are added to the temporary configuration object, ensuring the integrity of the configuration so that the system can correctly transmit data. For example, taking Flume as an example, the last line of the Flume system this.materializedConfiguration = tempConf assigns the temporary configuration object to the system's MaterializedConfiguration so that the new configuration file can be used when processing subsequent events, ensuring that the Flume application can adapt to new data sources, channels, and data destinations in real time when the configuration changes without restarting the entire system, and can adapt to changing data stream processing requirements.
[0093] Embodiment 2
[0094] Figure 3A schematic diagram of the structure of a system update device provided in an embodiment of the present disclosure is applicable to a system including a data source component, a buffer channel component, and a receiver component. The system update device 300 includes:
[0095] The trigger module 301 is used to trigger the processing configuration event instruction to create a temporary configuration object when it is detected that the first configuration file currently loaded into the system meets the specified configuration update condition;
[0096] A configuration comparison module 302 is used to compare the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used to control at least one corresponding data source component to keep running;
[0097] The configuration update module 303 is used to write the component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object.
[0098] In some embodiments, the configuration comparison module 302 includes:
[0099] a component list extraction unit, configured to extract a first component list in the first configuration file and a second component list in the second configuration file;
[0100] Among them, the first component list records at least one first data source operation component to be run and at least one data source component to be configured that is controlled by each first data source operation component; the second component list records at least one currently running second data source operation component and at least one currently running data source component that is controlled by each second data source operation component.
[0101] In some embodiments, the configuration comparison module 302 further includes:
[0102] A second component list traversal unit, used for traversing the second component list, and detecting whether each second data source running component is consistent with any first data source running component in the first component list;
[0103] The temporary data source running component processing unit is used to use the corresponding second data source running component as the temporary data source running component when the consistency is detected, and write the temporary data source running component into the temporary configuration object to keep the data source component related to the temporary data source running component running.
[0104] In some embodiments, the system updating apparatus 300 further includes:
[0105] a component-to-be-deleted determining unit, configured to, when detecting that at least one second data source operating component is inconsistent with any of the first data source operating components, determine that the corresponding second data source operating component is a component to be deleted, and trigger creation of a first thread;
[0106] The component removal unit is used to call a component stop operation in the first thread, wherein the component stop operation is used to instruct to remove the component to be deleted from a component management list, wherein the component management list records the second data source running component currently running in the system.
[0107] In some embodiments, the system updating apparatus 300 further includes:
[0108] A first component list traversal unit, configured to traverse the first component list, and when detecting that at least one first data source running component is inconsistent with any second data source running component in the second component list, determine that the corresponding first data source running component is a component to be added, and trigger the creation of a second thread;
[0109] The component startup unit is used to call a component startup operation in the second thread, wherein the component startup operation is used to instruct to add the component to be added to the component management list and run the component to be added.
[0110] In some embodiments, the trigger module 301 includes:
[0111] An extension unit, used for extending a preset Application class to generate an ApplicationExt class file, wherein the ApplicationExt class file includes a trigger operation for indicating an instruction for processing a configuration event;
[0112] The system startup unit is used to execute the startup script of the system based on the ApplicationExt class file.
[0113] In some embodiments, the trigger module 301 includes:
[0114] A configuration update detection unit, for use when the configuration update condition includes: a change in the attribute information about the data source component;
[0115] The attribute information includes type information, location information and data format information of the data source connected to the data source component.
[0116] The device of the embodiments of the present disclosure can execute the method provided by the embodiments of the present disclosure, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present disclosure correspond to the steps in the method of each embodiment of the present disclosure. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0117] Embodiment 3
[0118] The electronic device according to an embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, etc.
[0119] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the electronic device performs all or part of the steps of the system update method of each embodiment of the present disclosure.
[0120] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0121] like Figure 4 The present invention provides a schematic diagram of the structure of an electronic device according to an embodiment of the present invention, which is suitable for implementing the electronic device in the embodiment of the present invention. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0122] like Figure 4 As shown, the electronic device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0123] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as magnetic tapes and hard disks; and communication devices. The communication device can allow the electronic device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 4 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0124] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the system update method of the embodiment of the present disclosure are executed.
[0125] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0126] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the system updating method of each embodiment of the present disclosure are executed.
[0127] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0128] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0129] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0130] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0131] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0132] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0133] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0134] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0135] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A system updating method, characterized in that: Applicable to a system including a data source component, a buffer channel component, and a receiver component, the method includes: When it is detected that the first configuration file currently loaded into the system meets the specified configuration update condition, a configuration event processing instruction is triggered to create a temporary configuration object; Compare the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used to control at least one corresponding data source component to keep running; The method further comprises: Extracting a first component list in the first configuration file and a second component list in the second configuration file; The first component list records at least one first data source operation component to be run and at least one data source component to be configured that is controlled by each first data source operation component; the second component list records at least one currently running second data source operation component and at least one currently running data source component that is controlled by each second data source operation component; Writing component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object; The step of writing the component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object includes: The component configuration data of the data source running component and the data source component that have not been changed in the first configuration file, as well as the buffer channel component and the receiver component that have not been changed, are added to the temporary configuration object.
2. The system updating method according to claim 1, characterized in that: The comparing the first configuration file with the second configuration file currently running in the system to obtain one or more temporary data source running components and then updating them into the temporary configuration object includes: Traversing the second component list, and detecting whether each second data source running component is consistent with any first data source running component in the first component list; The corresponding second data source operation component when the consistency is detected is used as a temporary data source operation component, and the temporary data source operation component is written into the temporary configuration object to control the data source component related to the temporary data source operation component to keep running.
3. The system updating method according to claim 2, characterized in that: The method further comprises: When it is detected that at least one second data source running component is inconsistent with any of the first data source running components, the corresponding second data source running component is determined to be a component to be deleted, and creation of a first thread is triggered; A component stop operation is called in the first thread, where the component stop operation is used to instruct to remove the component to be deleted from a component management list, where the component management list records a second data source running component currently running in the system.
4. The system updating method according to claim 3, characterized in that: The method further comprises: Traversing the first component list, and when detecting that at least one first data source running component is inconsistent with any second data source running component in the second component list, determining the corresponding first data source running component as a component to be added, and triggering the creation of a second thread; A component start operation is called in the second thread, where the component start operation is used to instruct to add the component to be added to the component management list and run the component to be added.
5. The system updating method according to claim 1, characterized in that: Before the process of triggering the processing configuration event instruction to create a temporary configuration object when detecting that the first configuration file currently loaded into the system meets the specified configuration update condition includes: Extending a preset Application class to generate an ApplicationExt class file, wherein the ApplicationExt class file includes a trigger operation for indicating an instruction for processing a configuration event; Based on the ApplicationExt class file, the startup script of the system is executed.
6. The system updating method according to claim 1, characterized in that: The configuration update conditions include: The attribute information about the data source component changes; The attribute information includes type information, location information and data format information of the data source connected to the data source component.
7. A system updating device, characterized in that: Applicable to a system including a data source component, a buffer channel component and a receiver component, the device includes: A trigger module, configured to trigger a configuration event processing instruction to create a temporary configuration object when detecting that the first configuration file currently loaded into the system meets a specified configuration update condition; A configuration comparison module, used for comparing the first configuration file with the second configuration file currently running in the system, so as to obtain one or more temporary data source running components and then update them into the temporary configuration object, wherein the temporary data source running component is used for controlling at least one corresponding data source component to keep running; Wherein, the configuration comparison module includes: a component list extraction unit, configured to extract a first component list in the first configuration file and a second component list in the second configuration file; The first component list records at least one first data source operation component to be run and at least one data source component to be configured that is controlled by each first data source operation component; the second component list records at least one currently running second data source operation component and at least one currently running data source component that is controlled by each second data source operation component; a configuration update module, configured to write component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object, so that the operation of each component in the system is indicated according to the current temporary configuration object; The step of writing the component configuration data about the buffer channel component and the receiver component in the first configuration file into the updated temporary configuration object includes: The component configuration data of the data source running component and the data source component that have not been changed in the first configuration file, as well as the buffer channel component and the receiver component that have not been changed, are added to the temporary configuration object.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the system updating method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the system updating method described in any one of claims 1-6.