CN114003784A - Request recording method, device, equipment and storage medium - Google Patents

Request recording method, device, equipment and storage medium Download PDF

Info

Publication number
CN114003784A
CN114003784A CN202111265141.2A CN202111265141A CN114003784A CN 114003784 A CN114003784 A CN 114003784A CN 202111265141 A CN202111265141 A CN 202111265141A CN 114003784 A CN114003784 A CN 114003784A
Authority
CN
China
Prior art keywords
message
information
request
data
result
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
CN202111265141.2A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202111265141.2A priority Critical patent/CN114003784A/en
Publication of CN114003784A publication Critical patent/CN114003784A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Abstract

The invention relates to data acquisition and provides a request recording method, a request recording device, request recording equipment and a storage medium. The method can generate a matching expression according to a request recording instruction, obtain message requests in a plurality of processing servers, screen the message requests according to the matching expression to obtain a target message, extract message data according to an object source of the target message, detect the storage condition of an equipment database to obtain a detection result, obtain first storage information in the equipment database if the detection result is a preset result, obtain second storage information in the database server, compare the message data and the first storage information with the second storage information to obtain a comparison result, update the second storage information according to the comparison result to obtain recording information, and can collect a request for normal operation to improve test accuracy. In addition, the invention also relates to a block chain technology, and the recording information can be stored in the block chain.

Description

