CN109976872A - Data processing method, device, electronic equipment and storage medium - Google Patents
Data processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109976872A CN109976872A CN201910132814.3A CN201910132814A CN109976872A CN 109976872 A CN109976872 A CN 109976872A CN 201910132814 A CN201910132814 A CN 201910132814A CN 109976872 A CN109976872 A CN 109976872A
- Authority
- CN
- China
- Prior art keywords
- information
- http request
- type
- target
- data
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/541—Client-server
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure is directed to a kind of data processing method, device, electronic equipment and storage medium, which includes: to receive the first HTTP request;According to first HTTP request, the parameter preset information of container to be created and the size information of the shared drive to be configured to the container are obtained;According to preset data structural information, assembled, the second HTTP request of generation is carried out to the parameter preset information and the size information, wherein the preset data structural information is the data structure information required when creating container;Second HTTP request is sent to the API server of kubernetes cluster.
Description
Technical field
This disclosure relates to Internet technical field more particularly to a kind of data processing method, device, electronic equipment and storage
Medium.
Background technique
Container cloud provides the developing operation test environment of virtualization, in the various systems of container cloud, Kubernetes
It (k8s) is the container cloud system generally used by each enterprise at present, k8s is mainly used for disposing the application of containerization,
Planning is updated and is safeguarded.
The application of so-called containerization, i.e., each application can be packaged into a container mirror image and carry out containerization installation and make
With.But k8s does not run containerization application directly, but one or more containerization applications are encapsulated into one and are known as pod
Higher structure in, pod is the basic computational ele- ment of k8s.Any containerization application in identical pod will all share identical name
Claim space and local network.Pod mainly carries out layout, management and operation to containerization application described above.Therefore, pod phase
When pod is named as container herein in a big container.
The each containerization application operated in pod is needed using shared drive (shm), and in some deep learning frames
Middle that a certain size shm is needed to carry out operation frame, therefore, it is necessary to carry out shm configuration to the pod of creation.But current k8s
System in, do not support the shm automated to pod to configure, but need user by using kubectl order line work
Tool is by way of order, alternatively, the mode for writing yaml file (yaml is the programming language for expressing data sequences) is come
Manual creation has the pod of shm.
Therefore, pass through the scheme of pod of the manual creation with shm in the related technology in the prevalence of cumbersome, execution
The problem of low efficiency.
Summary of the invention
For overcome in the related technology by manual creation with shm pod scheme present in it is cumbersome, execute effect
The low problem of rate there are the problem of, the disclosure provides a kind of data processing method, device, electronic equipment and storage medium.
According to the first aspect of the embodiments of the present disclosure, a kind of data processing method is provided, comprising:
Receive the first HTTP request;
According to first HTTP request, obtains the parameter preset information of container to be created and the container is waited matching
The size information for the shared drive set;
According to preset data structural information, assembled, generation is carried out to the parameter preset information and the size information
Second HTTP request, wherein the preset data structural information is the data structure information required when creating container;
Second HTTP request is sent to the API server of kubernetes cluster.
It is described according to preset data structural information in a kind of possible embodiment, to the parameter preset information with
And the size information carries out assembly, before generating the second HTTP request, the method also includes:
Identify the type of first HTTP request;
According to the type of first HTTP request, identify in the API server of kubernetes cluster for handling institute
State the target api interface of the HTTP request of type;
Obtain the preset data structural information that the target api interface is supported.
It is described according to preset data structural information in a kind of possible embodiment, to the parameter preset information with
And the size information carries out assembled, the second HTTP request of generation, comprising:
Target type is set by the type of target storage medium belonging to the shared drive to be configured;
By the storage size of the target storage medium of the target type, it is set as and the size information
The target storage space size matched;
By the routing information of the target storage medium, it is set as destination path information;
By the data type of the parameter preset information, the number of targets that the preset data structural information is supported is converted to
According to type;
To the target type, the target storage space size, the destination path letter of the target storage medium
The parameter preset information after breath and change data type carries out assembled, the second HTTP request of generation.
It is described that second HTTP request is sent to kubernetes cluster in a kind of possible embodiment
API server, comprising:
By client-go component, second HTTP request is sent to the API server of kubernetes cluster.
It is described by client-go component in a kind of possible embodiment, second HTTP request is sent to
The API server of kubernetes cluster, comprising:
By client-go component, the API server of kubernetes cluster is connected;
According to the type of first HTTP request, identify in the API server for handling the HTTP of the type
The target api interface of request;
By the client-go component, the target api interface of the API server is called, by described second
HTTP request is sent to the API server of the kubernetes cluster, so that the kubernetes cluster is according to institute
State the container of shared drive of the second HTTP request creation configured with the target storage space size.
According to the second aspect of an embodiment of the present disclosure, a kind of data processing equipment is provided, comprising:
Receiving module is configured as receiving the first HTTP request;
First obtains module, is configured as obtaining the parameter preset of container to be created according to first HTTP request
The size information of information and the shared drive to be configured to the container;
Assembling module is configured as according to preset data structural information, to the parameter preset information and the size
Information carries out assembled, the second HTTP request of generation, wherein the preset data structural information is the number required when creating container
According to structural information;
Sending module is configured as second HTTP request being sent to the application programming of kubernetes cluster
Interface API server.
In a kind of possible embodiment, described device further include:
First identification module is configured as identifying the type of first HTTP request;
Second identification module is configured as the type according to first HTTP request, identification kubernetes cluster
For handling the target api interface of the HTTP request of the type in API server;
Second obtains module, is configured as obtaining the preset data structural information that the target api interface is supported.
In a kind of possible embodiment, the assembling module includes:
First assembled submodule, is configured as the type of target storage medium belonging to the shared drive to be configured
It is set as target type;
Second assembled submodule, is configured as the memory space of the target storage medium of the target type is big
It is small, it is set as and the matched target storage space size of the size information;
Third assembly submodule is configured as setting destination path letter for the routing information of the target storage medium
Breath;
4th assembled submodule, is configured as the data type of the parameter preset information being converted to the present count
The target data type supported according to structural information;
5th assembled submodule is configured as the target type to the target storage medium, target storage
The parameter preset information after space size, the destination path information and change data type carries out assembled, generates the
Two HTTP requests.
In a kind of possible embodiment, the sending module includes:
Sending submodule is configured as being sent to second HTTP request by client-go component
The API server of kubernetes cluster.
In a kind of possible embodiment, the sending submodule includes:
Connection unit is configured as connecting the API server of kubernetes cluster by client-go component;
Recognition unit is configured as the type according to first HTTP request, identifies in the API server for locating
Manage the target api interface of the HTTP request of the type;
Call unit is configured as calling the target API of the API server by the client-go component
Second HTTP request is sent to the API server of the kubernetes cluster, so that described by interface
Kubernetes cluster is according to shared drive of second HTTP request creation configured with the target storage space size
Container.
According to the third aspect of an embodiment of the present disclosure, a kind of electronic equipment is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to executing to realize performed by data processing method described in above-mentioned any one
Operation.
According to a fourth aspect of embodiments of the present disclosure, a kind of non-transitorycomputer readable storage medium is provided, when described
When instruction in storage medium is executed by the processor of electronic equipment, so that electronic equipment is able to carry out one kind to realize as above-mentioned
Operation performed by data processing method described in any one.
According to a fifth aspect of the embodiments of the present disclosure, a kind of application program is provided, the application program is by electronic equipment
When processor executes, so that electronic equipment is able to carry out a kind of data processing method, which comprises
Receive the first HTTP request;
According to first HTTP request, obtains the parameter preset information of container to be created and the container is waited matching
The size information for the shared drive set;
According to preset data structural information, assembled, generation is carried out to the parameter preset information and the size information
Second HTTP request, wherein the preset data structural information is the data structure information required when creating container;
Second HTTP request is sent to the API server of kubernetes cluster.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In this way, the embodiment of the present disclosure has custom size by way of HTTP request, to k8s collection pocket transmission creation
Shared drive container (pod) request, write order and file without developer, reduce user operation difficulty,
Simplify operating procedure;Also, the method for the embodiment of the present disclosure is by obtaining the container to be created in the first HTTP request
The size information of parameter preset information and the shared drive to be configured to the container, and according to required number when creation container
It is assembled to be carried out to the above- mentioned information carried in the first HTTP request according to structural information, so as to utilize second after assembly
HTTP request is interacted with the API server in k8s cluster, realizes k8s to shared drive using HTTP request
Container automation creation, improve the execution efficiency of the foundation step of container.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure
Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is a kind of flow chart of data processing method shown according to an exemplary embodiment;
Fig. 2 is a kind of flow chart of data processing method shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of data processing method shown according to an exemplary embodiment;
Fig. 4 is a kind of structural block diagram of data processing equipment shown according to an exemplary embodiment;
Fig. 5 is a kind of block diagram of device for data processing shown according to an exemplary embodiment;
Fig. 6 is a kind of block diagram of device for data processing shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Fig. 1 is a kind of flow chart of data processing method shown according to an exemplary embodiment, the data processing method
Applied to server, this method can specifically include following steps:
Step 101, the first hypertext transfer protocol (HTTP, HyperTextTransferProtocol) request is received;
Wherein, above-mentioned server can be WEB server.The method of the embodiment of the present disclosure to client in order to providing
REST service (REST describes a kind of interactive form between client and server in a network), the embodiment of the present disclosure
Method can create above-mentioned WEB server using the http packet of go language in advance.The WEB server can be provided to client
REST service, to realize the interaction of client and WEB server.
So (layout, management and fortune are carried out for applying to containerization in order to automatically create the pod with shm
Capable bulk container, hereinafter referred to as pod or container), client can be provided based on WEB server in the embodiments of the present disclosure
REST service, to WEB server send the first HTTP request, wherein first HTTP request can carry following letter
Breath: the size information of the parameter preset information of pod to be created and the shm to be configured to the pod.In this way, the disclosure is real
The WEB server for applying example can receive the first HTTP request from client.
Wherein, various parameters to be used are needed when above-mentioned parameter preset information is creation pod, which includes
But be not limited to: pod, pod label, the affiliated NameSpace of pod (namespace), pod inner pressurd vesselization application mirror image, port,
Start command, restart strategy, mirror image pull strategy etc..
In addition, since user only needs patterned WEB interface on the client to operate, so that it may initiate creation
The HTTP request of pod with shm, user is easy to operate, avoids the study that developer writes instruction, it is easier to client
Operation.
Step 102, according to first HTTP request, the parameter preset information of pod to be created is obtained and to described
The size information of shm pod to be configured;
Wherein, WEB server can parse the first HTTP request, carry to get in the first HTTP request
Above- mentioned information, here including pod to be created parameter preset information and the shm to be configured to the pod size letter
Breath.
Here the size information of the shm to be configured to pod indicates to be total to what pod to be created was needed to configure here
Enjoy the size of memory, such as 500M.
Step 103, according to preset data structural information, the parameter preset information and the size information are spelled
Dress generates the second HTTP request;
Wherein, the WEB server of the embodiment of the present disclosure needs to realize the function of automatically creating the pod with shm
It is interacted with application programming interface (API) server in k8s cluster, and what API server provided is used to create pod
Api interface, there is structured data request to the request of data of processing, both preset data structural information here.Wherein, described
Preset data structural information is the data structure information required when creating pod.
Therefore, WEB server is needed according to preset data structural information, assembled to carry out again to the information being resolved to,
Generate the second HTTP request.
Step 104, second HTTP request is sent to the API server of k8s cluster.
Wherein, the second HTTP request that assembly obtains can be sent to the API server in k8s cluster by WEB server,
So that k8s can have the pod of the shm of custom size according to the information creating in the second HTTP request.
Wherein, k8s cluster can when being configured with multiple API servers configured with one or more API servers
To select an API server to send second HTTP request according to preset strategy.
In this way, the embodiment of the present disclosure has custom size by way of HTTP request, to k8s collection pocket transmission creation
Shared drive container (pod) request, write order and file without developer, reduce user operation difficulty,
Simplify operating procedure;Also, the method for the embodiment of the present disclosure is by obtaining the container to be created in the first HTTP request
The size information of parameter preset information and the shared drive to be configured to the container, and according to required number when creation container
It is assembled to be carried out to the above- mentioned information carried in the first HTTP request according to structural information, so as to utilize second after assembly
HTTP request is interacted with the API server in k8s cluster, realizes k8s to shared drive using HTTP request
Container automation creation, improve the execution efficiency of the foundation step of container.
In a kind of possible embodiment, before step 103, it can also be wrapped according to the method for the embodiment of the present disclosure
It includes:
Firstly, the type of identification first HTTP request;
Wherein, WEB server can identify the type of first HTTP request after receiving the first HTTP request, should
Type includes but is not limited to Post request, Patch request, Get request etc..
Here only need the type for identifying the first HTTP request belong to it is above-mentioned enumerate it is any.
In the present embodiment, the type of first HTTP request recognized is Post request, is indicated in WEB server
Transmit information, the information of transmitting include above-mentioned pod to be created parameter preset information and the shm to be configured to the pod
Size information.
Then, it according to the type of first HTTP request, identifies described for handling in the API server of k8s cluster
The target api interface of the HTTP request of type;
Wherein, for the HTTP request of Post type, then illustrate that client wants will create the pod with shm, and k8s collection
The API server of group externally can be by a variety of api interfaces, here, and the WEB server of the embodiment of the present disclosure can identify use
In the target api interface for the HTTP request for handling the Post type.Wherein, which is to be used to create pod's
Api interface.
Finally, obtaining the preset data structural information that the target api interface is supported.
Wherein, when invocation target api interface creates pod, target api interface defines the preset data structure of its support
Information (such as data type etc.) therefore needs exist for the preset structure information for obtaining target api interface support.
In this way, type of the embodiment of the present disclosure according to the first HTTP request received, can identify the API of k8s cluster
For handling the target api interface of the HTTP request of the type in server, and obtain the default of target api interface support
Data structure information, so as to which the parameter information in the first HTTP request to be assembled into the data of target api interface support
Structure, by the spelling again for carrying out data structure to the parameter information for creating the pod with shm in the first HTTP request
Dress promotes the effect of pod of the creation configured with shm so as to the interaction convenient for subsequent WEB server and the API server of k8s
Rate.
In a kind of possible embodiment, when executing step 103, it can be realized by method shown in Fig. 2:
Step 201, target type is set by the type of target storage medium belonging to the shm to be configured;
Wherein, the purpose of the method for the embodiment of the present disclosure is to carry out k8s according to the second HTTP request received
The creation of pod, also, a certain size memory can also be distributed the pod of creation, as being total to for pod when creating pod
Enjoy memory use.
And memory necessarily belongs to some storage medium, therefore, this step is needed the class of target storage medium belonging to shm
Type is set as target type.
In one example, in k8s cluster, shared drive (shm) used in each container in a pod is general
It can be the catalogue in disk for volume, a volume, the catalogue being also possible in containerization application, therefore, volume
Target storage medium belonging to as shm in this step, can set volume to EmptyDir type, and will
The type of EmptyDir is arranged to Memory (memory) type.
Wherein, k8s supports a plurality of types of volumes, sets EmptyDir type for volume here;And
Also there are many kinds of types by emptydir, can set Memory type again for the type of EmptyDir here.
This step is equivalent to provided with which book shared drive shm needs to be mounted under.
Step 202, by the storage size of the target storage medium of the target type, be set as with it is described big
The target storage space size of small information matches;
Wherein, since the present embodiment is the shm for configuring custom size to the pod of creation, not only need step
202 are arranged the type of storage medium belonging to shm, it is also necessary to further be arranged in the target storage medium of the target type
Storage size as shm.
In one example, such as the size information is 500M, then volume can be dimensioned to 500M,
In, the type of the volueme is EmptyDir type, and the type of EmptyDir is Memory type.
This step be equivalent to need to be mounted to provided with shared drive shm it is much under the determined book of step 201
Memory space in.
Step 203, by the routing information of the target storage medium, it is set as destination path information;
Above-mentioned steps 201 and step 202 are provided with shm and need using storage sky great in which type of storage medium
Between, still, setting is not made to the address of the memory space, therefore, this step is also needed the target storage medium
Routing information is set as destination path information.
In one example ,/dev/shm can be set by path locating for the volume.Wherein, destination path :/
dev/shm.Wherein, the shm of general custom size is setting in the memory space under the/path dev/shm.
This step is equivalent to the location of voluem (target storage space) provided with shared drive shm institute carry.
Step 204, it by the data type of the parameter preset information, is converted to the preset data structural information and is supported
Target data type;
Wherein, the preset data structural information is the data structure information required when creating pod.
Wherein, the data type supported when can define creation pod in preset data structural information;
Such as the data type of parameter preset information is floating-point (float) type, and defined in preset data structural information
Data type be such as integer (int), then needing exist for the parameter preset information of float type carrying out data type
Conversion, is converted to int type.
Certainly, float type, int type here is schematic example, is not intended to limit the disclosure, and the disclosure is real
The quantity for applying the target data type that preset data structural information is supported described in example can be one or more, be also not necessarily limited to
The example above.
Wherein, the embodiment of the present disclosure for step 201, step 203 and step 204 execution sequence with no restrictions.
Step 205, to the target type of the target storage medium, the target storage space size, the mesh
The parameter preset information after marking routing information and change data type carries out assembled, the second HTTP request of generation.
Wherein it is possible to will treated that each data are spelled again according to http protocol by step 201~step 204
Dress, obtains the second HTTP request.
Wherein, the target type of the target storage medium can be carried in the second HTTP request, the target is deposited
The parameter preset information after storing up space size, the destination path information and change data type.
In addition, the data assembly process of 201~step 205 of above-mentioned steps can be understood as the method for the embodiment of the present disclosure certainly
The agreement of definition, the agreement indicate the required operation to be performed when creation is configured with the pod of custom size shm.By into
The operation of the method for row the present embodiment, so that it may be automated convenient for k8s system for the second HTTP request after assembly
The creation work of pod with custom size shm.
In this way, the embodiment of the present disclosure is by the information being resolved to from the first HTTP request, according to the embodiment of the present disclosure
Method when creation is configured with the pod of shm defined agreement carry out the again assembled of data, so as to accomplish to automate
The pod for creating the shm of custom size, can also ask the maintenance of the pod with custom size shm of creation by http
It asks and avoids many cumbersome O&M operations to realize.Also, order and yaml file are write without developer's study, is dropped
The learning cost of low user and the executory cost of order and yaml file.
In a kind of possible embodiment, when executing step 104, it can be realized by S401:
Second HTTP request is sent to the API server of k8s cluster by client-go component by S401.
Wherein, k8s cluster is accessed by http request in order to realize WEB server, WEB server can use
Second HTTP request is sent to the API server in k8s cluster by client-go component.
Wherein, client-go is a kind of new frame of the API of go language access K8s, and client-go is a calling
The client of the API of k8s cluster.
In this way, the embodiment of the present disclosure realizes WEB server to the API service in k8s cluster by client-go component
The HTTP of device is accessed, consequently facilitating k8s believes according to the parameter preset related with creation pod in the second HTTP request received
Breath automatically creates pod, and according to the relevant information of the shm in the second HTTP request, customized big to the pod configuration user of creation
Small shm simplifies the operating procedure of pod of the creation with shm, improves the execution efficiency of creation pod.Also, this public affairs
Opening embodiment makes user access WEB server by the first HTTP request in client-side, and is passed through by WEB server
Client-go component accesses API server, avoids client-side and directly accesses k8s cluster, realizes the access of client
Control, facilitates O&M.
In a kind of possible embodiment, when executing S401, it can be realized by method shown in Fig. 3:
Step 301, by client-go component, the API server of k8s cluster is connected;
Wherein, WEB server can be connect by client-go component with the API server of k8s cluster.
Step 302, it according to the type of first HTTP request, identifies in the API server for handling the class
The target api interface of the HTTP request of type;
The specific implementation of this step is referred to above, and which is not described herein again.
Step 303, by the client-go component, the target api interface of the API server is called, by institute
The API server that the second HTTP request is sent to the k8s cluster is stated, so that the k8s cluster is according to described second
The pod of shm of the HTTP request creation configured with the target storage space size.
Specifically, client-go component can be used to call in API server for creating pod's in WEB server
Target api interface, and be transmitted to the data after assembly are carried in the second HTTP request in target api interface, wherein target
Data after the assembly received can be parsed into json file by api interface.Last WEB server passes through client-go group
Json file is sent to the API server of the k8s cluster by part, so that the k8s cluster is according to json document creation
The pod of shm configured with the target storage space size.
Wherein, k8s cluster can be converted to the default of target data type according in json file when creating pod
Parameter information creates pod, and target type, the target storage space size, target of the target storage medium according to belonging to shm
Routing information distributes the one of target type and target storage space size under the corresponding destination path of destination path information
Section memory, so that shm is mounted to this section of memory, then any one containerization application in the pod created can be to the section
Data in memory carry out shared use.
Fig. 4 is a kind of structural block diagram of data processing equipment shown according to an exemplary embodiment.Referring to Fig. 4, the dress
It sets and includes:
Receiving module 41 is configured as receiving the first HTTP request;
First obtains module 42, is configured as obtaining the default ginseng of container to be created according to first HTTP request
The size information of number information and the shared drive to be configured to the container;
Assembling module 43, is configured as according to preset data structural information, to the parameter preset information and described big
Small information carries out assembled, the second HTTP request of generation, wherein the preset data structural information is required when creating container
Data structure information;
Sending module 44, the application program for being configured as second HTTP request being sent to kubernetes cluster are compiled
Journey interface API server.
In a kind of possible embodiment, described device further include:
First identification module is configured as identifying the type of first HTTP request;
Second identification module is configured as the type according to first HTTP request, identification kubernetes cluster
For handling the target api interface of the HTTP request of the type in API server;
Second obtains module, is configured as obtaining the preset data structural information that the target api interface is supported.
In a kind of possible embodiment, the assembling module 43 includes:
First assembled submodule, is configured as the type of target storage medium belonging to the shared drive to be configured
It is set as target type;
Second assembled submodule, is configured as the memory space of the target storage medium of the target type is big
It is small, it is set as and the matched target storage space size of the size information;
Third assembly submodule is configured as setting destination path letter for the routing information of the target storage medium
Breath;
4th assembled submodule, is configured as the data type of the parameter preset information being converted to the present count
The target data type supported according to structural information;
5th assembled submodule is configured as the target type to the target storage medium, target storage
The parameter preset information after space size, the destination path information and change data type carries out assembled, generates the
Two HTTP requests.
In a kind of possible embodiment, the sending module 44 includes:
Sending submodule is configured as being sent to second HTTP request by client-go component
The API server of kubernetes cluster.
In a kind of possible embodiment, the sending submodule includes:
Connection unit is configured as connecting the API server of kubernetes cluster by client-go component;
Recognition unit is configured as the type according to first HTTP request, identifies in the API server for locating
Manage the target api interface of the HTTP request of the type;
Call unit is configured as calling the target API of the API server by the client-go component
Second HTTP request is sent to the API server of the kubernetes cluster, so that described by interface
Kubernetes cluster is according to shared drive of second HTTP request creation configured with the target storage space size
Container.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 5 is a kind of block diagram of device 800 for data processing shown according to an exemplary embodiment.For example, dress
Setting 800 can be mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical treatment
Equipment, body-building equipment, personal digital assistant etc..
Referring to Fig. 5, device 800 may include following one or more components: processing component 802, memory 804, electric power
Component 806, multimedia component 808, audio component 810, the interface 812 of input/output (I/O), sensor module 814, and
Communication component 816.
The integrated operation of the usual control device 800 of processing component 802, such as with display, telephone call, data communication, phase
Machine operation and record operate associated operation.Processing component 802 may include that one or more processors 820 refer to execute
It enables, to perform all or part of the steps of the methods described above.In addition, processing component 802 may include one or more modules, just
Interaction between processing component 802 and other assemblies.For example, processing component 802 may include multi-media module, it is more to facilitate
Interaction between media component 808 and processing component 802.
Memory 804 is configured as storing various types of data to support the operation in equipment 800.These data are shown
Example includes the instruction of any application or method for operating on device 800, contact data, and telephone book data disappears
Breath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their group
It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile
Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash
Device, disk or CD.
Power supply module 806 provides electric power for the various assemblies of device 800.Power supply module 806 may include power management system
System, one or more power supplys and other with for device 800 generate, manage, and distribute the associated component of electric power.
Multimedia component 808 includes the screen of one output interface of offer between described device 800 and user.One
In a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen
Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings
Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action
Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers
Body component 808 includes a front camera and/or rear camera.When equipment 800 is in operation mode, such as screening-mode or
When video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and
Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 810 is configured as output and/or input audio signal.For example, audio component 810 includes a Mike
Wind (MIC), when device 800 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matched
It is set to reception external audio signal.The received audio signal can be further stored in memory 804 or via communication set
Part 816 is sent.In some embodiments, audio component 810 further includes a loudspeaker, is used for output audio signal.
I/O interface 812 provides interface between processing component 802 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock
Determine button.
Sensor module 814 includes one or more sensors, and the state for providing various aspects for device 800 is commented
Estimate.For example, sensor module 814 can detecte the state that opens/closes of equipment 800, and the relative positioning of component, for example, it is described
Component is the display and keypad of device 800, and sensor module 814 can be with 800 1 components of detection device 800 or device
Position change, the existence or non-existence that user contacts with device 800,800 orientation of device or acceleration/deceleration and device 800
Temperature change.Sensor module 814 may include proximity sensor, be configured to detect without any physical contact
Presence of nearby objects.Sensor module 814 can also include optical sensor, such as CMOS or ccd image sensor, at
As being used in application.In some embodiments, which can also include acceleration transducer, gyro sensors
Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between device 800 and other equipment.Device
800 can access the wireless network based on communication standard, such as WiFi, carrier network (such as 2G, 3G, 4G or 5G) or them
Combination.In one exemplary embodiment, communication component 816 is received via broadcast channel from the wide of external broadcasting management system
Broadcast signal or broadcast related information.In one exemplary embodiment, the communication component 816 further includes near-field communication (NFC)
Module, to promote short range communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) can be based in NFC module
Technology, ultra wide band (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 800 can be believed by one or more application specific integrated circuit (ASIC), number
Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 804 of instruction, above-metioned instruction can be executed by the processor 820 of device 800 to complete the above method.For example,
The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk
With optical data storage devices etc..
In the exemplary embodiment, a kind of application program including instruction, the memory for example including instruction are additionally provided
804, above-metioned instruction can be executed by the processor 820 of device 800 to complete the above method.For example, the non-transitory computer
Readable storage medium storing program for executing can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
Fig. 6 is a kind of block diagram of device 1900 for data processing shown according to an exemplary embodiment.For example, dress
Setting 1900 may be provided as a server.Referring to Fig. 6, it further comprises one that device 1900, which includes processing component 1922,
Or multiple processors and memory resource represented by a memory 1932, it can holding by processing component 1922 for storing
Capable instruction, such as application program.The application program stored in memory 1932 may include one or more each
A module for corresponding to one group of instruction.In addition, processing component 1922 is configured as executing instruction, to execute the above method ...
Device 1900 can also include that a power supply module 1926 be configured as the power management of executive device 1900, and one
Wired or wireless network interface 1950 is configured as device 1900 being connected to network and input and output (I/O) interface
1958.Device 1900 can be operated based on the operating system for being stored in memory 1932, such as Windows ServerTM, Mac
OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
It should be noted that the executing subject of the disclosure can be mobile phone, computer, digital broadcast terminal, message
Transceiver, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc.;It is also possible to server.
As electronic equipment such as mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, doctor
Treat equipment, body-building equipment, whens personal digital assistant etc., as shown in Figure 5.When electronic equipment is server, as shown in Figure 6.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure
Its embodiment.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following
Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
Claims (10)
1. a kind of data processing method characterized by comprising
Receive the first HTTP request;
According to first HTTP request, the parameter preset information of container to be created and to be configured to the container is obtained
The size information of shared drive;
According to preset data structural information, assembled, generation second is carried out to the parameter preset information and the size information
HTTP request, wherein the preset data structural information is the data structure information required when creating container;
Second HTTP request is sent to the application programming interface API server of kubernetes cluster.
2. data processing method according to claim 1, which is characterized in that it is described according to preset data structural information, it is right
The parameter preset information and the size information carry out assembly, before generating the second HTTP request, the method also includes:
Identify the type of first HTTP request;
According to the type of first HTTP request, identify in the API server of kubernetes cluster for handling the class
The target api interface of the HTTP request of type;
Obtain the preset data structural information that the target api interface is supported.
3. data processing method according to claim 1, which is characterized in that it is described according to preset data structural information, it is right
The parameter preset information and the size information carry out assembled, the second HTTP request of generation, comprising:
Target type is set by the type of target storage medium belonging to the shared drive to be configured;
By the storage size of the target storage medium of the target type, it is set as matched with the size information
Target storage space size;
By the routing information of the target storage medium, it is set as destination path information;
By the data type of the parameter preset information, the target data class that the preset data structural information is supported is converted to
Type;
To the target type of the target storage medium, the target storage space size, the destination path information, with
And the parameter preset information after change data type carries out assembled, the second HTTP request of generation.
4. data processing method according to claim 1, which is characterized in that described to be sent to second HTTP request
The API server of kubernetes cluster, comprising:
By client-go component, second HTTP request is sent to the API server of kubernetes cluster.
5. data processing method according to claim 4, which is characterized in that it is described by client-go component, it will be described
Second HTTP request is sent to the API server of kubernetes cluster, comprising:
By client-go component, the API server of kubernetes cluster is connected;
According to the type of first HTTP request, identify in the API server for handling the HTTP request of the type
Target api interface;
By the client-go component, the target api interface of the API server is called, the 2nd HTTP is asked
The API server for being sent to the kubernetes cluster is sought, so that the kubernetes cluster is according to described second
The container of shared drive of the HTTP request creation configured with the target storage space size.
6. a kind of data processing equipment characterized by comprising
Receiving module is configured as receiving the first HTTP request;
First obtains module, is configured as obtaining the parameter preset information of container to be created according to first HTTP request
And the size information of the shared drive to be configured to the container;
Assembling module is configured as according to preset data structural information, to the parameter preset information and the size information
Carry out assembled, the second HTTP request of generation, wherein the preset data structural information is the data knot required when creating container
Structure information;
Sending module is configured as second HTTP request being sent to the application programming interface of kubernetes cluster
API server.
7. data processing equipment according to claim 6, which is characterized in that described device further include:
First identification module is configured as identifying the type of first HTTP request;
Second identification module is configured as the type according to first HTTP request, the API clothes of identification kubernetes cluster
For handling the target api interface of the HTTP request of the type in business device;
Second obtains module, is configured as obtaining the preset data structural information that the target api interface is supported.
8. data processing equipment according to claim 6, which is characterized in that the assembling module includes:
First assembled submodule, is configured as the type of target storage medium belonging to the shared drive to be configured being arranged
For target type;
Second assembled submodule, is configured as the storage size of the target storage medium of the target type, if
It is set to and the matched target storage space size of the size information;
Third assembly submodule is configured as setting destination path information for the routing information of the target storage medium;
4th assembled submodule, is configured as the data type of the parameter preset information being converted to the preset data knot
The target data type that structure information is supported;
5th assembled submodule, is configured as the target type to the target storage medium, the target storage space
The parameter preset information after size, the destination path information and change data type carries out assembled, generation second
HTTP request.
9. a kind of electronic equipment characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to executing to realize the number as described in any one of claim 1 to claim 5
According to operation performed by processing method.
10. a kind of non-transitorycomputer readable storage medium, which is characterized in that when the instruction in the storage medium is by electronics
When the processor of equipment executes, so that electronic equipment is able to carry out one kind to realize as any in claim 1 to claim 5
Operation performed by data processing method described in one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910132814.3A CN109976872B (en) | 2019-02-21 | 2019-02-21 | Data processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910132814.3A CN109976872B (en) | 2019-02-21 | 2019-02-21 | Data processing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109976872A true CN109976872A (en) | 2019-07-05 |
CN109976872B CN109976872B (en) | 2021-05-18 |
Family
ID=67077239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910132814.3A Active CN109976872B (en) | 2019-02-21 | 2019-02-21 | Data processing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109976872B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110554865A (en) * | 2019-09-10 | 2019-12-10 | 联想(北京)有限公司 | Visual programming method, device, computing equipment and medium |
CN111414161A (en) * | 2020-03-27 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating ID L file |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101382985A (en) * | 2008-10-17 | 2009-03-11 | 深圳市金蝶中间件有限公司 | Method and filter for conversing JSF original page request |
CN103902355A (en) * | 2012-12-26 | 2014-07-02 | 深圳市蓝韵网络有限公司 | Quick medical image loading method |
CN108171473A (en) * | 2017-12-26 | 2018-06-15 | 北京九章云极科技有限公司 | A kind of Data Analysis Services system and data analysis processing method |
CN108737215A (en) * | 2018-05-29 | 2018-11-02 | 郑州云海信息技术有限公司 | A kind of method and apparatus of cloud data center Kubernetes clusters container health examination |
CN108958927A (en) * | 2018-05-31 | 2018-12-07 | 康键信息技术(深圳)有限公司 | Dispositions method, device, computer equipment and the storage medium of container application |
CN109067862A (en) * | 2018-07-23 | 2018-12-21 | 北京邮电大学 | The method and apparatus of API Gateway automatic telescopic |
CN109150616A (en) * | 2018-09-03 | 2019-01-04 | 成都嗨翻屋科技有限公司 | A kind of Intelligent gateway and its working method that can increase https entrance automatically |
US10212041B1 (en) * | 2016-03-04 | 2019-02-19 | Avi Networks | Traffic pattern detection and presentation in container-based cloud computing architecture |
-
2019
- 2019-02-21 CN CN201910132814.3A patent/CN109976872B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101382985A (en) * | 2008-10-17 | 2009-03-11 | 深圳市金蝶中间件有限公司 | Method and filter for conversing JSF original page request |
CN103902355A (en) * | 2012-12-26 | 2014-07-02 | 深圳市蓝韵网络有限公司 | Quick medical image loading method |
US10212041B1 (en) * | 2016-03-04 | 2019-02-19 | Avi Networks | Traffic pattern detection and presentation in container-based cloud computing architecture |
CN108171473A (en) * | 2017-12-26 | 2018-06-15 | 北京九章云极科技有限公司 | A kind of Data Analysis Services system and data analysis processing method |
CN108737215A (en) * | 2018-05-29 | 2018-11-02 | 郑州云海信息技术有限公司 | A kind of method and apparatus of cloud data center Kubernetes clusters container health examination |
CN108958927A (en) * | 2018-05-31 | 2018-12-07 | 康键信息技术(深圳)有限公司 | Dispositions method, device, computer equipment and the storage medium of container application |
CN109067862A (en) * | 2018-07-23 | 2018-12-21 | 北京邮电大学 | The method and apparatus of API Gateway automatic telescopic |
CN109150616A (en) * | 2018-09-03 | 2019-01-04 | 成都嗨翻屋科技有限公司 | A kind of Intelligent gateway and its working method that can increase https entrance automatically |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110554865A (en) * | 2019-09-10 | 2019-12-10 | 联想(北京)有限公司 | Visual programming method, device, computing equipment and medium |
CN111414161A (en) * | 2020-03-27 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating ID L file |
CN111414161B (en) * | 2020-03-27 | 2023-05-12 | 北京字节跳动网络技术有限公司 | Method, device, medium and electronic equipment for generating IDL file |
Also Published As
Publication number | Publication date |
---|---|
CN109976872B (en) | 2021-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108737242B (en) | System for providing dialog content | |
US11385857B2 (en) | Method for displaying UI component and electronic device | |
WO2020155014A1 (en) | Smart home device sharing system and method, and electronic device | |
CN110651241A (en) | Connecting multiple mobile devices to a smart home assistant account | |
EP3726376B1 (en) | Program orchestration method and electronic device | |
EP3793169B1 (en) | Application function implementation method and electronic device | |
CN106487622A (en) | Equipment control sharing method and device | |
CN104967889A (en) | Method used for controlling intelligent television to carry out video information processing and device | |
WO2020224447A1 (en) | Method and system for adding smart home device to contacts | |
CN112420217B (en) | Message pushing method, device, equipment and storage medium | |
CN109491932A (en) | Electronic equipment and method for being communicated with external electronic device | |
KR102462427B1 (en) | Method for integrating management of message and electronic device for the same | |
CN106201610A (en) | Web application accesses the method and device of the primary function of terminal | |
CN108833585A (en) | Information interacting method, device and storage medium | |
CN109246227A (en) | A kind of data request method, device, terminal device and storage medium | |
CN108600529A (en) | Information interacting method, device and computer readable storage medium | |
CN111314419B (en) | Network request method and device | |
CN106413129A (en) | Method and device for binding terminal to intelligent equipment | |
CN109976872A (en) | Data processing method, device, electronic equipment and storage medium | |
CN106452914B (en) | Method for configuring routers and device | |
CN103685491B (en) | A kind of application service provides method, system and relevant device | |
CN114530148A (en) | Control method and device and electronic equipment | |
JP6441385B2 (en) | Information input method, apparatus, program, and recording medium | |
CN109491655A (en) | A kind of incoming event processing method and processing device | |
CN107911807A (en) | Bluetooth data transfer method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |