Method for setting function signal, electronic device and computer program product

By generating and converting target function flag files and creating a function status query library, the problem of low efficiency of function flag configuration in multi-programming language systems is solved, and functional flags of different programming languages ​​are efficiently managed in a single location.

CN118779022APending Publication Date: 2024-10-15DELL PROD LP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310377418.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

It is difficult to efficiently configure function flags in a multi-programming language system with existing technology, causing developers to spend a lot of manpower, time and resources to set function flags in different programming languages ​​one by one.

Method used

By generating target function flag files with predetermined data formats, converting them into codes in multiple target programming languages, creating a function status query library, and sending corresponding target codes to the client to query and set function status.

Benefits of technology

It realizes rapid adaptation of function flag configurations of different programming languages ​​in a single location, improves configuration efficiency, and simplifies the management of multi-programming language systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779022A_ABST
    Figure CN118779022A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method for setting a function mark, electronic equipment and a computer program product. The method includes generating a target function flag file having a predetermined data format, wherein the target function flag file indicates a name and a target state of a target function. The method further includes generating a function state query library of the target function flag by converting the target function flag file into a plurality of target codes corresponding to the plurality of target programming languages. The method further includes querying, from a function state query library, a target code corresponding to a target programming language used by the client among the plurality of target programming languages, and sending the queried target code to the client, the target code indicating a target state of the target function. According to the method disclosed by the embodiment of the invention, the efficiency of configuring the function mark can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a method for setting a function flag, an electronic device, and a computer program product. Background Art

[0002] A feature flag, also known as a feature switch or feature switch, or feature flag, feature switch, feature switch, etc., is a technique used in software development to enable or disable certain features of an application or service without changing the functional code. It allows developers to turn on or off specific features of an application without having to deploy a new version of the software. Feature flags can be used to test new features, gradually roll out features, or create different versions for different applications. Feature flags can also be used to control access to certain features of a specific component.

[0003] For each application on the system, there are function flags corresponding to multiple functions. The programming languages ​​of these applications may be different, and their requirements and data formats are also different. Conventional solutions only support specific programming languages ​​and are not suitable for systems with multiple programming languages. Therefore, separate solutions are required for systems with multiple programming languages. If developers are asked to set function flags for different applications one by one according to different functions and in different locations in different programming languages, it will take a lot of manpower, time and resources. Summary of the invention

[0004] According to an exemplary embodiment of the present disclosure, a technical solution for setting a function flag is provided, which can be used to quickly adapt the function flag to multiple applications with different programming languages.

[0005] In the first aspect of the present disclosure, a method is provided, which may include: generating a target function flag file having a predetermined data format, the target function flag file indicating the name and target state of the target function. Generate a function state query library for the target function flag by converting the target function flag file into multiple target codes corresponding to multiple target programming languages. Query the target code corresponding to the target programming language used by the client in the multiple target programming languages ​​from the function state query library. And send the queried target code to the client, the target code indicating the target state of the target function. Implementing the method provided in the first aspect can improve the efficiency of configuring function flags.

[0006] In the second aspect of the present disclosure, an electronic device is provided. The electronic device includes: a processor, and a memory coupled to the processor, the memory having instructions stored therein, and the instructions, when executed by the electronic device, cause the electronic device to perform operations, including: generating a target function flag file having a predetermined data format, the target function flag file indicating the name and target state of the target function. A function state query library of the target function flag is generated by converting the target function flag file into multiple target codes corresponding to multiple target programming languages. The target code corresponding to the target programming language used by the client in the multiple target programming languages ​​is queried from the function state query library. And the queried target code is sent to the client, and the target code indicates the target state of the target function. Implementing the electronic device provided by the second aspect can improve the efficiency of configuring function flags.

[0007] In a third aspect of the present disclosure, there is provided a computer program product, which is tangibly stored on a computer-readable medium and comprises computer-executable instructions which, when executed, cause a computer to perform the method according to the first aspect of the present disclosure.

