Disclosure of Invention
The application aims to provide a functional module configuration method and system, electronic equipment and a computer readable storage medium, and the usability and the working efficiency of the module are improved.
In order to achieve the above object, the present application provides a method for configuring a functional module, including:
acquiring a target configuration file written for a functional module in advance;
Extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and corresponding calendar information, and writing the packaged configuration information into a calendar plug-in;
When the functional module operates, acquiring target configuration information corresponding to a current time node by reading the packaged configuration information in the calendar plug-in;
and updating the functional module by utilizing the target configuration information so that the functional module realizes the function corresponding to the target configuration information.
Optionally, the obtaining a target configuration file written in advance for the functional module includes:
Acquiring an initial configuration file corresponding to the functional module;
and returning the initial configuration file to the user terminal so that the user terminal adds function module configuration information corresponding to different time nodes in the initial configuration file to obtain the target configuration file.
Optionally, the updating the function module with the target configuration information to enable the function module to implement a function corresponding to the target configuration information includes:
if the target configuration information comprises the call quota of the virtual resource, modifying the original call quota into a target call quota corresponding to the target configuration information;
After receiving a call request for the virtual resource, judging whether an actual call allowance corresponding to the call request exceeds the target call allowance;
If yes, returning a first prompt message exceeding the call limit, and prohibiting the response to the call request;
if not, allowing to respond to the call request.
Optionally, after modifying the original call quota to the target call quota corresponding to the target configuration information, the method further includes:
And returning second prompt information to the user of the functional module, wherein the second prompt information is used for prompting the resource to call the quota adjustment.
Optionally, the method further comprises:
Receiving a setting instruction for configuring an update period for a functional module;
And acquiring an updating time period according to the setting instruction so as to read the packaged configuration information in the calendar plug-in at regular time according to the updating time period.
Optionally, when the function module operates, the obtaining, by reading the packaged configuration information in the calendar plug-in, target configuration information corresponding to a current time node includes:
when the functional module operates, judging whether the corresponding updating time period exists or not;
if yes, the packaged configuration information in the calendar plug-in is read regularly according to the updating time period so as to acquire target configuration information corresponding to the current time node;
And if not, the packaged configuration information in the calendar plug-in is read at regular time according to a default time period so as to acquire target configuration information corresponding to the current time node.
To achieve the above object, the present application provides a function module configuration system, including:
the file acquisition module is used for acquiring a target configuration file written for the functional module in advance;
The configuration binding module is used for extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and the corresponding calendar information, and writing the packaged configuration information into the calendar plug-in;
The configuration reading module is used for obtaining target configuration information corresponding to the current time node by reading the packaged configuration information in the calendar plug-in when the functional module operates;
And the function updating module is used for updating the function module by utilizing the target configuration information so as to enable the function module to realize the function corresponding to the target configuration information.
Optionally, the method further comprises:
the instruction receiving module is used for receiving a setting instruction aiming at the function module configuration update period;
and the period acquisition module is used for acquiring an updating time period according to the setting instruction so as to read the packaged configuration information in the calendar plug-in at regular time according to the updating time period.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
A processor for implementing the steps of any of the functional module configuration methods disclosed above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the function module configuration methods disclosed above.
According to the technical scheme, the function module configuration method comprises the steps of obtaining a target configuration file written for a function module in advance, extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and corresponding calendar information, writing the packaged configuration information into a calendar plug-in unit, obtaining the target configuration information corresponding to the current time node by reading the packaged configuration information in the calendar plug-in unit when the function module operates, and updating the function module by utilizing the target configuration information so that the function module achieves functions corresponding to the target configuration information. According to the method, the configuration information corresponding to different time nodes is written in the target configuration file in advance, after the target configuration file is obtained, the configuration information and the corresponding calendar information can be bound and packaged, the packaged information comprises daily date information and daily function module configuration information, when the function module operates, the function module configuration can be updated according to the date information through the calendar plug-in, the function update of the function module is automatically realized, the configuration file does not need to be manually modified at the appointed time, and the usability and the working efficiency of the module are effectively improved.
The application also discloses a functional module configuration system, electronic equipment and a computer readable storage medium, and the technical effects can be realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the related art, if the configuration file needs to be changed according to perpetual calendar time, a user is required to manually change the configuration file by reading the function module for changing the configuration file, so that the efficiency is low and the usability is poor.
Therefore, the embodiment of the application discloses a functional module configuration method, which effectively improves the usability and the working efficiency of the module.
Referring to fig. 1, a method for configuring a functional module according to an embodiment of the present application includes:
s101, acquiring a target configuration file written for a functional module in advance;
In the embodiment of the application, the target configuration file written for the functional module in advance can be firstly obtained, the target configuration file is specifically used for configuring the functional functions and the like which can be realized by the functional module, and in the specific implementation, the configuration file can be specifically in an XML (Xtensible Markup Languag extensible markup language) format.
As a possible implementation manner, the process of obtaining the target configuration file written for the functional module in advance may specifically include obtaining an initial configuration file corresponding to the functional module, and returning the initial configuration file to the user terminal, so that the user terminal adds configuration information of the functional module corresponding to different time nodes in the initial configuration file to obtain the target configuration file. That is, initial values of various configuration information of the functional module may be included in the initial configuration file. The developer can modify and update the initial configuration file through the user terminal, and write the configuration information of the function modules corresponding to different time nodes into the initial configuration file to obtain the target configuration file comprising the configuration information according to time.
As another possible implementation manner, the process of obtaining the target configuration file written in advance for the functional module may specifically include obtaining the required target configuration file by means of copying from an external storage device. That is, the external storage device may be used to copy the target configuration file from the preset device, and then copy the target configuration file in the external storage device to the current device, so as to obtain the file.
S102, extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and corresponding calendar information, and writing the packaged configuration information into a calendar plug-in;
in this step, functional module configuration information corresponding to different time nodes may be extracted from the target configuration file obtained in the above step, and then binding and packaging the functional module configuration information and the corresponding calendar information, to obtain packaged configuration information, and writing the packaged configuration information into the calendar plug-in.
It should be noted that, in this step, the function module configuration information may be extracted from the target configuration file specifically by means of keyword extraction. Binding and packaging the configuration information of the function module and the corresponding calendar information, namely, the configuration information after binding comprises date information and configuration files corresponding to the date, and writing the configuration information after packaging into a calendar plug-in through an interface.
S103, when the functional module operates, acquiring target configuration information corresponding to a current time node by reading the packaged configuration information in the calendar plug-in;
in a specific implementation, when the functional module is running, the target configuration information corresponding to the current time node can be obtained by reading the packaged configuration information in the calendar plug-in.
In a preferred implementation manner, the embodiment of the application can also receive a setting instruction for configuring an update period for the functional module, and acquire the update time period according to the setting instruction so as to read the packaged configuration information in the calendar plug-in at regular time according to the update time period. That is, the user can set the update time period according to the actual requirement, and the subsequent functional module can acquire the configuration to perform the timing update according to the set update time period.
Specifically, when the functional module is running, it may be determined whether the corresponding update time period exists, that is, whether a time period set by the user exists. If the target configuration information does not exist, the packaged configuration information in the calendar plug-in can be read regularly according to the default time period so as to acquire the target configuration information corresponding to the current time node.
And S104, updating the functional module by utilizing the target configuration information so as to enable the functional module to realize the function corresponding to the target configuration information.
It can be understood that after the target configuration information is obtained, the function module can be updated by using the target configuration information, and the updated function module can realize the function corresponding to the target configuration file.
According to the technical scheme, the function module configuration method comprises the steps of obtaining a target configuration file written for a function module in advance, extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and corresponding calendar information, writing the packaged configuration information into a calendar plug-in unit, obtaining the target configuration information corresponding to the current time node by reading the packaged configuration information in the calendar plug-in unit when the function module operates, and updating the function module by utilizing the target configuration information so that the function module achieves functions corresponding to the target configuration information. According to the method, the configuration information corresponding to different time nodes is written in the target configuration file in advance, after the target configuration file is obtained, the configuration information and the corresponding calendar information can be bound and packaged, the packaged information comprises daily date information and daily function module configuration information, when the function module operates, the function module configuration can be updated according to the date information through the calendar plug-in, the function update of the function module is automatically realized, the configuration file does not need to be manually modified at the appointed time, and the usability and the working efficiency of the module are effectively improved.
The embodiment of the application discloses a specific function module configuration method, and compared with the previous embodiment, the technical scheme of the embodiment is further described and optimized. See fig. 2 for details:
S201, acquiring a target configuration file written for a functional module in advance;
s202, extracting function module configuration information corresponding to different time nodes in the target configuration file, binding and packaging the function module configuration information and corresponding calendar information, and writing the packaged configuration information into a calendar plug-in;
S203, when the functional module operates, acquiring target configuration information corresponding to a current time node by reading the packaged configuration information in the calendar plug-in;
S204, if the target configuration information comprises the call quota of the virtual resource, modifying the original call quota into a target call quota corresponding to the target configuration information;
In the embodiment of the present application, the target configuration information may be specifically a call quota of the virtual resource, that is, the call quota of the virtual resource may be adjusted in real time according to a specific date. If the target configuration information includes the call quota of the virtual resource, the original call quota can be modified into a target call quota corresponding to the target configuration information. For example, the WeChat red envelope limit may be adjusted based on the actual date.
S205, judging whether the actual call quota corresponding to the call request exceeds the target call quota after receiving the call request for the virtual resource, if so, entering step S206, otherwise, entering step S207;
s206, returning a first prompt message exceeding the call limit and prohibiting the response to the call request;
s207, allowing to respond to the call request.
After the call quota of the virtual resource is modified, if the call request for the virtual resource is received within the time range limited by the calendar information, whether the actual call quota corresponding to the current call request exceeds the target call quota is required to be judged. If yes, the response to the call request is forbidden, and a first prompt message exceeding the call limit is returned, and if not, the response to the current call request is allowed.
As a preferred implementation manner, after modifying the original call quota into the target call quota corresponding to the target configuration information, the embodiment of the application may further return second prompt information to the user of the function module, where the second prompt information is used to prompt the user to call the quota adjustment, and the user may obtain information of the quota adjustment before initiating the call request, so that it is convenient to directly use a new function or initiate a call request meeting the current quota, thereby improving user experience.
The following describes a method for configuring a functional module according to an embodiment of the present application through a specific implementation scenario.
Specifically, for a functional module that often needs to change configuration information, an XML-format configuration file may be pre-written, and the configuration file is read in the initialization process of the functional module, where initial values of various configuration information are defined in the configuration file, and the initial values are specifically distinguished according to current date information in a calendar.
For some reason, the configuration information of the functional module needs to be changed to a specific value, for example, a WeChat red package, and a maximum limit of 200 is usually set, and the configuration information can be changed to 520 on a specified date, that is, the configuration information is changed according to calendar information, and the calendar information is updated every day, so that the calendar information can be expanded according to the daily configuration information, that is, the daily configuration information is written into the calendar information, and the data information returned by acquiring the calendar information is enriched.
It can be understood that the initial calendar information may only contain date information, and the calendar information is expanded through the interface of the calendar plug-in, and the structure of the packaged calendar information is the date information and the specific configuration information corresponding to each day. Thus, when the system performs the update of the function module every day, it is only necessary to read the configuration information therein by the time of the update date and perform the system update.
In addition, since many functions in the system require occasional updates of configuration information, which may be different from day to day, it is necessary to read the calendar daily for updating the function configuration information. In a specific implementation, the update period may be specifically set according to the update frequency of the configuration information, and if the configuration does not need to be changed according to the fine time such as the hour, the update may be directly performed according to the date information, that is, the update is automatically performed every zero point.
The following describes a functional module configuration system according to an embodiment of the present application, and the functional module configuration system described below and the functional module configuration method described above may be referred to each other.
Referring to fig. 3, a functional module configuration system provided in an embodiment of the present application includes:
A file obtaining module 301, configured to obtain a target configuration file written for a functional module in advance;
a configuration binding module 302, configured to extract function module configuration information corresponding to different time nodes in the target configuration file, bind and encapsulate the function module configuration information and corresponding calendar information, and write the encapsulated configuration information into a calendar plug-in;
A configuration reading module 303, configured to obtain, when the function module is running, target configuration information corresponding to a current time node by reading the packaged configuration information in the calendar plug-in;
And the function updating module 304 is configured to update the function module with the target configuration information, so that the function module implements a function corresponding to the target configuration information.
The specific implementation process of the modules 301 to 304 may refer to the corresponding content disclosed in the foregoing embodiment, and will not be described herein.
On the basis of the foregoing embodiment, as a preferred implementation manner, the functional module configuration system provided by the embodiment of the present application may further include:
the instruction receiving module is used for receiving a setting instruction aiming at the function module configuration update period;
and the period acquisition module is used for acquiring an updating time period according to the setting instruction so as to read the packaged configuration information in the calendar plug-in at regular time according to the updating time period.
The application also provides an electronic device, as shown in fig. 4, and the electronic device provided by the embodiment of the application includes:
a memory 100 for storing a computer program;
the processor 200, when executing the computer program, may implement the steps provided in the above embodiments.
Specifically, the memory 100 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer readable instructions, and the internal memory provides an environment for the operating system and the execution of the computer readable instructions in the non-volatile storage medium. The processor 200 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments, to provide computing and control capabilities for the electronic device, and to implement the method for configuring the functional modules disclosed in any of the foregoing embodiments when executing the computer program stored in the memory 100.
On the basis of the above embodiment, as a preferred implementation manner, referring to fig. 5, the electronic device further includes:
An input interface 300, coupled to the processor 200, for obtaining externally imported computer programs, parameters and instructions, which are stored in the memory 100 under control of the processor 200. The input interface 300 may be coupled to an input device for receiving parameters or instructions manually entered by a user. The input device can be a touch layer covered on a display screen, can also be a key, a track ball or a touch pad arranged on a terminal shell, and can also be a keyboard, a touch pad or a mouse, etc.
And a display unit 400 connected to the processor 200 for displaying data processed by the processor 200 and for displaying a visualized user interface. The display unit 400 may be an LED display, a liquid crystal display, a touch-control type liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like.
The network port 500 is connected to the processor 200 and is used for communication connection with external terminal devices. The communication technology adopted by the communication connection can be a wired communication technology or a wireless communication technology, such as a mobile high definition link technology (MHL), a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a wireless fidelity technology (WiFi), a Bluetooth communication technology with low power consumption, a communication technology based on IEEE802.11s, and the like.
Fig. 5 illustrates only an electronic device having assemblies 100-500, and it will be understood by those skilled in the art that the configuration illustrated in fig. 5 is not limiting of the electronic device and may include fewer or more components than illustrated, or may combine certain components, or a different arrangement of components.
The application also provides a computer readable storage medium, which can comprise a U disk, a mobile hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk and other various media capable of storing program codes. The storage medium has stored thereon a computer program which, when executed by a processor, implements the method of configuring a functional module as disclosed in any of the foregoing embodiments.
According to the method, configuration information corresponding to different time nodes is written in the target configuration file in advance, after the target configuration file is obtained, the configuration information and the corresponding calendar information can be bound and packaged, the packaged information comprises daily date information and daily function module configuration information, when the function module operates, the function module configuration can be updated according to the date information through the calendar plug-in, the function update of the function module is automatically realized, the configuration file does not need to be manually modified at the appointed time, and the usability and the working efficiency of the module are effectively improved.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.