CN113515305A - Configuration information determining method, configuration snapshot generating method and device - Google Patents

Configuration information determining method, configuration snapshot generating method and device Download PDF

Info

Publication number
CN113515305A
CN113515305A CN202110784779.0A CN202110784779A CN113515305A CN 113515305 A CN113515305 A CN 113515305A CN 202110784779 A CN202110784779 A CN 202110784779A CN 113515305 A CN113515305 A CN 113515305A
Authority
CN
China
Prior art keywords
configuration
target
configuration information
snapshot
target service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110784779.0A
Other languages
Chinese (zh)
Other versions
CN113515305B (en
Inventor
王鹏
方炜
李劼
洪学寰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110784779.0A priority Critical patent/CN113515305B/en
Publication of CN113515305A publication Critical patent/CN113515305A/en
Application granted granted Critical
Publication of CN113515305B publication Critical patent/CN113515305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to a configuration information determining method, a configuration snapshot generating device, computer equipment and a storage medium, and belongs to the technical field of computers. According to the method and the terminal, the configuration snapshot of the target historical time is obtained from the server, the configuration snapshot comprises the configuration information of the target business at the target historical time, after the terminal obtains the configuration snapshot, the configuration information of each configuration item in the target business at the target historical time can be quickly and accurately determined based on the configuration snapshot, developers are not required to manually determine the historical configuration information of the configuration items one by one, and the determination efficiency of the historical configuration information is improved.

Description

Configuration information determining method, configuration snapshot generating method and device
Technical Field
The present disclosure relates to computer technologies, and in particular, to a configuration information determining method, a configuration snapshot generating method, an apparatus, a computer device, and a storage medium.
Background
In the iterative updating process of the application program, some bugs often occur in the application program due to configuration information modification, code updating and the like of the application program, and when the bugs are checked, an important link is to quickly determine the configuration information at a certain historical moment and restore the configuration of the application program to the certain historical moment, so that whether the application program bugs are caused by the change of the configuration information or not is detected. However, the data size of the configuration information of the application is usually very large, the type is complex, and the readability is very poor, so that it is very difficult for a developer to manually determine the configuration information one by one. Therefore, how to quickly and accurately determine the configuration information at a certain historical moment is an important research direction.
Disclosure of Invention
The present disclosure provides a configuration information determining method, a configuration snapshot generating method, a device, a computer device, and a storage medium, which can determine configuration information at a certain historical time quickly and accurately. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for determining configuration information, including:
sending a first acquisition request to a server, wherein the first acquisition request comprises a target historical time and a service identifier of a target service, and the first acquisition request is used for indicating to acquire configuration information of the target service at the target historical time;
receiving a configuration snapshot sent by the server in response to the first acquisition request, wherein the configuration snapshot comprises configuration information of the target service at the target historical moment;
and determining the configuration information of each configuration item at the target historical moment in the configuration information included in the configuration snapshot based on the identification of at least one configuration item in the target service.
In the embodiment of the disclosure, by acquiring the configuration snapshot of the target historical time from the server, where the configuration snapshot includes the configuration information of the target service at the target historical time, after the terminal acquires the configuration snapshot, the terminal can quickly and accurately determine the configuration information of each configuration item in the target service at the target historical time based on the configuration snapshot, and developers do not need to manually determine the historical configuration information of the configuration items one by one, thereby improving the determination efficiency of the historical configuration information.
In a possible implementation manner, after receiving a configuration snapshot sent by the server in response to the first obtaining request, the configuration snapshot including configuration information of the target service at the target historical time, the method further includes:
receiving an execution instruction of the target service, wherein the execution instruction comprises the target historical time, and the execution instruction is used for indicating that the target service is operated based on the configuration information of the target historical time;
responding to the execution instruction, and acquiring the configuration snapshot corresponding to the target historical moment;
in the execution process of the target service, in response to any configuration item in the target service being called, the configuration information of the called configuration item at the target historical moment is acquired from the configuration snapshot, and the target service is executed based on the acquired configuration information.
In the embodiment of the disclosure, when the terminal executes the target service, the configuration snapshot at the target historical time is read, and the configuration information in the configuration snapshot is directly called to complete the execution of the target service, so that the configuration information of the target service is quickly restored to the target historical time, developers do not need to manually restore the configuration information one by one, and the restoration efficiency of the configuration information and the problem troubleshooting efficiency are improved.
In one possible implementation, the at least one configuration item is a configuration item in which the configuration information is updated after the target historical time.
In the embodiment of the present disclosure, only the configuration information of the configuration item that is updated after the target history time is acquired, and the data volume of the acquired configuration information can be effectively reduced, thereby reducing the data volume of the generated configuration snapshot.
In a possible implementation manner, the obtaining, from the configuration snapshot, configuration information of the called configuration item at the target historical time in response to any one configuration item in the target service being called includes:
responding to any configuration item in the target service being called, and inquiring the configuration snapshot based on the identification of the called configuration item;
and in response to the configuration snapshot including the identification of the called configuration item, obtaining configuration information of the called configuration item at the target historical moment from the configuration snapshot.
In the embodiment of the disclosure, the configuration information at the target historical time can be accurately and quickly acquired based on the snapshot, and the user does not need to manually restore the configuration information, so that the efficiency of restoring the configuration information is improved.
In one possible implementation, after the querying the configuration snapshot in response to any one of the configuration items in the target service being invoked based on the identification of the invoked configuration item, the method further includes:
in response to the configuration snapshot not including the identity of the called configuration item, sending a second get request to the server, the second get request including the identity of the called configuration item;
and receiving the configuration information of the called configuration item sent by the server in response to the first acquisition request.
In one possible implementation manner, the first obtaining request includes information of a running environment of the target service, where the running environment includes at least one of an application region of the service and a network environment in which the service runs.
In the embodiment of the disclosure, by adding the operating environment information to the first obtaining request, the configuration information currently required by the terminal can be more accurately obtained, the data size of the configuration snapshot generated by the second server is reduced, and the obtaining of redundant information is avoided.
According to a second aspect of the embodiments of the present disclosure, there is provided a configuration snapshot generating method, including:
receiving a first acquisition request of a terminal, wherein the first acquisition request comprises a target historical moment and a service identifier of a target service;
responding to the first acquisition request, and acquiring target configuration information of at least one configuration item in the target service at the target historical moment;
generating a configuration snapshot of the target service at the target historical moment based on the target configuration information;
and sending the configuration snapshot to the terminal, wherein the terminal is used for executing the target service based on the configuration information in the configuration snapshot.
In the embodiment of the disclosure, the history snapshot information of the target service is stored by the server, the request of the terminal is responded, the configuration snapshot is generated based on the configuration information of the target service at the target history moment, the configuration snapshot is sent to the terminal, and the terminal calls the configuration snapshot in the process of executing the target service, so that the terminal can rapidly and accurately acquire the configuration information at the target history moment.
In a possible implementation manner, the obtaining, in response to the first obtaining request, target configuration information of at least one configuration item in the target service at the target history time includes:
responding to the first acquisition request, acquiring at least one first candidate configuration information corresponding to at least one configuration item in the target service, wherein the candidate configuration information carries an updating moment;
and respectively acquiring the carried first candidate configuration information which is before the target historical time and is closest to the target historical time from at least one first candidate configuration information corresponding to each configuration item as the target configuration information.
In the embodiment of the present disclosure, the configuration information is screened based on the update time carried by each configuration information and the target history time in the first acquisition request, so that the configuration information corresponding to each configuration item at the target history time can be accurately determined.
In a possible implementation manner, the obtaining, in response to the first obtaining request, at least one first candidate configuration information corresponding to at least one configuration item in the target service includes:
in response to the first acquisition request, screening the at least one configuration item from a plurality of configuration items included in the target service, wherein the at least one configuration item is a configuration item of which the configuration information is updated after the target historical time;
and acquiring at least one piece of first candidate configuration information corresponding to the at least one configuration item.
In the embodiment of the present disclosure, only the configuration information of the configuration item that is updated after the target history time is acquired, and the data volume of the acquired configuration information can be effectively reduced, thereby reducing the data volume of the generated configuration snapshot.
In a possible implementation manner, the first obtaining request includes information of an operation environment of the target service, where the operation environment includes at least one of an application region of the service and a network environment in which the service is operated;
the obtaining, in response to the first obtaining request, at least one first candidate configuration information corresponding to at least one configuration item in the target service includes:
responding to the first acquisition request, and acquiring at least one piece of second candidate configuration information corresponding to each configuration item in the target service, wherein the at least one piece of second candidate configuration information carries information of an operating environment;
and acquiring the at least one first candidate configuration information from the at least one second candidate configuration information, wherein the information of the operating environment carried by the at least one first candidate configuration information is the same as the information of the operating environment in the first acquisition request.
In the embodiment of the disclosure, by adding the operating environment information to the first obtaining request and screening the configuration information based on the operating environment, the configuration information currently required by the terminal can be more accurately obtained, the data size of the configuration snapshot generated by the first server is reduced, and the redundant information is prevented from being obtained.
In a possible implementation manner, after the obtaining, from at least one first candidate configuration information corresponding to each configuration item, a first candidate configuration information that is carried by the update time before the target historical time and is closest to the target historical time as the target configuration information, the method further includes:
for any configuration item, in response to that the first candidate configuration information which is carried before the target history time and is closest to the target history time is not acquired, setting the target configuration information of the any configuration item to be a null value, or deleting the any configuration item in the configuration snapshot.
In the embodiment of the disclosure, for configuration items created after the target historical time, the configuration information corresponding to such configuration items is set to be null value or directly deleted when the configuration snapshot is generated, so that the data volume of the configuration snapshot can be effectively reduced.
According to a third aspect of the embodiments of the present disclosure, there is provided a configuration information determining apparatus including:
the system comprises a sending module, a receiving module and a processing module, wherein the sending module is configured to execute sending of a first obtaining request to a server, the first obtaining request comprises a target historical moment and a service identifier of a target service, and the first obtaining request is used for indicating to obtain configuration information of the target service at the target historical moment;
a receiving module configured to perform receiving a configuration snapshot sent by the server in response to the first obtaining request, where the configuration snapshot includes configuration information of at least one configuration item in the target service at the target historical time;
and the determining module is configured to determine the configuration information of each configuration item at the target historical moment in the configuration information included in the configuration snapshot based on the identification of at least one configuration item in the target service.
In one possible implementation manner, the receiving module is configured to execute receiving an execution instruction of the target service, where the execution instruction includes the target historical time, and the execution instruction is used for instructing to run the target service based on configuration information of the target historical time;
the device also comprises a snapshot obtaining module which is configured to respond to the execution instruction and obtain the configuration information corresponding to the target historical moment;
the device further comprises an information acquisition module, configured to execute, in the execution process of the target service, in response to any configuration item in the target service being called, acquiring configuration information of the called configuration item at the target historical time from the configuration snapshot, and executing the target service based on the acquired configuration information.
In one possible implementation, the at least one configuration item is a configuration item in which the configuration information is updated after the target historical time.
In one possible implementation, the information obtaining module is configured to perform:
responding to any configuration item in the target service being called, and inquiring the configuration snapshot based on the identification of the called configuration item;
and in response to the configuration snapshot including the identification of the called configuration item, obtaining configuration information of the called configuration item at the target historical moment from the configuration snapshot.
In one possible implementation, the information obtaining module is further configured to perform:
in response to the configuration snapshot not including the identity of the called configuration item, sending a second get request to the server, the second get request including the identity of the called configuration item;
and receiving the configuration information of the called configuration item sent by the server in response to the first acquisition request.
In one possible implementation manner, the first obtaining request includes information of a running environment of the target service, where the running environment includes at least one of an application region of the service and a network environment in which the service runs.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a configuration snapshot generating apparatus including:
the receiving module is configured to execute a first acquisition request of a receiving terminal, wherein the first acquisition request comprises a target historical moment and a service identifier of a target service;
the acquisition module is configured to execute the step of acquiring target configuration information of at least one configuration item in the target service at the target historical moment in response to the first acquisition request;
the generating module is configured to execute the generation of a configuration snapshot of the target service at the target historical moment based on the target configuration information;
and the sending module is configured to send the configuration snapshot to the terminal, and the terminal is used for executing the target service based on the configuration information in the configuration snapshot.
In one possible implementation, the obtaining module includes:
a first obtaining unit, configured to execute, in response to the first obtaining request, obtaining at least one first candidate configuration information corresponding to at least one configuration item in the target service, where the candidate configuration information carries an update time;
and the second acquisition unit is configured to acquire the first candidate configuration information which is carried by the update time before the target historical time and is closest to the target historical time from at least one first candidate configuration information corresponding to each configuration item as the target configuration information.
In one possible implementation, the first obtaining unit is configured to perform:
in response to the first acquisition request, screening the at least one configuration item from a plurality of configuration items included in the target service, wherein the at least one configuration item is a configuration item of which the configuration information is updated after the target historical time;
and acquiring at least one piece of first candidate configuration information corresponding to the at least one configuration item.
In a possible implementation manner, the first obtaining request includes information of an operation environment of the target service, where the operation environment includes at least one of an application region of the service and a network environment in which the service is operated;
the first acquisition unit is configured to perform:
responding to the first acquisition request, and acquiring at least one piece of second candidate configuration information corresponding to each configuration item in the target service, wherein the at least one piece of second candidate configuration information carries information of an operating environment;
and acquiring the at least one first candidate configuration information from the at least one second candidate configuration information, wherein the information of the operating environment carried by the at least one first candidate configuration information is the same as the information of the operating environment in the first acquisition request.
In one possible implementation, the apparatus further includes:
the configuration information setting module is configured to execute, for any configuration item, in response to not acquiring first candidate configuration information which is carried by the update time before the target history time and is closest to the target history time, setting the target configuration information of the any configuration item to be a null value;
a deletion module configured to perform deleting the any configuration item in the configuration snapshot.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer apparatus including:
one or more processors;
a memory for storing the processor executable program code;
wherein the processor is configured to execute the program code to implement the configuration information determining method or the configuration snapshot generating method described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium including: the program code in the computer-readable storage medium, when executed by a processor of a computer device, enables the computer to readable perform the configuration information determining method or the configuration snapshot generating method described above.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the above-described configuration information determination method or configuration snapshot generation method.
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 disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating a method of configuration information determination according to an example embodiment;
FIG. 2 is a flow diagram illustrating a method of configuration information determination in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of configuration snapshot generation in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating a method of configuration information determination, according to an example embodiment;
FIG. 5 is a schematic diagram illustrating a configuration information recovery process in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a configuration information determination apparatus according to an example embodiment;
FIG. 7 is a block diagram illustrating a configuration snapshot generating apparatus in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating a computer device in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that the information referred to in the present disclosure may be information authorized by the user or sufficiently authorized by each party.
Fig. 1 is a flowchart illustrating a configuration information determining method according to an exemplary embodiment, and as shown in fig. 1, the implementation environment includes a terminal 101 and a server 102.
The terminal 101 has an application installed and running therein, and can test various services in the application, for example, the application is a video application, a browser application, or the like, and the application includes a recommendation service, a search service, or the like. The exemplary terminal 101 is a terminal used by developers. The terminal 101 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart watch, smart glasses, or the like, and the terminal 101 may also be an AR interaction device, or the like, which is not limited in this disclosure. Terminal 101 may refer broadly to any of a number of terminals and the disclosed embodiments are illustrated with terminal 101 only.
The server 102 is loaded with a configuration information management platform for storing configuration information of each service in the application program, for example, the configuration information is stored in a form of Kconf (a syntax) file. The terminal 101 is capable of executing various types of services in the application based on the configuration information in the server 102. For example, the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
The terminal 101 and the server 102 may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating a configuration information determining method according to an exemplary embodiment, and as shown in fig. 2, the configuration information determining method can be applied to a terminal in the implementation environment, and in the embodiment of the present disclosure, the configuration information determining method is described with the terminal as an execution subject. In one possible implementation, the method comprises the steps of:
in step 201, the terminal sends a first acquisition request to the server, where the first acquisition request includes a target history time and a service identifier of a target service, and the first acquisition request is used to instruct to acquire configuration information of the target service at the target history time.
The server is provided with a configuration information management platform for storing configuration information of the target service at each historical moment; the first acquisition request is used for indicating the acquisition of configuration information of the target service at the target historical moment from the server; the target business is any business, the target historical time is any time before the current time, and illustratively, the target historical time is set by a developer, which is not limited in the embodiment of the disclosure.
In step 202, the terminal receives a configuration snapshot sent by the server in response to the first obtaining request, where the configuration snapshot includes configuration information of at least one configuration item in the target service at the target historical time.
The configuration item refers to an item configured by a developer or a user in the lifecycle of the target service, and the configuration information refers to the content of the configuration item, for example, the configuration item is a parameter. The configuration information is a value of the parameter, and exemplarily, the configuration item is marked as key, and the configuration information is marked as value. The configuration snapshot is a snapshot generated by the server based on the configuration information of the target service at the target historical time, and is used for recording the configuration information of the target service at the target historical time.
In step 203, the terminal determines, based on the identifier of at least one configuration item in the target service, configuration information of each configuration item at the target historical time in the configuration information included in the configuration snapshot.
In a possible implementation manner, the terminal parses the data of the configuration snapshot through an SDK (Software Development Kit) supporting snapshot parsing to obtain configuration information included in the configuration snapshot, and queries, based on an identifier of each configuration item in the target service, configuration information corresponding to each configuration item in the parsed configuration information, that is, determines configuration information corresponding to each configuration item at the target historical time.
According to the technical scheme provided by the embodiment of the disclosure, the configuration snapshot at the target historical time is obtained from the server, the configuration snapshot comprises the configuration information of the target service at the target historical time, and after the terminal obtains the configuration snapshot, the configuration information of each configuration item in the target service at the target historical time can be quickly and accurately determined based on the configuration snapshot, so that developers are not required to manually determine the historical configuration information of the configuration items one by one, and the determination efficiency of the historical configuration information is improved.
Fig. 3 is a flowchart illustrating a configuration snapshot generating method according to an exemplary embodiment, where as shown in fig. 3, the configuration snapshot generating method can be applied to a server in the above implementation environment, and in the embodiment of the present disclosure, the configuration snapshot generating method is described with the server as an execution subject. In one possible implementation, the method comprises the steps of:
in step 301, the server receives a first acquisition request of the terminal, where the first acquisition request includes a target historical time and a service identifier of a target service.
The server is provided with a configuration information management platform for storing configuration information of the target service at each historical moment; the first obtaining request is used for indicating to obtain the configuration information of the target service at the target historical moment.
In step 302, the server obtains, in response to the first obtaining request, target configuration information of at least one configuration item in the target service at the target historical time.
In the embodiment of the present disclosure, any configuration item in the target service corresponds to at least one configuration information, and the server screens out, from the at least one configuration information, target configuration information of the any configuration item at the target historical time.
In step 303, the server generates a configuration snapshot of the target service at the target historical time based on the target configuration information.
In the embodiment of the present disclosure, the server calls an API (Application Programming Interface) that supports snapshot generation, and exports the configuration information of the target service at the target historical time as the configuration snapshot.
In step 304, the server sends the configuration snapshot to the terminal, and the terminal is configured to execute the target service based on the configuration information in the configuration snapshot.
In the embodiment of the present disclosure, after the server generates the configuration snapshot, the server sends the configuration snapshot to the terminal, and the terminal invokes the configuration information in the configuration snapshot in the process of executing the target service, so as to implement executing the target service based on the configuration information of the target historical time.
According to the technical scheme provided by the embodiment of the disclosure, the historical snapshot information of the target service is stored through the server, the request of the terminal is responded, the configuration snapshot is generated based on the configuration information of the target service at the target historical moment, the configuration snapshot is sent to the terminal, and the terminal calls the configuration snapshot in the process of executing the target service, so that the terminal can conveniently and accurately acquire the configuration information at the target historical moment.
The foregoing embodiments are brief descriptions of embodiments of the present disclosure, and the method of the embodiments of the present disclosure is further described below with reference to fig. 4, where fig. 4 is a flowchart illustrating a configuration information determining method according to an exemplary embodiment, and with reference to fig. 4, the method includes the following steps:
in step 401, the terminal sends a first acquisition request to the server.
The first obtaining request is used to instruct to obtain configuration information of the target service at the target history time, where the target history time is set by a developer, and this is not limited in this disclosure. Illustratively, the terminal displays a configuration information acquisition interface, the test interface includes a service selection area, a historical time setting area and a confirmation control, the terminal acquires a service selected by a developer in the service selection area as the target service, acquires a time selected or input by the developer in the historical time setting area as the target historical time, the terminal responds to a trigger operation on the confirmation control to acquire a service identifier of the target service and the target historical time, and generates a first acquisition request, the first acquisition request includes the target historical time and the service identifier of the target service and is used for indicating to acquire configuration information of the target service at the target historical time from the server, and the terminal sends the first acquisition request to the server. It should be noted that the above description of the first obtaining request generating method is only an exemplary description of one possible implementation manner, and the embodiment of the present disclosure does not limit which method is specifically used to generate the first obtaining request.
In some embodiments, the first acquisition request includes information of a running environment of the target service, the running environment including at least one of an application region of the service, a network environment in which the service runs. For example, when the target service is applied to the east China and the north China, the adopted configuration information is different, and when the network environment is normal and the network environment is poor, the adopted configuration information of the target service is different. The network environment information is set by a developer, which is not limited in this disclosure. Illustratively, the configuration information acquisition interface further includes a running environment setting area, the terminal acquires the running environment information selected or input by the developer in the running environment setting area, and the terminal adds the running environment information to the first acquisition request when generating the first acquisition request. Optionally, the terminal automatically identifies a current operating environment, illustratively, the terminal responds to the configuration information recovery instruction, automatically identifies a current region where the terminal is located, automatically identifies a current network environment, obtains information of an operating environment of the target service, and adds the information of the operating environment to the first acquisition request when the first acquisition request is generated. It should be noted that the above description of the information acquisition method of the operating environment is only an exemplary description of one possible implementation manner, and the embodiment of the present disclosure does not limit which method is specifically used to acquire the information of the operating environment.
In step 402, the server receives a first obtaining request of the terminal, and obtains target configuration information of at least one configuration item in the target service at the target historical time in response to the first obtaining request.
In a possible implementation manner, in response to the first obtaining request, the server obtains at least one first candidate configuration information corresponding to at least one configuration item in the target service, where the candidate configuration information carries an update time, and the server obtains, from the at least one first candidate configuration information corresponding to each configuration item, a first candidate configuration information that is carried by the update time before the target historical time and is closest to the target historical time as the target configuration information. For example, the server stores a directory of configuration items included in the target service, the directory is named by a service identifier of the target service, and the target includes an identifier of at least one configuration item. In a possible implementation manner, the server queries, based on the service identifier of the target service in the first acquisition request, a directory of configuration items included in the target service, so as to determine the configuration items included in the target service, and further acquires at least one piece of first candidate configuration information stored in association with each configuration item, respectively; and screening at least one candidate configuration information of each configuration item respectively based on the target historical time carried by the first acquisition request to obtain the configuration information of each configuration item at the target historical time. It should be noted that the above description of the target configuration information obtaining method is only an exemplary description of one possible implementation manner, and the embodiment of the present disclosure does not limit which method is specifically adopted to obtain the target configuration information. In some embodiments, for any configuration item, in response to that the first candidate configuration information that is carried by the update time before the target history time and is closest to the target history time is not obtained, that is, the configuration item is created after the target history time, and the configuration item is not applied to the target service before the target history time, the server sets the target configuration information of the configuration item to a null value, or deletes the configuration item when the server generates a configuration snapshot in the subsequent process, which is not limited in this embodiment of the present application.
In a possible implementation manner, when the first acquisition request includes information of an operating environment of a target service, the server responds to the first acquisition request to acquire at least one piece of second candidate configuration information corresponding to each configuration item in the target service, where the at least one piece of second candidate configuration information carries the information of the operating environment, and the server acquires the at least one piece of first candidate configuration information from the at least one piece of second candidate configuration information, where the information of the operating environment carried by the at least one piece of first candidate configuration information is the same as the information of the operating environment in the first acquisition request.
In a possible implementation manner, the server filters each configuration item before obtaining the configuration information of each configuration item in the target service, for example, the server filters the at least one configuration item from a plurality of configuration items included in the target service in response to the first obtaining request, the at least one configuration item is a configuration item of which the configuration information is updated after the target historical time, and then at least one first candidate configuration information corresponding to the at least one configuration item is acquired, for configuration items for which the configuration information has not been updated after the target historical time, that is, configuration items for which the developer has not reconfigured after the target historical time, the configuration information of the configuration items does not need to be added into the configuration snapshot, and the configuration information can be directly read from the server when the subsequent target service is executed. In the embodiment of the present disclosure, the manner of screening the configuration items of the target service first can reduce the data amount of the target configuration information acquired by the server, thereby reducing the data amount of the configuration snapshot.
In step 403, the server generates a configuration snapshot of the target service at the target history time based on the target configuration information, and sends the configuration snapshot to the terminal.
In one possible implementation, the server calls an API that supports configuration information export, through which the configuration information is exported as a configuration snapshot, illustratively map (a data type) data in json (a data format) format, with the configuration information in the configuration snapshot being in base64 format. For example, the server derives configuration information of each configuration item in the target service, for example, "dirs. -infra.test", through a dirs function in the API, where test is a directory name of a directory of configuration items included in the target service, and in some embodiments, the server can derive configuration information of multiple services at a time, for example, "dirs. -infra.test, infra.test 2", through the dirs function.
In step 404, the terminal receives a configuration snapshot sent by the server in response to the first obtaining request, and stores the configuration snapshot, where the configuration snapshot includes configuration information of at least one configuration item in the target service at the target historical time.
In a possible implementation manner, data in the configuration snapshot is compressed and stored in an encrypted manner, and the terminal analyzes the configuration snapshot in response to receiving the configuration snapshot. It should be noted that the present disclosure does not limit which method is used to parse the configuration snapshot. It should be noted that, in some embodiments, the terminal immediately parses the configuration snapshot after receiving the configuration snapshot; in some embodiments, after receiving the configuration snapshot, the terminal does not analyze the configuration snapshot, and loads and analyzes the configuration snapshot through the target service when the target service starts to execute.
In a possible implementation manner, after receiving the configuration snapshots, the terminal stores the configuration snapshots to a local target memory space, each configuration snapshot carries a service identifier of a target service and a historical time, and when the target service is executed subsequently, a developer can select to apply the configuration snapshot at a certain historical time to execute the target service from the configuration snapshots stored in the target memory space.
In step 405, in response to the execution instruction for the target service, the terminal acquires a configuration snapshot corresponding to the target history time based on the target history time carried by the execution instruction.
In a possible implementation manner, a terminal displays an execution interface of the target service, the execution interface displays a historical time selection region and an execution control, in response to a trigger operation on the execution control, the terminal acquires the historical time at which the historical time selection region is selected as the target historical time, generates an execution instruction for the target service based on a service identifier of the target service and the target historical time, and in response to the execution instruction, the terminal acquires the service identifier carrying the target service and a configuration snapshot of the target historical time from a target memory space. It should be noted that, in some embodiments, if the target memory space does not include the configuration snapshot of the target service at the target history time, the terminal executes the step of obtaining the configuration snapshot of the target history time from the server.
In step 406, the terminal executes the target service based on the configuration snapshot of the target history time.
In the embodiment of the present disclosure, in the execution process of the target service, in response to any configuration item in the target service being called, the terminal obtains configuration information of the called configuration item at the target history time from the configuration snapshot, and executes the target service based on the obtained configuration information. In a possible implementation manner, after the target service starts to execute, sequentially calling each configuration item, the terminal responding to any configuration item in the target service being called, querying the configuration snapshot based on the identifier of the called configuration item, and responding to the configuration snapshot including the identifier of the called configuration item, and the terminal acquiring the configuration information of the called configuration item at the target historical time from the configuration snapshot; and in response to that the configuration snapshot does not include the identifier of the called configuration item, the terminal sends a second acquisition request to the server, the second acquisition request includes the identifier of the called configuration item, the server acquires the configuration information of the configuration item based on the identifier of the configuration item, namely, the latest configuration information of the configuration item, sends the acquired configuration information to the terminal, and the terminal receives the configuration information of the called configuration item sent by the server in response to the first acquisition request and continues to execute the target service based on the configuration information.
Fig. 5 is a schematic diagram illustrating a configuration information recovery process according to an exemplary embodiment, and the configuration information determination and configuration information recovery process described above will be described below with reference to fig. 5. As shown in fig. 5, the terminal obtains a configuration snapshot of a target service at a target history time from the server through a configuration snapshot obtaining SDK (Software Development Kit), stores the configuration snapshot in a local memory, loads and analyzes the configuration snapshot stored in the memory when the target service is executed, reads configuration information of each configuration item from the configuration snapshot, and if the configuration snapshot does not include configuration information of a certain configuration item, it indicates that the configuration information of the certain configuration item is not modified after the target history time, and the terminal directly requests the server for the configuration information of the certain configuration item, thereby implementing the target service under the configuration information at the target history time.
According to the technical scheme provided by the embodiment of the disclosure, when the terminal has a requirement for restoring the configuration information of the target service to the target historical time, the configuration snapshot of the target historical time is acquired from the server, the configuration snapshot comprises the configuration information of the target service at the target historical time, the configuration information in the configuration snapshot is directly called in the execution process of the target service, developers are not required to manually restore the configuration information one by one, and the acquisition efficiency of the historical configuration information is improved.
Fig. 6 is a block diagram illustrating a configuration information determination apparatus according to an example embodiment. Referring to fig. 6, the apparatus includes a transmitting module 601, a receiving module 602, and an obtaining module 603.
A sending module 601, configured to execute sending a first obtaining request to a server, where the first obtaining request includes a target history time and a service identifier of a target service, and the first obtaining request is used to instruct to obtain configuration information of the target service at the target history time;
a receiving module 602 configured to perform receiving a configuration snapshot sent by the server in response to the first obtaining request, where the configuration snapshot includes configuration information of the target service at the target historical time;
the determining module 603 is configured to perform determining, based on the identification of the at least one configuration item in the target service, configuration information of each configuration item at the target historical time in the configuration information included in the configuration snapshot.
In one possible implementation, the receiving module 602 is configured to execute receiving an execution instruction for the target service, where the execution instruction includes the target historical time, and the execution instruction is used to instruct to run the target service based on configuration information of the target historical time;
the device also comprises a snapshot obtaining module which is configured to respond to the execution instruction and obtain the configuration information corresponding to the target historical moment;
the device further comprises an information acquisition module, configured to execute, in the execution process of the target service, in response to any configuration item in the target service being called, acquiring configuration information of the called configuration item at the target historical time from the configuration snapshot, and executing the target service based on the acquired configuration information.
In one possible implementation, the at least one configuration item is a configuration item in which the configuration information is updated after the target historical time.
In one possible implementation, the information obtaining module is configured to perform:
responding to any configuration item in the target service being called, and inquiring the configuration snapshot based on the identification of the called configuration item;
and in response to the configuration snapshot including the identification of the called configuration item, obtaining configuration information of the called configuration item at the target historical moment from the configuration snapshot.
In one possible implementation, the information obtaining module is further configured to perform:
in response to the configuration snapshot not including the identity of the called configuration item, sending a second get request to the server, the second get request including the identity of the called configuration item;
and receiving the configuration information of the called configuration item sent by the server in response to the first acquisition request.
In one possible implementation manner, the first obtaining request includes information of a running environment of the target service, where the running environment includes at least one of an application region of the service and a network environment in which the service runs.
According to the device provided by the embodiment of the disclosure, the configuration snapshot at the target historical time is acquired from the server, the configuration snapshot includes the configuration information of the target service at the target historical time, after the terminal acquires the configuration snapshot, the configuration information of each configuration item in the target service at the target historical time can be quickly and accurately determined based on the configuration snapshot, developers are not required to manually determine the historical configuration information of the configuration items one by one, and the determination efficiency of the historical configuration information is improved.
Fig. 7 is a block diagram illustrating a configuration snapshot generating apparatus according to an example embodiment. Referring to fig. 7, the apparatus includes a receiving module 701, an obtaining module 702, a generating module 703, and a transmitting module 704.
A receiving module 701 configured to execute a first acquisition request of a receiving terminal, where the first acquisition request includes a target history time and a service identifier of a target service;
an obtaining module 702 configured to perform, in response to the first obtaining request, obtaining target configuration information of at least one configuration item in the target service at the target historical time;
a generating module 703 configured to execute generating a configuration snapshot of the target service at the target historical time based on the target configuration information;
a sending module 704 configured to execute sending the configuration snapshot to the terminal, where the terminal is configured to execute the target service based on the configuration information in the configuration snapshot.
In one possible implementation, the obtaining module 702 includes:
a first obtaining unit, configured to execute, in response to the first obtaining request, obtaining at least one first candidate configuration information corresponding to at least one configuration item in the target service, where the candidate configuration information carries an update time;
and the second acquisition unit is configured to acquire the first candidate configuration information which is carried by the update time before the target historical time and is closest to the target historical time from at least one first candidate configuration information corresponding to each configuration item as the target configuration information.
In one possible implementation, the first obtaining unit is configured to perform:
in response to the first acquisition request, screening the at least one configuration item from a plurality of configuration items included in the target service, wherein the at least one configuration item is a configuration item of which the configuration information is updated after the target historical time;
and acquiring at least one piece of first candidate configuration information corresponding to the at least one configuration item.
In a possible implementation manner, the first obtaining request includes information of an operation environment of the target service, where the operation environment includes at least one of an application region of the service and a network environment in which the service is operated;
the first acquisition unit is configured to perform:
responding to the first acquisition request, and acquiring at least one piece of second candidate configuration information corresponding to each configuration item in the target service, wherein the at least one piece of second candidate configuration information carries information of an operating environment;
and acquiring the at least one first candidate configuration information from the at least one second candidate configuration information, wherein the information of the operating environment carried by the at least one first candidate configuration information is the same as the information of the operating environment in the first acquisition request.
In one possible implementation, the apparatus further includes:
the configuration information setting module is configured to execute, for any configuration item, in response to not acquiring first candidate configuration information which is carried by the update time before the target history time and is closest to the target history time, setting the target configuration information of the any configuration item to be a null value;
a deletion module configured to perform deleting the any configuration item in the configuration snapshot.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
According to the device provided by the embodiment of the disclosure, the historical snapshot information of the target service is stored through the server, the request of the terminal is responded, the configuration snapshot is generated based on the configuration information of the target service at the target historical moment, the configuration snapshot is sent to the terminal, and the terminal calls the configuration snapshot in the process of executing the target service, so that the terminal can conveniently and accurately acquire the configuration information at the target historical moment.
Each of the above-mentioned terminal and server can be regarded as a computer device, and fig. 8 is a block diagram of a computer device according to an exemplary embodiment, where the computer device 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 801 and one or more memories 802, where at least one program code is stored in the one or more memories 802, and the at least one program code is loaded and executed by the one or more processors 801 to implement the processes executed by the computer device in the configuration information determining method or the configuration snapshot generating method provided by the above-mentioned embodiments of the methods. Certainly, the computer device 800 may further have a wired or wireless network interface, a keyboard, an input/output interface, and other components to facilitate input and output, and the computer device 800 may further include other components for implementing the device functions, which are not described herein again.
In an exemplary embodiment, a computer readable storage medium, such as a memory, comprising program code executable by the processor 801 of the computer device 800 to perform the above configuration information determination method or configuration snapshot generation method is also provided. Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a compact-disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises a computer program that, when being executed by a processor, implements the above-mentioned configuration information determining method or configuration snapshot generating method.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for determining configuration information, comprising:
sending a first acquisition request to a server, wherein the first acquisition request comprises a target history time and a service identifier of a target service, and the first acquisition request is used for indicating to acquire configuration information of the target service at the target history time;
receiving a configuration snapshot sent by the server in response to the first acquisition request, wherein the configuration snapshot comprises configuration information of the target service at the target historical moment;
and determining the configuration information of each configuration item at the target historical moment in the configuration information included in the configuration snapshot based on the identification of at least one configuration item in the target service.
2. The method according to claim 1, wherein the receiving a configuration snapshot sent by the server in response to the first acquisition request, the configuration snapshot including configuration information of the target service at the target historical time is later than the receiving, and the method further comprises:
receiving an execution instruction of the target service, wherein the execution instruction comprises the target historical time, and the execution instruction is used for indicating that the target service is operated based on the configuration information of the target historical time;
responding to the execution instruction, and acquiring the configuration snapshot corresponding to the target historical moment;
in the execution process of the target service, responding to any configuration item in the target service being called, obtaining the configuration information of the called configuration item at the target historical moment from the configuration snapshot, and executing the target service based on the obtained configuration information.
3. The method according to claim 2, wherein the at least one configuration item is a configuration item in which the configuration information is updated after the target history time.
4. The method according to claim 3, wherein the obtaining configuration information of the called configuration item at the target historical time from the configuration snapshot in response to any one of the configuration items in the target service being called comprises:
responding to any configuration item in the target service being called, and inquiring the configuration snapshot based on the identification of the called configuration item;
and in response to the configuration snapshot including the identification of the called configuration item, acquiring configuration information of the called configuration item at the target historical moment from the configuration snapshot.
5. A method for generating a configuration snapshot, comprising:
receiving a first acquisition request of a terminal, wherein the first acquisition request comprises a target historical moment and a service identifier of a target service;
responding to the first acquisition request, and acquiring target configuration information of at least one configuration item in the target service at the target historical moment;
generating a configuration snapshot of the target service at the target historical moment based on the target configuration information;
and sending the configuration snapshot to the terminal, wherein the terminal is used for executing the target service based on the configuration information in the configuration snapshot.
6. A configuration information determining apparatus, comprising:
the system comprises a sending module, a receiving module and a processing module, wherein the sending module is configured to execute sending of a first obtaining request to a server, the first obtaining request comprises a target historical moment and a service identifier of a target service, and the first obtaining request is used for indicating to obtain configuration information of the target service at the target historical moment;
a receiving module configured to perform receiving a configuration snapshot sent by the server in response to the first obtaining request, where the configuration snapshot includes configuration information of the target service at the target history time;
a determining module configured to perform determining, based on the identification of at least one configuration item in the target service, configuration information of each configuration item at the target historical time in configuration information included in the configuration snapshot.
7. A configuration snapshot generating apparatus, comprising:
the terminal comprises a receiving module, a sending module and a receiving module, wherein the receiving module is configured to execute a first acquisition request of a receiving terminal, and the first acquisition request comprises target historical time and a service identifier of a target service;
an obtaining module configured to perform, in response to the first obtaining request, obtaining target configuration information of at least one configuration item in the target service at the target historical time;
the generating module is configured to execute the generation of a configuration snapshot of the target service at the target historical moment based on the target configuration information;
and the sending module is configured to send the configuration snapshot to the terminal, and the terminal is used for executing the target service based on the configuration information in the configuration snapshot.
8. A computer device, comprising:
one or more processors;
a memory for storing the processor executable program code;
wherein the processor is configured to execute the program code to implement the configuration information determination method of any one of claims 1 to 4; or the configuration snapshot generating method of claim 5.
9. A computer-readable storage medium, characterized in that, when program code in the computer-readable storage medium is executed by a processor of a computer device, the computer device is enabled to execute the configuration information determination method according to any one of claims 1 to 4; or the configuration snapshot generating method of claim 5.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the configuration information determination method of any of claims 1 to 4; or the configuration snapshot generating method of claim 5.
CN202110784779.0A 2021-07-12 2021-07-12 Configuration information determining method, configuration snapshot generating method and device Active CN113515305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110784779.0A CN113515305B (en) 2021-07-12 2021-07-12 Configuration information determining method, configuration snapshot generating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110784779.0A CN113515305B (en) 2021-07-12 2021-07-12 Configuration information determining method, configuration snapshot generating method and device

Publications (2)

Publication Number Publication Date
CN113515305A true CN113515305A (en) 2021-10-19
CN113515305B CN113515305B (en) 2024-04-16

Family

ID=78067409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110784779.0A Active CN113515305B (en) 2021-07-12 2021-07-12 Configuration information determining method, configuration snapshot generating method and device

Country Status (1)

Country Link
CN (1) CN113515305B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150142747A1 (en) * 2013-11-20 2015-05-21 Huawei Technologies Co., Ltd. Snapshot Generating Method, System, and Apparatus
CN107579970A (en) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 Selection obtains method, terminal and the system of configuration information
CN108683538A (en) * 2018-05-18 2018-10-19 新华三技术有限公司 Snapshot Method, restoration methods and the device of configuration information
CN111817869A (en) * 2019-04-12 2020-10-23 华为技术有限公司 Network configuration recovery method and related equipment thereof
CN112463259A (en) * 2020-12-18 2021-03-09 杭州搜车网科技有限公司 Configuration information generation method, device, electronic device and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150142747A1 (en) * 2013-11-20 2015-05-21 Huawei Technologies Co., Ltd. Snapshot Generating Method, System, and Apparatus
CN107579970A (en) * 2017-08-31 2018-01-12 广东欧珀移动通信有限公司 Selection obtains method, terminal and the system of configuration information
CN108683538A (en) * 2018-05-18 2018-10-19 新华三技术有限公司 Snapshot Method, restoration methods and the device of configuration information
CN111817869A (en) * 2019-04-12 2020-10-23 华为技术有限公司 Network configuration recovery method and related equipment thereof
CN112463259A (en) * 2020-12-18 2021-03-09 杭州搜车网科技有限公司 Configuration information generation method, device, electronic device and medium

Also Published As

Publication number Publication date
CN113515305B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN112118565A (en) Multi-tenant service gray level publishing method and device, computer equipment and storage medium
US20060117091A1 (en) Data logging to a database
CN111125175B (en) Service data query method and device, storage medium and electronic device
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN110858172A (en) Automatic test code generation method and device
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN116974948B (en) Service system testing method, system, equipment and medium
CN112699034B (en) Virtual login user construction method, device, equipment and storage medium
CN113419818A (en) Basic component deployment method, device, server and storage medium
CN110347659B (en) Data processing method and device and transaction data processing method and device
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN113515305B (en) Configuration information determining method, configuration snapshot generating method and device
CN115859280A (en) Memory horse detection method, device, equipment and storage medium
CN113296750B (en) Function creation method and system, function calling method and system
CN115495372A (en) Analog data processing method, device, equipment and medium
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium
CN113377682A (en) Service testing method and device
CN113076343A (en) Data query method, device, equipment and storage medium
CN112416698A (en) Monitoring system expansion method and device, storage medium and electronic equipment
CN111158654A (en) Algorithm calling method, device, server and storage medium
CN117632445B (en) Request processing method and device, task execution method and device
CN113031960B (en) Code compiling method, device, server and storage medium
CN111104251B (en) Method, apparatus and computer readable medium for restoring files
CN109933573B (en) Database service updating method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant