CN116955178A - Method and device for determining server, storage medium and electronic equipment - Google Patents

Method and device for determining server, storage medium and electronic equipment Download PDF

Info

Publication number
CN116955178A
CN116955178A CN202310908284.3A CN202310908284A CN116955178A CN 116955178 A CN116955178 A CN 116955178A CN 202310908284 A CN202310908284 A CN 202310908284A CN 116955178 A CN116955178 A CN 116955178A
Authority
CN
China
Prior art keywords
server
servers
target
test case
historical
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
CN202310908284.3A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310908284.3A priority Critical patent/CN116955178A/en
Publication of CN116955178A publication Critical patent/CN116955178A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a device for determining a server, a storage medium and electronic equipment. Relates to the technical field of financial science and technology, wherein the method comprises the following steps: acquiring characteristic information of a target test case; inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server; and determining N target servers from M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer. The application solves the technical problem of higher failure rate of running the test cases caused by the fact that the server related to the test cases cannot be accurately determined in the related technology.

Description

Method and device for determining server, storage medium and electronic equipment
Technical Field
The present application relates to the technical field of financial science and technology, and in particular, to a method and apparatus for determining a server, a storage medium, and an electronic device.
Background
With the development of distributed platforms, more and more traditional centralized systems migrate to the distributed platforms, and specific functions of the systems are generally provided in a distributed service manner.
In the prior art, in the testing process of distributed services, functional testing is usually performed on servers in a distributed server cluster called by a transaction by directly running test cases. However, due to the long transaction links, which are of greater complexity, one transaction often involves invoking multiple servers, and failure of one or more of the transaction links can easily result in failure of the test case to run. Particularly, the newly added test case cannot accurately determine the server involved in the operation process of the newly added case, so that whether an abnormal server exists in the servers cannot be determined, and the failure rate of the operation test case is higher. In addition, if there are multiple abnormal servers in the servers involved in the operation process of the new case, the servers involved in the new case need to be diagnosed multiple times through the test case failure information to confirm the abnormal servers, and the above process is very time-consuming, which easily results in a problem of low test efficiency.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The application provides a method and a device for determining a server, a storage medium and electronic equipment, which at least solve the technical problem that the failure rate of running a test case is high because the server related to the test case cannot be accurately determined in the related technology.
According to an aspect of the present application, there is provided a method for determining a server, including: acquiring characteristic information of a target test case, wherein the target test case is used for performing functional test on servers in a distributed server cluster called by a target transaction; inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform the functional test on the first server, and M is a positive integer; and determining N target servers from the M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
Further, determining N target servers from the M first servers according to the associated probability value corresponding to each first server includes: detecting whether J second servers exist in the M first servers according to the associated probability value corresponding to each first server, wherein the associated probability value corresponding to each second server is larger than or equal to a preset probability value, and J is a positive integer; generating a first set based on the J second servers in the presence of the J second servers in the M first servers; obtaining J second sets corresponding to the J second servers, wherein each second set corresponds to one second server, each second set comprises K third servers, the third servers in each second set are servers with dependency relations with the second servers corresponding to the second sets, and K is a positive integer; the N target servers are determined based on the first set and the J second sets.
Further, determining the N target servers based on the first set and the J second sets includes: combining the first set and the J second sets to obtain a third set, wherein the third set comprises N fourth servers; and taking each server in the N fourth servers as a target server to obtain the N target servers.
Further, obtaining J second sets corresponding to the J second servers includes: obtaining a first historical server set corresponding to each first historical test case in L first historical test cases, and obtaining L first historical server sets, wherein each first historical test case is a test case which runs successfully, the first historical server set corresponding to each first historical test case comprises P fifth servers involved in the running process of the first historical test case, and the L first historical server sets comprise J second servers, and L, P is a positive integer; determining a target set corresponding to each fifth server based on the number of times that each fifth server and other servers corresponding to the fifth server appear in the L first historical server sets at the same time, wherein the target set comprises servers with dependency relationships among the fifth servers, and the other servers corresponding to the fifth server are any one fifth server except the fifth servers in the P fifth servers; and obtaining the J second sets from the target sets corresponding to each fifth server.
Further, the prediction model is obtained through the following process: acquiring a sample data set, wherein the sample data set comprises characteristic information of H second historical test cases and a second historical server set corresponding to each second historical test case, and the second historical server set corresponding to each second historical test case comprises servers involved in the running process of the second historical test case; dividing the sample data set into a training set and a testing set; inputting the data in the training set into an initial neural network model for iterative training to obtain a plurality of training models, wherein the data comprises characteristic information of a second historical test case and a second historical server set corresponding to the second historical test case; the characteristic information in the test set is respectively input into the training models to obtain a server set output by each training model in the training models; determining a loss coefficient of each training model according to the server set and a second historical server set in the test set; and selecting the training model with the smallest loss coefficient as the prediction model.
Further, before determining N target servers from the M first servers according to the associated probability value corresponding to each first server, the method further includes: and creating a heartbeat detection service for each server in the distributed server cluster, wherein the heartbeat detection service is used for detecting whether the server is an abnormal server or not.
Further, after determining N target servers from the M first servers according to the associated probability value corresponding to each first server, the method further includes: detecting whether the abnormal server exists in the N target servers or not based on the heartbeat detection service corresponding to each target server; performing repair operation on the abnormal servers under the condition that the abnormal servers exist in the N target servers, and running the target test cases to perform functional test on the N target servers, wherein the repair operation is used for recovering the abnormal servers to normal servers; and under the condition that the N target servers are all normal servers, the target test cases are operated to perform functional tests on the N target servers.
According to another aspect of the present application, there is also provided a determining apparatus of a server, including: the system comprises an acquisition module, a target test case generation module and a data processing module, wherein the acquisition module is used for acquiring characteristic information of a target test case, and the target test case is used for carrying out functional test on servers in a distributed server cluster called by a target transaction; the prediction module is used for inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform the functional test on the first server, and M is a positive integer; and the determining module is used for determining N target servers from the M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
According to another aspect of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described method of determining a server at run-time.
According to another aspect of the present application, there is also provided an electronic device including one or more processors; and a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running the program, wherein the program is configured to perform the method for determining a server as described above when run.
Firstly, obtaining characteristic information of a target test case, wherein the target test case is used for carrying out functional test on servers in a distributed server cluster called by a target transaction; inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform the functional test on the first server, and M is a positive integer; and finally, determining N target servers from the M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
In the process, the feature information of the target test case is processed through the pre-trained prediction model, M first servers corresponding to the target test case predicted by the prediction model are obtained, the probability (namely the associated probability value) that the target test case needs to perform functional test on the first servers is obtained, N target servers involved in the operation process of the target test case are determined through the associated probability value corresponding to each first server, the server involved in the operation process of the target test case is accurately determined, the problem that whether abnormal servers exist in the servers due to the fact that the servers involved in the operation process of the target test case cannot be accurately determined is avoided, the technical effect of reducing the failure rate of the operation test case is achieved, and the technical problem that the failure rate of the operation test case is high due to the fact that the servers involved in the test case cannot be accurately determined in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of an alternative method of determining a server according to an embodiment of the application;
FIG. 2 is a schematic illustration of the structure of an alternative predictive model in accordance with an embodiment of the application;
FIG. 3 is a schematic diagram of an alternative feature information collection process according to an embodiment of the application;
FIG. 4 is a flow chart of an alternative predictive model training process in accordance with an embodiment of the application;
FIG. 5 is a schematic diagram of an alternative server determination apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of an alternative electronic device according to an embodiment of the application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the method, the device, the storage medium and the electronic device for determining the server of the present application may be used in the field of financial technology, and may also be used in other fields besides the field of financial technology, and the application fields of the method, the device, the storage medium and the electronic device for determining the server of the present application are not limited.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide corresponding operation entries for the user to select authorization or rejection.
Example 1
According to an embodiment of the present application, an alternative method embodiment of a method for determining a server is provided, and it should be noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
FIG. 1 is a flow chart of an alternative method of determining a server according to an embodiment of the application, as shown in FIG. 1, the method comprising the steps of:
step S101, obtaining characteristic information of a target test case.
In an alternative embodiment, a server determination system may be used as the execution body of the server determination method in the embodiment of the present application. For convenience of description, the determination system of the server will be simply referred to as a system hereinafter.
In step S101, the target test case is used to perform a functional test on servers in the distributed server cluster invoked by the target transaction.
Optionally, the feature information of the target test case includes, but is not limited to, feature information of a test case package name, a test case name, a package name of a reference, a test case keyword, a switch involved, and the like of the target test case. The switch is a variable for controlling the program execution flow, and different switches correspond to different program execution flows, so as to correspond to different servers.
Alternatively, in this embodiment, the system may extract the test case keywords by the frequency (i.e., word frequency) with which the target words in the target test case appear in the target test case, as well as the reverse document frequency. Wherein the target word t i The importance in the target test case can be expressed as equation (1):
wherein, in the above formula (1), the file d is assumed j Together with k words, n k,j Is t k In document d j Is the number of occurrences. Molecule n i,j Is the word in file d j The number of occurrences in (a) and the denominator in (d) are in the file d j The sum of the number of occurrences of all words in (a). The inverse document frequency can be expressed as formula (2):
wherein in equation (2), D represents the total number of documents in the corpus. I { j: t i ∈d j The } | contains the word t i Number of files (i.e., n i,j Not 0), if the target word is not in the material, the denominator is zero, so 1+|{ j: t is typically used i ∈d j The test case keyword is then determined by the following equation (3):
tfidf i,j =tf i,f ×idf i (3)
wherein tf-idf tends to filter out common words in equation (3), preserving important words.
Step S102, inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model.
In step S102, the prediction result is used to describe M first servers corresponding to the target test case and associated probability values corresponding to each first server, where the M first servers are servers in the distributed server cluster, and the associated probability value corresponding to each first server is used to characterize a probability that the target test case needs to perform a functional test on the first server, and M is a positive integer.
Optionally, the predictive model is a pre-trained deep neural network model (Deep Neural Networks, DNN). Wherein the multi-layered nonlinear transformation layers of DNNs allow them to learn highly abstract and complex feature representations, thereby achieving higher level tasks. DNN is typically composed of an input layer (i.e., the input layer corresponding to feature 1, feature 2 …, feature n shown in fig. 2), a plurality of hidden layers (i.e., hidden layers corresponding to hidden nodes 11-1m, 21-2m, and n1-nm shown in fig. 2), and an output layer (i.e., the output layer corresponding to output node 1, output node 2 …, output node n shown in fig. 2). Each layer contains a plurality of neurons, where each neuron calculates the sum of the weighted inputs and inputs it into a nonlinear activation function (i.e., the softmax function shown in fig. 2, where the system calculates the associated probability value for the server by softmax). Training of deep neural networks typically uses a back propagation algorithm that updates the weights in the network by calculating and propagating the error gradient back into the network.
Step S103, N target servers are determined from M first servers according to the associated probability value corresponding to each first server.
In step S103, each target server is a server involved in the operation of the target test case, and N is a positive integer.
In this embodiment, the system may determine J second servers from the M first servers according to the associated probability value corresponding to each first server, where the associated probability value corresponding to each second server is greater than or equal to a preset probability value; the system may determine N target servers through a second set corresponding to each second server, where a third server in the second set is a server having a dependency relationship with the second servers corresponding to the second set.
Based on the above-mentioned schemes defined in step S101 to step S103, it can be known that in the present application, feature information of a target test case is first obtained, where the target test case is used for performing a functional test on a server in a distributed server cluster invoked by a target transaction; inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to a target test case and associated probability values corresponding to each first server, the M first servers are servers in a distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform functional test on the first servers, and M is a positive integer; and finally, determining N target servers from M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
In the above process, the feature information of the target test case is processed through the pre-trained prediction model, so as to obtain M first servers corresponding to the target test case predicted by the prediction model, the probability (i.e., the associated probability value) that the target test case needs to perform a functional test on the first servers, and determine N target servers related to the target test case in the operation process through the associated probability value corresponding to each first server, thereby realizing the servers related to the accurate target test case in the operation process, avoiding the problem that whether abnormal servers exist in the servers due to the fact that the servers related to the target test case cannot be accurately determined in the operation process, further realizing the technical effect of reducing the failure rate of the operation test case, and further solving the technical problem that the failure rate of the operation test case is higher due to the fact that the servers related to the test case cannot be accurately determined in the related technology.
Optionally, in the method for determining a server provided in the embodiment of the present application, determining N target servers from M first servers according to the association probability value corresponding to each first server includes: detecting whether J second servers exist in the M first servers according to the associated probability value corresponding to each first server, wherein the associated probability value corresponding to each second server is larger than or equal to a preset probability value, and J is a positive integer; generating a first set based on J second servers in the case where J second servers exist in the M first servers; obtaining J second sets corresponding to J second servers, wherein each second set corresponds to one second server, each second set comprises K third servers, each third server in each second set is a server with a dependency relationship with the second servers corresponding to the second set, and K is a positive integer; n target servers are determined based on the first set and the J second sets.
Optionally, in the method for determining a server provided by the embodiment of the present application, determining N target servers based on the first set and the J second sets includes: combining the first set with J second sets to obtain a third set, wherein the third set comprises N fourth servers; and taking each server in the N fourth servers as a target server to obtain N target servers.
In order to improve the accuracy of determining the server involved in the operation process of the target test case, the problem that whether an abnormal server exists in the servers or not is avoided because the server involved in the operation process of the target test case cannot be accurately determined, so that the failure rate of the operation test case is high is avoided.
For example, if the associated probability value for a server is greater than or equal to 0.5, the server is considered to be involved in the operation of the target test case. Then, under the condition that J second servers exist in the M first servers, the system can generate a first set based on the J second servers, and combine the first set with the J second sets to obtain a third set. For example, the first set is (S 1 ,S 2 ,...S n ) A second server S i Is (D) i1 ,D i2 ,...D ik ) (i.e., the dependent service set a and the dependent service set b … shown in fig. 3, and the dependent service set m), the system performs a merging process on the first set and the second set to obtain a third set as (S) 1 ,D 11 ,...D 1k ,S 2 ,D 21 ,...D 2k ,...S n ,D n1 ,...D nk ). And then the system can take each server in the third set as one target server to obtain N target servers, wherein each second set corresponds to one second server, each second set comprises K third servers, and each third server in each second set is a server with a dependency relationship between the second servers corresponding to the second set.
Optionally, in the method for determining a server provided by the embodiment of the present application, obtaining J second sets corresponding to J second servers includes: obtaining a first historical server set corresponding to each first historical test case in L first historical test cases to obtain L first historical server sets, wherein each first historical test case is a test case which runs successfully, the first historical server set corresponding to each first historical test case comprises P fifth servers involved in the running process of the first historical test case, and the L first historical server sets comprise J second servers, and L, P is a positive integer; determining a target set corresponding to each fifth server based on the number of times that each fifth server and other servers corresponding to the fifth server appear in the L first historical server sets at the same time, wherein the target set comprises servers with dependency relationships among the fifth servers, and the other servers corresponding to the fifth server are any one fifth server except the fifth server in the P fifth servers; and obtaining J second sets from the target sets corresponding to each fifth server.
In this embodiment, each time the system runs a successful test case, the central server in FIG. 3 receives the set of servers involved in the case. To calculate the server's corresponding set of dependent services, in this embodiment, the system calculates the set of dependent services by obtaining L successfully-run test cases (i.e., a first historical test case (t 1 ,t 2 ,...t n ) A server set (i.e. a first history server set S) i =(S i1 ,S i2 ,...S in ) I.e., run-through test cases), where n is the number of run-through test cases, each t i Corresponding to one S i =(S i1 ,S i2 ,...S in ) And each t i Either different test cases or the same test case but with different switching parameters.
Further, the system may determine the target set corresponding to the fifth server based on the number of times each fifth server and other servers corresponding to the fifth server appear simultaneously in the L first historical server sets. For example, if for service S 1 Presence service S a Satisfying the conditional probability Count (S 1 ,S a )/Count(S 1 ) > 95%, and Count (S) 1 ) N is greater than 10%, then S 1 Dependent on S a . Wherein Count (S 1 ,S a ) Is S 1 And S is a At the same time appear at S i Count (S) 1 ) Is S 1 Appear at S i Is a number of times in the past. If S 1 Dependent on S a It is explained that the two servers have a logical dependency relationship and then the system determines the target set by all servers having a dependency relationship with the fifth server. Because the L first history server sets comprise J second servers, the system can acquire J second sets from the target set corresponding to each fifth server.
FIG. 4 is a flow chart of an alternative predictive model training process, as shown in FIG. 4, according to an embodiment of the application, including the steps of:
step S401, a sample data set is acquired.
In step S401, the sample data set includes feature information of H second historical test cases and a second historical server set corresponding to each second historical test case, and the second historical server set corresponding to each second historical test case includes a server involved in the running process of the second historical test case.
In this embodiment, the data in the sample data set may be collected during each actual test. Specifically, as shown in fig. 3, before each actual test, the test case (i.e., the second historical test case) reports the following feature information to the central server: test case package name, test case name, package name quoted, test case keywords, switches involved, etc. Then during the test, the test case calls the service (i.e. calls server 1, server 2, … server n in fig. 3), and if the server has a response request, reports the running state of the server to the central server. The central server may receive the operating states of the plurality of servers and obtain a sample data set. Wherein the key is characteristic information of the second historical test case: the test case package name, the test case name, the package name of the reference, the test case keyword, the switch involved, and the value is a second set of history servers corresponding to the second historical test case.
Step S402, the sample data set is divided into a training set and a test set.
Step S403, inputting the data in the training set into the initial neural network model, and performing iterative training to obtain a plurality of training models.
In step S403, the data includes feature information of the second historical test case and a second set of history servers corresponding to the second historical test case. The initial neural network model is a deep neural network for model training.
Step S404, the characteristic information in the test set is respectively input into a plurality of training models, and a server set output by each training model in the plurality of training models is obtained.
Step S405, determining a loss coefficient of each training model according to the server set and the second history server set in the test set.
In step S406, a training model with the smallest loss coefficient is selected as the prediction model.
In the embodiment, the system performs iterative training by inputting the data in the training set into the initial neural network model to obtain a plurality of training models, so that a server set involved in the running process of the predicted test case is trained through the characteristic information of the second historical test case and a second historical server set corresponding to the second historical test case; the system obtains a server set output by each training model in the plurality of training models by respectively inputting the characteristic information in the test set into the plurality of training models, determines the loss coefficient of each training model according to the server set and the second historical server set in the test set, selects the training model with the smallest loss coefficient as a prediction model, and improves the model prediction precision, thereby improving the accuracy of determining the server involved in the running process of the test case.
Optionally, in the method for determining a server provided in the embodiment of the present application, before determining N target servers from M first servers according to the association probability value corresponding to each first server, the method further includes: a heartbeat detection service is created for each server in the distributed server cluster, wherein the heartbeat detection service is used for detecting whether the server is an abnormal server.
To enable server availability monitoring, in this embodiment, the system enables detecting whether a server is an anomalous server by creating one heartbeat detection service for each server in the distributed server cluster. Among them, the exception servers include, but are not limited to, failure servers, restarting servers, and servers where there is an exception to the deployed micro-service (e.g., transaction data acquisition exception to the micro-service, transaction data processing exception (e.g., insufficient transaction balance)).
Alternatively, the heartbeat detection service may automatically send the operating state of each server in the distributed server cluster to the central server shown in fig. 3. The system may query the operating state of each server through the central server.
Optionally, in the method for determining a server provided in the embodiment of the present application, after determining N target servers from M first servers according to the association probability values corresponding to each first server, the method further includes: detecting whether an abnormal server exists in N target servers or not based on heartbeat detection service corresponding to each target server; under the condition that an abnormal server exists in the N target servers, repairing the abnormal server, and running a target test case to perform functional test on the N target servers, wherein the repairing operation is used for recovering the abnormal server into a normal server; and under the condition that the N target servers are all normal servers, running the target test cases to perform functional tests on the N target servers.
In this embodiment, the system may determine whether to directly run the target test case based on the heartbeat detection service corresponding to each target server detecting whether there is an abnormal server in the N target servers; under the condition that an abnormal server exists in the N target servers, repairing the abnormal server, and running target test cases to perform functional test on the N target servers, wherein the repairing operation is used for recovering the abnormal server into a normal server; and under the condition that the N target servers are all normal servers, running the target test cases to perform functional tests on the N target servers.
It should be noted that, whether to directly run the target test case is determined based on whether the abnormal server exists in the N target servers or not detected by the heartbeat detection service corresponding to each target server, so that the problem that the server involved in the target test case needs to be diagnosed for many times due to the server fault involved in the running process of the target test case to confirm the abnormal server is avoided, the time required for testing is reduced, the test efficiency of the target test case is improved, and the problem that the test efficiency of the target test case is lower is solved.
Therefore, the method for determining the server provided by the application can process the characteristic information of the target test case through the pre-trained prediction model to obtain M first servers corresponding to the target test case predicted by the prediction model, and the probability (namely the associated probability value) that the target test case needs to perform functional test on the first servers, and determine N target servers related to the target test case in the operation process through the associated probability value corresponding to each first server, thereby realizing the server related to the accurate target test case in the operation process, avoiding the problem that whether the server has abnormal servers or not due to the fact that the server related to the target test case cannot be accurately determined in the operation process, further realizing the technical effect of reducing the failure rate of the operation test case, and further solving the technical problem that the failure rate of the operation test case is higher due to the fact that the server related to the test case cannot be accurately determined by the related technology. The method for determining the server can determine whether the target test case is directly operated or not based on whether the abnormal server exists in N target servers or not by the heartbeat detection service corresponding to each target server, so that the problem that the server related to the target test case needs to be diagnosed for many times due to server faults related to the target test case in the operation process is avoided, the time required by testing is reduced, the test efficiency of the target test case is improved, and the problem that the test efficiency of the target test case is lower is solved.
Example 2
According to an embodiment of the present application, there is provided an embodiment of a determining apparatus for a server, where fig. 5 is a schematic diagram of an alternative determining apparatus for a server according to an embodiment of the present application, as shown in fig. 5, including:
an obtaining module 501, configured to obtain feature information of a target test case, where the target test case is used to perform a functional test on a server in a distributed server cluster called by a target transaction;
the prediction module 502 is configured to input the feature information into a prediction model to obtain a prediction result output by the prediction model, where the prediction result is used to describe M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability value corresponding to each first server is used to characterize a probability that the target test case needs to perform a functional test on the first server, and M is a positive integer;
a determining module 503, configured to determine N target servers from the M first servers according to the associated probability value corresponding to each first server, where each target server is a server involved in the operation process of the target test case, and N is a positive integer.
It should be noted that the above-mentioned obtaining module 501, predicting module 502 and determining module 503 correspond to steps S101 to S103 in the above-mentioned embodiment 1, and the three modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to those disclosed in the above-mentioned embodiment 1.
Optionally, the determining module includes: the detection unit is used for detecting whether J second servers exist in the M first servers according to the associated probability value corresponding to each first server, wherein the associated probability value corresponding to each second server is larger than or equal to a preset probability value, and J is a positive integer; a generation unit configured to generate a first set based on J second servers in a case where J second servers exist among the M first servers; the first acquisition unit is used for acquiring J second sets corresponding to J second servers, wherein each second set corresponds to one second server, each second set comprises K third servers, the third servers in each second set are servers with dependency relations between the second servers corresponding to the second sets, and K is a positive integer; and the first determining unit is used for determining N target servers based on the first set and the J second sets.
Optionally, the first determining unit includes: the merging unit is used for merging the first set with J second sets to obtain a third set, wherein the third set comprises N fourth servers; and the second determining unit is used for taking each server in the N fourth servers as one target server to obtain N target servers.
Optionally, the first acquisition unit includes: the second obtaining unit is configured to obtain a first history server set corresponding to each first history test case in the L first history test cases, so as to obtain L first history server sets, where each first history test case is a test case that is successfully operated, each first history server set corresponding to each first history test case includes P fifth servers involved in the operation process of the first history test case, and the L first history server sets include J second servers, where L, P is a positive integer; a third determining unit, configured to determine a target set corresponding to each fifth server based on the number of times that each fifth server and other servers corresponding to the fifth server appear in the L first history server sets at the same time, where the target set includes a server having a dependency relationship with the fifth server, and the other servers corresponding to the fifth server are any one fifth server other than the fifth server among the P fifth servers; and the third acquisition unit is used for acquiring J second sets from the target sets corresponding to each fifth server.
Optionally, the determining device of the server further includes: the first acquisition module is used for acquiring a sample data set, wherein the sample data set comprises characteristic information of H second historical test cases and a second historical server set corresponding to each second historical test case, and the second historical server set corresponding to each second historical test case comprises servers involved in the running process of the second historical test case; the dividing module is used for dividing the sample data set into a training set and a testing set; the iterative training module is used for inputting data in the training set into the initial neural network model, and performing iterative training to obtain a plurality of training models, wherein the data comprises characteristic information of a second historical test case and a second historical server set corresponding to the second historical test case; the test module is used for respectively inputting the characteristic information in the test set into the plurality of training models to obtain a server set output by each training model in the plurality of training models; the first determining module is used for determining the loss coefficient of each training model according to the server set and the second historical server set in the test set; and the second determining module is used for selecting a training model with the minimum loss coefficient as a prediction model.
Optionally, the determining device of the server further includes: the creation module is used for creating a heartbeat detection service for each server in the distributed server cluster before N target servers are determined from M first servers according to the associated probability value corresponding to each first server, wherein the heartbeat detection service is used for detecting whether the server is an abnormal server.
Optionally, the determining device of the server further includes: the detection module is used for detecting whether an abnormal server exists in the N target servers or not based on heartbeat detection services corresponding to each target server after N target servers are determined from the M first servers according to the associated probability values corresponding to each first server; the execution module is used for repairing the abnormal servers and running the target test cases to perform functional tests on the N target servers under the condition that the abnormal servers exist in the N target servers, wherein the repairing operation is used for recovering the abnormal servers to normal servers; and the operation module is used for operating the target test cases to perform functional tests on the N target servers under the condition that the N target servers are normal servers.
Example 3
According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to perform the above-described method of determining a server at run-time.
Example 4
According to another aspect of an embodiment of the present application, there is also provided an electronic device, wherein fig. 6 is a schematic diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 6, the electronic device including one or more processors; and a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running the program, wherein the program is configured to perform the method for determining a server as described above when run.
As shown in fig. 6, an embodiment of the present application provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, the following steps are implemented:
acquiring characteristic information of a target test case, wherein the target test case is used for performing functional test on servers in a distributed server cluster called by a target transaction; inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to a target test case and associated probability values corresponding to each first server, the M first servers are servers in a distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform functional test on the first servers, and M is a positive integer; and determining N target servers from M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
Optionally, the processor when executing the program further implements the following steps: detecting whether J second servers exist in the M first servers according to the associated probability value corresponding to each first server, wherein the associated probability value corresponding to each second server is larger than or equal to a preset probability value, and J is a positive integer; generating a first set based on J second servers in the case where J second servers exist in the M first servers; obtaining J second sets corresponding to J second servers, wherein each second set corresponds to one second server, each second set comprises K third servers, each third server in each second set is a server with a dependency relationship with the second servers corresponding to the second set, and K is a positive integer; n target servers are determined based on the first set and the J second sets.
Optionally, the processor when executing the program further implements the following steps: combining the first set with J second sets to obtain a third set, wherein the third set comprises N fourth servers; and taking each server in the N fourth servers as a target server to obtain N target servers.
Optionally, the processor when executing the program further implements the following steps: obtaining a first historical server set corresponding to each first historical test case in L first historical test cases to obtain L first historical server sets, wherein each first historical test case is a test case which runs successfully, the first historical server set corresponding to each first historical test case comprises P fifth servers involved in the running process of the first historical test case, and the L first historical server sets comprise J second servers, and L, P is a positive integer; determining a target set corresponding to each fifth server based on the number of times that each fifth server and other servers corresponding to the fifth server appear in the L first historical server sets at the same time, wherein the target set comprises servers with dependency relationships among the fifth servers, and the other servers corresponding to the fifth server are any one fifth server except the fifth server in the P fifth servers; and obtaining J second sets from the target sets corresponding to each fifth server.
Optionally, the processor when executing the program further implements the following steps: acquiring a sample data set, wherein the sample data set comprises characteristic information of H second historical test cases and a second historical server set corresponding to each second historical test case, and the second historical server set corresponding to each second historical test case comprises servers involved in the running process of the second historical test case; dividing a sample data set into a training set and a testing set; inputting the data in the training set into an initial neural network model for iterative training to obtain a plurality of training models, wherein the data comprises characteristic information of a second historical test case and a second historical server set corresponding to the second historical test case; respectively inputting the characteristic information in the test set into a plurality of training models to obtain a server set output by each training model in the plurality of training models; determining a loss coefficient of each training model according to the server set and a second historical server set in the test set; and selecting the training model with the minimum loss coefficient as a prediction model.
Optionally, the processor when executing the program further implements the following steps: before N target servers are determined from M first servers according to the associated probability value corresponding to each first server, a heartbeat detection service is created for each server in the distributed server cluster, wherein the heartbeat detection service is used for detecting whether the server is an abnormal server.
Optionally, the processor when executing the program further implements the following steps: after N target servers are determined from M first servers according to the associated probability value corresponding to each first server, detecting whether an abnormal server exists in the N target servers or not based on the heartbeat detection service corresponding to each target server; under the condition that an abnormal server exists in the N target servers, repairing the abnormal server, and running a target test case to perform functional test on the N target servers, wherein the repairing operation is used for recovering the abnormal server into a normal server; and under the condition that the N target servers are all normal servers, running the target test cases to perform functional tests on the N target servers.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for determining a server, comprising:
acquiring characteristic information of a target test case, wherein the target test case is used for performing functional test on servers in a distributed server cluster called by a target transaction;
inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform the functional test on the first server, and M is a positive integer;
and determining N target servers from the M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
2. The method of claim 1, wherein determining N target servers from the M first servers based on the associated probability value for each first server, comprises:
detecting whether J second servers exist in the M first servers according to the associated probability value corresponding to each first server, wherein the associated probability value corresponding to each second server is larger than or equal to a preset probability value, and J is a positive integer;
generating a first set based on the J second servers in the presence of the J second servers in the M first servers;
obtaining J second sets corresponding to the J second servers, wherein each second set corresponds to one second server, each second set comprises K third servers, the third servers in each second set are servers with dependency relations with the second servers corresponding to the second sets, and K is a positive integer;
the N target servers are determined based on the first set and the J second sets.
3. The method of claim 2, wherein determining the N target servers based on the first set and the J second sets comprises:
Combining the first set and the J second sets to obtain a third set, wherein the third set comprises N fourth servers;
and taking each server in the N fourth servers as a target server to obtain the N target servers.
4. The method of claim 2, wherein obtaining J second sets corresponding to the J second servers comprises:
obtaining a first historical server set corresponding to each first historical test case in L first historical test cases, and obtaining L first historical server sets, wherein each first historical test case is a test case which runs successfully, the first historical server set corresponding to each first historical test case comprises P fifth servers involved in the running process of the first historical test case, and the L first historical server sets comprise J second servers, and L, P is a positive integer;
determining a target set corresponding to each fifth server based on the number of times that each fifth server and other servers corresponding to the fifth server appear in the L first historical server sets at the same time, wherein the target set comprises servers with dependency relationships among the fifth servers, and the other servers corresponding to the fifth server are any one fifth server except the fifth servers in the P fifth servers;
And obtaining the J second sets from the target sets corresponding to each fifth server.
5. The method of claim 1, wherein the predictive model is obtained by:
acquiring a sample data set, wherein the sample data set comprises characteristic information of H second historical test cases and a second historical server set corresponding to each second historical test case, and the second historical server set corresponding to each second historical test case comprises servers involved in the running process of the second historical test case;
dividing the sample data set into a training set and a testing set;
inputting the data in the training set into an initial neural network model for iterative training to obtain a plurality of training models, wherein the data comprises characteristic information of a second historical test case and a second historical server set corresponding to the second historical test case;
the characteristic information in the test set is respectively input into the training models to obtain a server set output by each training model in the training models;
determining a loss coefficient of each training model according to the server set and a second historical server set in the test set;
And selecting the training model with the smallest loss coefficient as the prediction model.
6. The method of claim 1, wherein prior to determining N target servers from the M first servers based on the associated probability value for each first server, the method further comprises:
and creating a heartbeat detection service for each server in the distributed server cluster, wherein the heartbeat detection service is used for detecting whether the server is an abnormal server or not.
7. The method of claim 6, wherein after determining N target servers from the M first servers according to the associated probability value for each first server, the method further comprises:
detecting whether the abnormal server exists in the N target servers or not based on the heartbeat detection service corresponding to each target server;
performing repair operation on the abnormal servers under the condition that the abnormal servers exist in the N target servers, and running the target test cases to perform functional test on the N target servers, wherein the repair operation is used for recovering the abnormal servers to normal servers;
And under the condition that the N target servers are all normal servers, the target test cases are operated to perform functional tests on the N target servers.
8. A server determining apparatus, comprising:
the system comprises an acquisition module, a target test case generation module and a data processing module, wherein the acquisition module is used for acquiring characteristic information of a target test case, and the target test case is used for carrying out functional test on servers in a distributed server cluster called by a target transaction;
the prediction module is used for inputting the characteristic information into a prediction model to obtain a prediction result output by the prediction model, wherein the prediction result is used for describing M first servers corresponding to the target test case and associated probability values corresponding to each first server, the M first servers are servers in the distributed server cluster, the associated probability values corresponding to each first server are used for representing the probability that the target test case needs to perform the functional test on the first server, and M is a positive integer;
and the determining module is used for determining N target servers from the M first servers according to the associated probability value corresponding to each first server, wherein each target server is a server involved in the operation process of the target test case, and N is a positive integer.
9. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program is arranged to execute the method of determining a server according to any of the claims 1 to 7 when run.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of determining a server of any of claims 1-7.
CN202310908284.3A 2023-07-21 2023-07-21 Method and device for determining server, storage medium and electronic equipment Pending CN116955178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310908284.3A CN116955178A (en) 2023-07-21 2023-07-21 Method and device for determining server, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310908284.3A CN116955178A (en) 2023-07-21 2023-07-21 Method and device for determining server, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116955178A true CN116955178A (en) 2023-10-27

