CN117762454A - Upgrading method and device of client and electronic equipment - Google Patents

Upgrading method and device of client and electronic equipment Download PDF

Info

Publication number
CN117762454A
CN117762454A CN202410039226.6A CN202410039226A CN117762454A CN 117762454 A CN117762454 A CN 117762454A CN 202410039226 A CN202410039226 A CN 202410039226A CN 117762454 A CN117762454 A CN 117762454A
Authority
CN
China
Prior art keywords
acquisition
client
upgrading
version
upgrade
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.)
Pending
Application number
CN202410039226.6A
Other languages
Chinese (zh)
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.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202410039226.6A priority Critical patent/CN117762454A/en
Publication of CN117762454A publication Critical patent/CN117762454A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a method, a device and electronic equipment for upgrading a client, and relates to the field of collecting client upgrading, wherein the method comprises the following steps: acquiring target information carried in an upgrade instruction; if the target information comprises the version catalog and the first file abstract, executing a program package of which the first version is pulled from the acquisition server according to the version catalog; determining a second file digest of the package; the first file abstract and the second file abstract are compared and consistent, and a local acquisition client is upgraded according to the program package of the first version; if the target information comprises a dynamic acquisition script and dynamic acquisition parameters, executing analysis of the dynamic acquisition script to obtain an unparameterized data acquisition task; binding an unparameterized data acquisition task with a dynamic acquisition parameter to obtain a parameterized data acquisition task, and acquiring data based on the data acquisition task.

Description

