Request recording method, device, equipment and storage medium

By generating a matching expression to filter and process the message requests of the server, the problem of low simulation data rate of the test tool in the existing technology is solved, the recording and storage of normal requests is realized, and the accuracy and efficiency of system testing are improved.

CN114003784BActive Publication Date: 2025-09-16PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111265141.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2025-09-16
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

In the existing technology, the test tool simulates a low data rate and cannot simulate a large amount of data in a short time. It can only record requests when an abnormal request response is detected, and cannot intercept requests with normal responses for recording, resulting in insufficient accuracy of system testing.

Method used

By generating matching expressions to filter and process the message requests of the server, extracting the target message data, and detecting the storage status of the device database, the storage information of the database server is compared and updated to realize the recording and storage of normal requests.

Benefits of technology

It improves the efficiency of obtaining test requests, ensures the accuracy of system testing, avoids redundant requests in recorded information, and improves the efficiency of database storage and system testing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114003784B_ABST
    Figure CN114003784B_ABST
Patent Text Reader

Abstract

The present invention relates to data collection and provides a request recording method, apparatus, device, and storage medium. The method can generate a matching expression based on a request recording instruction, obtain message requests from multiple processing servers, filter the message requests based on the matching expression, obtain a target message, extract message data based on the object source of the target message, detect the storage status of the device database, and obtain a detection result. If the detection result is a preset result, obtain first storage information in the device database, obtain second storage information in the database server, compare the message data and the first storage information with the second storage information, obtain a comparison result, update the second storage information based on the comparison result, and obtain recording information. The method can collect requests for normal operation to improve test accuracy. In addition, the present invention also relates to blockchain technology, and the recording information can be stored in the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data acquisition technology, and in particular to a method, device, equipment and storage medium for requesting recording. Background Art

[0002] Currently, testing tools are often used to simulate various normal, peak, and abnormal load conditions to test various system performance indicators. However, due to the low data simulation rate of test tools, it is impossible to simulate a large amount of data for testing in a short period of time.

[0003] In order to obtain a large number of test requests in a short period of time, request recording has emerged. However, in current request recording solutions, request recording can usually only be performed when an abnormal request response is detected, resulting in the inability to intercept and record requests with normal responses. Summary of the Invention

[0004] In view of the above, it is necessary to provide a request recording method, apparatus, device and storage medium that can intercept requests that are running normally, thereby improving the accuracy of system testing.

[0005] In one aspect, the present invention provides a recording request method, which is applied to an electronic device, wherein the electronic device communicates with a plurality of processing servers and a database server respectively, and the electronic device includes a device database. The recording request method includes:

[0006] When a recording request instruction is received, a matching expression is generated according to the recording request instruction;

[0007] Obtaining message requests from the multiple processing servers;

[0008] Filtering the message request according to the matching expression to obtain a target message;

[0009] Extracting message data according to the object source of the target message;

[0010] Detecting the storage status of the device database and obtaining a detection result;

[0011] If the detection result is a preset result, obtaining first stored information in the device database and obtaining second stored information in the database server;

[0012] Comparing the message data and the first stored information with the second stored information to obtain a comparison result;

[0013] The second storage information is updated according to the comparison result to obtain recording information.

[0014] According to a preferred embodiment of the present invention, generating a matching expression according to the recording request instruction includes:

[0015] Extracting a characteristic character string from the recording request instruction;

[0016] Locating a display interface of the electronic device;

[0017] Capturing user input parameters from the display interface;

[0018] The characteristic character string and the input parameters are written into a preset instruction to obtain the matching expression.

[0019] According to a preferred embodiment of the present invention, filtering the message request according to the matching expression to obtain the target message includes:

[0020] Extracting a request object from the message request;

[0021] Determine the message request containing the request object identical to the characteristic character string as the primary screening message;

[0022] Detecting whether the primary screening message contains the input parameter;

[0023] If the primary screening message contains the input parameter, the primary screening message is determined as the target message.

[0024] According to a preferred embodiment of the present invention, extracting message data according to the object source of the target message includes:

[0025] Detecting the object type of the object source;

[0026] If the object type is a forwarding server, parsing the target message according to a preset tag to obtain the message data; or

[0027] If the object type is a local server, the target message is determined to be the message data.

[0028] According to a preferred embodiment of the present invention, detecting the storage status of the device database and obtaining the detection result includes:

[0029] Entering the message data into the device database and obtaining response information from the device database;

[0030] Performing semantic analysis on the response information to obtain a semantic result;

[0031] Detecting whether the semantic result contains configuration information;

[0032] If the semantic result includes the configuration information, determining the detection result as that the device database is full;

[0033] If the semantic result does not include the configuration information, counting the storage amount in the device database;

[0034] If the storage amount is greater than a preset amount, the detection result is determined as the device database is full.

[0035] According to a preferred embodiment of the present invention, the comparing the message data and the first stored information with the second stored information to obtain a comparison result includes:

[0036] Determine the message data and the first stored information as target information, wherein the target information stores a data key and a data value corresponding to the data key;

[0037] detecting whether the second storage information contains the data key;

[0038] If the second storage information does not include the data key, determining the comparison result as the first result; and / or

[0039] If the second stored information contains the data key, extracting information corresponding to the data key from the second stored information as information to be compared, and comparing the data value with the information to be compared;

[0040] If the data value is different from the information to be compared, the comparison result is determined as a second result.

[0041] According to a preferred embodiment of the present invention, updating the second stored information according to the comparison result to obtain the recording information includes:

[0042] Extracting the data key whose comparison result is the first result as the 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

[0043] Extract the data key whose comparison result is the second result as the target key, and extract the data value corresponding to the target key as the target value, obtain the key value corresponding to the target key from the second storage information as the initial value, and merge the target value and the initial value to obtain an updated value, replace the initial value with the updated value, and obtain the recording information.

[0044] In another aspect, the present invention further provides a recording request device, which operates on an electronic device, wherein the electronic device communicates with a plurality of processing servers and a database server, the electronic device including a device database, and the recording request device includes:

[0045] a generating unit, configured to generate a matching expression according to a recording request instruction when receiving the recording request instruction;

[0046] an acquiring unit, configured to acquire message requests from the plurality of processing servers;

[0047] A screening unit, configured to screen the message request according to the matching expression to obtain a target message;

[0048] An extraction unit, configured to extract message data according to an object source of the target message;

[0049] A detection unit, used to detect the storage status of the device database and obtain a detection result;

[0050] The acquiring unit is further configured to acquire the first stored information in the device database and acquire the second stored information in the database server if the detection result is a preset result;

[0051] a comparing unit, configured to compare the message data and the first stored information with the second stored information to obtain a comparison result;

[0052] An updating unit is used to update the second storage information according to the comparison result to obtain recording information.

[0053] On the other hand, the present invention further provides an electronic device, comprising:

[0054] a memory storing computer-readable instructions; and

[0055] The processor executes the computer-readable instructions stored in the memory to implement the recording request method.

[0056] On the other hand, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the recording request method.

[0057] It can be seen from the above technical solution that the present invention can filter the message requests in the multiple processing servers through the matching expression. Since there is no need to set an interception window in front of the corresponding interface, the target message to be recorded can be quickly obtained, thereby improving the efficiency of obtaining test requests. At the same time, since the target message selected by the matching expression contains normal requests and abnormal requests, normal requests can be recorded for testing, ensuring the test performance of the subsequent system, and then through the detection of the device database, the second storage information in the database server can be updated in time to avoid redundant requests in the recorded information. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a flow chart of a preferred embodiment of the recording request method of the present invention.

[0059] Figure 2 It is a functional module diagram of a preferred embodiment of the request recording device of the present invention.

[0060] Figure 3 It is a structural diagram of an electronic device of a preferred embodiment of the present invention for implementing the request recording method. DETAILED DESCRIPTION

[0061] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a method for requesting recording according to the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different requirements.

[0063] The request recording method can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0064] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0065] The request recording method is applied to one or more electronic devices, which are devices that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions. Their hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0066] The electronic device can be any electronic product that can interact with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0067] 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, a group of electronic devices consisting of multiple network electronic devices, or a cloud based on cloud computing consisting of a large number of hosts or network electronic devices.