[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a device, the device executes the method according to the first aspect of the present disclosure.

[0009] It can be seen from the above description that according to the solutions of the various embodiments of the present disclosure, the efficiency of configuring function flags can be improved. It should be understood that the invention summary is provided to introduce the selection of concepts in a simplified form, which will be further described in the specific implementation below. The invention summary is not intended to identify the key features or main features of the present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0011] Figure 1 A schematic diagram showing application scenarios according to some embodiments of the present disclosure is shown;

[0012] Figure 2 A flowchart of a method for setting a function flag according to some embodiments of the present disclosure is shown;

[0013] Figure 3 A schematic diagram showing an architecture for setting a function flag according to some embodiments of the present disclosure is shown;

[0014] Figure 4 A schematic diagram of building a query client according to some embodiments of the present disclosure is shown;

[0015] Figure 5 A schematic diagram showing functional status file merging according to some embodiments of the present disclosure; and

[0016] Figure 6 A schematic structural diagram of a device that can be used to implement an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0017] 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 described herein, which are instead provided for 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.

[0018] 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 "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0019] Feature flags are a technology used in software development to enable or disable features without changing the code. This can be achieved through configuration files or code. However, programs in other programming languages ​​cannot read and execute code in a certain programming language. For different applications on a system that use different programming languages, it is a labor-intensive, time-consuming, and resource-intensive task for developers to set feature flags in different programming languages ​​one by one according to different functions. For example, a storage device that supports containerized applications may have different containers and applications compiled in different programming languages. If feature flags are set in different locations for containers and applications in different programming languages, it is very labor-intensive, time-consuming, and resource-intensive. Therefore, there is room for improvement.

[0020] The present disclosure proposes a method for setting a function flag, an electronic device, and a computer program product. The method for setting a function flag includes: generating a target function flag file having a predetermined data format, the target function flag file indicating the name and target state of the target function. A function state query library for the target function flag is generated by converting the target function flag file into multiple target codes corresponding to multiple target programming languages. The target code corresponding to the target programming language used by the client in multiple target programming languages ​​is queried from the function state query library. And the queried target code is sent to the client, and the target code indicates the target state of the target function. By implementing the method proposed in the present disclosure, the function flag can be defined in the required format at a single location, and for different applications of different programming languages, query client libraries corresponding to different programming languages ​​can be generated to adapt to different applications, so that the function flag can be easily added, deleted, and modified at a single location, which improves the efficiency of configuring the function flag.

[0021] Figure 1 A schematic diagram 100 of an application scenario according to some embodiments of the present disclosure is shown. Figure 1 As shown, multiple applications such as application 102-1, application 102-2, application 102-3, ..., application 102-N are deployed in system 101. In some embodiments, system 101 may also include components, services, modules, libraries, etc., which are not limited in this embodiment. Applications can run independently of each other and may use different programming languages, such as java, c, c++, python, bash, etc. In some embodiments of the present disclosure, system 101 can configure different application programming interfaces (APIs) for different applications for deployment and management. Different applications, components or containers can provide their own APIs, and developers can choose appropriate technologies and APIs to manage them according to their needs. Since system 101 provides a variety of APIs, it can be easily accessed and operated through different programming languages. Even if different applications use different programming languages, function flags can be configured in system 101.

[0022] In some embodiments, system 101 may be a storage system for providing efficient, flexible and scalable data storage, on which multiple containers are deployed to support flexible deployment and expansion of their capacity or performance. Each of these containers is an independent virtualized operating environment, containing applications, components, and required software and configuration information, and different operating systems and applications may be deployed on different containers. System 101 can provide storage resources for containers, and these resources can be accessed by applications running in containers. In a container storage system, each container has its own storage space and can be managed and controlled independently. This approach can better provide flexibility and scalability, while also enhancing security and isolation to prevent interference and influence between containers.

[0023] In some embodiments of the present disclosure, when storage resources need to be provided for containers, appropriate function flags can be set to enable or disable in the storage system to ensure that the container can access the required storage functions. Developers can flexibly enable or disable some storage functions for different containers or different applications by configuring function flags in the storage system as needed. For example, the automatic thin provisioning function can be enabled or disabled by setting the "thin_provision" flag, the snapshot and clone functions can be enabled or disabled by setting the "snapshot_clone" flag, the backup and restore functions can be enabled or disabled by setting the "backup_restore" flag, and the data compression and deduplication functions can be enabled or disabled by setting the "compression_dedupe" flag.

[0024] In some application scenarios, feature flags are often used to control the release of new, unfinished features. Release flags are defined in a single feature flag definition file for the entire system or product. Feature developers use feature flags as code switches to control the behavior of features in different applications. Each feature flag has a default state: enabled or disabled. During feature development, feature flags remain in the disabled state. After the feature is ready, the feature flag can be changed to enabled. During development, for testing purposes, the product can allow developers or testers to override the default state at installation time or runtime. It allows developers to gradually roll out new features in an online environment without having to wait until all features are completed before releasing them. In this way, developers can gradually test and optimize new features and eventually release them to all applications.

[0025] In some embodiments of the present disclosure, a function flag framework is provided as a general software that can provide the function of enabling or disabling functions for multiple applications in the system without changing the function code. Using this framework, the system can define its function flags in the required format in a single location throughout the system, and based on the function flags and the supported APIs to control the enabling or disabling of functions on different components. In addition, if a function state override is required, a function state override file is generated in the required format at the appropriate time. By calling the function state generation script provided by the function flag framework, a target function state file is generated at the appropriate time. In some embodiments, the function state query library provided by the framework can be used by different applications of the system to query the function state and perform function control. The framework in the embodiment of the present disclosure is an extensible function flag framework, and the framework can be conveniently enhanced to support new other types of function flags when necessary. The framework also supports verification of function flag files, code generation, and function state query libraries in multiple programming languages. The specific description can be combined with reference to subsequent embodiments.

[0026] Figure 2 A flowchart of a method 200 for setting a function flag according to some embodiments of the present disclosure is shown, and the method 200 can be performed by an electronic device. The electronic device may include, but is not limited to, a personal computer (PC), a server computer, a handheld or laptop device, a mobile terminal, a multiprocessor system, or a combination thereof. The embodiments of the present disclosure do not impose any restrictions on the device type of the electronic device implementing the method 200. It should be understood that in the embodiments of the present disclosure, the subject implementing the method 200 can be implemented by one entity device or by multiple entity devices. It can be understood that the subject implementing the method 200 can be a logical function module in a physical device or a logical function module composed of multiple entity devices. It should be understood that in the following embodiments of the present disclosure, the various steps in the method provided in the embodiments of the present disclosure can be performed by one entity device, or by multiple entity devices in collaboration, and the embodiments of the present disclosure do not impose any restrictions on this. In some embodiments, the electronic device may include multiple applications using different programming languages. It should be understood that the method 200 may also include additional frames not shown and / or the frames shown may be omitted, and the scope of the present disclosure is not limited in this respect.

[0027] In box 201, a target function flag file having a predetermined data format is generated, and the target function flag file indicates the name and target state of the target function. In box 202, a function state query library of the target function flag is generated by converting the target function flag file into multiple target codes corresponding to multiple target programming languages. In box 203, the target code corresponding to the target programming language used by the client in the multiple target programming languages ​​is queried from the function state query library. In box 204, the queried target code is sent to the client, where the target code indicates the target state of the target function. Implementing this method 200 can improve the efficiency of configuring function flags for multiple clients using different programming languages. Figure 2 The described method embodiments can be combined with the following Figures 3 to 6 to understand through the examples.

[0028] In combination with the foregoing embodiments, in some embodiments of the present disclosure, a function flag default file having a predetermined data format is generated, the function flag default file indicates the default state of the target function under the initial setting. A function flag override file having a predetermined data format is generated, the function flag override file indicates the default state of the target function under the override condition. And a target function flag file is generated according to the function flag default file and the function flag override file.

