CN118093012A - Data acquisition method and device, storage medium and electronic equipment - Google Patents
Data acquisition method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN118093012A CN118093012A CN202410372122.7A CN202410372122A CN118093012A CN 118093012 A CN118093012 A CN 118093012A CN 202410372122 A CN202410372122 A CN 202410372122A CN 118093012 A CN118093012 A CN 118093012A
- Authority
- CN
- China
- Prior art keywords
- program
- service request
- interface program
- reconstructed
- original
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000004590 computer program Methods 0.000 claims description 15
- 238000004458 analytical method Methods 0.000 claims description 2
- 238000011161 development Methods 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 12
- 230000006872 improvement Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 239000010979 ruby Substances 0.000 description 2
- 229910001750 ruby Inorganic materials 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/72—Code refactoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The specification discloses a data acquisition method, a data acquisition device, a storage medium and electronic equipment. The data acquisition method comprises the following steps: receiving a service request sent by a client; analyzing the service request, and determining an original interface address of an original interface program corresponding to the service request; if the original interface address is pre-bound with the reconstructed interface address of the reconstructed interface program corresponding to the original interface program, the service request is sent to the reconstructed interface program through the reconstructed interface address so as to obtain service data corresponding to the service request through the reconstructed interface program, and the service data is returned to the client, wherein the reconstructed interface program is obtained after the original interface program is reconstructed based on a programming language different from that of the original interface program. According to the scheme, when the interface program is reconfigured, the client does not need to be updated or modified, so that the development cost is reduced, and the user experience is ensured.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data acquisition method, a data acquisition device, a storage medium, and an electronic device.
Background
In the process of communication between a client and a server, data interaction is usually required by means of an interface program, and as the requirements of users on the performance and reliability of the interface program are higher, the conventional interface program cannot meet the requirements of the users. To solve this problem, the conventional interface program needs to be reconfigured by another programming language.
At present, in the process of reconstructing an interface program, a new interface address is generally allocated to the reconstructed interface program, and in order to ensure normal access of a client to the reconstructed interface program, the client program needs to be updated or updated in a mode of modifying an interface request address, which not only wastes a great deal of development cost, but also may generate loopholes in the process of updating the client, thereby reducing user experience.
Therefore, how to avoid the modification to the client in the process of interface reconstruction, thereby reducing the development cost and further ensuring the user experience is a problem to be solved urgently.
Disclosure of Invention
The present disclosure provides a data acquisition method, apparatus, storage medium, and electronic device, so as to partially solve the foregoing problems in the prior art.
The technical scheme adopted in the specification is as follows:
the specification provides a data acquisition method, which includes:
Receiving a service request sent by a client;
analyzing the service request, and determining an original interface address of an original interface program corresponding to the service request;
If it is determined that the original interface address is pre-bound with a reconstructed interface address of a reconstructed interface program corresponding to the original interface program, the service request is sent to the reconstructed interface program through the reconstructed interface address, so that service data corresponding to the service request is obtained through the reconstructed interface program, and the service data is returned to the client, wherein the reconstructed interface program is obtained after the original interface program is reconstructed based on a programming language different from that of the original interface program.
Optionally, the method further comprises:
And if the original interface address is not pre-bound with the reconstructed interface address, sending the service request to the original interface program through the original interface address so as to acquire service data corresponding to the service request through the original interface program, and returning the service data to the client.
Optionally, before the service request is sent to the reconfiguration interface program through the reconfiguration interface address, the method further includes:
Determining a random number corresponding to the service request;
Judging whether the numerical value of the random number is smaller than a preset gray scale threshold value or not;
The service request is sent to the reconfiguration interface program through the reconfiguration interface address, and the method specifically comprises the following steps:
And if the original interface address is pre-bound with the reconfiguration interface address and the numerical value of the random number is smaller than the gray scale threshold value, sending the service request to the reconfiguration interface program through the reconfiguration interface address.
Optionally, the method further comprises:
And if the numerical value of the random number is not smaller than the gray scale threshold, sending the service request to the original interface program through the original interface address so as to acquire service data corresponding to the service request through the original interface program, and returning the service data to the client.
Optionally, before determining whether the value of the random number is less than a preset gray scale threshold, the method further includes:
determining whether an original interface address corresponding to the service request is pre-bound with the reconstructed interface address;
judging whether the numerical value of the random number is smaller than a preset gray scale threshold value or not, specifically comprising:
And if the original interface address is pre-bound with the reconstructed interface address, judging whether the numerical value of the random number is smaller than a preset gray scale threshold value.
Optionally, the method further comprises:
And after the number of the service requests received by the reconfiguration interface program exceeds the preset number, if the service requests acquired by the reconfiguration interface program are determined to be valid requests, the gray scale threshold value is increased.
Optionally, the programming language corresponding to the original interface program includes: and the PHP language of the hypertext preprocessor is obtained after the original interface program is reconstructed based on the Go language.
The present specification provides a data acquisition apparatus comprising:
The receiving module is used for receiving the service request sent by the client;
the analysis module is used for analyzing the service request and determining an original interface address of an original interface program corresponding to the service request;
And the return module is used for sending the service request to the reconfiguration interface program through the reconfiguration interface address if the original interface address is pre-bound with the reconfiguration interface address of the reconfiguration interface program corresponding to the original interface program, so as to acquire the service data corresponding to the service request through the reconfiguration interface program, and returning the service data to the client, wherein the reconfiguration interface program is obtained after the reconfiguration of the original interface program based on a programming language different from the programming language of the original interface program.
The present specification provides a computer readable storage medium storing a computer program which when executed by a processor implements the data acquisition method described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the data acquisition method described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
In the data acquisition method provided by the specification, a service request sent by a client is received; analyzing the service request, and determining an original interface address of an original interface program corresponding to the service request; if the original interface address is pre-bound with the reconstructed interface address of the reconstructed interface program corresponding to the original interface program, the service request is sent to the reconstructed interface program through the reconstructed interface address so as to obtain service data corresponding to the service request through the reconstructed interface program, and the service data is returned to the client, wherein the reconstructed interface program is obtained after the original interface program is reconstructed based on a programming language different from that of the original interface program.
According to the method, after the server receives the service request, the original interface address corresponding to the service request can be acquired, the reconstructed interface address bound with the original interface address is determined and forwarded to the reconstructed interface program, and compared with the existing method, the method does not need to modify the client program, and smooth switching of the reconstructed interface program can be achieved only by binding the original interface address corresponding to the reconstructed interface program with the reconstructed interface address corresponding to the original interface program in advance, waste of development cost in the interface reconstruction process is reduced, vulnerability risks caused by updating the client are avoided, and user experience is further guaranteed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
Fig. 1 is a schematic flow chart of a data acquisition method provided in the present specification;
FIG. 2 is a schematic diagram of an overall process of data acquisition provided in the present specification;
FIG. 3 is a schematic diagram of a data acquisition device provided in the present specification;
fig. 4 is a schematic view of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flow chart of a data acquisition method provided in the present specification, including the following steps:
S101: and receiving a service request sent by the client.
The back-end PHP interface is generally used to implement interaction between the front-end and the database, process the business logic, and return corresponding data or response to the front-end, however, the existing (Hypertext Preprocessor, PHP) back-end interface has a bottleneck in terms of performance due to the use of dynamic language, and cannot meet the requirements of enterprises. To solve this problem, it is necessary to reconstruct the PHP program interface, and switch the programming language to a static language such as Go language, to improve the interface performance.
However, problems are encountered in performing the program reconfiguration. First, the interface request addresses of all clients need to be modified due to the change of the original interface address, which will bring huge costs and may be missed. Secondly, the reconstructed interface needs to pass through the flow verification function requested by the real user and cannot be directly and fully switched to the reconstructed program, so that the influence of the loopholes of the reconstructed program on all users is avoided.
Based on this, the present disclosure provides a data acquisition method, after the interface is reconstructed, the interface address of the reconstructed program interface is bound with the interface address of the original program interface, so that after the server acquires the service request, the service data can be acquired and returned through the reconstructed interface program based on the reconstructed interface address bound with the original interface address.
The user can reconstruct the original interface program based on other programming languages different from the programming language corresponding to the original interface program through the configuration site provided by the server, so as to obtain the reconstructed interface program, and the reconstructed interface program is allocated with an original interface address as a reconstructed interface address.
And then the server can bind the original interface address corresponding to the original interface program with the reconstructed interface address based on the corresponding relation between the original interface address corresponding to the original interface program and the reconstructed interface address and store the corresponding relation. In this specification, the server may store, through a hash table, a correspondence between an original interface address corresponding to an original interface program and a reconstructed interface address.
It should be noted that, some interface programs that are not reconstructed may exist in the server, and the original interface addresses corresponding to these interface programs that are not reconstructed do not have the reconstructed interface addresses bound to them.
In this specification, the programming language corresponding to the original interface program may be PHP language, and the server may reconstruct the PHP interface program based on Go language. Of course, the programming corresponding to the original interface program may be other dynamic programming languages, such as Python, ruby, etc., and the server may reconstruct the programming through static programming languages, such as C, C ++, java, etc., which are not limited in detail in this specification.
In addition, the server may preset a gray scale threshold for determining the proportion of service requests forwarded to the reconfiguration interface procedure. When the gray scale threshold is 1, all service requests are forwarded to the reconfiguration interface program for processing.
In the process of actually executing the service, the server can receive the service request sent by the client, in the actual application, the service request can be an http request, and the server can simultaneously receive a plurality of http requests sent by different clients.
Specifically, an original interface program, a reconfiguration interface program and an nginx program may be set in the server, where the ginx program may be used as a traffic entry, parse a service request and forward the service request to a corresponding interface program, and return service data acquired by the interface program to the client, where the gray scale threshold, a correspondence between an original interface address and a reconfiguration interface address corresponding to the original interface program may be stored in the ginx program.
S102: and analyzing the service request and determining the original interface address of the original interface program corresponding to the service request.
For each received service request, the server can analyze the service request through an nginx program, determine Host, path and Query parameters, and determine an original interface address corresponding to the service request according to the parameters. The original interface address is the original interface address corresponding to the original interface program.
S103: if it is determined that the original interface address is pre-bound with a reconstructed interface address of a reconstructed interface program corresponding to the original interface program, the service request is sent to the reconstructed interface program through the reconstructed interface address, so that service data corresponding to the service request is obtained through the reconstructed interface program, and the service data is returned to the client, wherein the reconstructed interface program is obtained after the original interface program is reconstructed based on a programming language different from that of the original interface program.
After determining the original interface address corresponding to each service request, the server can determine whether the original interface address corresponding to the service request is pre-bound with the reconstructed interface address by means of matching the hash table with the corresponding relation. If the hash table has a reconstructed interface address corresponding to the original interface address, the hash table indicates that the original interface address is bound with the reconstructed interface address in advance, otherwise, the hash table indicates that the original interface address is a previously bound reconstructed interface address, and the interface program is not reconstructed.
If the original interface address corresponding to the service request is not bound with the reconstructed interface address, the service request can be processed only through the original interface program, at this time, the server can send the service request to the original interface program through the original interface address by the nginx program, so as to obtain service data corresponding to the service request through the original interface program, and return the service data to the client.
If the original interface address corresponding to the service request is bound to the reconstructed interface address in advance, the server can further determine a random number corresponding to the service request, wherein the random number can be randomly generated by the nginx program after the service request is received, and the value range of the random number is the same as the value range of the gray scale threshold value.
And then the nginx program can judge whether the value of the random number is smaller than a preset gray scale threshold value, if so, the reconstruction interface address which is bound with the original interface address in advance is determined, and the service request is sent to the reconstruction interface program according to the reconstruction interface address.
If not, the service request is sent to the original interface program through the original interface address, so that the service data corresponding to the service request is obtained through the original interface program, and the service data is returned to the client.
That is, when the original interface address is not pre-bound with the reconstructed interface address, the service data can only be obtained through the original interface program, when the original interface address is pre-bound with the reconstructed interface address, if the random number is smaller than the gray scale threshold value, the service data is obtained through the reconstructed interface program, and if the random number is not smaller than the gray scale threshold value, the service data is obtained through the original interface program.
For ease of understanding, the present description provides an overall process diagram of data acquisition, as shown in FIG. 2.
Fig. 2 is a schematic diagram of an overall process of data acquisition provided in the present specification.
The corresponding relation between the original interface address and the reconstructed interface address can be preconfigured in the server, a gray scale threshold value is set, after an http request is received, whether the http request is bound with the reconstructed interface address is determined, if yes, whether the value of the generated random number is larger than the gray scale threshold value is determined, if yes, the value is sent to the reconstructed interface program, so that service data is obtained through the reconstructed interface program and returned to the client, otherwise, the value is sent to the original interface program, so that the service data is obtained through the original interface program and returned to the client.
Of course, the server may not set the gray scale threshold (corresponding to the gray scale threshold of 1), and in this case, it is not necessary to determine the size of the random number, but it may directly forward the original interface address to the reconfiguration interface program after determining that the reconfiguration interface address is bound to the original interface address.
In this specification, after the interface program (including the reconfiguration interface program and the original interface program) acquires the response content from the server, the response content may be first sent to the nginx program, where the ginx program analyzes the header and the response body of the response content, so as to obtain service data and return the service data to the client.
Further, the server may adjust the gray scale threshold to gradually switch traffic to the reconfiguration interface program by configuring the gray scale to ensure gradual verification of the function.
Specifically, the server may determine whether all the service requests acquired by the reconfiguration interface program are valid requests after the number of service requests received by the reconfiguration interface program exceeds a preset number, and if yes, increase the gray scale threshold. Otherwise, the interface program is detected and adjusted. The preset number may be set according to actual situations, which is not specifically limited in the present specification.
According to the method, the request flow of the PHP program interface can be smoothly switched to the Go program without any change of a client, and the gray flow is gradually changed to the reconstructed program, so that the influence of the loopholes of the reconstructed program on all users is avoided.
For example, user a uses Go language to reconstruct the interface program of the PHP and configures forwarding parameters and gray scale in the PHP site. When the client sends a request to the PHP program, the request is automatically forwarded to the Go language program according to the rules, and the client does not need to modify the original interface address. Meanwhile, the flow can be gradually switched to the reconstructed program by configuring the gray scale ratio so as to ensure the gradual verification of the functions.
For another example, when an iPhone client sends a request to a PHP program, some of the requests will be forwarded to the reconstructed Go language program, while other requests will still be forwarded to the original PHP program, depending on the configured forwarding parameters and gray scale. Thus, smooth flow switching can be realized, and all users are prevented from being influenced.
The foregoing describes one or more embodiments of the data acquisition method according to the present disclosure, and based on the same concept, the present disclosure further provides a corresponding data acquisition device, as shown in fig. 3.
Fig. 3 is a schematic diagram of a data acquisition device provided in the present specification, including:
a receiving module 301, configured to receive a service request sent by a client;
the parsing module 302 is configured to parse the service request, and determine an original interface address of an original interface program corresponding to the service request;
And a return module 303, configured to send the service request to the reconfiguration interface program through the reconfiguration interface address if it is determined that the original interface address is pre-bound with a reconfiguration interface address corresponding to the reconfiguration interface program, so as to obtain service data corresponding to the service request through the reconfiguration interface program, and return the service data to the client, where the reconfiguration interface program is obtained after the reconfiguration of the original interface program based on a programming language different from that of the original interface program.
Optionally, the return module 303 is further configured to send the service request to the original interface program through the original interface address if the original interface address is not pre-bound with the reconstructed interface address, so as to obtain service data corresponding to the service request through the original interface program, and return the service data to the client.
Optionally, before the service request is sent to the reconfiguration interface program through the reconfiguration interface address, the parsing module 302 is further configured to determine a random number corresponding to the service request; judging whether the numerical value of the random number is smaller than a preset gray scale threshold value or not;
The return module 303 is specifically configured to send the service request to the reconfiguration interface program through the reconfiguration interface address if the original interface address is pre-bound with the reconfiguration interface address and the value of the random number is smaller than the gray scale threshold.
Optionally, the return module 303 is further configured to send the service request to the original interface program through the original interface address if the value of the random number is not less than the gray scale threshold, so as to obtain service data corresponding to the service request through the original interface program, and return the service data to the client.
Optionally, before determining whether the value of the random number is smaller than a preset gray scale threshold, the parsing module 302 is further configured to determine whether the original interface address corresponding to the service request is pre-bound with the reconstructed interface address;
The parsing module 302 is specifically configured to determine whether the value of the random number is smaller than a preset gray scale threshold if the original interface address is pre-bound with the reconstructed interface address.
Optionally, the apparatus further comprises:
And the updating module 304 is configured to increase the gray scale threshold value if it is determined that the service requests acquired by the reconfiguration interface program are valid requests after the number of service requests received by the reconfiguration interface program exceeds the preset number.
Optionally, the programming language corresponding to the original interface program includes: and the PHP language of the hypertext preprocessor is obtained after the original interface program is reconstructed based on the Go language.
The present specification also provides a computer readable storage medium storing a computer program operable to perform a data acquisition method as provided in fig. 1 above.
The present specification also provides a schematic structural diagram of an electronic device corresponding to fig. 1 shown in fig. 4. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as described in fig. 4, although other hardware required by other services may be included. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the data acquisition method described above with respect to fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Improvements to one technology can clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable GATE ARRAY, FPGA)) is an integrated circuit whose logic functions are determined by user programming of the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented with "logic compiler (logic compiler)" software, which is similar to the software compiler used in program development and writing, and the original code before being compiled is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but HDL is not just one, but a plurality of kinds, such as ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language), and VHDL (Very-High-SPEED INTEGRATED Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.
Claims (10)
1. A data acquisition method, wherein the method is applied to a server and comprises:
Receiving a service request sent by a client;
analyzing the service request, and determining an original interface address of an original interface program corresponding to the service request;
If it is determined that the original interface address is pre-bound with a reconstructed interface address of a reconstructed interface program corresponding to the original interface program, the service request is sent to the reconstructed interface program through the reconstructed interface address, so that service data corresponding to the service request is obtained through the reconstructed interface program, and the service data is returned to the client, wherein the reconstructed interface program is obtained after the original interface program is reconstructed based on a programming language different from that of the original interface program.
2. The method of claim 1, wherein the method further comprises:
And if the original interface address is not pre-bound with the reconstructed interface address, sending the service request to the original interface program through the original interface address so as to acquire service data corresponding to the service request through the original interface program, and returning the service data to the client.
3. The method of claim 1, wherein prior to sending the service request to the reconfiguration interface program via the reconfiguration interface address, the method further comprises:
Determining a random number corresponding to the service request;
Judging whether the numerical value of the random number is smaller than a preset gray scale threshold value or not;
The service request is sent to the reconfiguration interface program through the reconfiguration interface address, and the method specifically comprises the following steps:
And if the original interface address is pre-bound with the reconfiguration interface address and the numerical value of the random number is smaller than the gray scale threshold value, sending the service request to the reconfiguration interface program through the reconfiguration interface address.
4. A method as claimed in claim 3, wherein the method further comprises:
And if the numerical value of the random number is not smaller than the gray scale threshold, sending the service request to the original interface program through the original interface address so as to acquire service data corresponding to the service request through the original interface program, and returning the service data to the client.
5. The method of claim 3, wherein prior to determining whether the value of the random number is less than a preset gray scale threshold, the method further comprises:
determining whether an original interface address corresponding to the service request is pre-bound with the reconstructed interface address;
judging whether the numerical value of the random number is smaller than a preset gray scale threshold value or not, specifically comprising:
And if the original interface address is pre-bound with the reconstructed interface address, judging whether the numerical value of the random number is smaller than a preset gray scale threshold value.
6. A method as claimed in claim 3, wherein the method further comprises:
And after the number of the service requests received by the reconfiguration interface program exceeds the preset number, if the service requests acquired by the reconfiguration interface program are determined to be valid requests, the gray scale threshold value is increased.
7. The method according to any one of claims 1 to 6, wherein the programming language corresponding to the original interface program includes: and the PHP language of the hypertext preprocessor is obtained after the original interface program is reconstructed based on the Go language.
8. A data acquisition device, comprising:
The receiving module is used for receiving the service request sent by the client;
the analysis module is used for analyzing the service request and determining an original interface address of an original interface program corresponding to the service request;
And the return module is used for sending the service request to the reconfiguration interface program through the reconfiguration interface address if the original interface address is pre-bound with the reconfiguration interface address of the reconfiguration interface program corresponding to the original interface program, so as to acquire the service data corresponding to the service request through the reconfiguration interface program, and returning the service data to the client, wherein the reconfiguration interface program is obtained after the reconfiguration of the original interface program based on a programming language different from the programming language of the original interface program.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-7 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410372122.7A CN118093012A (en) | 2024-03-28 | 2024-03-28 | Data acquisition method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410372122.7A CN118093012A (en) | 2024-03-28 | 2024-03-28 | Data acquisition method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118093012A true CN118093012A (en) | 2024-05-28 |
Family
ID=91165170
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410372122.7A Pending CN118093012A (en) | 2024-03-28 | 2024-03-28 | Data acquisition method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118093012A (en) |
-
2024
- 2024-03-28 CN CN202410372122.7A patent/CN118093012A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107479868B (en) | Interface loading method, device and equipment | |
CN112631679B (en) | Preloading method and device for micro-applications | |
CN108595234A (en) | Five application page switching method, device and equipment | |
CN111400681B (en) | Data authority processing method, device and equipment | |
CN110750437B (en) | Equipment debugging method, device, equipment and system | |
CN117312394B (en) | Data access method and device, storage medium and electronic equipment | |
CN116405554B (en) | Network communication method and device, storage medium and electronic equipment | |
CN116225669B (en) | Task execution method and device, storage medium and electronic equipment | |
CN111324533A (en) | A/B test method and device and electronic equipment | |
CN108427737A (en) | A kind of data clearing method, equipment and computer-readable medium | |
CN117407124B (en) | Service execution method based on constructed data arrangement strategy generation model | |
CN117828360A (en) | Model training method, model training device, model code generating device, storage medium and storage medium | |
CN117555697B (en) | Distributed training-oriented cache loading system, method, device and equipment | |
CN110825943B (en) | Method, system and equipment for generating user access path tree data | |
CN111796864A (en) | Data verification method and device | |
CN110874322B (en) | Test method and test server for application program | |
CN110022351B (en) | Service request processing method and device | |
CN118093012A (en) | Data acquisition method and device, storage medium and electronic equipment | |
CN108769152B (en) | Service refresh policy registration method, service refresh request method, device and equipment | |
CN117041980B (en) | Network element management method and device, storage medium and electronic equipment | |
CN117348999B (en) | Service execution system and service execution method | |
CN115134349B (en) | Method, device, medium and equipment for executing transmission task | |
CN116737367B (en) | Minio-based data preservation method, device and medium | |
CN117118523B (en) | Information transmission system, method and device, storage medium and electronic equipment | |
CN117376143A (en) | Service execution method and device based on full-dimension definable network function instance |
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 |