Family

ID=88442180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310908284.3A Pending CN116955178A (en) 2023-07-21 2023-07-21 Method and device for determining server, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116955178A (en)

Similar Documents

Publication Publication Date Title
KR102011453B1 (en) Predictability of Conditionality Using Recurrent Neural Networks
Singh et al. Empirical validation of object-oriented metrics for predicting fault proneness models
US11861519B2 (en) System and method for semantics based probabilistic fault diagnosis
Hu et al. Web service recommendation based on time series forecasting and collaborative filtering
Idri et al. Accuracy comparison of analogy‐based software development effort estimation techniques
US20180285969A1 (en) Predictive model training and selection for consumer evaluation
Ambalavanan et al. Using contextual representations for suicide risk assessment from internet forums
CN116661954B (en) Virtual machine abnormality prediction method, device, communication equipment and storage medium
EP4049213A1 (en) Account prediction using machine learning
De Luna et al. Choosing a model selection strategy
CN116955178A (en) Method and device for determining server, storage medium and electronic equipment
Strasser et al. An empirical evaluation of Bayesian networks derived from fault trees
CN110008098B (en) Method and device for evaluating operation condition of nodes in business process
Yadav et al. A novel and improved developer rank algorithm for bug assignment
Hauser et al. An improved assessing requirements quality with ML methods
US11922441B2 (en) Method and system for event prediction using spatio-temporally sampled data
CN115115449B (en) Optimized data recommendation method and system for financial supply chain
US11900365B1 (en) Predicting attributes for recipients
CN114926082B (en) Data fluctuation early warning method based on artificial intelligence and related equipment
US20240037425A1 (en) Integrated machine learning and rules platform for improved accuracy and root cause analysis
CN117093720A (en) Service efficiency measurement and quality evaluation method based on knowledge graph and artificial intelligence
CN109474445B (en) Distributed system root fault positioning method and device
YUSOF SURE-AUTOMETRTCS ALGORITHM FOR MODEL SELECTION IN MULTIPLE EQUATIONS
Fisch Conformal Methods for Efficient and Reliable Deep Learning
Lee et al. Service reliability prediction method for service-oriented multi-agent system

Legal Events

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