[0029] In some embodiments of the present disclosure, when a function flag override file is detected, the default state in the function flag override file is overwritten with the default state in the function flag default file as the target state in the target function flag file. Figure 5 Described embodiments.

[0030] In combination with other embodiments, in some other embodiments of the present disclosure, the status of the function flag setting includes: enabled, disabled, etc. The predetermined data format may be in JSON format. The default status of the target function under the initial setting is disabled, and the default status of the target function under the overwrite condition is enabled. The function flag default file also includes dependencies, which indicate the subordinate relationship with the function status of other function flags.

[0031] In some other embodiments of the present disclosure, in response to receiving a query request from a client using a target programming language, target codes corresponding to multiple target programming languages ​​can be queried from a function status query library, and the query request carries the name of the target function.

[0032] In some other embodiments of the present disclosure, a function status query library can be constructed based on multiple programming languages ​​and target function flag files, and the function status query library includes codes indicating the target state of the target function corresponding to each of the multiple target programming languages. And the function status query library obtains the runtime path of the target function flag file from the target function flag file. In some other embodiments of the present disclosure, the function status query library provides multiple application programming interfaces corresponding to multiple clients; and by using multiple application programming interfaces, multiple clients are configured with query paths for the target state of the target function flag. Specifically, you can refer to Figure 4 Described embodiments.

[0033] In one example, a second target function flag file having a predetermined data format may be generated, the second target function flag file indicating a second name and a second target state of the second target function. Then, a functional state query library of the second target function flag is generated by converting the second target function flag file into a plurality of target codes corresponding to a plurality of target programming languages. In another example, the target function flag file may be converted into a second target code corresponding to the second target programming language according to the second target programming language used by the second client in the plurality of target programming languages. According to the query request of the second client, the second target code corresponding to the second target programming language is queried from the functional state query library. The queried second target code is sent to the second client, and the second target code indicates the target state of the target function.

[0034] Figure 3 An architecture 300 for setting function flags provided by some embodiments of the present disclosure is shown. The architecture 300 is designed from a general software perspective, which provides product-independent functions and defines a general API that products need to follow, so as to provide the function of function flags for different components in different programming languages. Using this framework, the system can define its function flags in a single location in the entire system in the required format, and control the enabling or disabling of functions on different applications based on the function flags and the supported APIs.

[0035] like Figure 3 As shown, the function framework 301 supports verification 302 of function flag files, code generation 303, function status query client 304 of multiple programming languages, and function status generation script 305, etc. The system 306 includes a function flag default file 307, function status generation 308, function flag coverage file 309, function coverage information generation 310, target function flag file 311, function status query client 312, etc. The dedicated code library function framework 301 for setting function flags in the embodiment of the present disclosure is product-agnostic and extensible, and can support other types of function flags that may appear in the future.

[0036] The feature state can be set using a feature flag definition file in json format. There is usually a default configuration file 307, such as feature_flags_default.json. If a feature state override is required, a feature flag override file 309, such as feature_override.json, is generated 310 at the appropriate time in the required format. By calling the feature state generation script 305 provided by the feature framework 301, such as "feature_state_generation.py", a target feature flag file 311, such as "feature_flags.json", is generated at the appropriate time. All feature flags for the system can be defined in this single file. The feature flag file must define the "features" in the feature list, and each feature includes the following attributes: name, default state, dependencies, etc. The name is name, which is used to identify a unique name. The default state is default_state, and the default state can be enabled or disabled or null. Valid values ​​can be, for example, enabled or disabled, 1 or 0, true or false, etc.; the dependency is depends_on, which is a list of dependency flags. Circular dependencies or the default state of the dependency option is inconsistent with the current option are not allowed. For an Enable flag, all dependent flags must be in the Enabled state.

[0037] A feature state query client 304 may be constructed based on the feature flag configuration file and source code. During construction, feature flag file verification 302 and code generation 303 may be performed based on the feature flag definition file. For details, please refer to Figure 4 A schematic diagram 400 of building a query client is shown.

[0038] like Figure 4As shown, based on the function flag default file 403 (such as feature_flags_default.json) of the system warehouse 402, the runtime file path 404 of the target function state file (also referred to as the active function state file) provided in the function framework 401, and the source code provided by the function state query client 406 as input, the function state query client 407 is constructed by the code generator 405. The code generation script provided by the code generator 405 can verify the function flag file 403, and the code generation script can also generate the runtime file path 404 of the target function state file into the function state query client 407 code, and finally construct the function state query client 407 in multiple programming languages. In some embodiments, the function state query client 407 reports the function state by reading the target function state file. In some embodiments, the function state query client 407 provided by the framework can be used by different applications of the system to query the function state and perform function control.

[0039] The constructed feature status query client 407 may include multiple feature status query clients in multiple languages ​​(such as java / c / c++ / python / bash / etc.). Each query client may provide a function similar to "boolisFeatureEnabled( <flag>)" API to report the feature status once the feature status file is loaded into the storage. The feature flag can be used as a switch to control whether the feature is turned on or off. For example, by using the function featureStateQueryClient.isFeatureEnabled("FEATURE_A"), using the if-else conditional statement, check whether the feature FEATURE_A is enabled in the application. If the feature is enabled, execute the code in the if statement block. Otherwise, execute the code in the else statement block.

[0040] The feature status client is a client library for querying and managing feature status, which can generate corresponding APIs for different programming languages. For example, it is used to dynamically query and modify feature status, thereby realizing dynamic configuration and control of functions. In some embodiments, when the application starts or runs, the current feature status can be obtained by querying the feature status client. For example, the application queries the status of the specified feature by calling the featureStateQueryClient.isFeatureEnabled(featureName) method. If the feature has been enabled, the return value of the function may be enabled, otherwise it is disabled. When deploying the featureStateQueryClient library, you need to ensure that it can access the feature status storage location (such as a database or cache system) in order to correctly query and modify the feature status. The featureStateQueryClient client library can provide an API interface for accessing and modifying feature status.

[0041] In some embodiments, the process of building a query client library may include: according to the selected programming language, finding a source code client library suitable for the language, and downloading or installing the library. According to the selected code generator, use the code generator to generate the API code of the client library. Some code generators can also generate code for executing function files on applications. Specify the function file path so that the client library knows which function file to query. Generate and build the client library so that the application can use it to query the function status. The query client library finally built usually includes an API for querying the function status. For example, for the Python language, the query client library may provide a set of Python APIs to process and execute requests to query the function status. For the C language, the query client library may provide a set of C functions to perform the same operation. Depending on the source code client library and the code generator, the client library finally generated may contain different types of APIs, such as functions, classes, structures, etc., to meet the needs of specific programming languages ​​and usage scenarios.

[0042] The code generator can automatically generate the client query library used by the programming language according to the needs and requirements of a specific programming language. Generally, the code generator generates the client query library code corresponding to the file according to the function flag definition in a JSON file. Specifically, the code generator needs to parse the configuration file first, such as reading the function flag information from the JSON configuration file and converting it into a data structure inside the program. Then, the code generator automatically generates the client query library code of the corresponding programming language according to the content of the data structure. In some embodiments, when parsing the JSON file, the code generator usually verifies the format and structure of the file and ensures that the required fields and data types are contained in the file. If the file format is incorrect, an exception or error may be raised. Then build the query and use the API provided by the query library to build a query statement suitable for a specific client. Different query statements can be generated according to the value of the function flag. Then use a template engine or a code generator to generate code and embed the query statement provided by the query library into the code. The generated code should comply with the client-specific language and code specifications. Then save the generated code file to an appropriate location. The code can be packaged and published to the client as needed. It should be noted that different programming languages ​​and query libraries may have different capabilities and limitations, so appropriate handling is required for different languages ​​and libraries. This may require fine-tuning the code generation process or adding more conditional statements to ensure that the generated code can run correctly and meet the needs of specific clients.

