CN109976872B - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109976872B
CN109976872B CN201910132814.3A CN201910132814A CN109976872B CN 109976872 B CN109976872 B CN 109976872B CN 201910132814 A CN201910132814 A CN 201910132814A CN 109976872 B CN109976872 B CN 109976872B
Authority
CN
China
Prior art keywords
http request
target
type
information
size
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.)
Active
Application number
CN201910132814.3A
Other languages
Chinese (zh)
Other versions
CN109976872A (en
Inventor
徐清泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910132814.3A priority Critical patent/CN109976872B/en
Publication of CN109976872A publication Critical patent/CN109976872A/en
Application granted granted Critical
Publication of CN109976872B publication Critical patent/CN109976872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-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 present disclosure relates to a data processing method, an apparatus, an electronic device, and a storage medium, wherein the data processing method includes: receiving a first HTTP request; acquiring preset parameter information of a container to be created and size information of a shared memory to be configured of the container according to the first HTTP request; assembling the preset parameter information and the size information according to preset data structure information to generate a second HTTP request, wherein the preset data structure information is data structure information required when a container is created; and sending the second HTTP request to an API server of the kubernets cluster.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
The container cloud provides a virtualized development operation test environment, among various systems of the container cloud, kubernets (k8s) is a container cloud system commonly used by various enterprises at present, and k8s is mainly used for deploying, planning, updating and maintaining containerized applications.
So-called containerized applications, that is, each application can be packaged into a container image for containerized installation and use. However, k8s does not run containerized applications directly, but instead packages one or more containerized applications into a high-level structure called pod, which is the basic computing unit of k8 s. Any containerized applications in the same pod will share the same namespace and local network. The pod primarily orchestrates, manages, and runs the containerized applications described above. Thus, a pod corresponds to one large vessel, which is herein designated as a vessel.
Each containerized application running in a pod needs to use a shared memory (shm), and in some deep learning frameworks, a certain size of shm is needed to run the framework, so that the shm configuration needs to be performed on the created pod. However, the current k8s architecture does not support automated shm configuration for a pod, but instead requires a user to manually create a pod with a shm by way of commands using a kubecect command line tool, or by writing a yaml file (yaml is a programming language used to express material sequences).
Therefore, the scheme of manually creating the pod with the shm in the related art generally has the problems of complex operation and low execution efficiency.
Disclosure of Invention
In order to overcome the problems of complex operation and low execution efficiency in the scheme of manually creating a pod with a shm in the related art, the disclosure provides a data processing method and device, an electronic device and a storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a data processing method, including:
receiving a first HTTP request;
acquiring preset parameter information of a container to be created and size information of a shared memory to be configured of the container according to the first HTTP request;
assembling the preset parameter information and the size information according to preset data structure information to generate a second HTTP request, wherein the preset data structure information is data structure information required when a container is created;
and sending the second HTTP request to an API server of the kubernets cluster.
In a possible implementation manner, before the assembling the preset parameter information and the size information according to preset data structure information and generating the second HTTP request, the method further includes:
identifying a type of the first HTTP request;
according to the type of the first HTTP request, identifying a target API interface used for processing the type of HTTP request in an API server of the kubernets cluster;
and acquiring preset data structure information supported by the target API.
In a possible implementation manner, the assembling the preset parameter information and the size information according to preset data structure information to generate a second HTTP request includes:
setting the type of a target storage medium to which the shared memory to be configured belongs as a target type;
setting the size of the storage space of the target storage medium of the target type to be a target storage space size matched with the size information;
setting the path information of the target storage medium as target path information;
converting the data type of the preset parameter information into a target data type supported by the preset data structure information;
and assembling the target type of the target storage medium, the size of the target storage space, the target path information and the preset parameter information after data type conversion to generate a second HTTP request.
In one possible embodiment, the sending the second HTTP request to an API server of a kubernets cluster includes:
and sending the second HTTP request to an API server of the kubernets cluster through a client-go component.
In one possible embodiment, the sending, by the client-go component, the second HTTP request to an API server of a kubernets cluster includes:
connecting an API server of the kubernets cluster through a client-go assembly;
according to the type of the first HTTP request, identifying a target API interface in the API server for processing the type of HTTP request;
calling the target API interface of the API server through the client-go component, and sending the second HTTP request to the API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory with the size of the target storage space according to the second HTTP request.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus including:
a receiving module configured to receive a first hypertext transfer protocol, HTTP, request;
a first obtaining module, configured to obtain, according to the first HTTP request, preset parameter information of a container to be created and size information of a shared memory to be configured for the container;
the assembling module is configured to assemble the preset parameter information and the size information according to preset data structure information to generate a second HTTP request, wherein the preset data structure information is data structure information required when the container is created;
a sending module configured to send the second HTTP request to an Application Programming Interface (API) server of a kubernets cluster.
In a possible embodiment, the apparatus further comprises:
a first identification module configured to identify a type of the first HTTP request;
a second identification module configured to identify a target API interface in an API server of the kubernets cluster for processing the type of HTTP request according to the type of the first HTTP request;
and the second acquisition module is configured to acquire preset data structure information supported by the target API interface.
In one possible embodiment, the construction module comprises:
the first splicing submodule is configured to set the type of a target storage medium to which the shared memory to be configured belongs as a target type;
a second splicing submodule configured to set a size of a storage space of the target storage medium of the target type to a size of a target storage space matched with the size information;
a third splicing submodule configured to set path information of the target storage medium as target path information;
the fourth splicing submodule is configured to convert the data type of the preset parameter information into a target data type supported by the preset data structure information;
a fifth splicing submodule configured to splice the target type of the target storage medium, the size of the target storage space, the target path information, and the preset parameter information after the data type is converted, and generate a second HTTP request.
In one possible implementation, the sending module includes:
and the sending submodule is configured to send the second HTTP request to an API server of the kubernets cluster through the client-go component.
In one possible implementation, the sending submodule includes:
the connection unit is configured to be connected with the API server of the kubernets cluster through the client-go component;
an identifying unit configured to identify a target API interface in the API server for processing the type of the HTTP request according to the type of the first HTTP request;
a calling unit, configured to call the target API interface of the API server through the client-go component, and send the second HTTP request to the API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory of the target storage space size according to the second HTTP request.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform operations performed to implement the data processing method of any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform an operation to implement the data processing method according to any one of the above.
According to a fifth aspect of embodiments of the present disclosure, there is provided an application program, which when executed by a processor of an electronic device, enables the electronic device to perform a data processing method, the method comprising:
receiving a first HTTP request;
acquiring preset parameter information of a container to be created and size information of a shared memory to be configured of the container according to the first HTTP request;
assembling the preset parameter information and the size information according to preset data structure information to generate a second HTTP request, wherein the preset data structure information is data structure information required when a container is created;
and sending the second HTTP request to an API server of the kubernets cluster.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
thus, the embodiment of the disclosure sends a request for creating a container (pod) with a custom-sized shared memory to the k8s cluster in an HTTP request manner, without requiring developers to write commands and files, thereby reducing the operation difficulty of users and simplifying the operation steps; in addition, the method of the embodiment of the disclosure assembles the information carried in the first HTTP request by obtaining the preset parameter information of the container to be created in the first HTTP request and the size information of the shared memory to be configured for the container, and according to the data structure information required when the container is created, so that the assembled second HTTP request can be used to interact with the API server in the k8s cluster, and the HTTP request is used to implement the automatic creation of the container with the shared memory by the k8s, thereby improving the execution efficiency of the container creation step.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method of data processing in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of data processing in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating a method of data processing according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating the structure of a data processing apparatus according to an exemplary embodiment;
FIG. 5 is a block diagram illustrating an apparatus for data processing in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating an apparatus for data processing in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a data processing method according to an exemplary embodiment, where the data processing method is applied to a server, and the method may specifically include the following steps:
step 101, receiving a first hypertext transfer protocol (HTTP) request;
wherein, the server may be a WEB server. In order to provide REST services to the client (the REST describes an interactive form between the client and the server in the network), the method of the embodiment of the present disclosure may create the WEB server using an http packet in a go language in advance. The WEB server can provide REST service for the client, so that interaction between the client and the WEB server is realized.
Then, in order to automatically create a pod with shm (i.e. a large container for orchestrating, managing, and running a containerized application, hereinafter referred to as pod, or container), in an embodiment of the present disclosure, a client may send a first HTTP request to a WEB server based on a REST service provided by the WEB server, where the first HTTP request may carry the following information: and presetting parameter information of the pod to be created and size information of the shm of the pod to be configured. In this way, the WEB server according to the embodiment of the present disclosure may receive the first HTTP request from the client.
The preset parameter information is various parameters that need to be used when the pod is created, and the preset parameter information includes but is not limited to: pod name, pod tag, namespace (namespace) to which the pod belongs, image of the hosted application within the pod, port, start command, restart policy, image pull policy, etc.
In addition, the user can initiate the HTTP request for creating the pod with the shm only by operating the graphical WEB interface on the client, so that the user can operate the HTTP request easily, the learning of command writing by developers is avoided, and the operation of the client is easier.
Step 102, acquiring preset parameter information of a pod to be created and size information of a shm of the pod to be configured according to the first HTTP request;
the WEB server can analyze the first HTTP request so as to acquire the information carried in the first HTTP request, wherein the information comprises preset parameter information of the pod to be created and size information of the shm of the pod to be configured.
The size information of the shm to be configured for the pod indicates the size of the shared memory, such as 500M, that needs to be configured for the pod to be created.
103, assembling the preset parameter information and the size information according to preset data structure information to generate a second HTTP request;
in order to realize the function of automatically creating a pod with a shm, the WEB server in the embodiment of the present disclosure needs to interact with an Application Programming Interface (API) server in the k8s cluster, and the API interface provided by the API server and used for creating the pod has a data structure requirement for a processed data request, that is, preset data structure information. Wherein the preset data structure information is data structure information required when the pod is created.
Therefore, the WEB server needs to reassemble the parsed information according to the preset data structure information to generate the second HTTP request.
And step 104, sending the second HTTP request to the API server of the k8s cluster.
The WEB server may send the assembled second HTTP request to an API server in the k8s cluster, so that the k8s can create a pod with a shm of a custom size according to information in the second HTTP request.
The k8s cluster may be configured with one or more API servers, and when a plurality of API servers are configured, one API server may be selected according to a preset policy to send the second HTTP request.
Thus, the embodiment of the disclosure sends a request for creating a container (pod) with a custom-sized shared memory to the k8s cluster in an HTTP request manner, without requiring developers to write commands and files, thereby reducing the operation difficulty of users and simplifying the operation steps; in addition, the method of the embodiment of the disclosure assembles the information carried in the first HTTP request by obtaining the preset parameter information of the container to be created in the first HTTP request and the size information of the shared memory to be configured for the container, and according to the data structure information required when the container is created, so that the assembled second HTTP request can be used to interact with the API server in the k8s cluster, and the HTTP request is used to implement the automatic creation of the container with the shared memory by the k8s, thereby improving the execution efficiency of the container creation step.
In one possible implementation, before step 103, the method according to the embodiment of the present disclosure may further include:
firstly, identifying the type of the first HTTP request;
after receiving the first HTTP request, the WEB server may identify a type of the first HTTP request, where the type includes, but is not limited to, a Post request, a Patch request, a Get request, and the like.
It is only necessary here to identify to which of the above-listed types the first HTTP request belongs.
In this embodiment, the identified type of the first HTTP request is a Post request, which indicates that information is transferred to a WEB server, where the transferred information includes the preset parameter information of the pod to be created and size information of the shm to which the pod is to be configured.
Then, according to the type of the first HTTP request, identifying a target API interface used for processing the type of HTTP request in an API server of the k8s cluster;
for a Post-type HTTP request, it indicates that the client wants to create a pod with shm, and the API server of the k8s cluster may pass through a variety of API interfaces externally, where the WEB server of the embodiment of the present disclosure may identify a target API interface for processing the Post-type HTTP request. Wherein the target API interface is an API interface for creating the pod.
And finally, acquiring preset data structure information supported by the target API.
When the target API interface is called to create the pod, the target API interface defines preset data structure information (e.g., data type, etc.) supported by the target API interface, and therefore, the preset structure information supported by the target API interface needs to be acquired here.
In this way, according to the type of the received first HTTP request, the embodiment of the present disclosure may identify a target API interface in the API server of the k8s cluster, which is used for processing the HTTP request of the type, and obtain preset data structure information supported by the target API interface, so that parameter information in the first HTTP request may be assembled into a data structure supported by the target API interface, and the parameter information in the first HTTP request, which is used for creating a pod with shm, is reassembled into a data structure, so that interaction between a subsequent WEB server and the API server of the k8s may be facilitated, and efficiency of creating a pod configured with shm is improved.
In a possible implementation, when step 103 is executed, it may be implemented by the method shown in fig. 2:
step 201, setting the type of the target storage medium to which the shm to be configured belongs as a target type;
the purpose of the method in the embodiment of the present disclosure is to enable k8s to create a pod according to the received second HTTP request, and when creating the pod, allocate a certain size of memory to the created pod to be used as a shared memory of the pod.
Since the memory is bound to a certain storage medium, the type of the target storage medium to which the shm belongs needs to be set as the target type in this step.
In an example, in a k8s cluster, a shared Memory (shm) used by each container in a pod is generally a volume, and a volume may be a directory in a disk or a directory in a containerized application, and therefore, a volume is a target storage medium to which the shm belongs.
Wherein k8s supports multiple types of volumes, where volume is set to the EmptyDir type; there are many types of EmptyDir, and here, the type of EmptyDir may be set as a Memory type.
This step is equivalent to setting which data volume the shared memory shm needs to be mounted to.
Step 202, setting the size of the storage space of the target storage medium of the target type as the size of the target storage space matched with the size information;
in this embodiment, since the created pod is configured with the shm of the custom size, step 202 is required to set the type of the storage medium to which the shm belongs, and the size of the storage space in the target storage medium of the target type as the shm needs to be further set.
In one example, for example, if the size information is 500M, the size of the volume may be set to 500M, where the type of the volume is an EmptyDir type, and the type of the EmptyDir is a Memory type.
This step is equivalent to setting how much storage space in the data volume determined in step 201 the shared memory shm needs to be mounted to.
Step 203, setting the path information of the target storage medium as target path information;
the above-mentioned step 201 and step 202 set how much storage space the shm needs to use in which type of storage medium, but no setting is made for the address of the storage space, so this step also needs to set the path information of the target storage medium as the target path information.
In one example, the path where the volume is located may be set to/dev/shm. Wherein, the target path: and/dev/shm. Wherein, the common custom-sized shm is set in the storage space under the/dev/shm path.
This step is equivalent to setting the position of the volume (target storage space) mounted in the shared memory shm.
Step 204, converting the data type of the preset parameter information into a target data type supported by the preset data structure information;
wherein the preset data structure information is data structure information required when the pod is created.
The preset data structure information can define the data types supported during pod creation;
for example, the data type of the preset parameter information is a floating point (float) type, and the data type defined in the preset data structure information is, for example, an integer (int), then the preset parameter information of the float type needs to be converted into the int type by performing data type conversion.
Of course, the float type and the int type herein are only illustrative examples, and do not limit the disclosure, and the number of target data types supported by the preset data structure information in the embodiments of the disclosure may be one or more, and is not limited to the above examples.
The execution sequence of step 201, step 203, and step 204 is not limited in the embodiment of the present disclosure.
Step 205, assembling the target type, the size of the target storage space, the target path information, and the preset parameter information after converting the data type of the target storage medium, and generating a second HTTP request.
The data processed in steps 201 to 204 may be reassembled according to the HTTP protocol to obtain the second HTTP request.
The second HTTP request may carry the target type of the target storage medium, the size of the target storage space, the target path information, and the preset parameter information after the data type is converted.
In addition, the data assembling process of step 201 to step 205 may be understood as a protocol customized by the method of the embodiment of the present disclosure, where the protocol represents operations that need to be performed when creating a pod configured with a custom size shm. By performing the operation of the method of this embodiment, it is convenient for the k8s system to perform automatic creation work of pod with custom size shm for the assembled second HTTP request.
In this way, according to the information analyzed from the first HTTP request, the method according to the embodiment of the present disclosure performs data reassembly according to the protocol defined when creating the pod configured with the shm, so that it is possible to automatically create the pod of the shm with the user-defined size, and the created pod with the shm with the user-defined size can be maintained by using the HTTP request, thereby avoiding many complex operations and maintenance operations. And moreover, developers are not required to learn and write commands and yaml files, so that the learning cost of the users and the execution cost of the commands and the yaml files are reduced.
In a possible implementation, when step 104 is executed, it may be implemented by S401:
s401, the second HTTP request is sent to the API server of the k8S cluster through the client-go component.
In order to enable the WEB server to access the k8s cluster through the HTTP request, the WEB server may employ a client-go component to send the second HTTP request to the API server in the k8s cluster.
The client-go is a new framework for the go language to access the API of K8s, and the client-go is a client calling the API of the K8s cluster.
Thus, according to the embodiment of the disclosure, the HTTP access of the WEB server to the API server in the k8s cluster is realized through the client-go component, so that the k8s automatically creates a pod according to the preset parameter information related to the pod creation in the received second HTTP request, and configures the user-defined size shm for the created pod according to the relevant information of the shm in the second HTTP request, thereby simplifying the operation step of creating the pod with the shm, and improving the execution efficiency of creating the pod. In addition, the embodiment of the disclosure enables a user to access the WEB server through the first HTTP request at the client side, and the WEB server accesses the API server through the client-go component, so that the client side is prevented from directly accessing the k8s cluster, access control of the client side is realized, and operation and maintenance are facilitated.
In a possible implementation, when S401 is executed, it may be implemented by the method shown in fig. 3:
step 301, connecting an API server of the k8s cluster through a client-go component;
wherein, the WEB server can be connected with the API server of the k8s cluster through a client-go component.
Step 302, according to the type of the first HTTP request, identifying a target API interface in the API server for processing the HTTP request of the type;
the specific implementation of this step can refer to the above, and is not described here again.
Step 303, calling the target API interface of the API server through the client-go component, and sending the second HTTP request to the API server of the k8s cluster, so that the k8s cluster creates a pod configured with the shm of the target storage space size according to the second HTTP request.
Specifically, the WEB server may use the client-go component to call a target API interface used for creating the pod in the API server, and transmit the assembled data carried in the second HTTP request to the target API interface, where the target API interface may parse the received assembled data into a json file. And finally, the WEB server sends the json file to the API server of the k8s cluster through a client-go component, so that the k8s cluster creates a pod configured with the shm with the size of the target storage space according to the json file.
When creating the pod, the k8s cluster may create the pod according to the preset parameter information converted into the target data type in the json file, and allocate a segment of memory of the target type and the target storage space size under the target path corresponding to the target path information according to the target type, the target storage space size, and the target path information of the target storage medium to which the shm belongs, so that the shm is mounted to the segment of memory, and then any containerized application in the created pod may share and use the data in the segment of memory.
Fig. 4 is a block diagram illustrating a structure of a data processing apparatus according to an exemplary embodiment. Referring to fig. 4, the apparatus includes:
a receiving module 41 configured to receive a first hypertext transfer protocol, HTTP, request;
a first obtaining module 42, configured to obtain, according to the first HTTP request, preset parameter information of a container to be created and size information of a shared memory to be configured for the container;
an assembling module 43, configured to assemble the preset parameter information and the size information according to preset data structure information, and generate a second HTTP request, where the preset data structure information is data structure information required when a container is created;
a sending module 44 configured to send the second HTTP request to an application programming interface, API, server of the kubernets cluster.
In a possible embodiment, the apparatus further comprises:
a first identification module configured to identify a type of the first HTTP request;
a second identification module configured to identify a target API interface in an API server of the kubernets cluster for processing the type of HTTP request according to the type of the first HTTP request;
and the second acquisition module is configured to acquire preset data structure information supported by the target API interface.
In a possible embodiment, the splicing module 43 comprises:
the first splicing submodule is configured to set the type of a target storage medium to which the shared memory to be configured belongs as a target type;
a second splicing submodule configured to set a size of a storage space of the target storage medium of the target type to a size of a target storage space matched with the size information;
a third splicing submodule configured to set path information of the target storage medium as target path information;
the fourth splicing submodule is configured to convert the data type of the preset parameter information into a target data type supported by the preset data structure information;
a fifth splicing submodule configured to splice the target type of the target storage medium, the size of the target storage space, the target path information, and the preset parameter information after the data type is converted, and generate a second HTTP request.
In a possible implementation, the sending module 44 includes:
and the sending submodule is configured to send the second HTTP request to an API server of the kubernets cluster through the client-go component.
In one possible implementation, the sending submodule includes:
the connection unit is configured to be connected with the API server of the kubernets cluster through the client-go component;
an identifying unit configured to identify a target API interface in the API server for processing the type of the HTTP request according to the type of the first HTTP request;
a calling unit, configured to call the target API interface of the API server through the client-go component, and send the second HTTP request to the API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory of the target storage space size according to the second HTTP request.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an apparatus 800 for data processing in accordance with an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, the apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The apparatus 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, an application comprising instructions is also provided, such as the memory 804 comprising instructions executable by the processor 820 of the device 800 to perform the method described above. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 6 is a block diagram illustrating an apparatus 1900 for data processing according to an example embodiment. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 6, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the method … … described above
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
It should be noted that the execution subject of the present disclosure may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.; or may be a server. When the electronic device is a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, etc., as shown in fig. 5. When the electronic device is a server, as shown in fig. 6.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data processing method, comprising:
receiving a first HTTP request;
acquiring preset parameter information of a container to be created and size information of a shared memory to be configured of the container according to the first HTTP request;
setting the type of a target storage medium to which the shared memory to be configured belongs as a target type;
setting the size of the storage space of the target storage medium of the target type to be a target storage space size matched with the size information;
setting the path information of the target storage medium as target path information;
converting the data type of the preset parameter information into a target data type supported by preset data structure information, wherein the preset data structure information is data structure information required when a container is created;
assembling the target type of the target storage medium, the size of the target storage space, the target path information and the preset parameter information after data type conversion to generate a second HTTP request;
and sending the second HTTP request to an API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory with the size of the target storage space according to the second HTTP request.
2. The data processing method according to claim 1, wherein before the predetermined parameter information and the size information are assembled according to predetermined data structure information and a second HTTP request is generated, the method further comprises:
identifying a type of the first HTTP request;
according to the type of the first HTTP request, identifying a target API interface used for processing the type of HTTP request in an API server of the kubernets cluster;
and acquiring preset data structure information supported by the target API.
3. The data processing method of claim 1, wherein sending the second HTTP request to an API server of a kubernets cluster comprises:
and sending the second HTTP request to an API server of the kubernets cluster through a client-go component.
4. The data processing method of claim 3, wherein sending, by the client-go component, the second HTTP request to an API server of a kubernets cluster comprises:
connecting an API server of the kubernets cluster through a client-go assembly;
according to the type of the first HTTP request, identifying a target API interface in the API server for processing the type of HTTP request;
calling the target API interface of the API server through the client-go component, and sending the second HTTP request to the API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory with the size of the target storage space according to the second HTTP request.
5. A data processing apparatus, comprising:
a receiving module configured to receive a first HTTP request;
a first obtaining module, configured to obtain, according to the first HTTP request, preset parameter information of a container to be created and size information of a shared memory to be configured for the container;
an assembly module comprising:
the first splicing submodule is configured to set the type of a target storage medium to which the shared memory to be configured belongs as a target type;
a second splicing submodule configured to set a size of a storage space of the target storage medium of the target type to a size of a target storage space matched with the size information;
a third splicing submodule configured to set path information of the target storage medium as target path information;
the fourth splicing submodule is configured to convert the data type of the preset parameter information into a target data type supported by preset data structure information, wherein the preset data structure information is data structure information required when a container is created;
a fifth splicing submodule configured to splice the target type of the target storage medium, the size of the target storage space, the target path information, and the preset parameter information after the data type is converted, and generate a second HTTP request;
a sending module configured to send the second HTTP request to an API server of a kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory of the target storage space size according to the second HTTP request.
6. The data processing apparatus of claim 5, wherein the apparatus further comprises:
a first identification module configured to identify a type of the first HTTP request;
a second identification module configured to identify a target API interface in an API server of the kubernets cluster for processing the type of HTTP request according to the type of the first HTTP request;
and the second acquisition module is configured to acquire preset data structure information supported by the target API interface.
7. The data processing apparatus of claim 5, wherein the sending module comprises:
and the sending submodule is configured to send the second HTTP request to an API server of the kubernets cluster through the client-go component.
8. The data processing apparatus of claim 7, wherein the sending submodule comprises:
the connection unit is configured to be connected with the API server of the kubernets cluster through the client-go component;
an identifying unit configured to identify a target API interface in the API server for processing the type of the HTTP request according to the type of the first HTTP request;
a calling unit, configured to call the target API interface of the API server through the client-go component, and send the second HTTP request to the API server of the kubernets cluster, so that the kubernets cluster creates a container configured with the shared memory of the target storage space size according to the second HTTP request.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform operations to implement the data processing method of any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform operations performed to implement the data processing method of any one of claims 1 to 4.
CN201910132814.3A 2019-02-21 2019-02-21 Data processing method and device, electronic equipment and storage medium Active CN109976872B (en)

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 CN109976872A (en) 2019-07-05
CN109976872B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110554865B (en) * 2019-09-10 2021-05-18 联想(北京)有限公司 Visual programming method, device, computing equipment and medium
CN111414161B (en) * 2020-03-27 2023-05-12 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for generating IDL file

Citations (8)

* Cited by examiner, † Cited by third party
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN109976872A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN107329742B (en) Software development kit calling method and device
EP2998899A1 (en) Method and apparatus for running application program
US9870239B2 (en) Method and device for running application program
CN108833585B (en) Information interaction method and device and storage medium
CN105808305B (en) Static resource loading method and device
CN108600529B (en) Information interaction method and device and computer readable storage medium
CN110858173A (en) Data processing method and device and data processing device
CN110502444B (en) Testing method and testing device for image processing algorithm
CN110928543A (en) Page processing method and device and storage medium
CN110704054A (en) Method and device for accessing target application program through applet, electronic equipment and storage medium
CN109117144B (en) Page processing method, device, terminal and storage medium
CN107562500B (en) Debugging device, method and equipment
CN107463372B (en) Data-driven page updating method and device
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN111198706A (en) Method for updating system function, apparatus for updating system function and storage medium
CN106612149B (en) Radio frequency circuit testing method, device and system and mobile terminal
CN110221813B (en) Application data connection establishment method and device, storage medium and electronic equipment
CN109491655B (en) Input event processing method and device
CN111782997A (en) Method and device for loading webpage and storage medium
CN111079040A (en) Resource sniffing method, device, terminal, server and storage medium
CN105607958B (en) Information input method and device
CN111596980B (en) Information processing method and device
CN113238887A (en) Data processing method, device and storage medium
CN110908904A (en) Method and device for debugging fast application and electronic equipment
CN113377322A (en) Page direct processing method and device and electronic equipment

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