[0068] The network where 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), etc.

[0069] The electronic device communicates with a plurality of processing servers and a database server respectively, and the electronic device includes a device database.

[0070] S10: When a recording request instruction is received, a matching expression is generated according to the recording request instruction.

[0071] In at least one embodiment of the present invention, the recording request instruction can be triggered when a test requirement is generated. The information carried by the recording request instruction includes, but is not limited to: a character string corresponding to the interface to be tested.

[0072] The matching expression is used to filter out requests that need to be tested.

[0073] In at least one embodiment of the present invention, the electronic device generating a matching expression according to the recording request instruction includes:

[0074] Extracting a characteristic character string from the recording request instruction;

[0075] Locating a display interface of the electronic device;

[0076] Capturing user input parameters from the display interface;

[0077] The characteristic character string and the input parameters are written into a preset instruction to obtain the matching expression.

[0078] The characteristic character string may be a character string pre-set by the user according to the recording interface.

[0079] The display interface includes multiple buttons and input spaces. The display interface is not only used to display the layout of the page, but also used for the user to control the recording of specific requests.

[0080] The input parameters may be interface parameters that are set according to requirements.

[0081] For example, the characteristic string may be getWin.do, the input parameters may be a=1&b=2, and the preset instruction is characteristic prefix+?+parameter, then the matching expression is getWin.do? a=1&b=2.

[0082] The characteristic character string can be used to uniformly record requests in the same interface to avoid missing requests, and the input parameters can be used to control the specific requests to be recorded to avoid recording redundant requests, which is not conducive to subsequent system testing.

[0083] S11, obtaining message requests from the multiple processing servers.

[0084] In at least one embodiment of the present invention, the message request refers to a request processed by the multiple processing servers. Specifically, the message request can be generated by the multiple processing servers, and the message request can also be forwarded by the multiple processing servers.

[0085] S12: Filter the message request according to the matching expression to obtain a target message.

[0086] In at least one embodiment of the present invention, the target message refers to a request related to a test requirement, wherein the test requirement may refer to an interface or system that needs to be tested.

[0087] In at least one embodiment of the present invention, the electronic device filters the message request according to the matching expression to obtain the target message, including:

[0088] Extracting a request object from the message request;

[0089] Determine the message request containing the request object identical to the characteristic character string as the primary screening message;

[0090] Detecting whether the primary screening message contains the input parameter;

[0091] If the primary screening message contains the input parameter, the primary screening message is determined as the target message.

[0092] The request object may be character string information corresponding to the request address of the message request.

[0093] The target message to be recorded can be accurately screened out from the message request through the characteristic character string and input parameters in the matching expression.

[0094] S13, extracting message data according to the object source of the target message.

[0095] In at least one embodiment of the present invention, the message data refers to the core data information carried in the target message. For example, the message data may be data information corresponding to a certain field.

[0096] In at least one embodiment of the present invention, the electronic device extracting message data according to the object source of the target message includes:

[0097] Detecting the object type of the object source;

[0098] If the object type is a forwarding server, parsing the target message according to a preset tag to obtain the message data; or

[0099] If the object type is a local server, the target message is determined to be the message data.

[0100] The object type refers to the specific type of the object source, and the object type includes the forwarding server and the local server.

[0101] The forwarding server refers to a server responsible for forwarding requests to the access terminal.

[0102] The local server refers to an access terminal, and the local server is used to process a request to obtain a response result of the request.

[0103] The preset tag is used to indicate a message character string in the target message.

[0104] By detecting the source of the object, the message data can be accurately extracted from the target message in different ways.

[0105] S14, detecting the storage status of the device database and obtaining a detection result.

[0106] In at least one embodiment of the present invention, the detection result includes that the device database is full, and the detection result also includes that the device database is not full.

[0107] In at least one embodiment of the present invention, the electronic device detects the storage status of the device database, and obtaining the detection result includes:

[0108] Entering the message data into the device database and obtaining response information from the device database;

[0109] Performing semantic analysis on the response information to obtain a semantic result;

[0110] Detecting whether the semantic result contains configuration information;

[0111] If the semantic result includes the configuration information, determining the detection result as that the device database is full;