[0043] When generating code, the code generator needs to consider the following factors: The syntax and specifications of the programming language: Different programming languages ​​have different syntax and specifications. The code generator needs to generate code according to the syntax and specifications of the target programming language. The implementation method of the conditions and rules for enabling feature flags: The implementation method of the conditions and rules for enabling feature flags may vary depending on the programming language. For example, in Python, a dictionary (dict) can be used to store the feature flag status; in Java, a map (Map) or an interface (Interface) can be used to implement it. Design of the client API: The client API is usually designed according to the characteristics and syntax of the programming language. The code generator needs to design an easy-to-use and understand client API according to the requirements of the programming language. Once the code generator generates the client query library code, the developer can map it to the application and use the library to handle the feature flag status.

[0044] In some embodiments, in a feature flag-based architecture, a JSON file can be used to define all feature flags. This JSON file can be stored in the cloud or locally and can be shared by multiple client applications. For application clients in different programming languages, the feature flags need to be parsed and processed in order to dynamically enable or disable functions in the application. By providing a feature flag client library for multiple programming languages, the feature flag function can be implemented quickly and conveniently. The query client library generates a code library that helps application developers easily use feature flags, including functions for parsing feature flag JSON files, etc. The feature flag client library can be written in various programming languages ​​and can provide a feature flag parser for the programming language. These parsers can read and parse JSON files, store feature flags and their corresponding states in memory, so that applications can easily query and use these feature flags. In addition to parsing JSON files, the feature flag client library can also provide other functions, such as supporting multiple feature flag enabling conditions and rules, providing client APIs, etc.

[0045] The information obtained by different APIs can be different, depending on the functionality and accessible data provided by developers when implementing the API interface. For example, a basic API interface may only provide status information (enabled or disabled) of a feature flag, while other more complex APIs may provide more information, such as the name, description, target audience, etc. of the feature flag. In addition, there are some APIs that allow application clients to dynamically create, modify, and delete feature flags, allowing application clients to implement more flexible and adaptive functions. A feature flag can also correspond to multiple APIs, such as different operations for querying, creating, modifying, or deleting the feature. Depending on the requirements, developers can define the corresponding URL path, HTTP method, and parameters for each API, and implement the corresponding logic to handle client requests.

[0046] When using feature flags, there is usually a default JSON configuration file that contains the default values ​​for all feature flags. In addition, an optional override JSON configuration file can be provided to override the default values ​​of some feature flags to different values. The default and override values ​​need to be merged together to determine the final target value for each feature flag.

[0047] refer to Figure 5 Schematic diagram 500 of feature state file merging is shown. A feature state generation script 503 (such as feature_state_generation.py) merges a feature flag default file 501 (such as feature_flags_default.json) and a possible feature flag override file 502 (such as feature_override.json) to generate a target feature flag file (or called an active feature flag file, such as feature_flags.json). The feature flag target file is a single source for all feature state query clients. For example, the default state in the feature flag default file of Feature_A is disabled, the default state in the target feature flag file is disabled, the default state in the generated feature flag override file is enabled, the feature flag default file and the feature flag override file are merged, the feature state in the feature flag override file overrides the feature state of the feature flag default file, and the current feature state in the generated target feature flag file is enabled.

[0048] In some embodiments, the manner of merging the default JSON file and the override JSON file can be implemented by the following steps: Parse the default JSON file into a dictionary or mapping and store it in memory. If an override JSON file exists, parse it into a dictionary or mapping and merge it with the dictionary of the default JSON file. If a flag is defined in the override JSON file, replace the default value with the value in the override JSON file. Otherwise, keep the default value. Use the merged dictionary or mapping as the state of the client library and use it to determine the final value of each flag when querying the flag state.

