Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a data processing method, which can ensure the effectiveness of updating a target configuration file by a production server and is beneficial to ensuring normal processing of services. Based on this, the embodiment of the application provides a data processing system, and the data processing system can at least comprise at least one terminal device, at least one computer device, a plurality of gray servers and a plurality of production servers. Referring to FIG. 1, FIG. 1 is a block diagram illustrating an exemplary architecture of a data processing system, wherein the computer device may be the management server 102 shown in FIG. 1. In the data processing system, the terminal device 101 and the management server 102 may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited herein.
In a specific implementation, the management server 102 may perform data interaction with a plurality of grayscale servers 103 and a plurality of production servers 104. For example, management server 102 may send the modified profile to multiple grayscale servers 103, multiple grayscale servers 103 may return feedback information for the modified profile to management server 102, and so on; when each feedback information satisfies a preset condition, the management server may send the modified configuration file to the production server. Wherein multiple grayscale servers 103 may be in a grayscale environment and multiple production servers 104 may be in a production environment. Multiple grayscale servers 103 and multiple production servers 104 may be switched to different environments as needed.
It should be noted that the above mentioned terminal device may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the control server and the sub-server may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Network services, cloud communication, middleware services, domain name services, security services, Content Delivery Networks (CDNs), big data platforms, artificial intelligence platforms, and the like.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present disclosure. The method may be performed by a computer device, which may be the management server described above. The data processing method described in the present embodiment includes the following steps S201 to S205:
s201, receiving a data modification request aiming at a target item, wherein the data modification request comprises modification data aiming at the target item.
In a specific implementation, a manager can log in a file configuration page through a terminal device, modify data of a target item in the file configuration page, the terminal device generates a data modification request according to the target item and the modified data, sends the data modification request for the target item to a computer device, and then the computer device can receive the data modification request for the target item. The file configuration page includes environment configuration, data configuration items, data corresponding to the data configuration items, and the like.
S202, obtaining an initial configuration file matched with the target item, and modifying the initial configuration file according to the modified data of the target item to obtain the target configuration file.
In a specific implementation, a plurality of configuration files are stored in the computer device, and the functions implemented by the configuration files are different. Therefore, the computer device may obtain an initial configuration file matching the target item from the plurality of configuration files, and modify a corresponding portion of data in the initial configuration file according to the modification data of the target item, so as to obtain a target configuration file, where the target configuration file may include the target item, the modification data of the target item, and other unmodified data configuration items, modification time, and so on.
It should be noted that the computer device may mark the target item and the modified data of the target item in the target configuration file, so that a subsequent administrator may compare the initial configuration file with the target configuration file, thereby determining the modified item and the data corresponding to the modified item in the target configuration file, so as to perform adjustment at any time.
In a possible embodiment, the specific implementation manner that the computer device can obtain the initial configuration file matching the target item from the plurality of configuration files may be: the computer device may obtain an initial configuration file matching the target item directly from the plurality of configuration files according to the target item. Or the computer device may obtain an initial configuration file from the plurality of configuration files that matches the identification of the target item based on the identification of the target item.
And S203, distributing the target configuration file to a plurality of gray scale servers in a gray scale environment so that the plurality of gray scale servers can operate the target configuration file conveniently, and respectively returning feedback information aiming at the target configuration file.
Feedback information returned by any one of the multiple gray scale servers is used for indicating: and whether the target configuration file has abnormal operation on any gray server or not. The grayscale environment is used to detect whether the target configuration file can operate normally and take effect. Multiple grayscale servers may be included in a grayscale environment.
In a specific implementation, the computer device may publish the target configuration file to a plurality of grayscale servers in the grayscale environment according to the environment configuration information in the target configuration file, and then the plurality of grayscale servers may load the operating target configuration file after receiving the target configuration file, and return feedback information about the target configuration file to the computer device.
And S204, receiving feedback information aiming at the target configuration file returned by the plurality of gray servers.
In a specific implementation, the computer equipment can continuously receive feedback information aiming at a target configuration file, which is returned by a plurality of gray servers; or the computer equipment can receive feedback information aiming at the target configuration file returned by the multiple gray scale servers within a period of time (or a preset period); or the computer device can send a data acquisition request to the multiple gray-scale servers, wherein the data acquisition request carries the target configuration file identifier, and then the computer device can receive feedback information which is returned by the multiple gray-scale servers and aims at the target configuration file according to the data acquisition request.
And S205, when each feedback information meets a preset condition, sending the target configuration file to a production server in the production environment.
The production environment refers to an environment where a user uses and runs a normal configuration file, and is generally maintained by management personnel, and other people do not have the right to modify the environment.
In a specific implementation, when each piece of feedback information satisfies a preset condition, the computer device may determine that the target configuration file operates normally or the function implemented by the target configuration file is normal, and send the target configuration file to the production server in the production environment, so that the production server in the production environment can completely load and operate the target configuration file. And the computer device may also save the target configuration file in a database to enable subsequent retrieval of the target configuration file from the database at a rapid pace.
The loading and running of the target configuration file by the production server can be divided into two cases: (1) the production server may first determine whether the target configuration file is a configuration file loaded at startup, and if the target configuration file is a configuration file loaded at startup, the production server stores the target configuration file in the database, and backs up the historical configuration file, and then the production server runs the target configuration file. (2) If the target configuration file is not the configuration file loaded during starting, the production server calls the target configuration file by using various applications, so that the production server runs the target configuration file.
In this embodiment of the application, after receiving a data modification request for a target item, a computer device may modify an initial configuration file matched with the target item according to modification data of the target item to obtain a target configuration file, and issue the target configuration file to a plurality of grayscale servers in a grayscale environment, so as to implement running of the target configuration file in the plurality of grayscale servers, and implement testing of the target configuration file according to feedback information for the target configuration file returned by the plurality of grayscale servers. When each piece of feedback information meets the preset condition, the target configuration file is proved to have no problem, and then the computer equipment sends the target configuration file to a production server in the production environment, so that dynamic refreshing is realized, the effectiveness of the production server for operating the target configuration file can be ensured, the accuracy of version updating is ensured, and normal processing of services is favorably ensured.
Referring to fig. 3, fig. 3 is a schematic flow chart of another data processing method according to an embodiment of the present disclosure. The method may be performed by the computer device, which may be the management server. The data processing method described in this embodiment includes the following steps S301 to S308:
s301, receiving a data modification request aiming at the target item, wherein the data modification request comprises modification data aiming at the target item.
S302, obtaining an initial configuration file matched with the target item, and modifying the initial configuration file according to the modified data of the target item to obtain the target configuration file.
The specific implementation manners of steps S301 to S302 may refer to the specific implementation manners of steps S201 to S202 in the foregoing embodiments, and are not described herein again.
S303, when detecting the operation to the environment switching button, reading an available server in the production environment, and acquiring a version number of the available server.
Wherein, an environment switching button is provided, which can switch the production server in the production environment to the grayscale environment in the grayscale environment, or switch the grayscale environment in the grayscale environment to the production server in the production environment. For example, when a server in a grayscale environment is not enough, an environment switch button may be triggered to switch an available server in a production environment to the grayscale environment, so that the available servers in different environments may be fully utilized.
In a specific implementation, when the computer device detects a pressing operation for the environment switching button, the computer device may read an available server in the production environment, and obtain a version number of the available server, so that a configuration file corresponding to the available server is obtained from the configuration file set according to the version number of the available server.
In one possible embodiment, the specific implementation of the computer device reading the available servers in the production environment is: the computer device sends an acknowledgement packet (ACK) to the production server in the production environment, and when receiving acknowledgement information of the production server for the ACK packet, the computer device determines that the production server is an available server. In a specific implementation, the computer device may periodically send an ACK packet to a production server in the production environment, and when acknowledgement information of the production server for the ACK packet is not received, it may be determined that the production server is not currently available; when the acknowledgement information of the production server for the ACK packet is received, the production server is indicated to be available in the production environment, and the production server is determined to be the available server.
Further, after obtaining the available server in the production environment, in a possible embodiment, the computer device may call the information interface to obtain the version number of the available server. In another possible embodiment, the computer device may further obtain the version number of the available server and the name of the available server, so that the switching profile of the available server is subsequently matched from the profile set according to the version number of the server and the name of the available server, thereby ensuring that a more accurate switching profile is found.
And S304, matching the switching configuration file of the available server from the configuration file set according to the version number of the available server.
Wherein, the environment type of the environment configuration information in the switching configuration file is a gray scale environment.
In a specific implementation, the computer device may obtain the set of configuration files from the database, and find a switching configuration file suitable for running on the available server from the set of configuration files according to the version number of the available server.
In a possible embodiment, the configuration files in the configuration file set correspond to version numbers of servers, and it is understood that these configuration files can be run in the corresponding servers. The computer device finds a plurality of configuration files from the configuration file set according to the available server version number, and determines a switching configuration file from the plurality of found configuration files for the gray scale environment according to the environment type of the environment configuration information because the configuration file is converted from the production environment to the gray scale environment.
S305, sending a switching configuration file to the available server so that the available server can be switched from the production environment to the gray scale environment based on the environment configuration information in the switching configuration file.
In a specific implementation, the computer device sends a switching configuration file to the available server, and the available server loads and runs the switching configuration file and switches from the production environment to the grayscale environment according to the environment configuration information in the switching configuration file.
S306, the target configuration file is distributed to the multiple gray scale servers in the gray scale environment, so that the multiple gray scale servers can conveniently run the target configuration file, and feedback information aiming at the target configuration file is respectively returned.
Feedback information returned by any one of the multiple gray scale servers is used for indicating: and whether the target configuration file has abnormal operation on any gray server or not.
In one possible embodiment, to enable running tests in multiple grayscale servers in a grayscale environment, the computer device may obtain environment configuration information from a target configuration file, and determine an environment type to be published by the target configuration file based on the environment configuration information, where the environment type to be published includes a grayscale environment or a production environment. The computer device may then determine whether the type of environment to be published in the target profile is a grayscale environment or a production environment. If the environment type to be published is a grayscale environment, the computer device may publish the target configuration file to a plurality of grayscale servers in the grayscale environment.
In another possible embodiment, if the type of the environment to be released is a production environment, the computer device obtains environment configuration information of a grayscale environment, and modifies the environment configuration information in the target configuration file according to the environment configuration information of the grayscale environment, thereby obtaining a modified target configuration file. And distributing the modified target configuration file to a plurality of gray scale servers in a gray scale environment.
And S307, receiving feedback information aiming at the target configuration file returned by the plurality of gray servers.
The feedback information comprises first feedback information used for indicating that the target configuration file operates abnormally and second feedback information used for indicating that the target configuration file operates normally.
And S308, when the feedback information meets the preset conditions, sending the target configuration file to a production server in the production environment.
In a specific implementation, the computer device may count the number of abnormal times that the target profile operates abnormally in the plurality of grayscale servers based on the first feedback information and the second feedback information returned by the plurality of grayscale servers, and calculate the abnormal rate of the target profile in the plurality of grayscale servers according to the number of abnormal times. The computer device may then determine whether the anomaly rate is less than the anomaly rate. In one possible embodiment, if the anomaly rate is less than the anomaly rate threshold, indicating that the target configuration file can operate normally or can implement the function corresponding to the target configuration file, the computer device may send the target configuration file to a production server in the production environment. In another possible embodiment, if the anomaly rate is greater than or equal to the anomaly rate threshold, indicating that the target configuration file is abnormal, the computer device may obtain the initial configuration file from the database through a rollback operation, and issue the initial configuration file to the grayscale environment, so that the grayscale server in the grayscale environment runs the initial configuration file, and it is ensured that the grayscale server can normally perform service processing. The initial configuration file may be understood as a correct configuration file (i.e., a configuration file that can operate normally and can implement a function corresponding to the configuration file).
In a possible embodiment, when the computer device obtains the initial configuration file through the rollback operation, it may first detect whether the initial configuration file is saved (or backed up) in the database. If the initial configuration file is not stored in the database, prompt information is output, so that a manager can acquire the initial configuration file according to the prompt information and upload the initial configuration file to the computer equipment. The mode of outputting the prompt message comprises the following steps: and outputting the prompt information in a voice mode or outputting the prompt information in a text mode. If the initial configuration file is stored in the database, the computer device may directly obtain the initial configuration file.
In the embodiment of the application, the computer device modifies the initial configuration file matched with the target item according to the modification data of the target item to obtain a target configuration file, and when the operation aiming at the environment switching button is detected, reads an available server in the production environment and obtains the version number of the available server. And then the computer equipment matches a switching configuration file of the available server from the configuration file set according to the version number of the available server and sends the switching configuration file to the available server, so that the available server is switched from the production environment to the gray scale environment based on the environment configuration information in the switching configuration file, thereby ensuring that the gray scale servers running the target configuration file have enough quantity and ensuring the accuracy of the test. The target configuration file is issued to a plurality of gray scale servers in a gray scale environment, the target configuration file is operated in the plurality of gray scale servers, and the target configuration file can be tested. The computer equipment can receive feedback information which is returned by the gray servers and aims at the target configuration file, when the feedback information meets preset conditions, the target configuration file is proved to have no problem, the target configuration file is sent to the production server in the production environment, dynamic refreshing is achieved, accordingly, the effectiveness of the ecological server in running the target configuration file can be guaranteed, the version updating accuracy is guaranteed, and normal processing of business is guaranteed.
Based on the above method for providing data processing, please refer to fig. 4, and fig. 4 provides a data processing apparatus for the embodiment of the present application, where the data processing apparatus may be applied to the computer devices corresponding to fig. 2 and fig. 3, and specifically, the data processing apparatus may be a computer program (including program codes) running in the computer devices, and the data processing apparatus may be configured to execute corresponding steps in the method provided by the embodiment of the present application. The method comprises the following steps:
a receiving module 401, configured to receive a data modification request for a target item, where the data modification request includes modification data for the target item;
a processing module 402, configured to obtain an initial configuration file matched with the target item, and modify the initial configuration file according to modification data of the target item to obtain a target configuration file;
the processing module 402 is further configured to publish the target configuration file to a plurality of grayscale servers in a grayscale environment, so that the plurality of grayscale servers run the target configuration file and each return feedback information for the target configuration file, where the feedback information returned by any one of the plurality of grayscale servers is used to indicate: whether the target configuration file has abnormal operation on any one of the grayscale servers or not;
the receiving module 401 is further configured to receive feedback information, which is returned by the multiple grayscale servers and is for the target configuration file;
a sending module 403, configured to send the target configuration file to a production server in a production environment when the feedback information satisfies a preset condition.
In a possible embodiment, the processing module 402 is specifically configured to:
acquiring environment configuration information from the target configuration file;
determining the type of the environment to be issued of the target configuration file based on the environment configuration information, wherein the type of the environment to be issued comprises a gray level environment or a production environment;
and if the environment type to be issued is a gray scale environment, issuing the target configuration file to a plurality of gray scale servers in the gray scale environment.
In a possible embodiment, the processing module 402 is specifically configured to:
if the environment type to be released is a production environment, acquiring environment configuration information of a gray level environment;
modifying the environment configuration information in the target configuration file according to the environment configuration information of the gray level environment to obtain a modified target configuration file;
and issuing the modified target configuration file to a plurality of gray scale servers in the gray scale environment.
In a possible embodiment, the feedback information includes first feedback information used for indicating that the target profile operates abnormally and second feedback information used for indicating that the target profile operates normally, and the processing module 402 is specifically configured to:
counting the abnormal times of the target configuration file in the multiple gray servers based on the first feedback information and the second feedback information returned by the multiple gray servers;
calculating the abnormal rate of the target configuration file in the plurality of gray servers according to the abnormal times;
and if the abnormal rate is smaller than the abnormal rate threshold value, sending the target configuration file to a production server in the production environment.
In a possible embodiment, the processing module 402 is specifically configured to:
and if the abnormal rate is greater than or equal to an abnormal threshold value, acquiring the initial configuration file through rollback operation, and issuing the initial configuration file to a gray environment.
In a possible embodiment, before publishing the target profile to a plurality of grayscale servers in a grayscale environment, the processing module 402 is further configured to: when the operation aiming at the environment switching button is detected, reading an available server in the production environment, and acquiring the version number of the available server; matching a switching configuration file of the available server from a configuration file set according to the version number of the available server, wherein the environment type of environment configuration information in the switching configuration file is a gray environment;
the sending module 403 is further configured to send the switching configuration file to the available server, so that the available server switches from the production environment to the grayscale environment based on the environment configuration information in the switching configuration file.
In a possible embodiment, the sending module 403 is configured to send an acknowledgement packet to a production server in the production environment;
the processing module 402 is specifically configured to determine that the production server is an available server when receiving the acknowledgement information of the production server for the acknowledgement packet.
It can be understood that the functions of the functional modules of the data processing apparatus in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not described herein again.
Further, please refer to fig. 5, wherein fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device in the corresponding embodiment of fig. 2 or fig. 3 may be the computer device shown in fig. 5. As shown in fig. 5, the computer apparatus may include: a processor 501, an input device 502, an output device 503, and a memory 504. The processor 501, the input device 502, the output device 503, and the memory 504 are connected by a bus 505. The memory 504 is used to store a computer program comprising program instructions and the processor 501 is used to execute the program instructions stored by the memory 504.
Receiving a data modification request for a target item, the data modification request including modification data for the target item;
acquiring an initial configuration file matched with the target item, and modifying the initial configuration file according to the modification data of the target item to obtain a target configuration file;
issuing the target configuration file to a plurality of gray scale servers in a gray scale environment so that the plurality of gray scale servers run the target configuration file and respectively return feedback information aiming at the target configuration file, wherein the feedback information returned by any one of the plurality of gray scale servers is used for indicating: whether the target configuration file has abnormal operation on any one of the grayscale servers or not;
receiving feedback information aiming at the target configuration file returned by the plurality of gray scale servers;
and when the feedback information meets preset conditions, sending the target configuration file to a production server in a production environment.
In a possible embodiment, the processor 501 is specifically configured to:
acquiring environment configuration information from the target configuration file;
determining the type of the environment to be issued of the target configuration file based on the environment configuration information, wherein the type of the environment to be issued comprises a gray level environment or a production environment;
and if the environment type to be issued is a gray scale environment, issuing the target configuration file to a plurality of gray scale servers in the gray scale environment.
In a possible embodiment, the processor 501 is specifically configured to:
if the environment type to be released is a production environment, acquiring environment configuration information of a gray level environment;
modifying the environment configuration information in the target configuration file according to the environment configuration information of the gray level environment to obtain a modified target configuration file;
and issuing the modified target configuration file to a plurality of gray scale servers in the gray scale environment.
In a possible embodiment, the feedback information includes first feedback information used for indicating that the target profile operates abnormally and second feedback information used for indicating that the target profile operates normally, and the processor 501 is specifically configured to:
counting the abnormal times of the target configuration file in the multiple gray servers based on the first feedback information and the second feedback information returned by the multiple gray servers;
calculating the abnormal rate of the target configuration file in the plurality of gray servers according to the abnormal times;
and if the abnormal rate is smaller than the abnormal rate threshold value, sending the target configuration file to a production server in the production environment.
In a possible embodiment, the processor 501 is further configured to:
and if the abnormal rate is greater than or equal to an abnormal threshold value, acquiring the initial configuration file through rollback operation, and issuing the initial configuration file to a gray environment.
In a possible embodiment, before publishing the target profile to a plurality of grayscale servers in a grayscale environment, the processor 501 is further configured to:
when the operation aiming at the environment switching button is detected, reading an available server in the production environment, and acquiring the version number of the available server;
matching a switching configuration file of the available server from a configuration file set according to the version number of the available server, wherein the environment type of environment configuration information in the switching configuration file is a gray environment;
sending the switching profile to the available server to cause the available server to switch from the production environment to the grayscale environment based on environment configuration information in the switching profile.
In a possible embodiment, the processor 501 is specifically configured to:
sending a confirmation data packet to a production server in the production environment;
and when receiving the confirmation information of the production server aiming at the confirmation data packet, determining that the production server is an available server.
It should be understood that, in the embodiment of the present Application, the Processor 501 may be a Central Processing Unit (CPU), and the Processor 501 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 504 may include a read-only memory and a random access memory, and provides instructions and data to the processor 501. A portion of the memory 504 may also include non-volatile random access memory.
The input device 502 may include a keyboard or the like, and inputs a data request to the processor 501; the output device 503 may include a display or the like.
In a specific implementation, the processor 501, the input device 502, the output device 503, and the memory 504 described in this embodiment of the present application may perform the implementation described in all the embodiments, or may also perform the implementation described in the apparatus described above, and no further description is provided herein.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.