Request recording method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data acquisition technologies, and in particular, to a request recording method, apparatus, device, and storage medium.
Background
Currently, various performance indexes of a system are usually tested by simulating various normal, peak and abnormal load conditions through a testing tool. However, since the speed of the test tool in simulating data is not high, a large amount of data cannot be simulated in a short time for testing.
In order to obtain a large number of test requests in a short time, a request recording mode is developed. However, in the current request recording scheme, the request recording can be performed only when the request response is detected to be abnormal, so that the request recording in response to the normal request cannot be intercepted.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a request recording method, apparatus, device and storage medium, which can intercept a request that runs normally, so as to improve the accuracy of system testing.
In one aspect, the present invention provides a request recording method applied to an electronic device, where the electronic device is respectively in communication with a plurality of processing servers and a database server, the electronic device includes a device database, and the request recording method includes:
when a request recording instruction is received, generating a matching expression according to the request recording instruction;
acquiring message requests in the plurality of processing servers;
screening the message request according to the matching expression to obtain a target message;
extracting message data according to the object source of the target message;
detecting the storage condition of the equipment database to obtain a detection result;
if the detection result is a preset result, acquiring first storage information in the equipment database, and acquiring second storage information in the database server;
comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and updating the second storage information according to the comparison result to obtain recording information.
According to the preferred embodiment of the present invention, the generating a matching expression according to the request recording instruction includes:
extracting a characteristic character string in the request recording instruction;
positioning a display interface of the electronic device;
capturing input parameters of a user from the display interface;
and writing the characteristic character string and the input parameter into a preset instruction to obtain the matching expression.
According to the preferred embodiment of the present invention, the screening the message request according to the matching expression to obtain the target message includes:
extracting a request object in the message request;
determining the message request where the request object same as the characteristic character string is located as a primary screening message;
detecting whether the initial screening message contains the input parameters or not;
and if the initial screening message contains the input parameters, determining the initial screening message as the target message.
According to a preferred embodiment of the present invention, the extracting packet data according to the object source of the target packet includes:
detecting an object type of the object source;
if the object type is a forwarding server, analyzing the target message according to a preset label to obtain the message data; or
And if the object type is a local server, determining the target message as the message data.
According to a preferred embodiment of the present invention, the detecting the storage condition of the device database, and obtaining the detection result includes:
inputting the message data into the equipment database to obtain response information of the equipment database;
performing semantic analysis on the response information to obtain a semantic result;
detecting whether the semantic result contains configuration information or not;
if the semantic result contains the configuration information, determining the detection result as that the equipment database is full;
if the semantic result does not contain the configuration information, counting the storage capacity in the equipment database;
and if the storage amount is larger than a preset amount, determining the detection result as that the equipment database is full.
According to a preferred embodiment of the present invention, the comparing the message data and the first storage information with the second storage information to obtain a comparison result includes:
determining the message data and the first storage information as target information, wherein a data key and a data value corresponding to the data key are stored in the target information;
detecting whether the second storage information contains the data key;
if the second storage information does not contain the data key, determining the comparison result as a first result; and/or
If the second storage information contains the data key, extracting information corresponding to the data key from the second storage information as information to be compared, and comparing the data value with the information to be compared;
and if the data value is different from the information to be compared, determining the comparison result as a second result.
According to a preferred embodiment of the present invention, the updating the second storage information according to the comparison result to obtain the recording information includes:
extracting the data key with the comparison result being the first result as a key to be added, and writing the key to be added and the data value corresponding to the key to be added into the database server to obtain the recording information; and/or
And extracting the data key with the comparison result being the second result as a target key, extracting a data value corresponding to the target key as a target value, acquiring a key value corresponding to the target key from the second storage information as an initial value, combining the target value and the initial value to obtain an updated value, and replacing the initial value with the updated value to obtain the recording information.
In another aspect, the present invention further provides a request recording apparatus, operating on an electronic device, where the electronic device is respectively in communication with a plurality of processing servers and a database server, the electronic device includes a device database, and the request recording apparatus includes:
the generating unit is used for generating a matching expression according to a request recording instruction when the request recording instruction is received;
an obtaining unit, configured to obtain the message requests in the multiple processing servers;
the screening unit is used for screening the message request according to the matching expression to obtain a target message;
the extracting unit is used for extracting message data according to the object source of the target message;
the detection unit is used for detecting the storage condition of the equipment database to obtain a detection result;
the obtaining unit is further configured to obtain first storage information in the device database and obtain second storage information in the database server if the detection result is a preset result;
the comparison unit is used for comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and the updating unit is used for updating the second storage information according to the comparison result to obtain the recording information.
In another aspect, the present invention further provides an electronic device, including:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the request recording method.
In another aspect, the present invention further provides a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions are executed by a processor in an electronic device to implement the request recording method.
According to the technical scheme, the message requests in the processing servers can be screened through the matching expressions, and since an interception window is not required to be arranged in front of a corresponding interface, the target message to be recorded can be quickly acquired, the acquisition efficiency of the test request is improved, and meanwhile, since the target message selected by the matching expressions contains a normal request and an abnormal request, the normal request can be recorded for testing, the test performance of a subsequent system is ensured, and further, through the detection of the equipment database, the second storage information in the database server can be updated in time, and the redundant request in the recorded information is avoided.
Drawings
Fig. 1 is a flowchart of a preferred embodiment of a recording request method according to the present invention.
Fig. 2 is a functional block diagram of a preferred embodiment of a request recording apparatus according to the present invention.
Fig. 3 is a schematic structural diagram of an electronic device implementing a request recording method according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart illustrating a recording request method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The request recording method can acquire and process related data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The request recording method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to computer readable instructions set or stored in advance, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), a smart wearable device, and the like.
The electronic device may include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of a plurality of network electronic devices, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network electronic devices.
The network in which the electronic device is located includes, but is not limited to: the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
The electronic device is respectively communicated with the processing servers and the database server, and the electronic device comprises a device database.
And S10, when receiving a request recording instruction, generating a matching expression according to the request recording instruction.
In at least one embodiment of the invention, the request recording instruction can be triggered to be generated when a test requirement is generated. The information carried by the recording request instruction includes, but is not limited to: and the character string corresponding to the interface needing to be tested.
The matching expression is used for screening out the request needing to be tested.
In at least one embodiment of the present invention, the generating, by the electronic device, the matching expression according to the request recording instruction includes:
extracting a characteristic character string in the request recording instruction;
positioning a display interface of the electronic device;
capturing input parameters of a user from the display interface;
and writing the characteristic character string and the input parameter into a preset instruction to obtain the matching expression.
The characteristic character string may be a character string preset by a user according to a recording interface.
The display interface comprises a plurality of keys and input spaces, and is not only used for displaying the layout of a page, but also used for recording control of a user on a specific request.
The input parameters may be interface parameters for setting according to requirements.
For example, the characteristic string may be getwin, the input parameter may be a ═ 1& b ═ 2, and the preset instruction is a characteristic prefix +? + parameter, then the matching expression is getwin.doa ═ 1& b ═ 2.
The requests in the same interface can be uniformly recorded through the characteristic character strings, the missing recording of the requests is avoided, the specific requests for recording can be controlled through the input parameters, the redundant requests are prevented from being recorded, and therefore the testing of a follow-up system is not facilitated.
S11, obtaining the message request in the plurality of processing servers.
In at least one embodiment of the present invention, the message request refers to a request processed by the plurality of processing servers. Specifically, the message request may be generated by the plurality of processing servers, and the message request may also be forwarded by the plurality of processing servers.
S12, screening the message request according to the matching expression to obtain the target message.
In at least one embodiment of the present invention, the target packet refers to a request related to a test requirement, where the test requirement may refer to an interface or a system that needs to be tested.
In at least one embodiment of the present invention, the screening, by the electronic device, the message request according to the matching expression, and obtaining the target message includes:
extracting a request object in the message request;
determining the message request where the request object same as the characteristic character string is located as a primary screening message;
detecting whether the initial screening message contains the input parameters or not;
and if the initial screening message contains the input parameters, determining the initial screening message as the target message.
The request object may be character string information corresponding to a request address requested by the packet.
And the target message to be recorded can be accurately screened from the message request through the characteristic character string and the input parameter in the matching expression.
S13, extracting message data according to the object source of the target message.
In at least one embodiment of the present invention, the packet data refers to core data information carried in the target packet. For example, the message data may be data information corresponding to a certain field.
In at least one embodiment of the present invention, the extracting, by the electronic device, message data according to an object source of the target message includes:
detecting an object type of the object source;
if the object type is a forwarding server, analyzing the target message according to a preset label to obtain the message data; or
And if the object type is a local server, determining the target message as the message data.
The object type refers to a specific type to which the object source belongs, and the object type includes the forwarding server and the local server.
The forwarding server refers to a server responsible for forwarding the request to the access terminal.
The local server refers to an access terminal, and is used for processing the request to obtain a response result of the request.
The preset label is used for indicating the message character string in the target message.
By detecting the object source, the message data can be accurately extracted from the target message according to different modes.
And S14, detecting the storage condition of the equipment database to obtain a detection result.
In at least one embodiment of the present invention, the detection result includes that the device database is full, and the detection result further includes that the device database is not full.
In at least one embodiment of the present invention, the detecting, by the electronic device, the storage condition of the device database, and obtaining the detection result includes:
inputting the message data into the equipment database to obtain response information of the equipment database;
performing semantic analysis on the response information to obtain a semantic result;
detecting whether the semantic result contains configuration information or not;
if the semantic result contains the configuration information, determining the detection result as that the equipment database is full;
if the semantic result does not contain the configuration information, counting the storage capacity in the equipment database;
and if the storage amount is larger than a preset amount, determining the detection result as that the equipment database is full.
The response information refers to a response made by the equipment database after the message data is recorded into the equipment database. For example, the response information may be that data has been successfully entered, or may be a quoteedederror, or may be a try catch.
The semantic result refers to information capable of representing the semantic meaning of the response information.
The configuration information is used to represent that the message data cannot be entered into the device database, for example, the configuration information may be entry success, and the configuration information may also be entry failure.
The preset amount may be set according to a requirement, for example, the preset amount may be 90% of a total memory of the device database, specifically, if the total memory is 100M, the preset amount may be 90M.
Through the embodiment, when the semantic result does not contain the configuration information, the storage amount can be further compared with the preset amount, and the accuracy of the detection result is further improved.
In this embodiment, when the semantic result does not include the configuration information, it indicates that the device database is not full before the message data is recorded into the device database, and after the message data is stored in the device database, the storage condition in the device database can be accurately determined by combining the storage amount and the preset amount.
And S15, if the detection result is a preset result, acquiring first storage information in the equipment database, and acquiring second storage information in the database server.
In at least one embodiment of the present invention, the preset result is that the device database is full.
The first storage information refers to all information in the device database, and the second storage information refers to all information in the database server.
In this embodiment, when the device database is full, the first storage information is migrated to the database server, so that a subsequent request can be directly stored in the device database, thereby improving the storage efficiency.
In at least one embodiment of the invention, the method further comprises:
and if the detection result is not the preset result, directly inputting the message data into the equipment database.
S16, comparing the message data and the first storage information with the second storage information to obtain a comparison result.
In at least one embodiment of the present invention, the comparison result includes a first result, a second result, and a third result. The first result indicates that the data key and the data value corresponding to the data key do not exist in the database server, the second result indicates that the data key exists in the database server and the data value corresponding to the data key does not exist, and the third result indicates that the data key and the data value corresponding to the data key exist in the database server.
In at least one embodiment of the present invention, the comparing, by the electronic device, the message data and the first storage information with the second storage information, and obtaining a comparison result includes:
determining the message data and the first storage information as target information, wherein a data key and a data value corresponding to the data key are stored in the target information;
detecting whether the second storage information contains the data key;
if the second storage information does not contain the data key, determining the comparison result as a first result; and/or
If the second storage information contains the data key, extracting information corresponding to the data key from the second storage information as information to be compared, and comparing the data value with the information to be compared;
and if the data value is different from the information to be compared, determining the comparison result as a second result.
By comparing the data values after comparing the data keys, the same data values in different data keys can be avoided, thereby improving the accuracy of the comparison result.
In at least one embodiment of the present invention, if the data value is the same as the information to be compared, the comparison result is determined as a third result.
And S17, updating the second storage information according to the comparison result to obtain recording information.
In at least one embodiment of the invention, the recorded information may be used for performance testing of the system.
It should be emphasized that, in order to further ensure the privacy and security of the recording information, the recording information may also be stored in a node of a block chain.
In at least one embodiment of the present invention, the updating, by the electronic device, the second storage information according to the comparison result, and obtaining the recording information includes:
extracting the data key with the comparison result being the first result as a key to be added, and writing the key to be added and the data value corresponding to the key to be added into the database server to obtain the recording information; and/or
And extracting the data key with the comparison result being the second result as a target key, extracting a data value corresponding to the target key as a target value, acquiring a key value corresponding to the target key from the second storage information as an initial value, combining the target value and the initial value to obtain an updated value, and replacing the initial value with the updated value to obtain the recording information.
Through the embodiment, repeated requests can be avoided from existing in the recording information, so that not only can the occupied space of resources be saved, but also the same request can be avoided from being used for testing, and therefore the resource occupation during system testing is caused. In at least one embodiment of the invention, the method further comprises:
and testing the testing system based on the recording information. According to the technical scheme, the message requests in the processing servers can be screened through the matching expressions, and since an interception window is not required to be arranged in front of a corresponding interface, the target message to be recorded can be quickly acquired, the acquisition efficiency of the test request is improved, and meanwhile, since the target message selected by the matching expressions contains a normal request and an abnormal request, the normal request can be recorded for testing, the test performance of a subsequent system is ensured, and further, through the detection of the equipment database, the second storage information in the database server can be updated in time, and the redundant request in the recorded information is avoided.
Fig. 2 is a functional block diagram of a recording request apparatus according to a preferred embodiment of the present invention. The request recording device 11 includes a generating unit 110, an obtaining unit 111, a screening unit 112, an extracting unit 113, a detecting unit 114, a comparing unit 115, an updating unit 116, an entering unit 117, and a testing unit 118. The module/unit referred to herein is a series of computer readable instruction segments that can be accessed by the processor 13 and perform a fixed function and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
When receiving a request recording instruction, the generating unit 110 generates a matching expression according to the request recording instruction.
In at least one embodiment of the invention, the request recording instruction can be triggered to be generated when a test requirement is generated. The information carried by the recording request instruction includes, but is not limited to: and the character string corresponding to the interface needing to be tested.
The matching expression is used for screening out the request needing to be tested.
In at least one embodiment of the present invention, the generating unit 110 generates the matching expression according to the request recording instruction includes:
extracting a characteristic character string in the request recording instruction;
positioning a display interface of the electronic device;
capturing input parameters of a user from the display interface;
and writing the characteristic character string and the input parameter into a preset instruction to obtain the matching expression.
The characteristic character string may be a character string preset by a user according to a recording interface.
The display interface comprises a plurality of keys and input spaces, and is not only used for displaying the layout of a page, but also used for recording control of a user on a specific request.
The input parameters may be interface parameters for setting according to requirements.
For example, the characteristic string may be getwin, the input parameter may be a ═ 1& b ═ 2, and the preset instruction is a characteristic prefix +? + parameter, then the matching expression is getwin.doa ═ 1& b ═ 2.
The requests in the same interface can be uniformly recorded through the characteristic character strings, the missing recording of the requests is avoided, the specific requests for recording can be controlled through the input parameters, the redundant requests are prevented from being recorded, and therefore the testing of a follow-up system is not facilitated.
The obtaining unit 111 obtains the message requests in the plurality of processing servers.
In at least one embodiment of the present invention, the message request refers to a request processed by the plurality of processing servers. Specifically, the message request may be generated by the plurality of processing servers, and the message request may also be forwarded by the plurality of processing servers.
The screening unit 112 screens the message request according to the matching expression to obtain a target message.
In at least one embodiment of the present invention, the target packet refers to a request related to a test requirement, where the test requirement may refer to an interface or a system that needs to be tested.
In at least one embodiment of the present invention, the screening unit 112 screens the message request according to the matching expression, and obtaining a target message includes:
extracting a request object in the message request;
determining the message request where the request object same as the characteristic character string is located as a primary screening message;
detecting whether the initial screening message contains the input parameters or not;
and if the initial screening message contains the input parameters, determining the initial screening message as the target message.
The request object may be character string information corresponding to a request address requested by the packet.
And the target message to be recorded can be accurately screened from the message request through the characteristic character string and the input parameter in the matching expression.
The extracting unit 113 extracts message data according to the object source of the target message.
In at least one embodiment of the present invention, the packet data refers to core data information carried in the target packet. For example, the message data may be data information corresponding to a certain field.
In at least one embodiment of the present invention, the extracting unit 113 extracting the message data according to the object source of the target message includes:
detecting an object type of the object source;
if the object type is a forwarding server, analyzing the target message according to a preset label to obtain the message data; or
And if the object type is a local server, determining the target message as the message data.
The object type refers to a specific type to which the object source belongs, and the object type includes the forwarding server and the local server.
The forwarding server refers to a server responsible for forwarding the request to the access terminal.
The local server refers to an access terminal, and is used for processing the request to obtain a response result of the request.
The preset label is used for indicating the message character string in the target message.
By detecting the object source, the message data can be accurately extracted from the target message according to different modes.
The detection unit 114 detects the storage condition of the device database to obtain a detection result.
In at least one embodiment of the present invention, the detection result includes that the device database is full, and the detection result further includes that the device database is not full.
In at least one embodiment of the present invention, the detecting unit 114 detects a storage condition of the device database, and obtaining a detection result includes:
inputting the message data into the equipment database to obtain response information of the equipment database;
performing semantic analysis on the response information to obtain a semantic result;
detecting whether the semantic result contains configuration information or not;
if the semantic result contains the configuration information, determining the detection result as that the equipment database is full;
if the semantic result does not contain the configuration information, counting the storage capacity in the equipment database;
and if the storage amount is larger than a preset amount, determining the detection result as that the equipment database is full.
The response information refers to a response made by the equipment database after the message data is recorded into the equipment database. For example, the response information may be that data has been successfully entered, or may be a quoteedederror, or may be a try catch.
The semantic result refers to information capable of representing the semantic meaning of the response information.
The configuration information is used to represent that the message data cannot be entered into the device database, for example, the configuration information may be entry success, and the configuration information may also be entry failure.
The preset amount may be set according to a requirement, for example, the preset amount may be 90% of a total memory of the device database, specifically, if the total memory is 100M, the preset amount may be 90M.
Through the embodiment, when the semantic result does not contain the configuration information, the storage amount can be further compared with the preset amount, and the accuracy of the detection result is further improved.
In this embodiment, when the semantic result does not include the configuration information, it indicates that the device database is not full before the message data is recorded into the device database, and after the message data is stored in the device database, the storage condition in the device database can be accurately determined by combining the storage amount and the preset amount.
If the detection result is a preset result, the obtaining unit 111 obtains first storage information in the device database, and obtains second storage information in the database server.
In at least one embodiment of the present invention, the preset result is that the device database is full.
The first storage information refers to all information in the device database, and the second storage information refers to all information in the database server.
In this embodiment, when the device database is full, the first storage information is migrated to the database server, so that a subsequent request can be directly stored in the device database, thereby improving the storage efficiency.
In at least one embodiment of the present invention, if the detection result is not the preset result, the entry unit 117 directly enters the message data into the device database.
The comparing unit 115 compares the message data and the first storage information with the second storage information to obtain a comparison result.
In at least one embodiment of the present invention, the comparison result includes a first result, a second result, and a third result. The first result indicates that the data key and the data value corresponding to the data key do not exist in the database server, the second result indicates that the data key exists in the database server and the data value corresponding to the data key does not exist, and the third result indicates that the data key and the data value corresponding to the data key exist in the database server.
In at least one embodiment of the present invention, the comparing unit 115 compares the message data and the first stored information with the second stored information, and obtaining a comparison result includes:
determining the message data and the first storage information as target information, wherein a data key and a data value corresponding to the data key are stored in the target information;
detecting whether the second storage information contains the data key;
if the second storage information does not contain the data key, determining the comparison result as a first result; and/or
If the second storage information contains the data key, extracting information corresponding to the data key from the second storage information as information to be compared, and comparing the data value with the information to be compared;
and if the data value is different from the information to be compared, determining the comparison result as a second result.
By comparing the data values after comparing the data keys, the same data values in different data keys can be avoided, thereby improving the accuracy of the comparison result.
In at least one embodiment of the present invention, if the data value is the same as the information to be compared, the comparing unit 115 determines the comparison result as a third result.
The updating unit 116 updates the second storage information according to the comparison result to obtain the recording information.
In at least one embodiment of the invention, the recorded information may be used for performance testing of the system.
It should be emphasized that, in order to further ensure the privacy and security of the recording information, the recording information may also be stored in a node of a block chain.
In at least one embodiment of the present invention, the updating unit 116 updates the second storage information according to the comparison result, and obtaining the recording information includes:
extracting the data key with the comparison result being the first result as a key to be added, and writing the key to be added and the data value corresponding to the key to be added into the database server to obtain the recording information; and/or
And extracting the data key with the comparison result being the second result as a target key, extracting a data value corresponding to the target key as a target value, acquiring a key value corresponding to the target key from the second storage information as an initial value, combining the target value and the initial value to obtain an updated value, and replacing the initial value with the updated value to obtain the recording information.
Through the embodiment, repeated requests can be avoided from existing in the recording information, so that not only can the occupied space of resources be saved, but also the same request can be avoided from being used for testing, and therefore the resource occupation during system testing is caused. In at least one embodiment of the invention, test unit 118 tests the test system based on the recorded information.
According to the technical scheme, the message requests in the processing servers can be screened through the matching expressions, and since an interception window is not required to be arranged in front of a corresponding interface, the target message to be recorded can be quickly acquired, the acquisition efficiency of the test request is improved, and meanwhile, since the target message selected by the matching expressions contains a normal request and an abnormal request, the normal request can be recorded for testing, the test performance of a subsequent system is ensured, and further, through the detection of the equipment database, the second storage information in the database server can be updated in time, and the redundant request in the recorded information is avoided.
Fig. 3 is a schematic structural diagram of an electronic device implementing a recording request method according to a preferred embodiment of the present invention.
In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer readable instructions stored in the memory 12 and executable on the processor 13, such as a request recording program.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing specific functions, which are used for describing the execution process of the computer readable instructions in the electronic device 1. For example, the computer readable instructions may be partitioned into a generation unit 110, an acquisition unit 111, a filtering unit 112, an extraction unit 113, a detection unit 114, a comparison unit 115, an update unit 116, an entry unit 117, and a test unit 118.
The memory 12 may be used for storing the computer readable instructions and/or modules, and the processor 13 implements various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. The memory 12 may include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by hardware that is configured to be instructed by computer readable instructions, which may be stored in a computer readable storage medium, and when the computer readable instructions are executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer readable instructions comprise computer readable instruction code which may be in source code form, object code form, an executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying said computer readable instruction code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. 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.
With reference to fig. 1, the memory 12 in the electronic device 1 stores computer-readable instructions to implement a request recording method, which is applied to an electronic device, the electronic device is respectively communicated with a plurality of processing servers and a database server, the electronic device includes a device database, and the processor 13 can execute the computer-readable instructions to implement:
when a request recording instruction is received, generating a matching expression according to the request recording instruction;
acquiring message requests in the plurality of processing servers;
screening the message request according to the matching expression to obtain a target message;
extracting message data according to the object source of the target message;
detecting the storage condition of the equipment database to obtain a detection result;
if the detection result is a preset result, acquiring first storage information in the equipment database, and acquiring second storage information in the database server;
comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and updating the second storage information according to the comparison result to obtain recording information.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer readable instructions, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The computer readable storage medium has computer readable instructions stored thereon, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
when a request recording instruction is received, generating a matching expression according to the request recording instruction;
acquiring message requests in the plurality of processing servers;
screening the message request according to the matching expression to obtain a target message;
extracting message data according to the object source of the target message;
detecting the storage condition of the equipment database to obtain a detection result;
if the detection result is a preset result, acquiring first storage information in the equipment database, and acquiring second storage information in the database server;
comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and updating the second storage information according to the comparison result to obtain recording information.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. The plurality of units or devices may also be implemented by one unit or device through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A request recording method is applied to electronic equipment, the electronic equipment is respectively communicated with a plurality of processing servers and a database server, the electronic equipment comprises an equipment database, and the request recording method comprises the following steps:
when a request recording instruction is received, generating a matching expression according to the request recording instruction;
acquiring message requests in the plurality of processing servers;
screening the message request according to the matching expression to obtain a target message;
extracting message data according to the object source of the target message;
detecting the storage condition of the equipment database to obtain a detection result;
if the detection result is a preset result, acquiring first storage information in the equipment database, and acquiring second storage information in the database server;
comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and updating the second storage information according to the comparison result to obtain recording information.
2. The request recording method according to claim 1, wherein the generating a matching expression according to the request recording instruction includes:
extracting a characteristic character string in the request recording instruction;
positioning a display interface of the electronic device;
capturing input parameters of a user from the display interface;
and writing the characteristic character string and the input parameter into a preset instruction to obtain the matching expression.
3. The request recording method according to claim 2, wherein the screening the message request according to the matching expression to obtain a target message comprises:
extracting a request object in the message request;
determining the message request where the request object same as the characteristic character string is located as a primary screening message;
detecting whether the initial screening message contains the input parameters or not;
and if the initial screening message contains the input parameters, determining the initial screening message as the target message.
4. The method of claim 1, wherein the extracting the message data according to the object source of the target message comprises:
detecting an object type of the object source;
if the object type is a forwarding server, analyzing the target message according to a preset label to obtain the message data; or
And if the object type is a local server, determining the target message as the message data.
5. The method for requesting recording of claim 1, wherein the detecting the storage status of the device database and obtaining the detection result comprises:
inputting the message data into the equipment database to obtain response information of the equipment database;
performing semantic analysis on the response information to obtain a semantic result;
detecting whether the semantic result contains configuration information or not;
if the semantic result contains the configuration information, determining the detection result as that the equipment database is full;
if the semantic result does not contain the configuration information, counting the storage capacity in the equipment database;
and if the storage amount is larger than a preset amount, determining the detection result as that the equipment database is full.
6. The method of claim 1, wherein the comparing the message data and the first stored information with the second stored information to obtain a comparison result comprises:
determining the message data and the first storage information as target information, wherein a data key and a data value corresponding to the data key are stored in the target information;
detecting whether the second storage information contains the data key;
if the second storage information does not contain the data key, determining the comparison result as a first result; and/or
If the second storage information contains the data key, extracting information corresponding to the data key from the second storage information as information to be compared, and comparing the data value with the information to be compared;
and if the data value is different from the information to be compared, determining the comparison result as a second result.
7. The method of claim 6, wherein the updating the second stored information according to the comparison result to obtain the recording information comprises:
extracting the data key with the comparison result being the first result as a key to be added, and writing the key to be added and the data value corresponding to the key to be added into the database server to obtain the recording information; and/or
And extracting the data key with the comparison result being the second result as a target key, extracting a data value corresponding to the target key as a target value, acquiring a key value corresponding to the target key from the second storage information as an initial value, combining the target value and the initial value to obtain an updated value, and replacing the initial value with the updated value to obtain the recording information.
8. A request recording apparatus, operating on an electronic device, the electronic device being in communication with a plurality of processing servers and a database server, respectively, the electronic device including a device database, the request recording apparatus comprising:
the generating unit is used for generating a matching expression according to a request recording instruction when the request recording instruction is received;
an obtaining unit, configured to obtain the message requests in the multiple processing servers;
the screening unit is used for screening the message request according to the matching expression to obtain a target message;
the extracting unit is used for extracting message data according to the object source of the target message;
the detection unit is used for detecting the storage condition of the equipment database to obtain a detection result;
the obtaining unit is further configured to obtain first storage information in the device database and obtain second storage information in the database server if the detection result is a preset result;
the comparison unit is used for comparing the message data and the first storage information with the second storage information to obtain a comparison result;
and the updating unit is used for updating the second storage information according to the comparison result to obtain the recording information.
9. An electronic device, characterized in that the electronic device comprises:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the request recording method of any one of claims 1 to 7.
10. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein computer-readable instructions that are executed by a processor in an electronic device to implement the request recording method of any one of claims 1 to 7.
CN202111265141.2A 2021-10-28 2021-10-28 Request recording method, device, equipment and storage medium Pending CN114003784A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111265141.2A CN114003784A (en) 2021-10-28 2021-10-28 Request recording method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111265141.2A CN114003784A (en) 2021-10-28 2021-10-28 Request recording method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114003784A true CN114003784A (en) 2022-02-01

