Service instance data processing method and device, computer equipment and storage medium
By replacing the metadata value in the service instance data using the metadata index dictionary on the client, the resource tightness caused by the increase in the number of service instances is solved, and efficient data processing in high data volume scenarios is achieved.
Patent Information
- Application Number
- CN202411935575.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-08
AI Technical Summary
As the number of service instances and client subscriptions increase, the server's demand for storage resources and network bandwidth increases, resulting in resource tightness, which may cause memory overflow or push failure.
By obtaining service instance data and metadata index dictionary on the client, multiple metadata pieces are determined, and the metadata value is found and replaced in the metadata index dictionary to reduce the data size. Finally, the compressed metadata is sent to the server to complete the registration task.
It reduces the pressure on service instance data in transmission and storage, thereby improving data processing efficiency in scenarios where the service instance data is large, and avoiding resource tightness and memory overflow problems.
Smart Images

Figure CN119788735A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to a service instance data processing method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] Currently, in the registry architecture, when a client registers a service instance with a server, the server generates a corresponding object for each instance and stores the object in memory. Since each instance contains a large amount of metadata, each service instance consumes approximately 1KB of memory resources.
[0003] When the number of service instances and client subscriptions is small, the system can run stably without resource bottlenecks. However, as the number of service instances and client subscriptions continue to increase, each service instance occupies a large amount of memory, and the system's demand for server storage resources and network bandwidth will also increase, leading to resource shortages and even memory overflow or push failures. The system will not be able to efficiently process a large amount of service instance data. Summary of the invention
[0004] Based on this, it is necessary to provide a service instance data processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve data processing efficiency in scenarios where the server instance data volume is large, in response to the above technical problems.
[0005] In a first aspect, the present application provides a service instance data processing method, the method being applied to a client, the method comprising:
[0006] Get service instance data and metadata index dictionary;
[0007] Determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0008] For each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index;
[0009] The plurality of metadata are sent to the server to complete the registration task of the client.
[0010] In one embodiment, the method further comprises:
[0011] In the case that there is no metadata index matching the metadata field in the metadata index dictionary, compressing the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server;
[0012] The metadata index dictionary is updated according to the metadata field and the metadata value.
[0013] In one of the embodiments, compressing the metadata value corresponding to the metadata field in a temporary compression manner to obtain a metadata compression value includes:
[0014] Extracting each character in the metadata value corresponding to the metadata field respectively;
[0015] Calculate the occurrence frequency of each of the characters in all the characters of the metadata value;
[0016] Constructing Huffman tree data according to the occurrence frequency, and encoding each of the characters according to the Huffman tree data to obtain a character code;
[0017] The character codes corresponding to all the characters of the metadata value are collected to obtain a metadata compression value.
[0018] In one embodiment, updating the metadata index dictionary according to the metadata field and the metadata value includes:
[0019] Counting the ratio of the metadata that needs to be compressed in the temporary manner to all the metadata in the service instance data to obtain a temporary compression frequency;
[0020] In a case where the temporary compression frequency is higher than a preset frequency threshold, the metadata index dictionary is updated according to the metadata field and the metadata value.
[0021] In one of the embodiments, when the temporary compression frequency is higher than a preset frequency threshold, updating the metadata index dictionary according to the metadata field and the metadata value includes:
[0022] In a case where the temporary compression frequency is higher than a preset frequency threshold, determining index partition information according to the metadata field;
[0023] assigning a metadata index to the metadata value according to the index partition information;
[0024] The metadata index and the metadata field are stored in the metadata index dictionary in correspondence to update the metadata index dictionary.
[0025] In one of the embodiments, after updating the metadata index dictionary according to the metadata field and the metadata value, the method further includes:
[0026] The updated metadata index dictionary is sent to the server so that the server can decode the metadata.
[0027] In a second aspect, the present application further provides a service instance data processing device, which is applied to a client and includes:
[0028] Data acquisition module, used to obtain service instance data and metadata index dictionary;
[0029] A metadata extraction module, used to determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0030] A data processing module, configured to search the metadata index in the metadata index dictionary for each piece of metadata, and replace the metadata value with the metadata index;
[0031] The data sending module is used to send the plurality of metadata to the server to complete the registration task of the client.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Get service instance data and metadata index dictionary;
[0034] Determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0035] For each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index;
[0036] The plurality of metadata are sent to the server to complete the registration task of the client.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0038] Get service instance data and metadata index dictionary;
[0039] Determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0040] For each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index;
[0041] The plurality of metadata are sent to the server to complete the registration task of the client.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0043] Get service instance data and metadata index dictionary;
[0044] Determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0045] For each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index;
[0046] The plurality of metadata are sent to the server to complete the registration task of the client.
[0047] The above-mentioned service instance data processing method, device, computer equipment, storage medium and computer program product are applied to the client, and multiple metadata are determined by obtaining service instance data, obtaining metadata fields and metadata values corresponding to the metadata fields, and then obtaining a metadata index dictionary. For each metadata, the metadata index matching the metadata field in the metadata index dictionary is searched, and the metadata value is replaced with the metadata index. After the metadata value is replaced, the memory occupied by the metadata is reduced, and multiple metadata are sent to the server to complete the registration task of the client, which can reduce the data transmission and storage pressure of the service instance data, thereby being able to improve data processing efficiency in scenarios with large amounts of service instance data. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1An application environment diagram of a service instance data processing method in an embodiment;
[0050] Figure 2 A schematic diagram of a flow chart of a method for processing service instance data in an embodiment;
[0051] Figure 3 This is a flow chart of step S206 of a method for processing service instance data in one embodiment;
[0052] Figure 4 is a structural block diagram of a service instance data processing device in an embodiment;
[0053] Figure 5 is an internal structure diagram of a computer device in one embodiment;
[0054] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] The service instance data processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network, and the terminal 102 can be used to obtain service instance data and metadata index dictionary. When service registration is required, the service instance data is compressed and sent to the server 104. The server 104 can be used to receive the data instance data sent by the terminal 102, so as to register the terminal 102. The data storage system can store the data that the terminal 102 and the server 104 need to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The data storage system can be used to store information such as metadata index dictionary. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0057] In an exemplary embodiment, Figure 2As shown, a service instance data processing method is provided, which is applied to the registration center client to perform the registration task for the client. Figure 1 The terminal 102 in the example is used as an example to illustrate, including the following steps S202 to S208. Among them:
[0058] Step S202: Obtain service instance data and metadata index dictionary.
[0059] Among them, service instance data refers to the detailed information used to describe a specific service instance, where each service instance may contain multiple fields, such as service name, version, network area, deployment environment, instance status, etc. These fields together constitute the complete data of the service instance. In a registration center, service instance data can contain all metadata fields for each service instance and their corresponding values. For example, the metadata of a service instance may include fields such as networkArea=APP, deployEnvironment=PAT, dataCenter=WG, etc., where APP represents the application area or the network environment in which the application is deployed; PAT represents the identifier of a deployment environment, which can be used to distinguish different development, test or production environments; WG can represent the identifier of a specific data center. These fields and their values together constitute a complete description of the service instance.
[0060] Exemplarily, the terminal 102 may obtain data related to the service instance as service instance data, and the service instance data may include metadata of multiple service instances. The metadata may include various descriptive information about the service instance, such as the name, version, network region, deployment environment, etc. of the service.
[0061] The metadata index dictionary may be a mapping table for mapping metadata fields and corresponding values to a unique metadata index. For example, the terminal 102 may assign an index value of 1 to the networkArea field, an index value of 2 to the deployEnvironment field, and an index value of 3 to the dataCenter field, and map metadata values such as APP, PAT, and WG to different digital indexes, respectively, so that the originally lengthy metadata fields and values are compressed into a more compact digital index, making data transmission and storage more efficient.
[0062] Step S204: determining multiple metadata according to the service instance data.
[0063] Among them, metadata includes metadata fields and metadata values corresponding to metadata fields. Metadata is a part of the service instance data, which refers to the attributes of the service instance and the corresponding values. Each service instance has multiple metadata fields, which usually describe various aspects of the service instance, such as the network area, operating environment, version, etc. where the service is located. The metadata fields and the corresponding metadata values together constitute the complete information of the metadata. Metadata fields include networkArea, deployEnvironment, dataCenter, etc. Metadata values correspond to specific content such as APP, PAT, WG, etc. Exemplarily, during the registration center client processing, the terminal 102 can obtain the original data of the service instance, including all metadata fields and metadata values.
[0064] Step S206: for each metadata, search the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replace the metadata value with the metadata index.
[0065] For example, if there is a metadata index matching the metadata field in the metadata index dictionary, the terminal 102 can search the metadata index dictionary and replace each metadata field and the corresponding value with the corresponding index. For example, the original networkArea=APP is replaced with networkArea=1, and the deploymentEnvironment=PAT is replaced with deploymentEnvironment=2, so that only the index value is transmitted instead of the complete metadata content, which significantly reduces the size of the data.
[0066] Furthermore, when there is no metadata index matching the metadata field in the metadata index dictionary, the terminal 102 may compress the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server; the metadata index dictionary is updated according to the metadata field and the metadata value, and when updating the metadata index dictionary, the terminal 102 may directly assign an index to the metadata value, or assign the index according to the metadata field type partition.
[0067] Exemplarily, when there is no metadata index matching the metadata field in the metadata index dictionary, the terminal 102 may select a temporary compression method to reduce the size of the unindexed metadata value. The temporary compression method is to compress the metadata value using a specific algorithm according to the agreement between the terminal 102 and the server 104. For example, the client (terminal 102) and the server (server 104) may agree to use a certain compression algorithm, such as Huffman coding or other lightweight compression strategies. This compression method will convert the specific value of the metadata field into a shorter data form, thereby saving the resources required for storage and transmission. After completing the compression operation, the terminal 102 may generate a metadata compression value as a representation of the compressed metadata value, which may be a shorter string or digital form.
[0068] Exemplarily, terminal 102 can count the ratio of metadata that needs to be temporarily compressed to all metadata in service instance data to obtain a temporary compression frequency; when the temporary compression frequency is higher than a preset frequency threshold, the metadata index dictionary is updated according to the metadata field and metadata value.
[0069] Furthermore, when the temporary compression frequency is higher than a preset frequency threshold, the terminal 102 can determine the index partition information according to the metadata field; assign a metadata index to the metadata value according to the index partition information; and store the metadata index and the metadata field in the metadata index dictionary to update the metadata index dictionary.
[0070] Exemplarily, terminal 102 can monitor and count the metadata compression situation. When it is found that the proportion of metadata that needs to be temporarily compressed is high, terminal 102 can calculate the value of the temporary compression frequency by counting the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data, thereby reflecting which metadata fields need to be temporarily compressed more frequently during the processing process, and then measuring whether there is too much data that needs to be processed through temporary compression.
[0071] Furthermore, assume that a service instance contains 3 metadata fields, of which only networkArea and serviceVersion need to be temporarily compressed, and deployEnvironment already has corresponding indexes and can be used directly. Therefore, 2 fields in each service instance need to be temporarily compressed. Next, terminal 102 can perform the same statistics on the data of all service instances, and finally obtain the total number of metadata fields that need to be temporarily compressed in all service instances. Then, terminal 102 can calculate the temporary compression frequency, that is, the proportion of metadata fields that need to be temporarily compressed to all metadata fields. Assuming that there are a total of 15 metadata fields in 5 service instances, 10 of which need to be temporarily compressed, then the temporary compression frequency is 10 divided by 15, which is 66.67%. This frequency value indicates that approximately 2 / 3 of the metadata fields need to be compressed.
[0072] Subsequently, the terminal 102 may compare the value with a preset frequency threshold. Assume that the frequency threshold set by the system is 50%. When the calculated temporary compression frequency (66.67%) is higher than this threshold, the terminal 102 may determine that the metadata index dictionary needs to be updated to optimize storage and transmission efficiency. The terminal 102 may determine how to perform index partitioning by analyzing the metadata field type. For metadata fields that frequently need to be compressed, the terminal 102 may assign a suitable index partition to the field based on the characteristics of the field, and store these fields and their compressed values in the metadata index dictionary for subsequent efficient use. For example, for metadata fields such as network area, deployment environment, and service version, the terminal 102 may divide the index interval according to the range or type of its value, thereby making the indexing of related fields more efficient. For example, all metadata related to "area" can be assigned indexes in the same index interval, while other types of metadata fields may adopt different partitioning strategies.
[0073] Step S208, sending multiple metadata to the server to complete the client registration task.
[0074] Exemplarily, the terminal 102 can send all metadata (i.e., compressed data) that have been replaced by indexes to the server, i.e., the server 104. After receiving the data, the server can restore these digital indexes to actual metadata fields and values according to the metadata index dictionary agreed in advance. In this way, the client can effectively complete the registration task of the service instance while reducing the consumption of memory and network resources. Furthermore, the terminal 102 can also send the updated metadata index dictionary to the server for the server to decode the metadata.
[0075] In the above service instance data processing method, applied to the client, multiple metadata are determined by obtaining service instance data, metadata fields and metadata values corresponding to the metadata fields are obtained, and then a metadata index dictionary is obtained. For each metadata, a metadata index matching the metadata field in the metadata index dictionary is searched, and the metadata value is replaced with the metadata index. After replacing the metadata value, the memory occupied by the metadata is reduced, and multiple metadata are sent to the server to complete the client's registration task, which can reduce the data transmission and storage pressure of the service instance data, thereby improving data processing efficiency in scenarios with large amounts of service instance data.
[0076] In an exemplary embodiment, Figure 3 As shown, using a temporary compression method to compress the metadata value corresponding to the metadata field to obtain the metadata compression value includes steps S302 to S308. Among them:
[0077] Step S302: extract each character in the metadata value corresponding to the metadata field.
[0078] Exemplarily, the terminal 102 may extract each character from the metadata value. For example, if the metadata value is "mesh-demo4mesh-c", the terminal 102 may extract each character in the string in turn, decompose the original string, and convert it into a character sequence: m, e, s, h, -, d, e, m, o, 4, m, e, s, h, -, c.
[0079] Step S304, calculating the occurrence frequency of each character in all characters of the metadata value.
[0080] Exemplarily, terminal 102 may perform frequency statistics on these characters and calculate the number of times each character appears in the metadata value. For the metadata value "mesh-demo4mesh-c", terminal 102 may obtain the following statistical results: character "m" appears "3" times, character "e" appears "3" times, character "s" appears "2" times, character "h" appears "2" times, character "-" appears "2" times, character "d" appears "1" time, character "o" appears "1" time, character "4" appears "1" time, character "c" appears "1" time, thereby determining the frequency of occurrence of each character, and characters with high frequency will occupy shorter encoding positions in the subsequent encoding process, while characters with low frequency will occupy longer encoding positions.
[0081] Step S306, constructing Huffman tree data according to the occurrence frequency, and encoding each character according to the Huffman tree data to obtain a character code.
[0082] Next, terminal 102 can use these character frequencies to build a Huffman tree. The construction of the Huffman tree is based on the frequency of the characters, and the characters with lower frequencies will be merged into new nodes, and the characters with higher frequencies will be assigned to shorter coding paths. In the process of building the Huffman tree, terminal 102 can put each character and its frequency into a list as an independent node, sort these nodes according to the frequency, and select the two nodes with the smallest frequency to merge into a new node until only one root node is left. For example, the initial character frequency node list is: m:3, e:3, s:2, h:2, -:2, d:1, o:1, 4:1, c:1. Terminal 102 can merge d:1 and o:1 to obtain a new node do:2, and then merge 4:1 and c:1 to obtain 4c:2, and then continue to merge until a complete Huffman tree is built.
[0083] After the Huffman tree is constructed, the terminal 102 can start to assign codes to each character according to the structure of the tree. The principle of Huffman coding is that the higher the frequency of the character, the shorter the code; the lower the frequency of the character, the longer the code. The terminal 102 can assign a unique binary code to each character through the path from the root node to the leaf node. For example, the characters "m" and "e" have the highest frequency, and they will be assigned to positions closer to the root node of the tree and get shorter codes, "0" and "1" respectively; the characters "s", "h" and "-" have lower frequencies, so they will get longer codes, "00", "01" and "10" respectively; the characters "d, o, 4" and "c" will be assigned longer codes, "110", "1110", "1111" and "11111" respectively, thereby ensuring that the characters with high frequencies occupy shorter codes, achieving the effect of compressing data.
[0084] Step S308: collect the character codes corresponding to all characters of the metadata value to obtain a metadata compression value.
[0085] Exemplarily, terminal 102 can replace each character in the original metadata value with its corresponding Huffman code. In this embodiment, the original metadata value "mesh-demo4mesh-c" will be replaced one by one with the code corresponding to each character, and the following binary code string will be obtained: "m"→"0", "e"→"1", "s"→"00", "h"→"01", "-"→"10", "d"→"110", "e"→"1", "m"→"0", "o"→"1110", "4"→"1111", "m"→"0", "e"→"1", "s"→"00", "h"→"01", "-"→"10", "c"→"11111". After combining these codes, the compression result is: 0100011011010111011110100011011111. Compared with the original character sequence, the binary code string takes up less storage space, thus achieving compression.
[0086] In another exemplary embodiment, the terminal 102 obtains service instance data and a metadata index dictionary, determines multiple metadata based on the service instance data, and obtains metadata fields and metadata values corresponding to the metadata fields. In this embodiment, the terminal 102 performs compression based on the HPACK algorithm, which is used to compress header data in the HTTP / 2 protocol. Compared with HTTP / 1.x, HTTP / 2 can reduce transmission bandwidth and delay and improve performance by compressing request and response headers.
[0087] Next, the terminal 102 searches for the metadata index that matches the metadata field in the metadata index dictionary for each metadata, and replaces the metadata value with the metadata index. If there is no metadata index that matches the metadata field in the metadata index dictionary, the metadata value corresponding to the metadata field is compressed using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server. The terminal 102 extracts each character in the metadata value corresponding to the metadata field, calculates the frequency of occurrence of each character in all characters of the metadata value, constructs Huffman tree data according to the frequency of occurrence, and encodes each character according to the Huffman tree data to obtain a character code, collects the character codes corresponding to all characters of the metadata value, and obtains a metadata compression value.
[0088] Subsequently, the terminal 102 counts the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data to obtain a temporary compression frequency. When the temporary compression frequency is higher than a preset frequency threshold, the terminal 102 determines the index partition information according to the metadata field, assigns a metadata index to the metadata value according to the index partition information, and then stores the metadata index and the metadata field in the metadata index dictionary to update the metadata index dictionary. The updated metadata index dictionary is sent to the server for the server to decode the metadata. Finally, the terminal 102 sends multiple metadata to the server to complete the client registration task.
[0089] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0090] Based on the same inventive concept, the embodiment of the present application also provides a service instance data processing device for implementing the service instance data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more service instance data processing device embodiments provided below can refer to the limitations of the service instance data processing method above, and will not be repeated here.
[0091] In an exemplary embodiment, Figure 4 As shown, a service instance data processing device is provided, which is applied to a client and includes: a data acquisition module 402, a metadata extraction module 404, a data processing module 406 and a data sending module 408, wherein:
[0092] Data acquisition module 402, used to acquire service instance data and metadata index dictionary;
[0093] The metadata extraction module 404 is used to determine multiple metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields;
[0094] The data processing module 406 is used to search for a metadata index matching the metadata field in the metadata index dictionary for each metadata, and replace the metadata value with the metadata index;
[0095] The data sending module 408 is used to send multiple metadata to the server to complete the registration task of the client.
[0096] In one embodiment, the device further comprises:
[0097] A temporary compression module, used to compress the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value when there is no metadata index matching the metadata field in the metadata index dictionary; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server;
[0098] The index update module is used to update the metadata index dictionary according to the metadata fields and metadata values.
[0099] In one of the embodiments, the temporary compression module is specifically used to: extract each character in the metadata value corresponding to the metadata field respectively; calculate the frequency of occurrence of each character in all characters of the metadata value; construct Huffman tree data according to the frequency of occurrence, and encode each character according to the Huffman tree data to obtain a character code; and collect the character codes corresponding to all characters of the metadata value to obtain a metadata compression value.
[0100] In one of the embodiments, the index update module is specifically used to: count the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data to obtain a temporary compression frequency; when the temporary compression frequency is higher than a preset frequency threshold, update the metadata index dictionary according to the metadata field and metadata value.
[0101] In one of the embodiments, the index update module is also used to: determine index partition information based on the metadata field when the temporary compression frequency is higher than a preset frequency threshold; assign a metadata index to the metadata value based on the index partition information; and store the metadata index and the metadata field in the metadata index dictionary in correspondence to update the metadata index dictionary.
[0102] In one of the embodiments, the device further includes: an index synchronization module, configured to send the updated metadata index dictionary to the server, so that the server can decode the metadata.
[0103] Each module in the above service instance data processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0104] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store information such as a metadata index dictionary. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a service instance data processing method is implemented.
[0105] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a service instance data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0106] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0107] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining service instance data and a metadata index dictionary; determining multiple metadata according to the service instance data; wherein the metadata includes a metadata field and a metadata value corresponding to the metadata field; for each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index; and sending the multiple metadata to a server to complete a registration task of a client.
[0108] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when there is no metadata index matching the metadata field in the metadata index dictionary, a metadata value corresponding to the metadata field is compressed using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server; and the metadata index dictionary is updated according to the metadata field and the metadata value.
[0109] In one embodiment, when the processor executes the computer program, the following steps are also implemented: extracting each character in the metadata value corresponding to the metadata field respectively; calculating the frequency of occurrence of each character in all characters of the metadata value; constructing Huffman tree data according to the frequency of occurrence, and encoding each character according to the Huffman tree data to obtain a character code; and collecting the character codes corresponding to all characters of the metadata value to obtain a metadata compression value.
[0110] In one embodiment, when the processor executes the computer program, the following steps are also implemented: counting the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data to obtain a temporary compression frequency; when the temporary compression frequency is higher than a preset frequency threshold, updating the metadata index dictionary according to the metadata field and metadata value.
[0111] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the temporary compression frequency is higher than a preset frequency threshold, index partition information is determined according to the metadata field; a metadata index is assigned to the metadata value according to the index partition information; and the metadata index is stored in a metadata index dictionary corresponding to the metadata field to update the metadata index dictionary.
[0112] In one embodiment, when the processor executes the computer program, the following steps are further implemented: sending the updated metadata index dictionary to the server so that the server can decode the metadata.
[0113] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining service instance data and a metadata index dictionary; determining multiple metadata according to the service instance data; wherein the metadata includes a metadata field and a metadata value corresponding to the metadata field; for each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index; and sending the multiple metadata to a server to complete a registration task for a client.
[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when there is no metadata index matching the metadata field in the metadata index dictionary, compressing the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server; and updating the metadata index dictionary according to the metadata field and the metadata value.
[0115] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting each character in the metadata value corresponding to the metadata field respectively; calculating the frequency of occurrence of each character in all characters of the metadata value; constructing Huffman tree data according to the frequency of occurrence, and encoding each character according to the Huffman tree data to obtain a character code; and collecting the character codes corresponding to all characters of the metadata value to obtain a metadata compression value.
[0116] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: counting the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data to obtain a temporary compression frequency; when the temporary compression frequency is higher than a preset frequency threshold, updating the metadata index dictionary according to the metadata field and metadata value.
[0117] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: when the temporary compression frequency is higher than a preset frequency threshold, index partition information is determined according to the metadata field; a metadata index is assigned to the metadata value according to the index partition information; and the metadata index is stored in a metadata index dictionary corresponding to the metadata field to update the metadata index dictionary.
[0118] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: sending the updated metadata index dictionary to the server so that the server can decode the metadata.
[0119] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: obtaining service instance data and a metadata index dictionary; determining multiple metadata according to the service instance data; wherein the metadata includes a metadata field and a metadata value corresponding to the metadata field; for each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index; and sending the multiple metadata to a server to complete a registration task for a client.
[0120] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when there is no metadata index matching the metadata field in the metadata index dictionary, compressing the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server; and updating the metadata index dictionary according to the metadata field and the metadata value.
[0121] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting each character in the metadata value corresponding to the metadata field respectively; calculating the frequency of occurrence of each character in all characters of the metadata value; constructing Huffman tree data according to the frequency of occurrence, and encoding each character according to the Huffman tree data to obtain a character code; and collecting the character codes corresponding to all characters of the metadata value to obtain a metadata compression value.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: counting the ratio of metadata that needs to be temporarily compressed to all metadata in the service instance data to obtain a temporary compression frequency; when the temporary compression frequency is higher than a preset frequency threshold, updating the metadata index dictionary according to the metadata field and metadata value.
[0123] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: when the temporary compression frequency is higher than a preset frequency threshold, index partition information is determined according to the metadata field; a metadata index is assigned to the metadata value according to the index partition information; and the metadata index is stored in a metadata index dictionary corresponding to the metadata field to update the metadata index dictionary.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: sending the updated metadata index dictionary to the server so that the server can decode the metadata.
[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A service instance data processing method, characterized in that: The method is applied to a client, and the method comprises: Get service instance data and metadata index dictionary; Determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields; For each metadata, searching the metadata index in the metadata index dictionary for a metadata index that matches the metadata field, and replacing the metadata value with the metadata index; The plurality of metadata are sent to the server to complete the registration task of the client.
2. The method according to claim 1, characterized in that: The method further comprises: In the case that there is no metadata index matching the metadata field in the metadata index dictionary, compressing the metadata value corresponding to the metadata field using a temporary compression method to obtain a metadata compression value; wherein the temporary compression method includes one or more compression methods agreed upon by the client and the corresponding server; The metadata index dictionary is updated according to the metadata field and the metadata value.
3. The method according to claim 2, characterized in that The step of compressing the metadata value corresponding to the metadata field in a temporary compression manner to obtain a metadata compression value includes: Extracting each character in the metadata value corresponding to the metadata field respectively; Calculate the occurrence frequency of each of the characters in all the characters of the metadata value; Constructing Huffman tree data according to the occurrence frequency, and encoding each of the characters according to the Huffman tree data to obtain a character code; The character codes corresponding to all the characters of the metadata value are collected to obtain a metadata compression value.
4. The method according to claim 2, characterized in that: The updating the metadata index dictionary according to the metadata field and the metadata value includes: Counting the ratio of the metadata that needs to be compressed in the temporary manner to all the metadata in the service instance data to obtain a temporary compression frequency; In a case where the temporary compression frequency is higher than a preset frequency threshold, the metadata index dictionary is updated according to the metadata field and the metadata value.
5. The method according to claim 4, characterized in that When the temporary compression frequency is higher than a preset frequency threshold, updating the metadata index dictionary according to the metadata field and the metadata value includes: In a case where the temporary compression frequency is higher than a preset frequency threshold, determining index partition information according to the metadata field; assigning a metadata index to the metadata value according to the index partition information; The metadata index and the metadata field are stored in the metadata index dictionary in correspondence to update the metadata index dictionary.
6. The method according to any one of claims 2 to 5, characterized in that: After updating the metadata index dictionary according to the metadata field and the metadata value, the method further includes: The updated metadata index dictionary is sent to the server so that the server can decode the metadata.
7. A service instance data processing device, characterized in that: The device is applied to a client, and comprises: Data acquisition module, used to obtain service instance data and metadata index dictionary; A metadata extraction module, used to determine a plurality of metadata according to the service instance data; wherein the metadata includes metadata fields and metadata values corresponding to the metadata fields; A data processing module, configured to search the metadata index in the metadata index dictionary for each piece of metadata, and replace the metadata value with the metadata index; The data sending module is used to send the plurality of metadata to the server to complete the registration task of the client.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.