Upgrading method and device of client and electronic equipment
Technical Field
The present disclosure relates to the field of client upgrade collection, and in particular, to a method and an apparatus for upgrading a client, and an electronic device.
Background
The upgrade of the collection client refers to a mode of releasing the collection client in the form of patches after modifying or adding new functions to the collection client program after the software release due to incomplete design personnel consideration or imperfect program functions when the developer of the collection client writes the collection client program. The user updates the patches, i.e. upgrades the acquisition clients.
At present, the acquisition client realizes the upgrade of the acquisition client by downloading the new version mainly in a manual mode, and the problem of low upgrade efficiency exists.
Disclosure of Invention
The embodiment of the application provides a method, a device and electronic equipment for upgrading a client, which are used for solving the problem of low upgrading efficiency of the existing acquisition client.
The first aspect of the present application provides an upgrade method of a client, which is applied to an acquisition client in a data acquisition system, where the data acquisition system includes an acquisition server and a plurality of acquisition clients, the plurality of acquisition clients are deployed in different areas, and the acquisition server is configured to send upgrade instructions for the plurality of acquisition clients; the upgrading method comprises the following steps: in response to receiving the upgrade instruction, acquiring target information carried in the upgrade instruction;
If the target information includes a version directory and a first file digest of the first version package, executing a first operation procedure, where the first operation procedure includes: pulling a program package of a first version from an acquisition server according to the version catalog; determining a second file digest of the package; under the condition that the comparison of the first file abstract and the second file abstract is consistent, upgrading the local acquisition client according to the program package of the first version;
if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring corresponding data based on the data acquisition task.
In one embodiment of the present application, further comprising: and filtering the parameterized data acquisition task by using an interceptor so as to prevent SQL injection.
In one embodiment of the present application, the second operation flow further includes: and placing the parameterized data acquisition task in REDIS cache, and triggering database detection to verify whether the upgrade is successful.
In one embodiment of the present application, triggering database detection includes: connecting a database; when the database carries out heartbeat detection, verifying whether the parameterized data acquisition task is successfully executed; if the data acquired by the parameterized data acquisition task is acquired, the success of upgrading is determined; if the error reporting information is acquired, the upgrade failure is determined.
In one embodiment of the present application, the daemon running in the collecting client, the upgrade instruction further carries a version number of the first version, and the first operation flow further includes: under the condition that the comparison of the first file abstract and the second file abstract is consistent, modifying the version number in the configuration file of the acquisition client to be the version number of the first version; monitoring the version number in the configuration file through a daemon; under the condition that the version number in the configuration file changes, restarting the acquisition client through the daemon.
In one embodiment of the present application, further comprising: and sending relevant upgrade information to the acquisition server, wherein the relevant upgrade information comprises an upgrade result and an error report in the upgrade process, and the acquisition server is also used for recording an upgrade log according to the upgrade result.
A second aspect of the present application provides a data acquisition system comprising: the system comprises an acquisition server and a plurality of acquisition clients, wherein the acquisition clients are deployed in different areas, and the acquisition server comprises:
The system comprises an acquisition server, a server and a server, wherein the acquisition server is used for providing a visual interface and generating an upgrading instruction according to interactive operation acted on the visual interface; and sending an upgrade instruction to a plurality of acquisition clients;
and the acquisition client is used for executing the upgrading method of the client according to any one of the above.
The third aspect of the application provides an upgrading device of a client, which is applied to a collection client in a data collection system, wherein the data collection system comprises a collection server and a plurality of collection clients, the collection clients are deployed in different areas, and the collection server is used for sending upgrading instructions to the collection clients; the upgrading device comprises:
the acquisition module is used for responding to the received upgrade instruction and acquiring target information carried in the upgrade instruction;
the upgrade module is configured to execute a first operation flow if the target information includes a version directory and a first file digest of a first version of the package, where the first operation flow includes: pulling a program package of a first version from an acquisition server according to the version catalog; determining a second file digest of the package; under the condition that the comparison of the first file abstract and the second file abstract is consistent, upgrading the local acquisition client according to the program package of the first version; if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring corresponding data based on the data acquisition task.
In one embodiment of the present application, further comprising:
and the application interceptor is used for filtering the parameterized data acquisition task so as to prevent SQL injection.
In one embodiment of the present application, the second operation flow further includes: and placing the parameterized data acquisition task in REDIS cache, and triggering database detection to verify whether the upgrade is successful.
In one embodiment of the present application, the upgrade module is specifically configured to, when triggering database detection: connecting a database; when the database carries out heartbeat detection, verifying whether the parameterized data acquisition task is successfully executed; if the data acquired by the parameterized data acquisition task is acquired, the success of upgrading is determined; if the error reporting information is acquired, the upgrade failure is determined.
In one embodiment of the present application,
the daemon process is operated in the acquisition client, the upgrade instruction also carries the version number of the first version, and the first operation flow also comprises: under the condition that the comparison of the first file abstract and the second file abstract is consistent, modifying the version number in the configuration file of the acquisition client to be the version number of the first version; monitoring the version number in the configuration file through a daemon; under the condition that the version number in the configuration file changes, restarting the acquisition client through the daemon.
In one embodiment of the present application, further comprising: the system comprises a sending module, an acquisition server and a control module, wherein the sending module is used for sending relevant upgrade information to the acquisition server, the relevant upgrade information comprises an upgrade result and errors in the upgrade process, and the acquisition server is also used for recording an upgrade log according to the upgrade result.
A fourth aspect of the present application provides an electronic device comprising a memory and a processor; wherein,
the memory is used for storing program codes;
the processor is configured to invoke program code to implement the method of upgrading the client of any of the above.
A fifth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes an electronic device to perform the method of upgrading a client of any of the above.
A sixth aspect of the present application provides a computer program product having a computer program stored thereon, which, when executed by a processor, causes an electronic device to perform the method of upgrading a client of any of the above.
According to the technical scheme, the data acquisition system comprises the acquisition server and a plurality of acquisition clients, wherein the acquisition clients are deployed in different areas, and the acquisition server is used for sending upgrading instructions to the acquisition clients; the upgrading method comprises the following steps: in response to receiving the upgrade instruction, acquiring target information carried in the upgrade instruction; if the target information includes a version directory and a first file digest of the first version package, executing a first operation procedure, where the first operation procedure includes: pulling a program package of a first version from an acquisition server according to the version catalog; determining a second file digest of the package; under the condition that the comparison of the first file abstract and the second file abstract is consistent, upgrading the local acquisition client according to the program package of the first version; if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain the parameterized data acquisition task, acquiring corresponding data based on the data acquisition task, realizing automatic upgrading of the acquisition client, improving the upgrading efficiency of the acquisition client, and enabling the upgraded acquisition client to realize dynamic configuration parameters and dynamic data acquisition.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of an upgrade method of a client provided in the present application;
FIG. 2 is a flowchart illustrating steps of a method for upgrading a client according to an embodiment of the present application;
FIG. 3 is a block diagram of an upgrade apparatus for a client according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to better understand the solution of the present application, the following description will clearly and completely describe the solution of the embodiment of the present application with reference to the accompanying drawings in the embodiment of the present application, and it is obvious that the described embodiment is only a part of the embodiment of the present application, not all the embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments thereof.
With the development of business, business data rules of the business transaction system of the provinces and houses in the whole country are continuously changed. In order to support the national real estate market monitoring service more timely, accurately and comprehensively, the real estate market monitoring system needs to continuously optimize the acquisition system so as to ensure the timeliness, accuracy and comprehensiveness of acquiring real estate transaction data of all places of the country.
At present, the acquisition service consists of an acquisition client and an acquisition client. The collection program is updated, and the new version collection client code program needs to be issued to more than 300 provinces and cities in the whole country for manual upgrading in each place. With the consequent huge communication costs and repetitive work.
Based on the above problems, the application provides an upgrade method of a client, which monitors the state of an acquisition client and triggers the automatic upgrade of the acquisition client through a daemon, so that the acquisition client can realize the automatic upgrade after the acquisition server pushes the version to update, and the acquisition client of a new version is released, so that the automatic upgrade of the acquisition client can be realized without manual intervention, and the upgrade efficiency is improved.
Having described the basic principles of the present application, various non-limiting embodiments of the present application are specifically described below.
Referring to fig. 1, an application scenario diagram of an upgrade method of a client provided in the present application includes an acquisition server and a plurality of acquisition clients (for example, an acquisition client a1 to an acquisition client an, n are positive integers), where each acquisition client corresponds to an intermediate database (for example, in fig. 1, an acquisition client ai corresponds to an intermediate database bi, i takes an integer between 1 and n). Each acquisition client is deployed with an acquisition client, and the acquisition client is used for acquiring data from an intermediate database. The collection server may be a central server, the collection clients may be collection servers deployed in different areas, the collection servers may collect data in different areas and collect the data to the central server for processing, and when a first version of a program package of the collection client exists in the collection server, the collection server may send a new version of the program package to each collection client, so that the collection client automatically upgrades the collection client.
The following describes the technical scheme of the present application in detail through specific embodiments. It should be noted that the following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Referring to fig. 2, a flowchart of steps of a method for upgrading a client according to an embodiment of the present application specifically includes the following steps:
s201, in response to receiving the upgrade instruction, acquiring target information carried in the upgrade instruction.
In an alternative embodiment, the target information includes: a version directory and a first file digest of a first version of the package.
Specifically, the acquisition server saves the program package of the first version under the version directory. And then, sending an upgrade instruction to the acquisition clients of the plurality of acquisition clients deployed in different areas, wherein the upgrade instruction also carries the version number of the first version, which is the new version of the acquisition client, namely the version number of the program package of the first version. Therefore, the acquisition server can control the acquisition clients in different areas to automatically upgrade, and upgrade efficiency is improved.
In addition, the acquisition server saves the program package of the first version under the version directory. And then, sending an upgrade instruction to the acquisition clients of the plurality of acquisition clients deployed in different areas, wherein the upgrade instruction also carries the version number of the first version, namely the version number of the new version program package. Therefore, the acquisition server can control the acquisition clients in different areas to automatically upgrade, and upgrade efficiency is improved.
Further, at the collecting server, the file of the first version of the package may be encrypted, for example, the file of the first version of the package is encrypted by using an MD5 information summary algorithm or an SM4 algorithm to obtain a first file summary. The first file digest is then sent to the collection client.
The SM4 algorithm is a symmetric encryption algorithm, and is published along with the WAPI standard (wireless local area network security national standard), and the encryption strength is 128 bits. The algorithm is a grouping algorithm for wireless lan products. The algorithm has a packet length of 128 bits and a key length of 128 bits. The encryption algorithm and the key expansion algorithm both adopt a 32-round nonlinear iterative structure. The decryption algorithm is the same as the encryption algorithm except that the round keys are used in reverse order, and the decryption round keys are in reverse order of the encryption round keys.
The MD5 Message-Digest Algorithm (MD 5 Message-Digest algorism) is a widely used cryptographic hash function, where the MD5 code processes the input information in 512-bit packets, each packet is divided into 16 32-bit sub-packets, after a series of processing, the output of the Algorithm consists of four 32-bit packets, and after cascading the four 32-bit packets, a 128-bit hash value is generated to ensure that the information transmission is completely consistent.
In another alternative embodiment, the target information includes a dynamic acquisition script and dynamic acquisition parameters.
S202, if the target information includes a version directory and a first file abstract of the first version package, executing a first operation flow, where the first operation flow includes: pulling a program package of a first version from an acquisition server according to the version catalog; determining a second file digest of the package; and under the condition that the comparison of the first file abstract and the second file abstract is consistent, upgrading the local acquisition client according to the program package of the first version.
And acquiring the program package of the first version from the acquisition server through the acquisition client according to the version catalog. After receiving the upgrade instruction, the collecting client saves the version catalog, the version number of the first version and the first file abstract, and responds to the upgrade instruction to obtain the program package of the first version from the version catalog of the collecting server.
Further, the method further comprises the following steps: the original program package of the acquisition client is backed up, so that the original program package can be prevented from being lost when the acquisition client fails to be upgraded.
The configuration file corresponding to the acquisition client stores the original version number of the acquisition client, and the original version number is modified into the version number of the first version for monitoring by the daemon.
After the acquisition client acquires the first version of the program package, the abstract of the file of the first version of the program package is calculated to be the second file abstract. And comparing the second file abstract with the first file abstract in the upgrading instruction. If the comparison is inconsistent, S202 is executed, and if the comparison is consistent, S204 is executed. If the comparison is inconsistent for a plurality of times, the process returns to the exception and the step of S202 is terminated.
Specifically, the second file digest is calculated using a contracted algorithm, such as MD5 message digest algorithm or SM4 algorithm. And calculating the file of the acquired program package of the first version by adopting a contracted algorithm to acquire a second file abstract.
In an alternative embodiment, the daemon running in the collecting client, the upgrade instruction further carries a version number of the first version, and the first operation flow further includes: under the condition that the comparison of the first file abstract and the second file abstract is consistent, modifying the version number in the configuration file of the acquisition client to be the version number of the first version; monitoring the version number in the configuration file through a daemon; under the condition that the version number in the configuration file changes, restarting the acquisition client through the daemon.
And upgrading the acquisition client when the comparison of the first file abstract and the second file abstract is consistent. In this embodiment of the present application, each collecting client corresponds to a daemon, referring to fig. 1, in the case that there are n collecting clients, each collecting client corresponds to one collecting client and one daemon, and the daemon can monitor the status of the collecting client and trigger the automatic upgrade of the collecting client.
In addition, daemons (daemons) are a special class of processes that run in the background of the acquisition client for performing specific system tasks. Many daemons start up at system boot time and run until the system shuts down. Others are started only when needed, and are automatically ended after the task is completed. The daemon process of the application is started when needed and automatically ends after the upgrading task is completed.
In the embodiment of the application, the daemon is used for monitoring the version number in the configuration file of the acquisition client.
And under the condition that the version number in the configuration file is changed, upgrading the acquisition client through the daemon according to the program package of the first version. After the version number is changed from the original version number to the version number of the first version, the acquisition client is upgraded by adopting a new program package according to the version number of the first version, namely, the acquisition client is reissued.
In the embodiment of the application, after the new version of the acquisition client is started successfully, the new version of the acquisition client issues an upgrading result to the acquisition server so that the acquisition server records an upgrading result log.
Optionally, the method further comprises: and sending relevant upgrade information to the acquisition server, wherein the relevant upgrade information comprises an upgrade result and an error report in the upgrade process, and the acquisition server is also used for recording an upgrade log according to the upgrade result.
In the embodiment of the application, the acquisition program of the acquisition client needs to be added with a fund supervision data acquisition function from the requirements of the business department; the collection of the online signature transaction data is improved from the original daily collection to the quasi-real-time collection, and the collection data is standardized and newly added.
Aiming at increasing the fund supervision data acquisition function, upgrading and reforming of a code program of an acquisition client are needed at present, and shutdown deployment is needed. In the embodiment of the application, the new version acquisition client program is pushed to the version directory through the acquisition server, and meanwhile, the first file abstract of the new version acquisition client program is calculated through an MD5 algorithm. The acquisition server side sends a version upgrading instruction to the acquisition client side, and the first file abstract is obtained. After the acquisition client receives the update instruction of the acquisition server, the corresponding acquisition client is pulled to the target address of the acquisition server according to the version catalog, version number, first file abstract and other information in the update instruction to obtain a program package of the first version. And the acquisition client calculates the program package of the first version to obtain a second file abstract, compares the second file abstract with the first file abstract transmitted by the acquisition server, and backs up the original acquisition client program if the comparison is successful. The acquisition client profile is then modified. The Daemon process is realized by java, the change of the configuration file is monitored through a Daemon thread (Daemon thread), and after the change of the configuration file is monitored, the configuration file is analyzed based on a java reflection mechanism to obtain relevant information of a new version program. New version acquisition client program launch is achieved by constructing ProcessBuilder (by creating a new process to execute the specified command) classes. If the collection client calculates the second file abstract of the program package of the first version and the comparison with the first file abstract transmitted by the collection server fails, the program package of the first version is pulled again, the exception is returned after multiple attempts fail, and the pulling action is terminated. And finally, the acquisition client transmits the upgrading result to the acquisition server. And the acquisition server records the result and the log.
S203, if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring corresponding data based on the data acquisition task.
In the embodiment of the application, after the dynamic acquisition parameters and the dynamic acquisition scripts are set at the acquisition server, the dynamic acquisition parameters and the dynamic acquisition scripts can be sent to each acquisition client. The dynamic collection script is analyzed by an internal script engine of the application collection client.
Further, collecting corresponding data based on the data collection task includes: the parameterized data acquisition task may be placed in a REDIS (a key value storage system) cache to obtain data corresponding to the data acquisition task based on cache acquisition.
If the acquisition client is updated, the target information includes: dynamic acquisition scripts and dynamic acquisition parameters. The updated acquisition client is used for receiving the dynamic acquisition script and the dynamic acquisition parameters sent by the acquisition server, analyzing the dynamic acquisition script by adopting an internal script engine, analyzing a data acquisition task, binding the data acquisition task and the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring data according to the analyzed dynamic acquisition script and the analyzed dynamic acquisition parameters.
Specifically, after the acquisition client is upgraded, a dynamic acquisition parameter can be set at the acquisition server and a dynamic acquisition script can be configured according to the service type, wherein the dynamic acquisition parameter comprises: acquisition range and acquisition time, acquisition range such as the time of data generation, the type of data etc. The acquisition time is the data in the corresponding acquisition range acquired by the acquisition client from the intermediate database at the acquisition time point.
And then, receiving acquisition parameters sent by the acquisition server through the acquisition client. After the acquisition server sets the acquisition parameters, the acquisition parameters can be sent to each acquisition client. And the acquisition client side stores the dynamic acquisition parameters and the dynamic acquisition script into a configuration table. And analyzing the dynamic acquisition script by using an internal script engine of the acquisition client, returning an upgrading result to the acquisition server after the analysis is successful, and acquiring related data from a corresponding intermediate database by the acquisition client according to the dynamic acquisition parameters.
The method and the device are based on the daemon monitoring of the state of the acquisition client and triggering of the automatic upgrading of the acquisition client, the acquisition server initiates the upgrading, the acquisition client automatically pulls the program package of the first version, the automatic updating of the acquisition client is carried out, manual intervention is not needed, and the upgrading efficiency of the acquisition client is improved.
Wherein, still include: the parameterized data acquisition tasks are filtered with application interceptors to prevent SQL (Structured Query Language, database language) injection.
Further, by using dynamic acquisition parameters, the acquisition client can achieve dynamic expansion of simple requirements without suspending the service. By the daemon, after the version of the acquisition server is pushed to update, the acquisition client realizes automatic update, releases the new version acquisition program, does not need manual intervention, and improves the updating efficiency of the acquisition client.
In an alternative embodiment, the second operational procedure further comprises: and placing the parameterized data acquisition task in REDIS cache, and triggering database detection to verify whether the upgrade is successful.
In the embodiment of the application, after the parameterized data acquisition task is put into REDIS buffer, the database detection is triggered to detect whether the acquisition client is successfully upgraded.
Specifically, triggering database detection includes: connecting a database; when the database carries out heartbeat detection, verifying whether the parameterized data acquisition task is successfully executed; if the data acquired by the parameterized data acquisition task is acquired, the success of upgrading is determined; if the error reporting information is acquired, the upgrade failure is determined.
If the data acquisition is successful, the success of the upgrading of the client can be determined, otherwise, the failure of the upgrading is determined.
In the embodiment of the application, for the data to be acquired, such as the acquisition of the internet sign transaction data, the acquisition is promoted from the original acquisition according to the interval time to the real-time acquisition, and each acquisition client pushes the real-time data and completes the binding of the data acquisition task and the dynamic acquisition parameters according to the new data acquisition task. Dynamic acquisition parameters can be updated by configuring a dynamic acquisition script through an acquisition client. And after the configuration is completed, automatically triggering and notifying the acquisition client, and transmitting the dynamic acquisition parameters and the dynamic acquisition scripts. The acquisition client acquires and stores the dynamic acquisition parameters and the dynamic acquisition scripts. The internal script engine of the acquisition client acquires and constructs query sentences by using SQL sentences, binds dynamic acquisition parameters and can write an application interceptor to prevent SQL injection. Analyzing the dynamic acquisition script by utilizing an internal script engine of the acquisition client to acquire a data acquisition task, successfully storing the data acquisition task into REDIS (REDIS) cache, and acquiring data in real time by the acquisition client according to new dynamic acquisition parameters. After the upgrade is completed, the collecting client returns the upgrade result of the collecting client so as to collect the recorded result and log of the server.
Further, after each acquisition client receives the dynamic acquisition parameters and the dynamic acquisition scripts, analyzing the dynamic acquisition scripts to acquire related data in the corresponding intermediate database according to the dynamic acquisition parameters. The application is initiated by the acquisition server based on the daemon, and the acquisition client automatically pulls the latest version program codes, automatically updates the acquisition client and acquires data. Specifically, the present application includes: the acquisition server is used for configuring dynamic acquisition parameters and dynamic acquisition scripts and sending an upgrading instruction to the acquisition client; and the plurality of acquisition clients are used for receiving the upgrade instruction of the acquisition server and carrying out the upgrade of the acquisition clients or the acquisition of data according to the upgrade instruction. In addition, each acquisition client comprises a daemon corresponding to the acquisition client, and the daemon is used for monitoring the state of the acquisition client and triggering the automatic upgrading of the acquisition client. According to the method and the system, the automatic upgrading of the acquisition client can be realized, manual intervention is not needed, the acquisition parameters can be dynamically configured by the acquisition server, and then the acquisition parameters are sent to the acquisition client for data acquisition, so that the expandability of the acquisition client is improved.
In an alternative embodiment, a data acquisition system is provided with reference to fig. 1, comprising: the system comprises an acquisition server and a plurality of acquisition clients, wherein the acquisition clients are deployed in different areas, and the acquisition server comprises:
the system comprises an acquisition server, a server and a server, wherein the acquisition server is used for providing a visual interface and generating an upgrading instruction according to interactive operation acted on the visual interface; and sending an upgrade instruction to a plurality of acquisition clients;
and the acquisition server is used for executing the upgrading method of the client in any one of the above steps.
The specific implementation process of the data acquisition system refers to the above method embodiment, and is not described herein again.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Referring to fig. 3, a schematic diagram of an upgrade apparatus of a client is provided for a collection client in a data collection system, where the data collection system includes a collection server and a plurality of collection clients, the collection clients are deployed in different areas, and the collection server is configured to send upgrade instructions for the collection clients; the upgrade apparatus 300 of the client includes:
The acquiring module 301 is configured to acquire target information carried in an upgrade instruction in response to receiving the upgrade instruction;
the upgrade module 302 is configured to execute a first operation procedure if the target information includes a version directory and a first file digest of the first version package, where the first operation procedure includes: pulling a program package of a first version from an acquisition server according to the version catalog; determining a second file digest of the package; under the condition that the comparison of the first file abstract and the second file abstract is consistent, upgrading the local acquisition client according to the program package of the first version; if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring corresponding data based on the data acquisition task.
In one embodiment of the present application, further comprising:
and the application interceptor is used for filtering the parameterized data acquisition task so as to prevent SQL injection.
In one embodiment of the present application, the second operation flow further includes: and placing the parameterized data acquisition task in REDIS cache, and triggering database detection to verify whether the upgrade is successful.
In one embodiment of the present application, the upgrade module is specifically configured to, when triggering database detection: connecting a database; when the database carries out heartbeat detection, verifying whether the parameterized data acquisition task is successfully executed; if the data acquired by the parameterized data acquisition task is acquired, the success of upgrading is determined; if the error reporting information is acquired, the upgrade failure is determined.
In one embodiment of the present application, the daemon running in the collecting client, the upgrade instruction further carries a version number of the first version, and the first operation flow further includes: under the condition that the comparison of the first file abstract and the second file abstract is consistent, modifying the version number in the configuration file of the acquisition client to be the version number of the first version; monitoring the version number in the configuration file through a daemon; under the condition that the version number in the configuration file changes, restarting the acquisition client through the daemon.
In one embodiment of the present application, further comprising: the system comprises a sending module, an acquisition server and a control module, wherein the sending module is used for sending relevant upgrade information to the acquisition server, the relevant upgrade information comprises an upgrade result and errors in the upgrade process, and the acquisition server is also used for recording an upgrade log according to the upgrade result.
The upgrading device of the client is initiated by the acquisition server based on the daemon, and the acquisition client automatically pulls the latest version program codes to automatically update the acquisition client. Specifically, the present application includes: the acquisition server is used for configuring acquisition parameters and sending an upgrading instruction and an acquisition instruction to the acquisition client; and the plurality of acquisition clients are used for receiving the upgrade instruction and the acquisition instruction of the acquisition server and upgrading the acquisition clients according to the upgrade instruction, and each acquisition client comprises a daemon corresponding to the acquisition client, and the daemon is used for monitoring the state of the acquisition client and triggering the automatic upgrade of the acquisition client. According to the method and the system, the automatic upgrading of the acquisition client can be realized, manual intervention is not needed, the acquisition parameters can be dynamically configured at the acquisition server, and then the acquisition parameters are sent to the acquisition client for data acquisition, so that the expandability of the acquisition client is improved. Specifically, the specific working content of each module of the upgrading device of the client is referred to the embodiment content of the upgrading method of the client, which is not described herein.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the processing module may be a processing element that is set up separately, may be implemented in a chip of the above-mentioned apparatus, or may be stored in a memory of the above-mentioned apparatus in the form of program codes, and the functions of the above-mentioned processing module may be called and executed by a processing element of the above-mentioned apparatus. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more specific integrated circuits (application specific integrated circuit, ASIC), or one or more microprocessors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (central processing unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, central, or data center. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices such as a central office, data center, or the like, that contains an integration of one or more available media. Usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid State Disk (SSD)), among others.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 4, the electronic device may include: a processor 41, a memory 42, a communication interface 43 and a system bus 44. The memory 42 and the communication interface 43 are connected to the processor 41 through the system bus 44 and complete communication with each other, the memory 42 is used for storing computer execution instructions, the communication interface 43 is used for communicating with other devices, and the processor 41 implements the solution of the above embodiment when executing the computer execution instructions.
The system bus referred to in fig. 4 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface is used for realizing communication between the database access device and other devices (such as a user side, a read-write library and a read-only library). The memory may comprise random access memory (random access memory, RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a network processor (network processor, NP), etc.; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
Optionally, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor causes an electronic device to perform a method according to the above embodiment.
Optionally, an embodiment of the present application further provides a computer program product, on which a computer program is stored, which when executed by a processor causes an electronic device to perform the method of the above embodiment.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the front and rear associated objects are an "or" relationship; in the formula, the character "/" indicates that the front and rear associated objects are a "division" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
It will be appreciated that the various numerical numbers referred to in the embodiments of the present application are merely for ease of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the sequence number of each process does not mean the sequence of execution sequence, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (11)

1. The upgrading method of the client is characterized by being applied to an acquisition client in a data acquisition system, wherein the data acquisition system comprises an acquisition server and a plurality of acquisition clients, the acquisition clients are deployed in different areas, and the acquisition server is used for sending upgrading instructions to the acquisition clients; the upgrading method comprises the following steps:
Responding to the received upgrading instruction, and acquiring target information carried in the upgrading instruction;
if the target information includes a version directory and a first file digest of a first version of the package, executing a first operation procedure, where the first operation procedure includes: pulling the program package of the first version from the acquisition server according to the version catalog; determining a second file digest of the package; upgrading a local acquisition client according to the program package of the first version under the condition that the comparison of the first file abstract and the second file abstract is consistent;
if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring corresponding data based on the data acquisition task.
2. The method for upgrading a client according to claim 1, further comprising:
and filtering the parameterized data acquisition task by using an interceptor so as to prevent SQL injection.
3. The method for upgrading a client according to claim 1 or 2, wherein the second operation procedure further comprises:
and placing the parameterized data acquisition task into REDIS buffer memory, and triggering database detection to verify whether the upgrade is successful.
4. A method of upgrading a client according to claim 3, wherein the triggering database detection comprises:
connecting a database;
when the database carries out heartbeat detection, verifying whether the parameterized data acquisition task is successfully executed;
if the data acquired by the parameterized data acquisition task is acquired, the success of upgrading is determined;
if the error reporting information is acquired, the upgrade failure is determined.
5. The method for upgrading a client according to claim 1 or 2, wherein a daemon is run in the collecting client, the upgrading instruction further carries a version number of a first version, and the first operation flow further includes:
modifying the version number in the configuration file of the acquisition client to be the version number of the first version under the condition that the comparison of the first file abstract and the second file abstract is consistent;
monitoring the version number in the configuration file through the daemon;
And restarting the acquisition client through the daemon under the condition that the version number in the configuration file is changed.
6. The method for upgrading a client according to claim 1 or 2, further comprising:
the method comprises the steps that relevant upgrade information is sent to the acquisition server, the relevant upgrade information comprises an upgrade result and errors in the upgrade process, and the acquisition server is further used for recording an upgrade log according to the upgrade result.
7. A data acquisition system, comprising: the system comprises an acquisition server and a plurality of acquisition clients, wherein the acquisition clients are deployed in different areas, and the acquisition server comprises:
the acquisition server is used for providing a visual interface and generating an upgrading instruction according to the interactive operation acted on the visual interface; and sending an upgrade instruction to the plurality of acquisition clients;
the collecting client is configured to perform the method for upgrading a client according to any one of claims 1 to 6.
8. The upgrading device of the client is characterized by being applied to an acquisition client in a data acquisition system, wherein the data acquisition system comprises an acquisition server and a plurality of acquisition clients, the acquisition clients are deployed in different areas, and the acquisition server is used for sending upgrading instructions to the acquisition clients; the upgrading device comprises:
The acquisition module is used for responding to the received upgrading instruction and acquiring target information carried in the upgrading instruction;
the upgrade module is configured to execute a first operation procedure if the target information includes a version directory and a first file digest of a first version of a package, where the first operation procedure includes: pulling the program package of the first version from the acquisition server according to the version catalog; determining a second file digest of the package; upgrading a local acquisition client according to the program package of the first version under the condition that the comparison of the first file abstract and the second file abstract is consistent; if the target information includes a dynamic acquisition script and dynamic acquisition parameters, executing a second operation flow, wherein the second operation flow includes: analyzing the dynamic acquisition script to obtain an unparameterized data acquisition task; binding the unparameterized data acquisition task with the dynamic acquisition parameters to obtain a parameterized data acquisition task, and acquiring data corresponding to the data acquisition task based on the cache acquisition.
9. An electronic device comprising a memory and a processor; wherein,
The memory is used for storing program codes;
the processor is configured to invoke the program code to implement the method of upgrading a client according to any of claims 1 to 6.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, causes an electronic device to perform the method of upgrading a client according to any of claims 1-6.
11. A computer program product having a computer program stored thereon, which, when executed by a processor, causes an electronic device to perform the method of upgrading a client according to any of claims 1-6.
CN202410039226.6A 2024-01-10 2024-01-10 Upgrading method and device of client and electronic equipment Pending CN117762454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410039226.6A CN117762454A (en) 2024-01-10 2024-01-10 Upgrading method and device of client and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410039226.6A CN117762454A (en) 2024-01-10 2024-01-10 Upgrading method and device of client and electronic equipment

Publications (1)

Publication Number Publication Date
CN117762454A true CN117762454A (en) 2024-03-26

Family

ID=90314529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410039226.6A Pending CN117762454A (en) 2024-01-10 2024-01-10 Upgrading method and device of client and electronic equipment

Country Status (1)

Country Link
CN (1) CN117762454A (en)

Similar Documents

Publication Publication Date Title
US11163731B1 (en) Autobuild log anomaly detection methods and systems
US20200067802A1 (en) Communication between independent containers
US8543683B2 (en) Remote monitoring of local behavior of network applications
US7191364B2 (en) Automatic root cause analysis and diagnostics engine
US20060259594A1 (en) Progressive deployment and maintenance of applications on a set of peer nodes
US8843623B2 (en) Methods, apparatuses, and computer program products for automated remote data collection
EP3279812B1 (en) Techniques for data extraction
CN111144839B (en) Project construction method, continuous integration system and terminal equipment
CN112163412B (en) Data verification method and device, electronic equipment and storage medium
CN110225078B (en) Application service updating method, system and terminal equipment
CN116760860A (en) Cluster log collection method based on cloud computing and related equipment
CN110851352A (en) Fuzzy test system and terminal equipment
CN110908910B (en) Block chain-based test monitoring method and device and readable storage medium
US11151020B1 (en) Method and system for managing deployment of software application components in a continuous development pipeline
CN111782526A (en) Interface testing method and device, electronic equipment and storage medium
CN112598529B (en) Data processing method and device, computer readable storage medium and electronic equipment
US8380729B2 (en) Systems and methods for first data capture through generic message monitoring
CN117762454A (en) Upgrading method and device of client and electronic equipment
CN109814911A (en) Method, apparatus, computer equipment and storage medium for Manage Scripts program
CN112711466B (en) Hanging affair inspection method and device, electronic equipment and storage medium
AU2022207189A1 (en) Web attack simulator
Brandt et al. Large-scale persistent numerical data source monitoring system experiences
CN113238950A (en) System and method for testing distributed system, storage medium and electronic equipment
US10896115B2 (en) Investigation of performance bottlenecks occurring during execution of software applications
CN114205422B (en) Non-invasive service processing method, device, equipment and storage medium

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