[0112] If the semantic result does not include the configuration information, counting the storage amount in the device database;

[0113] If the storage amount is greater than a preset amount, the detection result is determined as the device database is full.

[0114] The response information refers to the response made by the device database after the message data is entered into the device database. For example, the response information may be "data has been successfully entered", "QuotaExceededError", or "try catch".

[0115] The semantic result refers to information that can represent the semantics of the response information.

[0116] The configuration information is used to indicate that the message data cannot be entered into the device database. For example, the configuration information may indicate that the entry is successful or that the entry fails.

[0117] The preset amount can be set according to demand. For example, the preset amount can be 90% of the total memory of the device database. Specifically, if the total memory is 100M, the preset amount can be 90M.

[0118] Through the above implementation, when the semantic result does not include the configuration information, the storage amount can be further compared with the preset amount, thereby further improving the accuracy of the detection result.

[0119] In this embodiment, when the configuration information is not included in the semantic result, it means that the device database is not full before the message data is entered into the device database. After the message data is stored in the device database, the storage status in the device database can be accurately determined by combining the storage capacity and the preset capacity.

[0120] S15: If the detection result is a preset result, obtain the first storage information in the device database and obtain the second storage information in the database server.

[0121] In at least one embodiment of the present invention, the preset result means that the device database is full.

[0122] The first stored information refers to all information in the device database, and the second stored information refers to all information in the database server.

[0123] In this embodiment, when the device database is full, the first storage information is migrated to the database server so that subsequent requests can be directly stored in the device database, thereby improving storage efficiency.

[0124] In at least one embodiment of the present invention, the method further comprises:

[0125] If the detection result is not the preset result, the message data is directly entered into the device database.

[0126] S16: Compare the message data and the first stored information with the second stored information to obtain a comparison result.

[0127] 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 means that the data key and the data value corresponding to the data key do not exist in the database server, the second result means that the data key exists in the database server but the data value corresponding to the data key does not exist, and the third result means that the data key and the data value corresponding to the data key exist in the database server.

[0128] In at least one embodiment of the present invention, the electronic device compares the message data and the first stored information with the second stored information, and obtaining a comparison result includes:

[0129] Determine the message data and the first stored information as target information, wherein the target information stores a data key and a data value corresponding to the data key;

[0130] detecting whether the second storage information contains the data key;

[0131] If the second storage information does not include the data key, determining the comparison result as the first result; and / or

[0132] If the second stored information contains the data key, extracting information corresponding to the data key from the second stored information as information to be compared, and comparing the data value with the information to be compared;

[0133] If the data value is different from the information to be compared, the comparison result is determined as a second result.

[0134] By comparing the data values ​​after comparing the data keys, it is possible to avoid identical data values ​​existing in different data keys, thereby improving the accuracy of the comparison result.

[0135] 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.

[0136] S17: Update the second storage information according to the comparison result to obtain recording information.

[0137] In at least one embodiment of the present invention, the recorded information can be used for system performance testing.

[0138] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned recorded information, the above-mentioned recorded information can also be stored in a node of a blockchain.

[0139] In at least one embodiment of the present invention, the electronic device updates the second stored information according to the comparison result, and obtaining the recording information includes:

[0140] Extracting the data key whose comparison result is the first result as the 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

[0141] Extract the data key whose comparison result is the second result as the target key, and extract the data value corresponding to the target key as the target value, obtain the key value corresponding to the target key from the second storage information as the initial value, and merge the target value and the initial value to obtain an updated value, replace the initial value with the updated value, and obtain the recording information.

[0142] Through the above implementation, repeated requests in the recording information can be avoided, which not only saves resource space, but also avoids the same request being used for testing, thereby causing resource occupation during system testing. In at least one embodiment of the present invention, the method further includes:

[0143] The test system is tested based on the recording information. It can be seen from the above technical solution that the present invention can filter the message requests in the multiple processing servers through the matching expression. Since there is no need to set an interception window in front of the corresponding interface, the target message to be recorded can be quickly obtained, thereby improving the efficiency of obtaining the test request. At the same time, since the target message selected by the matching expression contains normal requests and abnormal requests, normal requests can be recorded for testing, ensuring the test performance of the subsequent system, and then through the detection of the device database, the second storage information in the database server can be updated in time to avoid redundant requests in the recording information.

[0144] like Figure 2 , which is a functional block diagram of a preferred embodiment of a request recording device according to the present invention. The request recording device 11 includes a generation unit 110, an acquisition unit 111, a screening unit 112, an extraction unit 113, a detection unit 114, a comparison unit 115, an update unit 116, an entry unit 117, and a testing unit 118. A module / unit as referred to herein refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and perform a fixed function, and is stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0145] When receiving a recording request instruction, the generating unit 110 generates a matching expression according to the recording request instruction.

[0146] In at least one embodiment of the present invention, the recording request instruction can be triggered when a test requirement is generated. The information carried by the recording request instruction includes, but is not limited to: a character string corresponding to the interface to be tested.

[0147] The matching expression is used to filter out requests that need to be tested.

[0148] In at least one embodiment of the present invention, the generating unit 110 generates a matching expression according to the recording request instruction, including:

[0149] Extracting a characteristic character string from the recording request instruction;

[0150] Locating a display interface of the electronic device;

[0151] Capturing user input parameters from the display interface;

[0152] The characteristic character string and the input parameters are written into a preset instruction to obtain the matching expression.

[0153] The characteristic character string may be a character string pre-set by the user according to the recording interface.

[0154] The display interface includes multiple buttons and input spaces. The display interface is not only used to display the layout of the page, but also used for the user to control the recording of specific requests.

[0155] The input parameters may be interface parameters that are set according to requirements.

[0156] For example, the characteristic string may be getWin.do, the input parameters may be a=1&b=2, and the preset instruction is characteristic prefix+?+parameter, then the matching expression is getWin.do? a=1&b=2.

[0157] The characteristic character string can be used to uniformly record requests in the same interface to avoid missing requests, and the input parameters can be used to control the specific requests to be recorded to avoid recording redundant requests, which is not conducive to subsequent system testing.

[0158] The acquiring unit 111 acquires the message requests from the multiple processing servers.

[0159] In at least one embodiment of the present invention, the message request refers to a request processed by the multiple processing servers. Specifically, the message request can be generated by the multiple processing servers, and the message request can also be forwarded by the multiple processing servers.

[0160] The screening unit 112 screens the message request according to the matching expression to obtain a target message.

[0161] In at least one embodiment of the present invention, the target message refers to a request related to a test requirement, wherein the test requirement may refer to an interface or system that needs to be tested.

[0162] In at least one embodiment of the present invention, the screening unit 112 screens the message request according to the matching expression, and the obtained target message includes:

[0163] Extracting a request object from the message request;

[0164] Determine the message request containing the request object identical to the characteristic character string as the primary screening message;

[0165] Detecting whether the primary screening message contains the input parameter;

[0166] If the primary screening message contains the input parameter, the primary screening message is determined as the target message.

[0167] The request object may be character string information corresponding to the request address of the message request.

[0168] The target message to be recorded can be accurately screened out from the message request through the characteristic character string and input parameters in the matching expression.

[0169] The extraction unit 113 extracts message data according to the object source of the target message.

[0170] In at least one embodiment of the present invention, the message data refers to the core data information carried in the target message. For example, the message data may be data information corresponding to a certain field.

[0171] 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:

[0172] Detecting the object type of the object source;

[0173] If the object type is a forwarding server, parsing the target message according to a preset tag to obtain the message data; or

[0174] If the object type is a local server, the target message is determined to be the message data.

[0175] The object type refers to the specific type of the object source, and the object type includes the forwarding server and the local server.

[0176] The forwarding server refers to a server responsible for forwarding requests to the access terminal.

[0177] The local server refers to an access terminal, and the local server is used to process a request to obtain a response result of the request.

[0178] The preset tag is used to indicate a message character string in the target message.

[0179] By detecting the source of the object, the message data can be accurately extracted from the target message in different ways.

[0180] The detection unit 114 detects the storage status of the device database and obtains a detection result.