[0049] According to the various embodiments of the present disclosure described above and their combined embodiments, the efficiency of configuring the functional state can be improved. Figures 3 to 5 The implementation method shown in the figure is only for reference. Figures 3 to 5 The architecture or process illustrated in the figure may have other different forms, and may also include more or fewer functional modules and / or units. These modules and / or units may be partially or fully implemented as hardware modules, software modules, firmware modules or any combination thereof, and the embodiments of the present disclosure are not limited to this.

[0050] It is to be understood that the specific names and / or protocols of the various components in the system described herein are only to help those skilled in the art to better understand the concept of the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Moreover, in other embodiments, more or better components may be included, and alternative components with the same or similar functions may also be included.

[0051] Figure 6 1 shows a schematic structural diagram of an example device 600 that can be used to implement some embodiments of the present disclosure. The device 600 can be implemented as a server or a PC, etc. The embodiments of the present disclosure do not limit the specific implementation type of the device 600. Figure 6 As shown, the device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0052] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0053] The processing unit 601 can perform the various methods and / or processes described above, such as the method 200. For example, in some embodiments, the method 200 can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more steps of the method 200 described above can be performed. Alternatively, in other embodiments, the CPU 601 can be configured to perform the method 200 in any other suitable manner (e.g., by means of firmware, etc.).

[0054] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.

[0055] In some embodiments, the methods and processes described above may be implemented as a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0056] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0057] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0058] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, and conventional procedural programming languages. The computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server.

[0059] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer or other programmable data processing device, thereby producing a machine so that when these instructions are executed by the processing unit of a computer or other programmable data processing device, a device for realizing the functions / actions specified in one or more boxes in the flow chart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions make the computer, programmable data processing device and / or other equipment work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for realizing various aspects of the functions / actions specified in one or more boxes in the flow chart and / or block diagram. Computer-readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device, so that a series of operating steps are performed on the computer, other programmable data processing device or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing device, or other device realize the functions / actions specified in one or more boxes in the flow chart and / or block diagram.

[0060] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0061] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart, and the combination of frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0062] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0063] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

[0064] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.< / flag>

Claims

1. A method for setting a function flag, the method comprising: generating a target function flag file having a predetermined data format, wherein the target function flag file indicates a name and a target state of a target function; Generate a function status query library of the target function flag by converting the target function flag file into a plurality of target codes corresponding to a plurality of target programming languages; Querying the function status query library for a target code corresponding to a target programming language used by the client among the plurality of target programming languages; as well as The queried target code is sent to the client, where the target code indicates the target state of the target function.

2. The method according to claim 1, further comprising: generating a function flag default file having the predetermined data format, wherein the function flag default file indicates a default state of the target function under initial settings; Generate a function flag override file having the predetermined data format, wherein the function flag override file indicates a default state of the target function in an override situation; as well as The target function flag file is generated according to the function flag default file and the function flag override file. 3 . The method according to claim 2 , wherein a default state of the target function in the initial setting is disabled, and a default state of the target function in the overlay situation is enabled.

4. The method according to claim 2, wherein generating the target function flag file according to the function flag default file and the function flag override file comprises: When the function flag override file is detected, the default state in the function flag default file is overwritten with the default state in the function flag override file as the target state in the target function flag file.

5. The method according to claim 2, wherein the function flag default file also includes a dependency relationship, wherein the dependency relationship indicates a subordinate relationship with the function status of other function flags.

6. The method according to claim 1, further comprising: In response to receiving a query request from the client using the target programming language, querying the target codes corresponding to the multiple target programming languages ​​from the function status query library, the query request carrying the name of the target function.

7. The method according to claim 1, further comprising: Constructing the function status query library according to the multiple programming languages ​​and the target function flag file, wherein the function status query library includes codes indicating the target status of the target function corresponding to each of the multiple target programming languages; as well as The function status query library obtains the runtime path of the target function flag file from the target function flag file.

