Configuration management method and device, equipment and medium
By creating theme templates and instantiating themes in the business management platform, the problem of high complexity in configuration data usage in the existing technology is solved, and the function of directly using configuration data in the business system is realized, reducing system complexity and intrusion.
Patent Information
- Application Number
- CN202411698526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, the configuration center converts configuration data into strings for storage, resulting in the use of configuration data being too complicated and has a strong intrusiveness to the business system.
By creating a theme template corresponding to the business configuration objects in the business system in the business management platform and creating an instantiated theme based on the theme template, the configuration management platform can instantiate the target business configuration objects based on the instantiated theme, so that the business system can directly use the configuration data without performing data conversion operations.
It reduces the complexity of configuration data usage, enables business systems to access and use configuration data more concisely, and reduces intrusion into business systems.
Smart Images

Figure CN119917176A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a configuration management method, apparatus, device and medium. Background Art
[0002] As business develops, more and more people who propose business requirements want to have a high degree of operational capabilities for the requirements they propose. For example, the control switch of business requirements and the business configuration data in the entire business requirements are required to be flexible. In this context, the configuration center came into being. Business personnel can configure data for various business requirements in the configuration center. During the operation of the business system, business control is performed based on the configuration data in the configuration center.
[0003] At present, in some technologies, the configuration center converts the configuration data into strings for storage. When the business system uses the configuration data, it needs to perform a series of deserialization operations or verifications on the configuration data, which makes the use of the configuration data too complicated. Summary of the invention
[0004] In view of this, the present disclosure provides a configuration management method, a configuration management device, an electronic device, and a computer-readable storage medium, which can reduce the complexity of using configuration data.
[0005] In a first aspect, the present disclosure provides a configuration management method, which is applied to a configuration management platform, and the method includes:
[0006] Acquire a topic created in the business management platform, the topic including a topic template and an instantiated topic created based on the topic template, wherein the topic template represents a business configuration object in the business system, and the topic template includes a topic field, the topic field represents an attribute in the business configuration object, and the instantiated topic is the content obtained after assigning a value to the topic field in the topic template;
[0007] Receiving an instantiation request sent by the business system, the instantiation request including a target business configuration object to be instantiated;
[0008] A target subject that matches the target business configuration object is searched, and an instantiated object of the target business configuration object is generated based on an instantiated subject in the target subject.
[0009] In a second aspect, the present disclosure provides a configuration management device, applied to a configuration management platform, the device comprising:
[0010] A theme acquisition module is used to acquire a theme created in the business management platform, wherein the theme includes a theme template and an instantiated theme created based on the theme template, wherein the theme template represents a business configuration object in the business system, and the theme template includes a theme field, wherein the theme field represents an attribute in the business configuration object, and the instantiated theme is the content obtained after assigning a value to the theme field in the theme template;
[0011] A request receiving module, used to receive an instantiation request sent by the business system, wherein the instantiation request includes a target business configuration object to be instantiated;
[0012] The instantiation module is used to search for a target subject that matches the target business configuration object, and generate an instantiation object of the target business configuration object based on the instantiation subject in the target subject.
[0013] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the above method by executing the computer instructions.
[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the above method.
[0015] In the technical solutions of some embodiments of the present disclosure, by creating a theme template corresponding to the business configuration object in the business system on the business management platform, and creating an instantiated theme based on the theme template in the business management platform, the configuration management platform can instantiate the target business configuration object based on the instantiated theme, so that the business system can directly use the configuration data in the business management platform without performing data conversion operations, thereby reducing the complexity of using the configuration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 is a schematic diagram of a configuration system architecture provided by an embodiment of the present disclosure;
[0018] Figure 2is a schematic diagram of a theme template creation page provided by an embodiment of the present disclosure;
[0019] Figure 3 It is a creation page of an instantiated theme provided by an embodiment of the present disclosure;
[0020] Figure 4 is a schematic diagram of a theme template creation page provided by another embodiment of the present disclosure;
[0021] Figure 5 is a schematic diagram of a sub-theme template creation page provided by an embodiment of the present disclosure;
[0022] Figure 6 It is a creation page of an instantiated theme provided by another embodiment of the present disclosure;
[0023] Figure 7 It is a creation page of an instantiated sub-topic provided by an embodiment of the present disclosure;
[0024] Figure 8 is a schematic diagram of a theme template creation page provided by another embodiment of the present disclosure;
[0025] Fig. 9 is a schematic diagram of an instantiated topic page provided by another embodiment of the present disclosure;
[0026] Fig.10 is a flowchart of a configuration management method provided by an embodiment of the present disclosure;
[0027] Fig.11 It is a schematic diagram of a method for ensuring the consistency of read and write data between multiple nodes provided by an embodiment of the present disclosure;
[0028] Fig.12 is a module diagram of a configuration management device provided by an embodiment of the present disclosure;
[0029] Fig.13 It is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0032] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "some embodiments" or "the embodiment" should be understood as "at least some embodiments". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0033] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0034] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0035] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0036] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0037] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0038] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0039] The configuration center in some technologies has the following problems:
[0040] 1) When business requirements change, if you need to make configuration changes in the configuration center (such as adding / deleting configuration items or modifying configuration item properties), page developers often need to intervene. For example, suppose the configuration center does not originally support gift package configuration. If a new gift package configuration requirement is added, page developers are required to develop a configuration page for the gift package. Therefore, when business requirements change frequently and configuration items or configuration item properties in the configuration page need to be frequently modified, the development workload will be very large.
[0041] 2) The configuration center usually converts the configuration data into strings for storage. When the business system uses the configuration data, it needs to perform a series of deserialization operations or verifications on the configuration data, which makes the configuration data usage process too complicated and highly invasive to the business system.
[0042] To solve the above problems, the present disclosure first provides a configuration system architecture. Figure 1 . The configuration system architecture may include a configuration management platform, a business system, and a business management platform for business configuration. Among them, the configuration management platform includes a configuration server, a registration center, and a configuration client integrated in the business system. The configuration server and the business management platform can communicate based on HSDP (High Scalability Description Protocol). HSDP can describe the configuration data configured in the business management platform according to the definition of the data template, such as describing the data type and verification rules of the configuration data. In this way, the configuration server can obtain the configuration data of the business management platform and manage the configuration data. Specifically, if Figure 1 As shown, the configuration server can provide one or more service interfaces for interacting with the business management platform based on the HSDP protocol. In this way, configuration data can be obtained from the business management platform, the obtained configuration data can be verified, the obtained configuration data can be saved in the local storage, when the business management platform modifies the configuration data, the configuration data in the local storage can be modified synchronously, the configuration data of the business platform can be versioned in the local storage, and user authority control can be performed on the modification of the configuration data.
[0043] The business system can obtain the configuration data required for business control from the configuration server by calling the interface provided by the configuration client. The configuration server returns the configuration data to the configuration client, which can convert the configuration data obtained from the configuration server according to the data format required by the business system (i.e. Figure 1 After the configuration data is obtained, it is returned to the business system. In this way, the business system can directly use the obtained configuration data without converting or verifying the configuration data, thereby reducing the complexity of the business system using the configuration data.
[0044] Further, such as Figure 1 As shown, the configuration client can also save the configuration data obtained from the configuration server in the local cache. In this way, when the business system calls the configuration client's interface to obtain configuration data, the configuration client can first search in the local cache whether the configuration data required by the business system exists. If so, the configuration data in the local cache can be converted and returned to the business system. If not, the configuration data required by the business system can be obtained from the configuration server. In this way, the number of interactions between the configuration client and the configuration server can be reduced, thereby reducing the data query pressure on the configuration server.
[0045] For the configuration data stored in the local cache of the configuration client, if the configuration data is modified on the configuration server, the configuration client can synchronize the modified configuration data to the local cache, so as to ensure that the configuration data in the local cache is the latest configuration data, thereby ensuring the accuracy of the configuration data.
[0046] Furthermore, the configuration server can be deployed in a cluster manner, and each configuration server has a server address. The configuration server can register the server address and the RPC (Remote Procedure Call) service provided to the outside in the registration center. The configuration client obtains configuration data from the configuration server or modifies the configuration data according to the server address and RPC service in the registration center.
[0047] Furthermore, the configuration client and the configuration server can communicate based on PB (Protocol Buffers, serialized structured data protocol), so that the bandwidth occupied by the configuration data transmission can be reduced.
[0048] Furthermore, based on the HSDP protocol, the business management platform can be a low-code development platform. The so-called low-code development platform is a platform that uses a visual approach to enable people without professional programming skills to quickly build and deploy applications. In this way, when making configuration changes (such as adding / deleting configuration items or modifying configuration item properties), there is no need for page developers to intervene.
[0049] In some embodiments, in the business management platform, data configuration can be performed in units of themes. Each theme can represent a type of configuration. Different themes can correspond to different business configuration requirements. For ease of understanding, the following is explained by way of example. For example, in business configuration requirement 1, it is necessary to configure the ID, name, description and status of some specific goods in the business management platform to represent whether they are on the shelf. Then, this configuration including the product ID, name, description and status can be called the first theme (i.e., the first type of configuration). For another example, in business configuration requirement 2, it is necessary to configure the original price and discount of some specific goods in the business management platform. Then, this configuration including the original price and discount of the goods can be called the second theme (i.e., the second type of configuration). For another example, in business configuration requirement 3, it is necessary to configure the name and quantity of the goods included in the online gift package. Then, this configuration including the name and quantity of the goods can be called the third theme (i.e., the third type of configuration).
[0050] Specifically, a subject may include a subject template and an instantiated subject created based on the subject template. Among them, the subject template may specify subject fields, field attributes, subject attributes and other information corresponding to the business configuration requirements. For example, the product ID, product name, product status, etc. in the above examples can be respectively referred to as a subject field. The subject fields in different subject templates may not be exactly the same, and each subject field may have its own corresponding field attributes. Field attributes may include but are not limited to field name, field identifier, field type (such as number, text, etc.), whether it is required, whether the field needs to be hidden, etc. The instantiated subject is the content obtained after assigning values to the subject fields in the subject template. Subject attributes may include but are not limited to subject identifier, subject name, whether the instantiated subject created based on the subject template is allowed to be deleted or modified, etc. The subject identifier can uniquely identify the subject.
[0051] Normally, non-developers such as maintenance personnel can log in to the business management platform to create theme templates corresponding to business configuration requirements. Figure 2 , is a schematic diagram of a theme template creation page provided by an embodiment of the present disclosure. Figure 2In the middle area, the maintenance personnel specify the subject attributes, such as the subject name as "Product", the subject identifier as "Pxy", and allow deletion and modification operations for instantiated subjects created based on the subject template. At the same time, the maintenance personnel can create subject fields corresponding to business configuration requirements in the bottom area by clicking the "Add Subject Field" button. For example, the ID, name, description, and status of a product can be regarded as a subject field respectively. Behind each subject field, the field attributes of each subject field are also specified. After completing the creation of the subject template, the maintenance personnel can save the created subject template by clicking the "Save" button.
[0052] After the maintenance personnel have created the theme template, the business personnel can continue to create instantiated themes based on the created theme template. Figure 3 , based on Figure 2 Diagram of an instantiated theme created using the theme template in . Figure 3 , by clicking the Add button and Figure 2 By assigning values to each subject field in , two instantiated subjects named "Pencil" and "Pen" are obtained. At the same time, in each instantiated subject, based on the subject attributes "Delete" and "Modify" defined in the subject template, delete and modify buttons are created, so that business personnel can delete or modify the created instantiated subjects through the delete and modify buttons.
[0053] pass Figure 2 and Figure 3 It can be seen that based on Figure 2 In the theme template, business personnel can configure different products in the business management platform according to actual configuration needs, such as pencils, pens, mobile phones, etc., and each product can have its own corresponding product attributes, such as the product ID defined by the theme field "ID", the product color defined by the theme field "Description", and the product on and off the shelf status defined by the theme field "Status". By modifying the theme fields in the theme template, you can modify the product attributes of the configured product. For example, by adding a new theme field "Sales Channel" in the theme template, you can configure the sales channels of each product. For another example, by adding a new theme field "Price" in the theme template, you can configure the price of each product. Figure 1 The configuration server in can obtain various topics (including topic templates and instantiated topics) from the business management platform and save the obtained topics. The business system can obtain the required topics from the configuration server by configuring the client to control the business. For example, based on Figure 3 The instantiated theme in the example can display each product defined by the instantiated theme on the product sales page according to the product attributes defined in the instantiated theme.
[0054] similar Figure 2 and Figure 3 This configuration method can be called a visualization-based configuration method. In this configuration method, if configuration modification is required (such as adding / deleting configuration items or modifying configuration item properties), the maintenance personnel can directly create a new theme template and modify the theme fields in the existing theme template without the intervention of page developers. In this way, the workload of code development can be greatly reduced.
[0055] Further, in some embodiments, a theme may also include a sub-theme. A sub-theme may include a sub-theme template and an instantiated sub-theme created based on the sub-theme template. A sub-theme may be nested in a theme, and clicking a trigger button in the theme may jump to the sub-theme. A sub-theme template is substantially similar to a theme template, with the main difference being that a trigger button for jumping from a theme to a sub-theme may be defined in a sub-theme template. An instantiated sub-theme is substantially similar to an instantiated theme, with the main difference being that an instantiated theme includes a trigger button for jumping to an instantiated sub-theme (i.e., a trigger button defined in the above-mentioned sub-theme template).
[0056] For easier understanding, please refer to Figure 4 , which is a schematic diagram of a theme template creation page provided by another embodiment of the present disclosure. Figure 4 and Figure 2 Basically similar, the main difference is Figure 4 The button "Edit Sub-Model" is also included. By clicking "Edit Sub-Model", the maintenance personnel can create a sub-theme template nested in the theme template. For example, if in the actual configuration requirements, it is necessary to configure the pictures of each product, and the pictures have picture IDs, then Figure 4 Click "Edit Submodel" to get the following Figure 5 The creation page for the child theme template is shown in Figure 5 In the interface shown, by clicking "Add sub-theme field", you can create two sub-theme fields, ID and picture. Among them, the sub-theme field "ID" is used to define the picture ID, and the sub-theme field "Picture" can be used to provide business personnel with product pictures to upload. At the same time, the trigger button "Picture List" for jumping from the theme to the sub-theme is also defined. After creating the sub-theme template, you can establish a subordinate relationship between the sub-theme template and the theme template. In this way, when creating an instantiated theme based on the theme template, you can get something like Figure 6 The instantiated theme page shown. Figure 3 compared to, Figure 6 A new button "Picture List" has been added to each instantiated theme in the sub-theme template. When business personnel click "Picture List", they can enter the following Figure 7 The creation page for instantiating a sub-theme is shown. Figure 7In the , you can configure the product image ID and product image of the corresponding product.
[0057] In the above solution, the configuration server provides multiple service interfaces based on the HSDP protocol to perform one or more of the following operations:
[0058] 1) Obtain configuration data from the business management platform, parse and verify the obtained configuration data, and save the configuration data in local storage;
[0059] 2) When maintenance personnel perform operations such as adding, deleting, and modifying configuration data on the business management page, the configuration data in the local storage is updated synchronously;
[0060] 3) Manage and control the permissions of maintenance personnel who perform operations such as adding, deleting, and modifying, verify configuration data, etc.
[0061] In some embodiments, at least part of the above-mentioned business interfaces can be provided by the business system. In the case where the business system provides the business interface, the configuration data can be saved in the storage path provided by the business system. At the same time, when the maintenance personnel perform operations such as adding, deleting, and modifying the configuration data on the business management page, the configuration data saved in the business system is modified based on the business interface provided by the business system. Correspondingly, the theme template creation page can also include a configuration area for the business interface provided by the business system. For example, in conjunction with reference to Figure 8 , which is a schematic diagram of a theme template creation page provided by another embodiment of the present disclosure. Figure 8 In the theme template creation page, there are also configuration areas for the list interface, the add interface, the modify interface, the delete interface, and the verification interface. By calling the list interface, the configuration server can send configuration data to the business system, save business data in the business system, or read configuration data from the business system. Similarly, by calling the add interface, the modify interface, the delete interface, and the verification interface, the configuration server can perform add, modify, delete, and verify operations on the configuration data saved in the business system in turn. Figure 8 In the illustrated embodiment, the business system is supported to provide a business interface, which is more applicable.
[0062] In some embodiments, the business system can be divided into a grayscale environment and a formal environment. In the instantiated theme creation page, you can set the environment to which the instantiated theme is applied. For example, in conjunction with Fig. 9 , a schematic diagram of an instantiated topic page provided for another embodiment of the present disclosure. Fig. 9There are two options in the "Synchronize to grayscale environment" and "Synchronize to formal environment". After creating an instantiated theme, the maintenance personnel can select the environment to which the instantiated theme is applied. For example, when the instantiated theme is applied to the grayscale environment of the business system, Fig. 9 The configuration data shown will not be returned to the formal environment of the business system. Fig. 9 In the illustrated embodiment, it supports creating instantiated topics respectively according to the types of business systems, which is more applicable.
[0063] It should be noted that Figures 2 to 9 , only exemplarily describes the theme template creation page and the instantiated theme creation page. In actual application, functions can be added or deleted in the page according to actual needs, and this application does not limit this.
[0064] based on Figures 1 to 9 The present disclosure provides a configuration management method that can reduce the complexity of using configuration data. The configuration management method can be applied to Figure 1 Configuration management platform in . Fig.10 , which is a flow chart of a configuration management method provided by an embodiment of the present disclosure. Fig.10 In the configuration management method, the following steps are included:
[0065] Step S1001, obtaining a theme created in the business management platform, where the theme includes a theme template and an instantiated theme created based on the theme template.
[0066] Specifically, as described above, the configuration server in the configuration management platform can save the acquired instance in the local storage. Each theme template configured in the business management platform can correspond to each business configuration object in the business system one by one, and represent the corresponding business configuration object. The theme field in the theme template can represent the attribute in the corresponding business configuration object. The business configuration object is an object in the program code of the business system, which is used to define the configuration parameters required for business control. For example, Figure 2 and Figure 3 The corresponding business configuration object A can be as follows:
[0067] public class Pxy{
[0068] private String id;
[0069] private String name;
[0070] private String desc;
[0071] private Long status;
[0072] }
[0073] and Figure 4 and Figure 5 The corresponding business configuration object B can be as follows:
[0074] public class Pxy{
[0075] private String id;
[0076] private String name;
[0077] private String desc;
[0078] private Long status;
[0079] / **
[0080] *Picture List
[0081] * /
[0082] @AutoSubData(key="Pxy1")
[0083] private List <pxy1>Pxy1;
[0084] Public static class Pic{
[0085] Private String pic;
[0086] }
[0087] }
[0088] Among them, for business configuration objects A and B, the attribute "id" in the business configuration object can correspond to the subject field "id" in the subject template, the attribute "name" in the business configuration object can correspond to the subject field "name" in the subject template, and so on.
[0089] For business configuration object B, due to Figure 4 and Figure 5 The instantiated sub-topic is included, so the corresponding business configuration object B also includes attributes related to the picture list.
[0090] Step S1002: receiving an instantiation request sent by a business system, where the instantiation request includes a target business configuration object to be instantiated.
[0091] Specifically, instantiating the target business configuration object means assigning values to the attributes in the target business configuration object. The values of the attributes in the target business configuration object can be configured in the instantiation topic or instantiation subtopic of the business management platform. For example, assuming that the target business configuration object is the above-mentioned business configuration object A, then: Figure 3 The values of each subject field in the instantiated subject "pencil" in can be used as the values of each attribute of the business configuration object A, and the values of each subject field in the instantiated subject "pen" can also be used as the values of each attribute of the business configuration object A. That is, based on Figure 3 In the instantiation subject, two instantiation objects of the business configuration object A can be obtained. Step S1003, searching for a target subject that matches the target business configuration object, and generating an instantiation object of the target business configuration object based on the instantiation subject in the target subject.
[0092] Specifically, under normal circumstances, the object name of each business configuration object can be set to be the same as the subject identifier of the corresponding subject. In this way, a subject whose subject identifier matches (i.e. is the same as) the object name of the target business configuration object can be found in the stored subjects as the target subject.
[0093] However, considering that the business personnel who configure the instance and the developer who defines the target business configuration object may not be the same person, there may be a situation where the object name of the business configuration object is different from the subject identifier of the corresponding subject, which may lead to the problem that the target subject cannot be found based on the object name. To solve this problem, when the object name of the business configuration object is different from the subject identifier of the corresponding subject, the subject identifier of the subject corresponding to the business configuration object can be modified with a specified annotation in the business configuration object. In this way, after obtaining the instantiation request sent by the business system, if the target business configuration object includes a target string modified with a specified annotation, a subject whose subject identifier matches the target string can be searched as the target subject. If the target business configuration object does not include a target string modified with a specified annotation, a subject whose subject identifier matches the object name of the target business configuration object can be searched as the target subject.
[0094] In this embodiment, the subject identifier can be modified using the annotation AutoConfig, and the sub-subject identifier can be modified using the annotation AutoSubData. For example, assuming that the object name of the business configuration object A is PackageDTO, since PackageDTO is Figure 2 The subject identifier Pxy in is different, so the above business configuration object A can be modified as follows:
[0095] @AutoConfig(key="Pxy")
[0096] public class PackageDTO {
[0097] private String id;
[0098] private String name;
[0099] private String desc;
[0100] private Long status;
[0101] }
[0102] In this way, the target subject matching the business configuration object A can be found based on the target string Pxy modified by the annotation AutoConfig.
[0103] In the above embodiment, by introducing the specified annotation, the problem of being unable to find the target instance due to the object name of the target business configuration object being different from the instance identifier of the corresponding target instance can be avoided.
[0104] In this embodiment, based on the instantiated subject in the target subject, an instantiated object of the target business configuration object is generated, and the subject field identifier and the attribute in the instantiated subject can be compared. If the field identifier of a subject field A is the same as attribute B, attribute B can be instantiated based on the value of subject field A.
[0105] To sum up, in the technical solutions of some embodiments of the present disclosure, by creating a theme template corresponding to the business configuration object in the business system in the business management platform, and creating an instantiated theme based on the theme template in the business management platform, the configuration management platform can instantiate the target business configuration object based on the instantiated theme, so that the business system can directly use the configuration data in the business management platform without performing data conversion operations, thereby reducing the complexity of using the configuration data.
[0106] In some embodiments, based on Figure 1 As described in, the instantiation request may be received by the configuration client; searching for a target subject matching the target business configuration object in step S1003 may include:
[0107] Configure the client to check whether the target topic exists in the local cache;
[0108] If it does not exist, search for the target topic from the configuration server;
[0109] If it exists, stop searching for the target topic from the configuration server.
[0110] Configuring the client to search for the target topic in the local cache first can reduce the number of interactions with the configuration server, thereby reducing the data query pressure on the configuration server.
[0111] In some embodiments, if the target topic does not exist in the local cache of the configuration client, and the configuration client finds the target topic from the configuration server, the method of the present disclosure may further include:
[0112] The configuration client saves the target topic found from the configuration server in the local cache and records the current version number of the target topic.
[0113] In this way, the next time the business system initiates an instantiation request for the target business configuration object, the configuration client can find the target subject in the local cache, thereby avoiding obtaining the target subject from the configuration server.
[0114] In some embodiments, based on Figure 1 The maintenance personnel or business personnel can update the configured theme on the business management platform, and the configuration server can synchronously modify the theme in the local storage and record the modification record for the theme based on the version number. After the configuration client saves the target theme in the local cache, the method of the present disclosure can also include:
[0115] The configuration client periodically queries the configuration server for the latest version number of the target theme, and if the latest version number is greater than the current version number, obtains the target theme with the latest version number from the configuration server, and updates the target theme in the local cache based on the target theme with the latest version number; and / or
[0116] When the configuration client receives the message sent by the configuration server indicating that the target topic is modified, the configuration client obtains the modified target topic from the configuration server to update the target topic in the local cache.
[0117] This ensures that the target topic of the configured client is up to date.
[0118] In some embodiments, the configuration server may update the target topic based on the following method:
[0119] In response to a request message for modifying a target subject in the service management platform, determining a personnel identifier of a maintenance personnel currently logged into the service management platform;
[0120] According to the correspondence between the pre-set personnel identification and operation authority, if it is determined that the maintenance personnel has the authority to modify the target subject, the modifications to the target subject are saved and the version number of the target subject is updated. If it is determined that the maintenance personnel does not have the authority to modify the target subject, the modifications to the target subject are rejected.
[0121] In this way, the target subject can be prevented from being modified by mistake, thus improving data security.
[0122] In some embodiments, the target subject has a subject condition script, which is used to define the effectiveness conditions corresponding to each instantiated subject in the target subject, and the instantiation request includes condition parameters; generating an instantiated object of the target business configuration object based on the target subject in step S1003 may include:
[0123] Determine the target effective condition that matches the condition parameter in the subject condition script;
[0124] Selecting a target instantiation topic corresponding to the target validation condition in the target topic;
[0125] Generate an instantiation object of the target business configuration object based on the target instantiation subject.
[0126] For example, assume that the target topic includes instantiated topic A and instantiated topic B. In the topic condition script, you can specify that instantiated topic A is applied to the grayscale test environment, and instantiated topic B is applied to the existing network environment. The condition parameters in the instantiation request can be used to specify the grayscale test environment or the existing network environment. Among them, when the environment specified by the condition parameters is the grayscale test environment, the target business configuration object can be instantiated based on the instantiated topic A; when the environment specified by the condition parameters is the existing network environment, the target business configuration object can be instantiated based on the instantiated topic B.
[0127] Through the subject condition script and condition parameters, different business scenarios can be distinguished, and the solution is more applicable.
[0128] In some embodiments, considering the configuration of the server as a multi-node cluster deployment solution, the present disclosure also provides a method for ensuring the consistency of read and write data of each node. Fig.11 , which is a schematic diagram of a method for ensuring the consistency of read and write data between multiple nodes provided by an embodiment of the present disclosure. Specifically, each node can communicate with each other based on the Hermes protocol. The configuration server can use the modifyTime returned by updating the database configuration as part of the attribute in LT, and notify all nodes in the cluster through refresh. For example, assuming there are three nodes A, B, and C, describe them in the order of events: node A writes KEY=1, node C writes KEY=2, node B reads the KEY configuration, node A reads the KEY configuration, and node C is down.
[0129] First, node A writes 1, and after completing the database update, it generates LT(A). Node C writes to the database and generates LT(C). A broadcasts the INV message first. B receives the LT(A) of KEY. At this time, the local LT of node B is changed to LT(A) and the cache is changed to invalid state. It replies with an ACK(A) message. C receives the INV message from A and does not modify the state because LT(C) is larger than LT(A). It replies with an ACK message. At this time, after A receives the message from each node, it starts to send the VAL(1, LT(A)) message. Since this message will be overwritten, the subsequent steps will not be discussed.
[0130] At this time, C broadcasts an INV message, B receives KEY's LT(C), changes the local LT(A) to LT(C), and replies with an ACK message. A receives KEY's LT(C), and because C's LT is greater than A's LT, A changes the local LT(A) to LT(C) and replies with ACK.
[0131] At this time, read from Node B. Because the data is being synchronized, the cache status of Node B is invalid and the following three solutions will be selected according to the strategy:
[0132] 1) Directly use the local cache data in the SDDK
[0133] 2) Replace the node according to the strategy and try to obtain data again
[0134] 3) Spin and wait for node data update to complete
[0135] At this time, C receives the ACK messages returned by all nodes, and then C broadcasts the VAL(2) message again, which contains LT(C) and the updated value. After receiving it, A compares it with the local LT(C). If they are consistent, A accepts the new value and changes the invalid state to valid. Similarly, node B changes to valid.
[0136] Node A receives the read request and directly returns the latest value 2 because the current status is valid.
[0137] If C crashes after broadcasting the INV message, both nodes AB will be in invalid and LT(C) states. AB has not received the VAL message yet. At this time, a node comes to A to read the configuration and finds that it is still invalid due to the lease expiration. It will replay A, that is, A sends an INV(LT(C)) message. After B receives LT, it finds that the state is the same as the local state and remains invalid. It sends ACK at the same time. After A receives ACK, it will send a VAL(1) message to recover.
[0138] Corresponding to the configuration management method, the present disclosure also provides a configuration management device. Fig.12 , which is a module diagram of a configuration management device provided by an embodiment of the present disclosure. Fig.12 In the configuration management device, the configuration management device includes:
[0139] The subject acquisition module 121 is used to acquire the subject created in the business management platform, the subject includes a subject template and an instantiated subject created based on the subject template, wherein the subject template represents the business configuration object in the business system, and the subject template includes a subject field, the subject field represents the attribute in the business configuration object, and the instantiated subject is the content obtained after assigning a value to the subject field in the subject template;
[0140] The request receiving module 122 is used to receive an instantiation request sent by the business system, where the instantiation request includes a target business configuration object to be instantiated;
[0141] The instantiation module 123 is used to search for a target subject that matches the target business configuration object, and generate an instantiation object of the target business configuration object based on the instantiation subject in the target subject.
[0142] In some embodiments, the configuration management platform includes a configuration server and a configuration client integrated in the business system, and the instantiation request is received by the configuration client; the instantiation module 123 is specifically used for:
[0143] Configure the client to check whether the target topic exists in the local cache;
[0144] If it does not exist, search for the target topic from the configuration server;
[0145] If it exists, stop searching for the target topic from the configuration server.
[0146] In some embodiments, when the target subject is found from the configuration server, the instantiation module 123 is further used to:
[0147] The configuration client saves the target topic found from the configuration server in the local cache and records the current version number of the target topic.
[0148] In some embodiments, after configuring the client to save the target topic in the local cache, the instantiation module 123 is further used to:
[0149] The configuration client periodically queries the configuration server for the latest version number of the target theme, and if the latest version number is greater than the current version number, obtains the target theme with the latest version number from the configuration server, and updates the target theme in the local cache based on the target theme with the latest version number; and / or
[0150] When the configuration client receives the message sent by the configuration server indicating that the target topic is modified, the configuration client obtains the modified target topic from the configuration server to update the target topic in the local cache.
[0151] In some embodiments, the instantiation module 123 is specifically used to update the target theme based on the following method:
[0152] In response to a request message for modifying a target subject in the service management platform, determining a personnel identifier of a maintenance personnel currently logged into the service management platform;
[0153] According to the correspondence between the pre-set personnel identification and operation authority, if it is determined that the maintenance personnel has the authority to modify the target subject, the modifications to the target subject are saved and the version number of the target subject is updated. If it is determined that the maintenance personnel does not have the authority to modify the target subject, the modifications to the target subject are rejected.
[0154] In some embodiments, each topic further includes a topic identifier; the instantiation module 123 is specifically used to:
[0155] In the case where the target business configuration object includes a target string modified by a specified annotation, searching for a subject whose subject identifier matches the target string as the target subject;
[0156] In the case that the target business configuration object does not include a target string modified by the specified annotation, a subject whose subject identifier matches the object name of the target business configuration object is searched and used as the target subject.
[0157] In some embodiments, the target theme has a theme condition script, which is used to define the effectiveness conditions corresponding to each instantiated theme in the target theme, and the instantiation request includes condition parameters; the instantiation module 123 is specifically used to:
[0158] Determine the target effective condition that matches the condition parameter in the subject condition script;
[0159] Selecting a target instantiation topic corresponding to the target validation condition in the target topic;
[0160] Generate an instantiation object of the target business configuration object based on the target instantiation subject.
[0161] The configuration management device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0162] The configuration management device disclosed in the present invention has the same beneficial effects as the above configuration management method, which will not be described in detail here.
[0163] The present disclosure also provides an electronic device having the above Fig.12 The configuration management device shown.
[0164] Combined with reference Fig.13 , is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. Fig.13 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.13 A processor 10 is taken as an example.
[0165] The processor 10 may be a first PCIe device, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0166] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0167] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0169] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0170] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0171] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0172] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A configuration management method, characterized in that: Applied to a configuration management platform, the method includes: Acquire a topic created in the business management platform, the topic including a topic template and an instantiated topic created based on the topic template, the topic template represents a business configuration object in the business system, and the topic template includes a topic field, the topic field represents an attribute in the business configuration object, and the instantiated topic is the content obtained after assigning a value to the topic field in the topic template; Receiving an instantiation request sent by the business system, the instantiation request including a target business configuration object to be instantiated; A target subject that matches the target business configuration object is searched, and an instantiated object of the target business configuration object is generated based on an instantiated subject in the target subject.
2. The method according to claim 1, characterized in that: The configuration management platform includes a configuration server and a configuration client integrated in the business system, and the instantiation request is received by the configuration client; The searching for a target subject that matches the target business configuration object includes: The configuration client searches the local cache for the target topic; If it does not exist, searching for the target topic from the configuration server; If it exists, stop searching for the target topic from the configuration server.
3. The method according to claim 2, characterized in that In the case where the target subject is found from the configuration server, the method further includes: The configuration client saves the target topic found from the configuration server in a local cache and records the current version number of the target topic.
4. The method according to claim 3, characterized in that After the configuration client saves the target topic in the local cache, the method further includes: The configuration client periodically queries the configuration server for the latest version number of the target subject, and if the latest version number is greater than the current version number, obtains the target subject with the latest version number from the configuration server, and updates the target subject in the local cache based on the target subject with the latest version number; and / or When the configuration client receives the message sent by the configuration server indicating that the target topic has been modified, the modified target topic is obtained from the configuration server to update the target topic in the local cache.
5. The method according to claim 4, characterized in that The configuration server updates the target topic based on the following method: In response to a request message for modifying the target subject in the service management platform, determining a personnel identification of a maintenance personnel currently logged into the service management platform; According to the correspondence between the pre-set personnel identification and the operation authority, if it is determined that the maintenance personnel has the authority to modify the target subject, the modifications to the target subject are saved and the version number of the target subject is updated; if it is determined that the maintenance personnel does not have the authority to modify the target subject, the modifications to the target subject are rejected.
6. The method according to claim 1 or 2, characterized in that: Each of said topics also includes a topic identification; The searching for a target subject that matches the target business configuration object includes: In the case where the target business configuration object includes a target string modified by a specified annotation, searching for a subject whose subject identifier matches the target string as the target subject; In the case that the target business configuration object does not include a target character string modified by a designated annotation, a subject whose subject identifier matches the object name of the target business configuration object is searched for as the target subject.
7. The method according to claim 1 or 2, characterized in that: The target theme has a theme condition script, and the theme condition script is used to define the effectiveness conditions corresponding to each instantiation theme in the target theme, and the instantiation request includes a condition parameter; The step of generating an instantiation object of the target business configuration object based on the target subject includes: Determine a target validation condition in the subject condition script that matches the condition parameter; Selecting a target instantiation topic corresponding to the target validation condition from the target topic; Based on the target instantiation subject, an instantiation object of the target business configuration object is generated.
8. A configuration management device, characterized in that: Applied to a configuration management platform, the device comprises: A theme acquisition module is used to acquire a theme created in the business management platform, wherein the theme includes a theme template and an instantiated theme created based on the theme template, wherein the theme template represents a business configuration object in the business system, and the theme template includes a theme field, wherein the theme field represents an attribute in the business configuration object, and the instantiated theme is the content obtained after assigning a value to the theme field in the theme template; A request receiving module, used to receive an instantiation request sent by the business system, wherein the instantiation request includes a target business configuration object to be instantiated; The instantiation module is used to search for a target subject that matches the target business configuration object, and generate an instantiation object of the target business configuration object based on the instantiation subject in the target subject.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the configuration management method according to any one of claims 1 to 7 by executing the computer instructions.
10. 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 configuration management method according to any one of claims 1 to 7.