[0181] In at least one embodiment of the present invention, the detection result includes that the device database is full, and the detection result also includes that the device database is not full.

[0182] In at least one embodiment of the present invention, the detection unit 114 detects the storage status of the device database, and the detection result obtained includes:

[0183] Entering the message data into the device database and obtaining response information from the device database;

[0184] Performing semantic analysis on the response information to obtain a semantic result;

[0185] Detecting whether the semantic result contains configuration information;

[0186] If the semantic result includes the configuration information, determining the detection result as that the device database is full;

[0187] If the semantic result does not include the configuration information, counting the storage amount in the device database;

[0188] If the storage amount is greater than a preset amount, the detection result is determined as the device database is full.

[0189] The response information refers to the response made by the device database after the message data is entered into the device database. For example, the response information may be "data has been successfully entered", "QuotaExceededError", or "try catch".

[0190] The semantic result refers to information that can represent the semantics of the response information.

[0191] The configuration information is used to indicate that the message data cannot be entered into the device database. For example, the configuration information may indicate that the entry is successful or that the entry fails.

[0192] The preset amount can be set according to demand. For example, the preset amount can be 90% of the total memory of the device database. Specifically, if the total memory is 100M, the preset amount can be 90M.

[0193] Through the above implementation, when the semantic result does not include the configuration information, the storage amount can be further compared with the preset amount, thereby further improving the accuracy of the detection result.

[0194] In this embodiment, when the configuration information is not included in the semantic result, it means that the device database is not full before the message data is entered into the device database. After the message data is stored in the device database, the storage status in the device database can be accurately determined by combining the storage capacity and the preset capacity.

[0195] If the detection result is a preset result, the acquiring unit 111 acquires the first stored information in the device database and acquires the second stored information in the database server.

[0196] In at least one embodiment of the present invention, the preset result means that the device database is full.

[0197] The first stored information refers to all information in the device database, and the second stored information refers to all information in the database server.

[0198] In this embodiment, when the device database is full, the first storage information is migrated to the database server so that subsequent requests can be directly stored in the device database, thereby improving storage efficiency.

[0199] 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.

[0200] The comparison unit 115 compares the message data and the first stored information with the second stored information to obtain a comparison result.

[0201] 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 means that the data key and the data value corresponding to the data key do not exist in the database server, the second result means that the data key exists in the database server but the data value corresponding to the data key does not exist, and the third result means that the data key and the data value corresponding to the data key exist in the database server.

[0202] In at least one embodiment of the present invention, the comparison unit 115 compares the message data and the first stored information with the second stored information, and the comparison result obtained includes:

[0203] Determine the message data and the first stored information as target information, wherein the target information stores a data key and a data value corresponding to the data key;

[0204] detecting whether the second storage information contains the data key;

[0205] If the second storage information does not include the data key, determining the comparison result as the first result; and / or

[0206] If the second stored information contains the data key, extracting information corresponding to the data key from the second stored information as information to be compared, and comparing the data value with the information to be compared;

[0207] If the data value is different from the information to be compared, the comparison result is determined as a second result.

[0208] By comparing the data values ​​after comparing the data keys, it is possible to avoid identical data values ​​existing in different data keys, thereby improving the accuracy of the comparison result.

[0209] In at least one embodiment of the present invention, if the data value is the same as the information to be compared, the comparison unit 115 determines the comparison result as the third result.

[0210] The updating unit 116 updates the second storage information according to the comparison result to obtain recording information.

[0211] In at least one embodiment of the present invention, the recorded information can be used for system performance testing.

[0212] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned recorded information, the above-mentioned recorded information can also be stored in a node of a blockchain.

[0213] In at least one embodiment of the present invention, the updating unit 116 updates the second stored information according to the comparison result, and the obtained recording information includes:

[0214] Extracting the data key whose comparison result is the first result as the 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

[0215] Extract the data key whose comparison result is the second result as the target key, and extract the data value corresponding to the target key as the target value, obtain the key value corresponding to the target key from the second storage information as the initial value, and merge the target value and the initial value to obtain an updated value, replace the initial value with the updated value, and obtain the recording information.