8. The method according to claim 7, further comprising: The function status query library provides a plurality of application programming interfaces corresponding to a plurality of clients; as well as The query paths of the multiple clients for the target status of the target function flag are configured by using the multiple application programming interfaces.

9. The method according to claim 1, further comprising: generating a second target function flag file having a predetermined data format, wherein the second target function flag file indicates a second name and a second target state of the second target function; as well as The function status query library of the second target function flag is generated by converting the second target function flag file into multiple target codes corresponding to multiple target programming languages.

10. The method according to claim 1, further comprising: According to a second target programming language among the plurality of target programming languages, converting the target function flag file into a second target code corresponding to the second target programming language; According to a query request of the second client, querying the function status query library for the second target code corresponding to the second target programming language used by the second client; as well as The queried second target code is sent to the second client, where the second target code indicates the target state of the target function.

11. An electronic device, comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, the instructions causing the electronic device to perform operations when executed by the processor, the operations comprising: generating a target function flag file having a predetermined data format, wherein the target function flag file indicates a name and a target state of a target function; Generate a function status query library of the target function flag by converting the target function flag file into a plurality of target codes corresponding to a plurality of target programming languages; Querying the function status query library for a target code corresponding to a target programming language used by the client among the plurality of target programming languages; and The queried target code is sent to the client, where the target code indicates the target state of the target function.

12. The electronic device of claim 11, the operations further comprising: generating a function flag default file having the predetermined data format, wherein the function flag default file indicates a default state of the target function under initial settings; Generate a function flag override file having the predetermined data format, wherein the function flag override file indicates a default state of the target function in an override situation; as well as The target function flag file is generated according to the function flag default file and the function flag override file. 13 . The electronic device according to claim 12 , wherein a default state of the target function in the initial setting is disabled, and a default state of the target function in the overlay situation is enabled.

14. The electronic device according to claim 12, wherein the operation of generating the target function flag according to the function flag default file and the function flag override file comprises: When the function flag override file is detected, the default state in the function flag default file is overwritten with the default state in the function flag override file as the target state in the target function flag file.

15. The electronic device of claim 11, the operations further comprising: In response to receiving a query request from the client using the target programming language, querying the target codes corresponding to the multiple target programming languages ​​from the function status query library, the query request carrying the name of the target function.

16. The electronic device of claim 11, the operations further comprising: Constructing the function status query library according to the multiple programming languages ​​and the target function flag file, wherein the function status query library includes codes indicating the target status of the target function corresponding to each of the multiple target programming languages; as well as The function status query library obtains the runtime path of the target function flag file from the target function flag file.

17. The electronic device of claim 11, the operations further comprising: The function status query library provides a plurality of application programming interfaces corresponding to a plurality of clients; as well as The query paths of the multiple clients for the target status of the target function flag are configured by using the multiple application programming interfaces.

18. The electronic device of claim 11, the operations further comprising: generating a second target function flag file having a predetermined data format, wherein the second target function flag file indicates a second name and a second target state of the second target function; as well as The function status query library of the second target function flag is generated by converting the second target function flag file into multiple target codes corresponding to multiple target programming languages.

19. The electronic device of claim 11, the operations further comprising: According to a second target programming language among the plurality of target programming languages, converting the target function flag file into a second target code corresponding to the second target programming language; According to a query request of the second client, querying the second target code corresponding to the second target programming language used by the second client from the function status query library; as well as The queried second target code is sent to the second client, where the second target code indicates the target state of the target function.

20. A computer program product tangibly stored on a non-transitory computer readable medium and comprising computer executable instructions that when executed cause a computer to: generating a target function flag file having a predetermined data format, wherein the target function flag file indicates a name and a target state of a target function; Generate a function status query library of the target function flag by converting the target function flag file into a plurality of target codes corresponding to a plurality of target programming languages; Querying the function status query library for a target code corresponding to a target programming language used by the client among the plurality of target programming languages; as well as The queried target code is sent to the client, where the target code indicates the target state of the target function.