Family

ID=79924699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111265141.2A Pending CN114003784A (en) 2021-10-28 2021-10-28 Request recording method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114003784A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952515A (en) * 2022-12-05 2023-04-11 广州柏瀚信息科技有限公司 Data security processing method and device based on big data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952515A (en) * 2022-12-05 2023-04-11 广州柏瀚信息科技有限公司 Data security processing method and device based on big data
CN115952515B (en) * 2022-12-05 2023-09-26 广州柏瀚信息科技有限公司 Data security processing method and device based on big data

Similar Documents

Publication Publication Date Title
CN114035827A (en) Application program updating method, device, equipment and storage medium
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN113536770B (en) Text analysis method, device and equipment based on artificial intelligence and storage medium
CN113918467A (en) Financial system testing method, device, equipment and storage medium
CN114116108A (en) Dynamic rendering method, device, equipment and storage medium
CN114510487A (en) Data table merging method, device, equipment and storage medium
CN114418398A (en) Scene task development method, device, equipment and storage medium
CN114003784A (en) Request recording method, device, equipment and storage medium
CN112948418A (en) Dynamic query method, device, equipment and storage medium
CN112134968A (en) Domain name access method and device, electronic equipment and storage medium
CN115037790B (en) Abnormal registration identification method, device, equipment and storage medium
CN114329095A (en) System logic diagram generation method, device, equipment and storage medium
CN113420545B (en) Abstract generation method, device, equipment and storage medium
CN115205032A (en) Credit investigation query method, apparatus, device and storage medium
CN114610386A (en) Interaction method, device, equipment and storage medium of H5 and application program
CN111859985B (en) AI customer service model test method and device, electronic equipment and storage medium
CN114238296A (en) Product index data display method, device, equipment and storage medium
CN113886263A (en) System testing method, device, equipment and storage medium
CN112181485A (en) Script execution method and device, electronic equipment and storage medium
CN112632098A (en) Dynamic generation method of structured query statement and related equipment
CN112819305A (en) Service index analysis method, device, equipment and storage medium
CN114741018B (en) Data visualization method, device, equipment and storage medium
CN110719260B (en) Intelligent network security analysis method and device and computer readable storage medium
CN115001802B (en) Account abnormal login detection method based on shared screen and related equipment
CN114398104A (en) Script processing method, device, equipment and storage medium

Legal Events

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