[0216] Through the above implementation, repeated requests can be avoided in the recorded information, which not only saves resource space, but also avoids the same request being used for testing, thereby causing resource occupation during system testing. In at least one embodiment of the present invention, the test unit 118 tests the test system based on the recorded information.

[0217] It can be seen from the above technical solution that the present invention can filter the message requests in the multiple processing servers through the matching expression. Since there is no need to set an interception window in front of the corresponding interface, the target message to be recorded can be quickly obtained, thereby improving the efficiency of obtaining test requests. At the same time, since the target message selected by the matching expression contains normal requests and abnormal requests, normal requests can be recorded for testing, ensuring the test performance of the subsequent system, and then through the detection of the device database, the second storage information in the database server can be updated in time to avoid redundant requests in the recorded information.

[0218] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a preferred embodiment of the request recording method of the present invention.

[0219] 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 to record a program.

[0220] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.

[0221] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, connecting various parts of the entire electronic device 1 using various interfaces and lines, and executing the operating system of the electronic device 1 as well as various installed applications, program codes, etc.

[0222] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, which 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 describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into a generation unit 110, an acquisition unit 111, a screening unit 112, an extraction unit 113, a detection unit 114, a comparison unit 115, an update unit 116, an entry unit 117, and a testing unit 118.

[0223] The memory 12 can be used to store the computer-readable instructions and / or modules. The processor 13 implements the various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12 and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the electronic device. The memory 12 can include non-volatile and volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, at least one disk storage device, a flash memory device, or other storage devices.

[0224] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a physical memory, such as a memory stick, a TF card (Trans-flash Card), and the like.

[0225] If the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention can also implement all or part of the processes in the above-mentioned embodiment methods by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented.

[0226] The computer-readable instructions include computer-readable instruction codes, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer-readable instruction codes, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), or a random access memory (RAM).

[0227] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0228] Combine Figure 1 The memory 12 in the electronic device 1 stores computer-readable instructions to implement a recording request method, which is applied to an electronic device. The electronic device communicates with multiple processing servers and database servers respectively, and the electronic device includes a device database. The processor 13 can execute the computer-readable instructions to implement:

[0229] When a recording request instruction is received, a matching expression is generated according to the recording request instruction;

[0230] Obtaining message requests from the multiple processing servers;

[0231] Filtering the message request according to the matching expression to obtain a target message;

[0232] Extracting message data according to the object source of the target message;

[0233] Detecting the storage status of the device database and obtaining a detection result;

[0234] If the detection result is a preset result, obtaining first stored information in the device database and obtaining second stored information in the database server;

[0235] Comparing the message data and the first stored information with the second stored information to obtain a comparison result;

[0236] The second storage information is updated according to the comparison result to obtain recording information.

[0237] Specifically, the specific implementation method of the processor 13 for the above computer readable instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0238] In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical functional division, and actual implementation may employ other division methods.

[0239] The computer-readable storage medium stores computer-readable instructions, wherein the computer-readable instructions, when executed by the processor 13, are used to implement the following steps:

[0240] When a recording request instruction is received, a matching expression is generated according to the recording request instruction;

[0241] Obtaining message requests from the multiple processing servers;

[0242] Filtering the message request according to the matching expression to obtain a target message;

[0243] Extracting message data according to the object source of the target message;

[0244] Detecting the storage status of the device database and obtaining a detection result;

[0245] If the detection result is a preset result, obtaining first stored information in the device database and obtaining second stored information in the database server;

[0246] Comparing the message data and the first stored information with the second stored information to obtain a comparison result;

[0247] The second storage information is updated according to the comparison result to obtain recording information.

[0248] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

[0249] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.

[0250] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0251] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices described may also be implemented by a single unit or device through software or hardware. Terms such as first and second are used to indicate names and do not imply any particular order.

[0252] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A recording request method, characterized in that: Applied to an electronic device, the electronic device communicates with a plurality of processing servers and a database server respectively, the electronic device includes a device database, and the recording request method includes: When a recording request instruction is received, a matching expression is generated according to the recording request instruction, including: extracting a characteristic string in the recording request instruction; locating a display interface of the electronic device; capturing a user input parameter from the display interface; and writing the characteristic string and the input parameter into a preset instruction to obtain the matching expression; Obtaining message requests from the multiple processing servers; The message request is screened according to the matching expression to obtain a target message, including: extracting a request object from the message request; determining a message request containing a request object identical to a characteristic character string in the request recording instruction as a preliminary screening message; detecting whether the preliminary screening message contains an input parameter; and if the preliminary screening message contains the input parameter, determining the preliminary screening message as the target message; Extracting message data according to the object source of the target message; Detecting the storage status of the device database and obtaining a detection result; If the detection result is a preset result, obtaining first storage information in the device database and obtaining second storage information in the database server, the preset result being that the device database is full; Comparing the message data and the first stored information with the second stored information to obtain a comparison result; The second storage information is updated according to the comparison result to obtain recording information.

2. The recording request method according to claim 1, wherein: The extracting message data according to the object source of the target message includes: Detecting the object type of the object source; If the object type is a forwarding server, parsing the target message according to a preset tag to obtain the message data; or If the object type is a local server, the target message is determined to be the message data.

3. The recording request method according to claim 1, wherein: The detecting the storage status of the device database and obtaining the detection result includes: Entering the message data into the device database and obtaining response information from the device database; Performing semantic analysis on the response information to obtain a semantic result; Detecting whether the semantic result contains configuration information; If the semantic result includes the configuration information, determining the detection result as that the device database is full; If the semantic result does not include the configuration information, counting the storage amount in the device database; If the storage amount is greater than a preset amount, the detection result is determined as the device database is full.

4. The recording request method according to claim 1, wherein: The comparing the message data and the first stored information with the second stored information to obtain a comparison result includes: Determine the message data and the first stored information as target information, wherein the target information stores a data key and a data value corresponding to the data key; detecting whether the second storage information contains the data key; If the second storage information does not include the data key, determining the comparison result as the first result; and / or If the second stored information contains the data key, extracting information corresponding to the data key from the second stored information as information to be compared, and comparing the data value with the information to be compared; If the data value is different from the information to be compared, the comparison result is determined as a second result.

5. The recording request method according to claim 4, wherein: Updating the second stored information according to the comparison result to obtain the recording information includes: Extracting the data key whose comparison result is the first result as the 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 Extract the data key whose comparison result is the second result as the target key, and extract the data value corresponding to the target key as the target value, obtain the key value corresponding to the target key from the second storage information as the initial value, and merge the target value and the initial value to obtain an updated value, replace the initial value with the updated value, and obtain the recording information.

6. A recording request device, characterized in that: The electronic device is operated on, and the electronic device communicates with a plurality of processing servers and a database server respectively. The electronic device includes a device database. The recording request device includes: A generating unit is configured to, upon receiving a recording request instruction, generate a matching expression based on the recording request instruction, including: extracting a characteristic string from the recording request instruction; locating a display interface of the electronic device; capturing user input parameters from the display interface; and writing the characteristic string and the input parameters into a preset instruction to obtain the matching expression; an acquiring unit, configured to acquire message requests from the plurality of processing servers; a screening unit, configured to screen the message request according to the matching expression to obtain a target message, comprising: extracting a request object from the message request; determining a message request containing a request object identical to a characteristic string in the request recording instruction as a preliminary screening message; detecting whether the preliminary screening message contains an input parameter; and if the preliminary screening message contains the input parameter, determining the preliminary screening message as the target message; An extraction unit, configured to extract message data according to an object source of the target message; A detection unit, used to detect the storage status of the device database and obtain a detection result; The acquiring unit is further configured to acquire first stored information in the device database and second stored information in the database server if the detection result is a preset result, wherein the preset result is that the device database is full; a comparing unit, configured to compare the message data and the first stored information with the second stored information to obtain a comparison result; An updating unit is used to update the second storage information according to the comparison result to obtain recording information.

7. An electronic device, characterized in that: The electronic device comprises: a memory storing computer-readable instructions; and A processor executes computer-readable instructions stored in the memory to implement the recording request method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the recording request method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Page data refreshing method and device, electronic equipment and storage medium

    CN112231616A

  • ip-based Mock data test method, electronic equipment and storage medium

    CN112732567A